/* КорпаПлус product-page template — all rules scoped under .ptpl--korpaplus. */
/* .page-container is `display:flex; flex-direction:column; align-items:center`,
   so this section is NOT stretched — force full width or the grid columns
   below collapse to content width and the buy-box column disappears. */
.ptpl--korpaplus {
    width: 100%;
    --kp-accent: var(--brand-action);
    --kp-ink: var(--brand-primary);
    --kp-muted: #4a5565;
    --kp-tint: #f1fbf1;
    --kp-surface: #f7f8fa;
    --kp-line: #e6e8eb;
}

/* Flex (not grid): the shared tns gallery sizes correctly to a flex-basis
   column the way the default template does; a grid track confused its widths.
   min-width:0 on both lets the flex items shrink so nothing overflows. */
.ptpl--korpaplus .kp-card {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 48px;
    width: 100%;
    max-width: 1240px;
    margin: 24px auto;
    padding: 36px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(10, 25, 47, .08), 0 8px 24px rgba(10, 25, 47, .08);
    box-sizing: border-box;
}

.ptpl--korpaplus .kp-col-gallery {
    flex: 0 0 47%;
    min-width: 0;
    padding: 0;
    position: sticky;
    top: 16px;
}

.ptpl--korpaplus .kp-col-gallery img,
.ptpl--korpaplus .kp-col-gallery picture {
    width: 100%;
    height: auto;
    display: block;
}

.ptpl--korpaplus .kp-col-buy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* viewers — inline text flow (not flex), so the count + sentence stay on the
   same line and wrap together; the icon sits inline at the start */
.ptpl--korpaplus .kp-viewers {
    display: block;
    text-align: center;
    background: #eaf2fd;
    color: #64748b;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #2563eb;
}

.ptpl--korpaplus .kp-viewers .kp-ic {
    display: inline-block;
    vertical-align: -4px;
    margin-right: 6px;
}

.ptpl--korpaplus .kp-viewers-strong {
    color: #2563eb;
    font-weight: 700;
}

.ptpl--korpaplus .kp-viewers-count {
    font-weight: 800;
}

.ptpl--korpaplus .kp-viewers-rest {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.ptpl--korpaplus .kp-viewers-bump {
    animation: kp-bump .4s ease;
}

@keyframes kp-bump {
    0% {
        transform: translateY(4px);
        opacity: .4
    }
    100% {
        transform: none;
        opacity: 1
    }
}

/* title + rating */
.ptpl--korpaplus .kp-title {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--kp-ink);
    margin: 0;
    text-align: center;
    /* drop the 20px padding-bottom inherited from .product-title.product-page
       so the rating row sits snug under the title (column flex gap spaces it) */
    padding-bottom: 0;
}

.ptpl--korpaplus .kp-rating-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    color: var(--kp-muted);
}

.ptpl--korpaplus .kp-rating-num {
    font-weight: 700;
    color: var(--kp-ink);
}

/* features */
.ptpl--korpaplus .kp-features {
    background: var(--kp-tint);
    border: 1px solid var(--kp-accent);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.ptpl--korpaplus .kp-feature {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--kp-ink);
}

.ptpl--korpaplus .kp-feature-icon {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1.4;
}

/* package selector */
.ptpl--korpaplus .kp-package-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--kp-ink);
    margin: 0;
    text-align: center;
}

.ptpl--korpaplus .kp-packages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 100%;
}

.ptpl--korpaplus .kp-attr-title {
    display: none;
}

/* index-0 spacer for main.js .index() */
.ptpl--korpaplus .kp-package {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1.5px solid var(--kp-line);
    border-radius: 12px;
    padding: 18px 12px 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.ptpl--korpaplus .kp-package.active {
    border-color: var(--kp-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--kp-accent) 15%, transparent);
}

.ptpl--korpaplus .kp-pkg-label {
    font-size: 22px;
    font-weight: 800;
    color: var(--kp-ink);
    margin: 0 0 6px;
}

.ptpl--korpaplus .kp-pkg-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--kp-accent);
    margin: 0;
}

.ptpl--korpaplus .kp-pkg-old {
    font-size: 13px;
    color: var(--kp-muted);
    text-decoration: line-through;
    margin: 2px 0 0;
}

.ptpl--korpaplus .kp-pkg-popular {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--kp-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.ptpl--korpaplus .kp-pkg-discount {
    position: absolute;
    top: -10px;
    right: 8px;
    background: var(--black);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
}

/* price box */
.ptpl--korpaplus .kp-price-box {
    background: var(--kp-surface);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ptpl--korpaplus .kp-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.ptpl--korpaplus .kp-price-now {
    font-size: 32px;
    font-weight: 800;
    color: var(--kp-accent);
}

.ptpl--korpaplus .kp-price-old {
    font-size: 18px;
    color: var(--kp-muted);
    text-decoration: line-through;
}

/* compact light-green pill (override the navy full-width .product-savings bar) */
.ptpl--korpaplus .kp-savings {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    background: #e7f7e8;
    color: #15803d;
    border: 1px solid #86d693;
    text-transform: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
}

.ptpl--korpaplus .kp-savings-chip {
    background: var(--black);
    color: #fff;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
}

.ptpl--korpaplus .kp-savings-sub {
    font-size: 13px;
    color: var(--kp-muted);
    margin: 0;
    text-align: center;
}

/* CTA */
.ptpl--korpaplus .kp-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--kp-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 17px 20px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.ptpl--korpaplus .kp-cta:hover {
    filter: brightness(.96);
}

/* stock */
.ptpl--korpaplus .kp-stock-text {
    text-align: center;
    color: #dc2626;
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 8px;
}

.ptpl--korpaplus .kp-stock-bar {
    height: 8px;
    border-radius: 999px;
    background: #eee;
    overflow: hidden;
}

.ptpl--korpaplus .kp-stock-fill {
    width: 25%;
    height: 100%;
    background: #dc2626;
}

/* guarantee */
.ptpl--korpaplus .kp-guarantee {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--kp-tint);
    border: 1px solid var(--kp-accent);
    border-radius: 12px;
    padding: 16px;
}

.ptpl--korpaplus .kp-guarantee-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--kp-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ptpl--korpaplus .kp-guarantee-title {
    font-weight: 700;
    color: var(--kp-ink);
    margin: 0;
    font-size: 15px;
}

.ptpl--korpaplus .kp-guarantee-sub {
    color: var(--kp-muted);
    margin: 2px 0 0;
    font-size: 13px;
}

/* testimonials */
.ptpl--korpaplus .kp-testimonials {
    border: 1px solid var(--kp-line);
    border-radius: 12px;
    padding: 16px;
    /* override the mobile .col-2 { text-align:center } so the slide content
       (stars, date, quote, author) reads left-aligned */
    text-align: left;
}

.ptpl--korpaplus .kp-testimonials-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ptpl--korpaplus .kp-testimonials-title {
    font-weight: 700;
    color: var(--kp-ink);
    margin: 0;
    font-size: 16px;
}

.ptpl--korpaplus .kp-testimonials-nav {
    display: flex;
    gap: 6px;
}

.ptpl--korpaplus .kp-testimonials-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #E5E7EC;
    background: #E5E7EC;
    cursor: pointer;
    color: #000;
    line-height: 1;
}

.ptpl--korpaplus .kp-tst-toprow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ptpl--korpaplus .kp-tst-date {
    color: var(--kp-muted);
    font-size: 13px;
}

.ptpl--korpaplus .kp-tst-quote {
    font-style: italic;
    font-size: 15px;
    color: var(--kp-ink);
    margin: 8px 0;
}

.ptpl--korpaplus .kp-tst-author {
    font-size: 13px;
    color: var(--kp-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ptpl--korpaplus .kp-tst-verified {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #15803d;
    font-weight: 600;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    background: #e7f7e8;
    border: 1px solid #86d693;
    border-radius: 999px;
    padding: 2px 8px;
}

.ptpl--korpaplus .kp-tst-verified .kp-ic {
    width: 11px;
    height: 11px;
}

/* customers */
.ptpl--korpaplus .kp-customers {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--kp-tint);
    border: 1px solid var(--kp-accent);
    border-radius: 12px;
    padding: 16px;
}

.ptpl--korpaplus .kp-customers-avatars {
    display: flex;
}

.ptpl--korpaplus .kp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #cbd5e1;
    object-fit: cover;
    border: 2px solid #fff;
    margin-left: -12px;
}

.ptpl--korpaplus .kp-avatar:first-child {
    margin-left: 0;
}

.ptpl--korpaplus .kp-customers-count {
    font-weight: 800;
    color: var(--kp-ink);
    margin: 0;
    font-size: 14px;
}

.ptpl--korpaplus .kp-customers-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.ptpl--korpaplus .kp-customers-num {
    font-weight: 400;
    color: var(--kp-ink);
}

/* trust badges */
.ptpl--korpaplus .kp-trust {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.ptpl--korpaplus .kp-trust-item {
    background: #fbf9fa;
    border: 1px solid var(--kp-line);
    border-radius: 12px;
    padding: 18px 10px;
    text-align: center;
}

.ptpl--korpaplus .kp-trust-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--kp-tint);
    color: var(--kp-accent);
    margin-bottom: 10px;
}

.ptpl--korpaplus .kp-trust-icon svg {
    width: 28px;
    height: 28px;
}

.ptpl--korpaplus .kp-trust-title {
    font-weight: 700;
    color: var(--kp-ink);
    margin: 0;
    font-size: 13px;
}

.ptpl--korpaplus .kp-trust-sub {
    color: var(--kp-muted);
    margin: 2px 0 0;
    font-size: 12px;
}

/* gallery: round the image; move the sale badge to the top-left as a green
   "Распродажба" pill. (Sizing is left to the tns slider / column.) */
.ptpl--korpaplus .kp-col-gallery #productGallery img {
    border-radius: 14px;
}

/* gallery controls: chevrons sit inside white circular buttons (the global
   .tns-controls button is a bare white chevron); inset from the image edges */
.ptpl--korpaplus .tns-controls button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--kp-ink);
    box-shadow: 0 2px 10px rgba(10, 25, 47, .18);
}

.ptpl--korpaplus .tns-controls button[data-controls="prev"] {
    left: 12px;
}

.ptpl--korpaplus .tns-controls button[data-controls="next"] {
    right: 12px;
}

.ptpl--korpaplus .tns-controls button:hover {
    background: #f7f8fa;
}

/* hide the redundant tns nav dots — the thumbnail strip is the navigation */
.ptpl--korpaplus .tns-nav {
    display: none;
}

/* highlight the active thumbnail with a brand border */
.ptpl--korpaplus .productGallery__Thumbnail.is-active .productGallery__ThumbnailImage {
    outline: 2px solid var(--kp-accent);
    outline-offset: 0;
}

/* The JS-appended thumbnail strip is `position:absolute` by the global desktop
   rule, so it's out of flow and doesn't count toward the sticky gallery
   column's height — it hangs below the column and spills out of .kp-card on
   scroll. Keep it in flow so the sticky column's box includes the thumbnails
   and the whole gallery stays clamped inside the white card. */
.ptpl--korpaplus #productGallery__Thumbnails {
    position: static;
}

.ptpl--korpaplus .product-sale-badge {
    position: absolute;
    z-index: 2;
    top: 16px;
    left: 16px;
    right: auto;
    /* override the global fixed 64/58px square + flex-center so the badge is a
       content-fitting rounded rectangle */
    width: auto;
    height: auto;
    display: inline-block;
    background: var(--kp-accent);
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    line-height: 1.15;
}

.ptpl--korpaplus .product-sale-badge p {
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

.ptpl--korpaplus .product-sale-badge p::before {
    content: "Распродажба";
    display: block;
    font-size: 11px;
    font-weight: 700;
    opacity: .95;
}

.ptpl--korpaplus .product-sale-badge p::after {
    content: " попуст";
}

/* stars are em-sized SVGs (.ratingN sets font-size); scale per widget and
   drop the default .rating margins so they sit inline (e.g. stars + date row) */
.ptpl--korpaplus .kp-stars {
    font-size: 20px;
    margin: 0;
}

.ptpl--korpaplus .kp-tst-stars {
    font-size: 14px;
    margin: 0;
    line-height: 1;
}

.ptpl--korpaplus .kp-customers-stars {
    font-size: 16px;
    margin: 0;
}

/* toggles are direct flex children of .kp-col-buy, so the column's 18px gap
   stacks on top of .toggle-item's 15px margin-bottom (~33px between toggles —
   double the default template). Cancel the flex gap between consecutive toggles
   (and the toggle→FAQ transition) so they match the default 15px rhythm. */
.ptpl--korpaplus .toggle + .toggle,
.ptpl--korpaplus .toggle + .frequently-asked-questions {
    margin-top: -18px;
}

/* mobile */
@media (max-width: 768px) {
    .ptpl--korpaplus .kp-card {
        flex-direction: column;
        gap: 24px;
        padding: 16px;
        margin: 12px auto;
        width: auto;
        max-width: 100%;
    }

    .ptpl--korpaplus .kp-col-gallery {
        flex: 0 0 auto;
        width: 100%;
        position: static;
        /* override .col-1.product-page { height:100vw } (sized for just the
           square image) so the thumbnail strip below the slider grows the
           column instead of overflowing into the buy column */
        height: auto;
    }

    .ptpl--korpaplus .kp-col-buy {
        width: 100%;
    }

    .ptpl--korpaplus .kp-title {
        font-size: 24px;
    }

    .ptpl--korpaplus .kp-price-now {
        font-size: 26px;
    }

    .ptpl--korpaplus .kp-trust {
        grid-template-columns: repeat(2, 1fr);
    }

    .ptpl--korpaplus .kp-avatar {
        width: 32px;
        height: 32px;
    }

    /* packages: tighten so 3 cards fit a phone */
    .ptpl--korpaplus .kp-packages {
        gap: 8px;
    }

    .ptpl--korpaplus .kp-package {
        padding: 20px 4px 12px;
    }

    .ptpl--korpaplus .kp-pkg-label {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .ptpl--korpaplus .kp-pkg-price {
        font-size: 13px;
    }

    .ptpl--korpaplus .kp-pkg-old {
        font-size: 11px;
    }

    .ptpl--korpaplus .kp-pkg-popular {
        font-size: 9px;
        padding: 2px 6px;
        top: -8px;
    }

    /* show the discount chip on mobile too; sit it INSIDE the top-right corner
       (not floating above the border) so it clears the centered "Најпопуларно"
       pill on the popular card */
    .ptpl--korpaplus .kp-pkg-discount {
        font-size: 9px;
        padding: 2px 5px;
        top: 6px;
        right: 6px;
    }

    /* show the gallery thumbnail strip under the slider on mobile (the global
       rule hides it + positions it absolute for the desktop overlay) */
    .ptpl--korpaplus #productGallery__Thumbnails {
        display: flex;
        position: static;
        flex-wrap: nowrap;
        gap: 8px;
        padding-top: 12px;
    }

    /* at most 4 thumbnails, evenly filling the row */
    .ptpl--korpaplus #productGallery__Thumbnails .productGallery__Thumbnail {
        flex: 1 1 0;
        min-width: 0;
    }

    .ptpl--korpaplus #productGallery__Thumbnails .productGallery__Thumbnail:nth-child(n+5) {
        display: none;
    }

    .ptpl--korpaplus #productGallery__Thumbnails .productGallery__ThumbnailImage {
        width: 100%;
        height: auto;
        display: block;
    }
}
