/**
 * Rose & Bouchon — premium product lightbox (storefront)
 */

/* Storefront product page — uniform gallery frames */
[data-product-gallery-root] .product-gallery__hero {
    display: block;
    width: 100%;
    aspect-ratio: 10 / 11;
    position: relative;
    overflow: hidden;
    background-color: #f0eee9;
}

[data-product-gallery-root] .product-gallery__thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background-color: #f0eee9;
}

[data-product-gallery-root] .product-gallery__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
}

[data-product-gallery-root] .pg-trigger {
    display: block;
    width: 100%;
    height: 100%;
}

:root {
    --pg-overlay: rgba(12, 11, 10, 0.88);
    --pg-panel: rgba(22, 20, 18, 0.55);
    --pg-border: rgba(255, 250, 245, 0.12);
    --pg-text: rgba(255, 250, 245, 0.92);
    --pg-muted: rgba(255, 250, 245, 0.5);
    --pg-accent: #c9a962;
    --pg-radius: 2px;
    --pg-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --pg-duration: 0.38s;
}

body.pg-lightbox-open {
    overflow: hidden;
    touch-action: none;
}

.pg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
        env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity var(--pg-duration) var(--pg-ease),
        visibility 0s linear var(--pg-duration);
}

.pg-lightbox[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--pg-duration) var(--pg-ease), visibility 0s linear 0s;
}

.pg-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: var(--pg-overlay);
    cursor: pointer;
}

.pg-lightbox__inner {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 0.75rem 0.75rem 0.5rem;
}

@media (min-width: 768px) {
    .pg-lightbox__inner {
        padding: 1.25rem 1.5rem 0.75rem;
    }
}

.pg-lightbox__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.pg-lightbox__counter {
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--pg-muted);
}

.pg-lightbox__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: auto;
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-radius);
    background: transparent;
    color: var(--pg-text);
    cursor: pointer;
    transition:
        background var(--pg-duration) var(--pg-ease),
        border-color var(--pg-duration) var(--pg-ease),
        color 0.2s ease;
}

.pg-lightbox__close:hover {
    background: rgba(255, 250, 245, 0.06);
    border-color: rgba(255, 250, 245, 0.22);
    color: #fff;
}

.pg-lightbox__stage-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pg-lightbox__stage {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: min(78vh, 900px);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y pinch-zoom;
}

.pg-lightbox__photo {
    max-width: 100%;
    max-height: min(78vh, 900px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--pg-radius);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    opacity: 1;
    transform: scale(1);
    transition:
        opacity var(--pg-duration) var(--pg-ease),
        transform var(--pg-duration) var(--pg-ease);
    will-change: opacity, transform;
}

.pg-lightbox__photo.is-pg-dim {
    opacity: 0;
    transform: scale(0.985);
}

.pg-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-radius);
    background: rgba(18, 16, 14, 0.45);
    color: var(--pg-text);
    cursor: pointer;
    transition:
        background var(--pg-duration) var(--pg-ease),
        border-color var(--pg-duration) var(--pg-ease),
        opacity 0.2s ease;
}

.pg-lightbox__nav:hover:not(:disabled) {
    background: rgba(255, 250, 245, 0.08);
    border-color: rgba(255, 250, 245, 0.28);
}

.pg-lightbox__nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.pg-lightbox__nav--prev {
    left: 0.25rem;
}

.pg-lightbox__nav--next {
    right: 0.25rem;
}

@media (min-width: 768px) {
    .pg-lightbox__nav {
        width: 3rem;
        height: 3rem;
    }

    .pg-lightbox__nav--prev {
        left: 0.5rem;
    }

    .pg-lightbox__nav--next {
        right: 0.5rem;
    }
}

.pg-lightbox__thumbs {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 0.25rem 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 250, 245, 0.2) transparent;
}

.pg-lightbox__thumbs::-webkit-scrollbar {
    height: 4px;
}

.pg-lightbox__thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 250, 245, 0.18);
    border-radius: 4px;
}

.pg-lightbox__thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--pg-radius);
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 250, 245, 0.04);
    opacity: 0.55;
    transition:
        opacity var(--pg-duration) var(--pg-ease),
        border-color var(--pg-duration) var(--pg-ease),
        box-shadow var(--pg-duration) var(--pg-ease);
}

@media (min-width: 768px) {
    .pg-lightbox__thumb {
        width: 60px;
        height: 60px;
    }
}

.pg-lightbox__thumb:hover {
    opacity: 0.9;
}

.pg-lightbox__thumb.is-active {
    opacity: 1;
    border-color: rgba(201, 169, 98, 0.55);
    box-shadow: 0 0 0 1px rgba(201, 169, 98, 0.25);
}

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

@media (prefers-reduced-motion: reduce) {
    :root {
        --pg-duration: 0.01ms;
    }

    .pg-lightbox__photo {
        transition: none;
    }
}
