/* Explain: Styles for the product image gallery and lightbox. */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.product-gallery-main {
    display: block;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    background: var(--surface-color);
    padding: 0;
    box-shadow: var(--shadow-soft);
    cursor: zoom-in;
}

.product-gallery-main img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-gallery-thumbs {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.product-thumb {
    flex: 0 0 auto;
    width: 74px;
    height: 74px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 1rem;
    background: var(--surface-color);
    padding: 0;
    transition: border-color 250ms ease, transform 250ms ease, box-shadow 250ms ease;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.product-thumb.is-active {
    border-color: var(--primary-color);
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 15, 19, 0.94);
    padding: 1.25rem;
}

.gallery-lightbox-img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(92vw, 62rem);
    max-height: 82vh;
    border-radius: 1.25rem;
    object-fit: contain;
    background: var(--surface-color);
}

.gallery-lightbox-loader {
    position: absolute;
    inset: 0;
    width: 3rem;
    height: 3rem;
    margin: auto;
    border: 3px solid rgba(242, 242, 242, 0.22);
    border-top-color: var(--primary-color);
    border-radius: 999px;
    animation: gallery-spin 800ms linear infinite;
}

@keyframes gallery-spin {
    to {
        transform: rotate(360deg);
    }
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(26, 28, 35, 0.78);
    color: var(--text-color);
    backdrop-filter: blur(10px);
    transition: background 250ms ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
    background: rgba(38, 41, 51, 0.92);
}

.gallery-lightbox-close {
    top: 1.25rem;
    right: 1.25rem;
}

.gallery-lightbox-nav.prev {
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-lightbox-nav.next {
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 639px) {
    .gallery-lightbox-close,
    .gallery-lightbox-nav {
        width: 2.6rem;
        height: 2.6rem;
    }

    .gallery-lightbox-nav.prev {
        left: 0.6rem;
    }

    .gallery-lightbox-nav.next {
        right: 0.6rem;
    }
}