/**
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 * We offer the best and most useful modules PrestaShop and modifications
 * for your online store.
 *
 * @author    knowband.com <support@knowband.com>
 * @copyright 2026 Knowband
 * @license   see file: LICENSE.txt
 * @category  PrestaShop Module
 */

/*
 * Storefront styles for the product page button, the cart/order preview
 * cards and the popup designer. Self-contained: literal values, no dependency
 * on kb-pc-tokens.css (which only the designer page loads). 07-10-2026
 */

/* ---------- product page call to action ---------- */
.kb-pc-cta-wrap {
    margin-left: 10px;
}

#kb_custom_btn_link.kb-pc-cta,
.product-actions #kb_custom_btn_link.kb-pc-cta,
.box-info-product #kb_custom_btn_link.kb-pc-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    max-width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--kb-pc-accent, #0a7076);
    background-image: none;
    filter: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
    text-decoration: none;
    text-shadow: none;
    box-shadow: 0 7px 18px -7px rgba(10, 112, 118, .8);
    transition: background-color .16s ease;
}

#kb_custom_btn_link.kb-pc-cta:hover,
#kb_custom_btn_link.kb-pc-cta:focus {
    background: var(--kb-pc-accent-hover, #085e63);
    background-image: none;
    color: #ffffff;
    text-decoration: none;
}

#kb_custom_btn_link.kb-pc-cta:focus-visible {
    outline: 2px solid var(--kb-pc-accent, #0a7076);
    outline-offset: 2px;
}

#kb_custom_btn_link.kb-pc-cta::before,
#kb_custom_btn_link.kb-pc-cta::after {
    display: none;
    content: none;
}

#kb_custom_btn_link.kb-pc-cta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: inherit;
}

#kb_custom_btn_link .kb-pc-cta-ico {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

/* ---------- cart and order preview cards ---------- */
.kb-pc-preview-store {
    margin: 16px 0;
}

.kb-pc-preview-card {
    margin: 12px 0;
    padding: 12px 13px;
    border: 1px solid #dde4e6;
    border-radius: 11px;
    background: #ffffff;
    color: #14191b;
    font-size: 13px;
}

.kb-pc-preview-cost {
    margin: 0 0 11px;
    font-size: 12px;
    font-weight: 700;
    color: #4e595e;
    font-variant-numeric: tabular-nums;
}

.kb-pc-preview-sides {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.kb-pc-preview-side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.kb-pc-preview-side p {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #5d696f;
}

.kb-pc-preview-side img {
    width: 90px;
    height: 90px;
    border: 1px solid #dde4e6;
    border-radius: 8px;
    background: #f5f8f8;
    object-fit: contain;
}

.kb-pc-preview-card .btn,
.kb-cp-cart-li .btn {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 12px;
    border: 1px solid var(--kb-pc-accent, #0a7076);
    border-radius: 8px;
    background: var(--kb-pc-accent, #0a7076);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.kb-pc-preview-card .btn:hover,
.kb-cp-cart-li .btn:hover {
    background: var(--kb-pc-accent-hover, #085e63);
    color: #ffffff;
}

.kb-pc-preview-card a:focus-visible,
.kb-cp-cart-li a:focus-visible {
    outline: 2px solid var(--kb-pc-accent, #0a7076);
    outline-offset: 2px;
}

.kb-pc-preview-card .kb-cart-cp-pdf {
    margin: 11px 0 0;
    list-style: none;
}

/* cards moved into a cart line by kb_front1.js (cart_action.tpl markup) */
.cart-item .kb-cp-cart-li,
.product-line-grid-body .kb-cp-cart-li {
    margin: 10px 0 0;
}

/* Hummingbird cart: the card sits under the product details, full width of the
   left column, side previews in a wrapping row. 13-10-2026 */
.product-line .kb-cp-cart-li.kb-pc-cart-card--hb {
    display: block;
    width: 100%;
    margin: 12px 0 0;
    padding: 12px;
    border: 1px solid #dde4e6;
    border-radius: 8px;
    list-style: none;
}

.product-line .kb-cp-cart-li.kb-pc-cart-card--hb .products-container {
    gap: 12px;
}

.product-line .kb-cp-cart-li.kb-pc-cart-card--hb .kb-pc-cart-side {
    flex: 0 1 140px !important;
    margin-bottom: 0 !important;
}

.product-line .kb-cp-cart-li.kb-pc-cart-card--hb p {
    margin: 0 0 6px;
}

.kb-cp-cart-li .kb-cart-cp-img {
    max-width: 120px;
    max-height: 120px;
    border: 1px solid #dde4e6;
    border-radius: 8px;
    background: #f5f8f8;
    object-fit: contain;
}

.kb-cp-cart-li .kb-cp-cart-text {
    font-size: 12px;
    font-weight: 600;
    color: #5d696f;
}

.customizations .kb-cp-cart-li,
.customization .kb-cp-cart-li {
    display: inline-block;
    margin-right: 5%;
    text-align: center;
    list-style: none;
}

.kb-cp-cart-preview-btn {
    margin-top: 8px;
}

/* ---------- popup designer (editor mode "popup") ---------- */
html.kbpc-pop-lock,
html.kbpc-pop-lock body {
    overflow: hidden;
}

.kbpc-pop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 52px 24px 16px;
}

.kbpc-pop__scrim {
    position: absolute;
    inset: 0;
    background: rgba(20, 25, 27, .6);
}

.kbpc-pop__box {
    position: relative;
    width: 100%;
    max-width: 1440px;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .45);
}

.kbpc-pop__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    transition: opacity .2s ease;
}

.kbpc-pop--ready .kbpc-pop__frame {
    opacity: 1;
}

.kbpc-pop__close {
    position: absolute;
    top: 8px;
    right: 24px;
    z-index: 2;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #14191b;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.kbpc-pop__close:hover {
    background: #f5f8f8;
}

.kbpc-pop__close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.kbpc-pop__loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #4e595e;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.kbpc-pop--ready .kbpc-pop__loading {
    display: none;
}

.kbpc-pop__spin {
    width: 34px;
    height: 34px;
    border: 3px solid #dde4e6;
    border-top-color: var(--kb-pc-accent, #0a7076);
    border-radius: 50%;
    animation: kbpc-pop-spin .8s linear infinite;
}

.kbpc-pop__fallback {
    margin: 0;
    padding: 0 16px;
    font-size: 14px;
}

.kbpc-pop__fallback a {
    color: var(--kb-pc-accent, #0a7076);
    font-weight: 700;
    text-decoration: underline;
}

@keyframes kbpc-pop-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 767px) {
    .kbpc-pop {
        padding: 0;
    }

    .kbpc-pop__box {
        max-width: none;
        border-radius: 0;
    }

    .kbpc-pop__close {
        top: 8px;
        right: 8px;
    }

    /* the designer's own Close button takes over once it is loaded */
    .kbpc-pop--ready .kbpc-pop__close {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #kb_custom_btn_link.kb-pc-cta,
    .kbpc-pop__frame {
        transition: none;
    }

    .kbpc-pop__spin {
        animation-duration: 2.4s;
    }
}

/* ---------- 3.0.5 deliverables: mockup thumbs, layered fallback, summary ---------- */
/* 07-10-2026 */
.kb-pc-stack {
    position: relative;
    display: inline-block;
    line-height: 0;
    vertical-align: top;
}

.kb-pc-stack > img.kb-pc-stack-art,
.kb-pc-preview-side .kb-pc-stack > img.kb-pc-stack-art {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-color: transparent;
    background: transparent;
}

.kb-pc-preview-side .kb-pc-stack > img {
    background: transparent;
}

.kb-pc-cart-side .kb-pc-stack {
    width: 100%;
}

.kb-pc-cart-side .kb-pc-stack > img:first-child {
    display: block;
    width: 100%;
    height: auto;
}

/* the design alone (mockups hidden or not built): neutral checkerboard so
   white and black artwork both stay visible */
img.kb-pc-is-art,
.kb-pc-preview-side img.kb-pc-is-art,
.kb-cp-cart-li img.kb-pc-is-art {
    background-color: #b7c0c4;
    background-image:
        linear-gradient(45deg, #9aa5aa 25%, transparent 25%),
        linear-gradient(-45deg, #9aa5aa 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #9aa5aa 75%),
        linear-gradient(-45deg, transparent 75%, #9aa5aa 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.kb-pc-summary {
    flex: 1 0 100%;
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #4e595e;
}

.kb-pc-summary strong {
    color: #14191b;
}

.kb-pc-summary-li {
    display: block;
    width: 100%;
}

.kb-pc-dl {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--kb-pc-accent, #0a7076);
    text-decoration: underline;
}

.kb-pc-dl:focus-visible {
    outline: 2px solid var(--kb-pc-accent, #0a7076);
    outline-offset: 2px;
}

/* ---------- 3.0.7 order detail / history customization block: tidy side cards 08-10-2026 ---------- */
table .customization,
#order-products .customization {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 14px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

table .customization > li {
    list-style: none;
    margin: 0;
}

table .customization .kb-cp-cart-li:not(.kb-pc-summary-li) {
    flex: 0 0 188px;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 10px;
    border: 1px solid #dde4e6;
    border-radius: 12px;
    background: #ffffff;
    text-align: center;
}

table .customization .kb-cp-cart-text {
    margin: 0 !important;
    width: 100%;
    font-size: 13px !important;
    font-weight: 700;
    color: #14191b;
    overflow-wrap: anywhere;
}

table .customization .kb-cp-cart-li > a {
    display: flex;
    justify-content: center;
}

table .customization .kb-cart-cp-img {
    width: 112px;
    height: 112px;
    max-width: 100%;
    object-fit: contain;
}

table .customization .kb-pc-stack {
    width: 112px;
    height: 112px;
    border: 1px solid #dde4e6;
    border-radius: 8px;
    overflow: hidden;
}

table .customization .kb-pc-stack > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

table .customization .kb-cp-cart-preview-btn {
    margin: 0;
}

table .customization .kb-cp-cart-preview-btn .btn {
    font-size: 12px !important;
    padding: 4px 14px !important;
    min-height: 32px;
}

table .customization .kb-pc-dl {
    margin: 0;
    padding: 4px 10px;
    border: 1px solid #dde4e6;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    text-decoration: none;
    background: #f5f8f8;
}

table .customization .kb-pc-dl:hover {
    border-color: var(--kb-pc-accent, #0a7076);
}

table .customization .kb-pc-summary-li {
    flex: 1 0 100%;
    padding: 8px 12px;
    border-left: 3px solid var(--kb-pc-accent, #0a7076);
    background: #f5f8f8;
    border-radius: 0 8px 8px 0;
    text-align: left;
}

table .customization .kb-pc-summary {
    margin: 0;
}

table .customization .kb-cart-cp-pdf {
    flex: 1 0 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #14191b;
    list-style: none;
}

table .customization .kb-cart-cp-pdf a {
    color: var(--kb-pc-accent, #0a7076);
    font-weight: 600;
}
