/* Product detail image gallery — stage + thumbnail rail (desktop) / swipe track (mobile) */

.product-gallery {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* ---- Stage ---- */

.product-gallery__stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.product-gallery__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    outline-offset: 2px;
}

.product-gallery__track::-webkit-scrollbar {
    display: none;
}

.product-gallery__slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 12px;
    cursor: zoom-in;
}

.product-gallery__slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-gallery__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    aspect-ratio: 1 / 1;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #f7f7f7;
    color: #999;
}

.product-gallery__placeholder i {
    font-size: 48px;
}

/* ---- Magnifier overlay (desktop hover zoom) ---- */

.product-gallery__magnifier {
    position: absolute;
    inset: 0;
    z-index: 6;
    border-radius: 12px;
    background-color: #fff;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* ---- Zoom hint ---- */

.product-gallery__hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    pointer-events: none;
}

/* ---- Thumbnail rail (desktop) ---- */

.product-gallery__rail {
    display: none;
}

/* ---- Dots + counter (mobile) ---- */

.product-gallery__counter {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 7;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    pointer-events: none;
}

.product-gallery__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.product-gallery--multi .product-gallery__stage {
    display: flex;
    flex-direction: column;
}

.product-gallery__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ccc;
}

.product-gallery__dot.is-active {
    background: #1EA199;
    transform: scale(1.25);
}

@media (min-width: 992px) {
    .product-gallery__rail {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 0 0 68px;
        max-height: 480px;
        overflow-y: auto;
        scrollbar-width: thin;
    }

    .product-gallery__thumb {
        display: block;
        width: 68px;
        padding: 3px;
        border: 2px solid #e3e3e3;
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
        transition: border-color 0.15s ease;
    }

    .product-gallery__thumb img {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: contain;
    }

    .product-gallery__thumb:hover {
        border-color: #999;
    }

    .product-gallery__thumb.is-active {
        border-color: #1EA199;
        box-shadow: 0 0 0 3px rgba(30, 161, 153, 0.14);
    }

    .product-gallery__counter,
    .product-gallery__dots {
        display: none;
    }

    .product-gallery__hint--mobile {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .product-gallery__hint--desktop {
        display: none;
    }
}

/* ---- Fullscreen viewer pinch hint ---- */

.pswp__pinch-hint {
    position: absolute;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%);
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.pswp__pinch-hint.is-fading {
    opacity: 0;
}
