.productGalleryShell,
.productGalleryShell.has-thumbs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
}

.productGalleryStage {
    position: relative;
    order: 1;
    min-height: clamp(28rem, 44vw, 38rem);
    outline: none;
    touch-action: pan-y;
}

.productGalleryStage:focus-visible {
    border-color: rgba(255, 183, 3, 0.36);
    box-shadow: 0 0 0 4px rgba(255, 183, 3, 0.09);
}

.productGalleryMainImage {
    display: block;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

.productGalleryMainImage.is-switching {
    animation: productGalleryFade 0.28s ease both;
}

@keyframes productGalleryFade {
    from {
        opacity: 0.45;
        transform: scale(0.985);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.productGalleryThumbs {
    order: 2;
    display: flex;
    grid-template-columns: none;
    gap: 0.65rem;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.1rem 0 0.35rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 183, 3, 0.34) transparent;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.productGalleryThumb {
    width: 5.25rem;
    height: 5.25rem;
    flex: 0 0 5.25rem;
    aspect-ratio: 1;
    border-radius: 1rem;
}

.productGalleryThumb.is-active {
    border-color: rgba(255, 183, 3, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 183, 3, 0.11);
}

.productGalleryArrow,
.productGalleryLightboxArrow,
.productGalleryLightboxClose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(5, 10, 22, 0.78);
    color: #f4f6ff;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
}

.productGalleryArrow svg,
.productGalleryLightboxArrow svg,
.productGalleryLightboxClose svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.productGalleryArrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    transform: translateY(-50%);
}

.productGalleryArrow:hover,
.productGalleryLightboxArrow:hover,
.productGalleryLightboxClose:hover {
    border-color: rgba(255, 183, 3, 0.4);
    background: rgba(255, 183, 3, 0.18);
    color: #ffd66b;
}

.productGalleryArrow--prev {
    left: 1rem;
}

.productGalleryArrow--next {
    right: 1rem;
}

.productGalleryCounter {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 3;
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    padding: 0 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(5, 10, 22, 0.76);
    color: rgba(244, 246, 255, 0.88);
    font-size: 0.75rem;
    font-weight: 750;
    backdrop-filter: blur(12px);
}

.productGalleryLightbox[hidden] {
    display: none;
}

.productGalleryLightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(1, 4, 12, 0.94);
    backdrop-filter: blur(22px);
}

.productGalleryLightboxStage {
    position: relative;
    display: flex;
    width: 100%;
    height: min(82vh, 58rem);
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
}

.productGalleryLightboxStage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.productGalleryLightboxStage span {
    position: absolute;
    left: 50%;
    bottom: 0;
    display: inline-flex;
    min-height: 2.1rem;
    align-items: center;
    padding: 0 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(5, 10, 22, 0.78);
    color: #f4f6ff;
    font-size: 0.78rem;
    font-weight: 750;
    transform: translateX(-50%);
}

.productGalleryLightboxArrow {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
}

.productGalleryLightboxClose {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    right: 1rem;
    z-index: 2;
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 1rem;
}

body.productGalleryLightboxOpen {
    overflow: hidden;
}

@media (max-width: 767px) {
    .productGalleryStage {
        min-height: 0;
        aspect-ratio: 1 / 1.04;
        border-radius: 1.25rem;
    }

    .productGalleryThumb {
        width: 4.4rem;
        height: 4.4rem;
        flex-basis: 4.4rem;
        border-radius: 0.9rem;
    }

    .productGalleryArrow {
        width: 2.6rem;
        height: 2.6rem;
    }

    .productGalleryArrow--prev {
        left: 0.65rem;
    }

    .productGalleryArrow--next,
    .productGalleryCounter {
        right: 0.65rem;
    }

    .productGalleryCounter {
        bottom: 0.65rem;
    }

    .productGalleryLightbox {
        grid-template-columns: 1fr;
        padding: 4.5rem 0.75rem 1rem;
    }

    .productGalleryLightboxStage {
        height: 76vh;
    }

    .productGalleryLightboxArrow {
        position: absolute;
        top: 50%;
        z-index: 2;
        width: 2.8rem;
        height: 2.8rem;
        transform: translateY(-50%);
    }

    .productGalleryLightboxArrow--prev {
        left: 0.75rem;
    }

    .productGalleryLightboxArrow--next {
        right: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .productGalleryMainImage.is-switching {
        animation: none;
    }
}
