.product-gallery {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    grid-template-areas: "thumbs stage";
    gap: 1rem;
    align-items: center;
}

.product-gallery__thumb-column {
    grid-area: thumbs;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.product-gallery__thumb-viewport {
    height: 366px;
    overflow: hidden;
}

.product-gallery__thumb-track {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 280ms ease;
    will-change: transform;
}

.product-gallery__thumb {
    width: 84px;
    height: 84px;
    flex: 0 0 84px;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 0.8rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.product-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.55rem;
}

.product-gallery__thumb:hover {
    border-color: #93c5fd;
}

.product-gallery__thumb.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.product-gallery__thumb-nav {
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    color: #334155;
    background: #fff;
    transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.product-gallery__thumb-nav:hover:not(:disabled) {
    background: #eff6ff;
    color: #2563eb;
}

.product-gallery__thumb-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.product-gallery__thumb-nav-icon-mobile {
    display: none;
}

.product-gallery__stage {
    grid-area: stage;
    position: relative;
    min-width: 0;
    aspect-ratio: 16 / 10;
    min-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at 50% 40%, #ffffff 0%, #ffffff 45%, #f8fafc 100%);
    box-shadow: 0 18px 45px -32px rgba(15, 23, 42, 0.45);
}

.product-gallery__image-button {
    width: 100%;
    height: 100%;
    padding: clamp(1rem, 2.4vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.product-gallery__main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 160ms ease, transform 240ms ease;
}

.product-gallery__image-button:hover .product-gallery__main-image {
    transform: scale(1.015);
}

.product-gallery__main-image.is-changing {
    opacity: 0.35;
}

.product-gallery__arrow {
    position: absolute;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-size: 1.6rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    transition: transform 180ms ease, background-color 180ms ease;
}

.product-gallery__arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.06);
}

.product-gallery__arrow--prev {
    left: 1rem;
}

.product-gallery__arrow--next {
    right: 1rem;
}

.product-gallery__bottom-tools {
    position: absolute;
    z-index: 3;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.product-gallery__counter,
.product-gallery__zoom-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(8px);
}

.product-gallery__zoom-button {
    pointer-events: auto;
    cursor: pointer;
}

.product-gallery__zoom-button:hover {
    color: #2563eb;
}

.product-zoom {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
}

.product-zoom.is-open {
    display: block;
}

.product-zoom__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.86);
    backdrop-filter: blur(6px);
}

.product-zoom__panel {
    position: absolute;
    inset: 1rem;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.4rem;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.product-zoom__topbar {
    min-height: 62px;
    padding: 0.7rem 0.9rem 0.7rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.product-zoom__title {
    min-width: 0;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-zoom__title small {
    margin-left: 0.5rem;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-zoom__tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.product-zoom__tools button {
    min-width: 42px;
    height: 42px;
    padding: 0 0.65rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.8rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.product-zoom__tools button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.product-zoom__canvas {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 58%);
    cursor: zoom-in;
    touch-action: none;
}

.product-zoom__canvas.is-dragging {
    cursor: grabbing;
}

.product-zoom__canvas img {
    max-width: 91vw;
    max-height: 78vh;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
    transform-origin: center center;
    will-change: transform;
    transition: transform 120ms ease;
}

.product-zoom__canvas.is-dragging img {
    transition: none;
}

.product-zoom__arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, 0.62);
    font-size: 1.8rem;
}

.product-zoom__arrow:hover {
    background: rgba(37, 99, 235, 0.85);
}

.product-zoom__arrow--prev {
    left: 1.5rem;
}

.product-zoom__arrow--next {
    right: 1.5rem;
}

.product-zoom__help {
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    color: #94a3b8;
    text-align: center;
    font-size: 0.75rem;
}

body.product-zoom-open {
    overflow: hidden;
}


@media (min-width: 1280px) {
    .product-gallery__stage {
        min-height: 520px;
        aspect-ratio: auto;
    }

    .product-gallery__image-button {
        padding: 1.5rem 2rem 3rem;
    }
}

@media (max-width: 767px) {
    .product-gallery {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "stage"
            "thumbs";
    }

    .product-gallery__thumb-column {
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }

    .product-gallery__thumb-viewport {
        width: min(100%, 342px);
        height: 78px;
    }

    .product-gallery__thumb-track {
        flex-direction: row;
        gap: 10px;
    }

    .product-gallery__thumb {
        width: 78px;
        height: 78px;
        flex-basis: 78px;
    }

    .product-gallery__thumb-nav {
        width: 34px;
        height: 78px;
        flex: 0 0 34px;
    }

    .product-gallery__thumb-nav-icon-desktop {
        display: none;
    }

    .product-gallery__thumb-nav-icon-mobile {
        display: inline-block;
    }

    .product-gallery__stage {
        min-height: 0;
        border-radius: 1.15rem;
        aspect-ratio: 4 / 3;
    }

    .product-gallery__arrow {
        width: 40px;
        height: 40px;
    }

    .product-gallery__arrow--prev {
        left: 0.55rem;
    }

    .product-gallery__arrow--next {
        right: 0.55rem;
    }

    .product-gallery__image-button {
        padding: 1.4rem 2.6rem;
    }

    .product-gallery__bottom-tools {
        left: 0.7rem;
        right: 0.7rem;
        bottom: 0.7rem;
    }

    .product-zoom__panel {
        inset: 0;
        border-radius: 0;
    }

    .product-zoom__title {
        max-width: 42vw;
        font-size: 0.82rem;
    }

    .product-zoom__tools button {
        min-width: 38px;
        height: 38px;
        padding: 0 0.5rem;
    }

    .product-zoom__arrow {
        width: 44px;
        height: 44px;
    }

    .product-zoom__arrow--prev {
        left: 0.5rem;
    }

    .product-zoom__arrow--next {
        right: 0.5rem;
    }

    .product-zoom__canvas img {
        max-width: 96vw;
        max-height: 72vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-gallery__thumb-track,
    .product-gallery__main-image,
    .product-zoom__canvas img {
        transition: none;
    }
}