/* ==========================================================================
   Product detail gallery — Swiper 11 (MIT).
   Replaces the menucool ninja-slider / thumbnail-slider trialware, which
   stamped a "Ninja Slider trial version" watermark on any domain that did not
   match its baked licence key.
   Palette tokens (--herb/--leaf/--line/--card/--gz-radius) come from the
   MODERN POLISH block in responsive-fixes.css; fallbacks are inlined so this
   sheet also stands on its own.
   ========================================================================== */

.pdp-gallery {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* ---------------- thumbnail rail (vertical, desktop) ---------------- */

.pdp-gallery__thumbs {
    position: relative;
    width: 84px;
    flex: 0 0 84px;
    padding: 22px 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
}

.pdp-thumbs {
    height: 384px;
}

.pdp-thumb {
    height: 76px !important;
    box-sizing: border-box;
    padding: 5px;
    border: 1.5px solid var(--line, #e2ebe0);
    border-radius: var(--gz-radius-sm, 9px);
    overflow: hidden;
    cursor: pointer;
    background: var(--card, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .8;
    transition: opacity .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.pdp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pdp-thumb:hover {
    opacity: 1;
    border-color: var(--leaf, #2ea45f);
}

.pdp-thumb.swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--herb, #167a45);
    box-shadow: 0 0 0 3px rgba(22, 122, 69, .14);
}

.pdp-thumb--video {
    background: var(--chip, #eef4ea);
}

.pdp-thumb--video .fa {
    font-size: 34px;
    color: var(--herb, #167a45);
}

/* rail arrows */
.pdp-thumbs-nav {
    position: absolute;
    left: 0;
    width: 100%;
    height: 20px;
    cursor: pointer;
    z-index: 2;
    transition: opacity .3s ease;
}

.pdp-thumbs-prev { top: 0; }
.pdp-thumbs-next { bottom: 0; }

.pdp-thumbs-nav::before {
    position: absolute;
    left: 50%;
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-left: 2px solid var(--herb, #167a45);
    border-top: 2px solid var(--herb, #167a45);
}

.pdp-thumbs-prev::before {
    top: 6px;
    transform: rotate(45deg);
}

.pdp-thumbs-next::before {
    bottom: 6px;
    transform: rotate(-135deg);
}

.pdp-thumbs-nav.swiper-button-disabled {
    opacity: .15;
    cursor: default;
}

/* a single image needs no rail at all */
.pdp-gallery--single .pdp-gallery__thumbs {
    display: none;
}

/* ---------------- main stage ---------------- */

.pdp-gallery__main {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.pdp-main {
    width: 100%;
    background: var(--card, #fff);
    border-radius: var(--gz-radius, 12px);
    overflow: hidden;
}

.pdp-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f2f7ee, #e7f1e2);
    aspect-ratio: 1 / 1;
}

.pdp-slide .swiper-zoom-container {
    width: 100%;
    height: 100%;
}

.pdp-img,
.pdp-video-poster {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* arrows / pagination */
.pdp-main .pdp-nav {
    width: 40px;
    height: 40px;
    margin-top: -20px;
    background: rgba(255, 255, 255, .92);
    color: var(--herb, #167a45);
    border: 1px solid var(--line, #e2ebe0);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(20, 40, 30, .12);
    opacity: 0;
    transition: opacity .25s ease;
}

.pdp-main .pdp-nav::after {
    font-size: 15px;
    font-weight: 700;
}

.pdp-main:hover .pdp-nav,
.pdp-gallery--fs .pdp-nav {
    opacity: 1;
}

.pdp-main .pdp-nav.swiper-button-disabled {
    opacity: 0;
}

.pdp-main:hover .pdp-nav.swiper-button-disabled {
    opacity: .35;
}

.pdp-main .pdp-pagination {
    display: none;
}

.pdp-main .swiper-pagination-bullet-active {
    background: var(--herb, #167a45);
}

/* expand / close */
.pdp-fs-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    height: 28px;
    padding: 0 10px;
    z-index: 3;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--line, #e2ebe0);
    border-radius: 999px;
    color: var(--herb, #167a45);
    font: 700 11px/26px 'Quicksand', system-ui, sans-serif;
    letter-spacing: .04em;
    cursor: pointer;
    opacity: 0;
    transition: opacity .25s ease;
}

.pdp-main:hover .pdp-fs-toggle,
.pdp-gallery--fs .pdp-fs-toggle {
    opacity: 1;
}

/* ---------------- fullscreen ---------------- */

.pdp-gallery--fs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    background: #0d1410;
    padding: 20px;
    gap: 16px;
    align-items: center;
}

.pdp-gallery--fs .pdp-gallery__main {
    height: 100%;
    display: flex;
    align-items: center;
}

.pdp-gallery--fs .pdp-main {
    background: transparent;
    max-height: 100%;
}

.pdp-gallery--fs .pdp-slide {
    background: transparent;
    aspect-ratio: auto;
    height: calc(100vh - 40px);
}

.pdp-gallery--fs .pdp-thumbs {
    height: calc(100vh - 84px);
}

.pdp-gallery--fs .pdp-thumbs-nav::before {
    border-color: #fff;
}

.pdp-gallery--fs .cardItem__video_div {
    display: none !important;
}

/* ---------------- video slide ---------------- */

.pdp-slide--video {
    position: relative;
    background: #000;
}

.pdp-slide--video .pdp-video-poster {
    opacity: .55;
}

.pdp-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(22, 122, 69, .92);
    color: #fff;
    font-size: 26px;
    line-height: 72px;
    cursor: pointer;
    transition: transform .2s ease;
}

.pdp-video-play:hover {
    transform: scale(1.08);
}

.pdp-slide--video iframe,
.pdp-slide--video video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ---------------- tablet ---------------- */

@media only screen and (max-width: 992px) and (min-width: 601px) {
    .pdp-gallery__thumbs {
        width: 74px;
        flex: 0 0 74px;
    }

    .pdp-thumbs {
        height: 320px;
    }

    .pdp-thumb {
        height: 66px !important;
    }
}

/* ---------------- mobile: rail goes horizontal, under the stage ----------------
   Touch is the primary interaction here: swipe between slides, pinch/double-tap
   to zoom (Swiper zoom), pagination bullets instead of hover-only arrows.
   ------------------------------------------------------------------------- */

@media only screen and (max-width: 600px) {
    /* column-reverse: the rail is first in the DOM (so it stays a vertical column
       beside the stage on desktop) but must render UNDER the stage on mobile.
       align-items:stretch (not flex-start): in a column flex the main stage must
       take the full row width, else Swiper measures a shrink-to-fit container
       and mis-sizes the slides. */
    .pdp-gallery {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .pdp-gallery__main {
        width: 100%;
    }

    .pdp-gallery__thumbs {
        width: 100%;
        flex: 0 0 auto;
        padding: 0 22px;
    }

    .pdp-thumbs {
        height: auto;
    }

    .pdp-thumb {
        width: 62px;
        height: 62px !important;
    }

    .pdp-thumbs-nav {
        top: 0;
        bottom: 0;
        left: auto;
        width: 20px;
        height: 100%;
    }

    .pdp-thumbs-prev { left: 0; }
    .pdp-thumbs-next { right: 0; }

    .pdp-thumbs-nav::before {
        top: 50%;
        margin-top: -5px;
    }

    .pdp-thumbs-prev::before { left: 8px; transform: rotate(-45deg); }
    .pdp-thumbs-next::before { left: 2px; transform: rotate(135deg); }

    /* hover-only affordances are meaningless on touch */
    .pdp-main .pdp-nav,
    .pdp-fs-toggle {
        display: none;
    }

    .pdp-main .pdp-pagination {
        display: block;
    }

    .pdp-video-play {
        width: 60px;
        height: 60px;
        margin: -30px 0 0 -30px;
        font-size: 22px;
        line-height: 60px;
    }
}
