/*============================
    MISS ROSE — PRODUCT GALLERY & ZOOM
    Self-contained. No vendor dependencies.
    Replaces the missing frontend/detail/ zoom stack.
============================*/

.mr-gallery {
    --mr-brand: var(--colorPrimary, #b01257);
    --mr-brand-tint: var(--colorPrimaryTint, #f8e8ef);
    --mr-radius: 14px;
    --mr-gap: 14px;

    display: flex;
    gap: var(--mr-gap);
    align-items: flex-start;
    width: 100%;
}

/* ---------------------------------- Stage ---------------------------------- */

.mr-gallery__stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    border-radius: var(--mr-radius);
    overflow: hidden;
    background: #f6f6f7;
    /* Apparel photography is 2:3 — lock it so nothing stretches or crops. */
    aspect-ratio: 2 / 3;
    cursor: zoom-in;
    touch-action: manipulation;
    user-select: none;
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 2 / 3) {
    .mr-gallery__stage::before {
        content: "";
        display: block;
        padding-top: 150%;
    }
}

.mr-gallery__stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity .25s ease;
}

.mr-gallery__stage.is-loading img {
    opacity: .35;
}

/* Hover magnifier — a second layer showing the image at scale. */
.mr-gallery__lens {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background-color: #fff;
    background-repeat: no-repeat;
    background-size: 220%;
    transition: opacity .18s ease;
}

.mr-gallery__stage.is-zooming .mr-gallery__lens {
    opacity: 1;
}

.mr-gallery__hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .58);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    letter-spacing: .02em;
    pointer-events: none;
    transition: opacity .18s ease;
}

.mr-gallery__stage.is-zooming .mr-gallery__hint {
    opacity: 0;
}

.mr-gallery__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--mr-brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* -------------------------------- Thumbnails -------------------------------- */

.mr-gallery__thumbs {
    flex: 0 0 88px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    padding-right: 2px;
}

.mr-gallery__thumbs::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.mr-gallery__thumbs::-webkit-scrollbar-thumb {
    background: var(--mr-brand);
    border-radius: 4px;
}

.mr-gallery__thumb {
    position: relative;
    flex: 0 0 auto;
    width: 88px;
    aspect-ratio: 2 / 3;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #f6f6f7;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease;
}

@supports not (aspect-ratio: 2 / 3) {
    .mr-gallery__thumb { height: 132px; }
}

.mr-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mr-gallery__thumb:hover {
    border-color: var(--mr-brand-tint);
    transform: translateY(-1px);
}

.mr-gallery__thumb.is-active {
    border-color: var(--mr-brand);
}

.mr-gallery__thumb:focus-visible {
    outline: 2px solid var(--mr-brand);
    outline-offset: 2px;
}

/* --------------------------------- Lightbox --------------------------------- */

.mr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    background: rgba(12, 12, 14, .94);
    touch-action: none;
    overscroll-behavior: contain;
}

.mr-lightbox.is-open {
    display: block;
}

body.mr-lightbox-open {
    overflow: hidden;
}

.mr-lightbox__viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mr-lightbox__viewport.is-panning {
    cursor: grabbing;
}

.mr-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .22s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}

.mr-lightbox__viewport.is-panning .mr-lightbox__img {
    transition: none;
}

.mr-lightbox__bar {
    position: absolute;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(8px);
}

.mr-lightbox__btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.mr-lightbox__btn:hover {
    background: var(--colorPrimary, #b01257);
}

.mr-lightbox__btn:active {
    transform: scale(.94);
}

.mr-lightbox__btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.mr-lightbox__btn[disabled] {
    opacity: .35;
    cursor: not-allowed;
}

.mr-lightbox__zoomlevel {
    min-width: 52px;
    text-align: center;
    color: #fff;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.mr-lightbox__close {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: 16px;
    z-index: 3;
}

.mr-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
}

.mr-lightbox__nav--prev { left: 14px; }
.mr-lightbox__nav--next { right: 14px; }

.mr-lightbox__counter {
    position: absolute;
    top: max(22px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
}

/* -------------------------------- Responsive -------------------------------- */

@media (max-width: 991px) {
    .mr-gallery {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .mr-gallery__thumbs {
        flex: 0 0 auto;
        flex-direction: row;
        width: 100%;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
        scroll-snap-type: x mandatory;
    }

    .mr-gallery__thumb {
        width: 72px;
        scroll-snap-align: start;
    }

    @supports not (aspect-ratio: 2 / 3) {
        .mr-gallery__thumb { height: 108px; }
    }

    /* Hover zoom is meaningless on touch — tap opens the lightbox instead.
       Explicit width is required here: in column-direction flex, flex:1 1 auto
       only governs the main (vertical) axis, and with the stage's <img> being
       position:absolute it contributes no intrinsic width — without this the
       stage collapses to ~0 width and the main image never shows. */
    .mr-gallery__stage {
        width: 100%;
        aspect-ratio: 3 / 4;
    }

    @supports not (aspect-ratio: 3 / 4) {
        .mr-gallery__stage::before { padding-top: 133.33%; }
    }

    .mr-gallery__lens {
        display: none;
    }

    /* "Hover to zoom" is meaningless on touch — just show the image, no hint clutter. */
    .mr-gallery__hint {
        display: none;
    }

    .mr-gallery__stage {
        cursor: default;
    }
}

@media (max-width: 575px) {
    .mr-gallery__thumb { width: 62px; }

    @supports not (aspect-ratio: 2 / 3) {
        .mr-gallery__thumb { height: 93px; }
    }

    .mr-lightbox__nav { width: 42px; height: 42px; }
    .mr-lightbox__nav--prev { left: 8px; }
    .mr-lightbox__nav--next { right: 8px; }
    .mr-lightbox__btn { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .mr-gallery__stage img,
    .mr-gallery__lens,
    .mr-lightbox__img,
    .mr-gallery__thumb {
        transition: none;
    }
}

/*============================
    PRODUCT DETAIL PAGE LAYOUT
    The gallery block and details panel are siblings inside a single
    column; this pairs them side by side on desktop and stacks them
    on smaller screens.
============================*/

.pdp-image-gallery-block,
.product-details {
    box-sizing: border-box;
}

@media (min-width: 992px) {
    .col-xl-12 > .pdp-image-gallery-block,
    .col-md-12 > .pdp-image-gallery-block {
        float: left;
        width: 60%;
        max-width: 680px;
        padding-right: 40px;
    }

    .col-xl-12 > .product-details,
    .col-md-12 > .product-details {
        float: left;
        width: 40%;
    }

    /* Clear the floats before the related-products block. */
    .col-xl-12::after,
    .col-md-12::after {
        content: "";
        display: table;
        clear: both;
    }
}

/* Breathing room below the fixed navigation.
   .fp__topbar (50px) + .main_menu (80px) are both position:fixed, so page
   content needs to clear their combined 130px height or the header sits on
   top of it. */
.pdp-image-gallery-block {
    margin-top: 150px;
}

@media (max-width: 991px) {
    .pdp-image-gallery-block {
        margin-top: 100px;
    }
}

.product-details {
    margin-top: 150px;
}

@media (max-width: 991px) {
    .product-details {
        margin-top: 32px;
    }
}

.product-details .price del {
    color: #9a9a9a;
    font-size: .78em;
    margin-left: 8px;
}

.product-details .short_description ul {
    padding-left: 18px;
    margin-top: 10px;
}

.product-details .short_description li {
    list-style: disc;
    margin-bottom: 6px;
}

/* ---------------------------------- Product specs / attributes ---------------------------------- */

.pdp-specs {
    margin-top: 28px;
}

.pdp-specs h5 {
    font-size: 18px;
    margin-bottom: 12px;
}

.pdp-specs h6 {
    font-size: 15px;
    margin: 16px 0 10px;
}

.pdp-specs__table {
    width: 100%;
    margin-bottom: 0;
}

.pdp-specs__table th {
    width: 40%;
    padding: 8px 12px 8px 0;
    color: #6f6f6f;
    font-weight: 600;
    text-transform: capitalize;
    border-top: 1px solid #eee;
}

.pdp-specs__table td {
    padding: 8px 0;
    color: #222;
    border-top: 1px solid #eee;
}

.pdp-specs__size-list {
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pdp-specs__size-list li {
    padding: 6px 16px;
    border: 1px solid var(--mr-brand, #b01257);
    border-radius: 999px;
    font-size: 14px;
    color: var(--mr-brand, #b01257);
}
