/*
    Product gallery (single product page).
    Swiper main image + thumbnail carousel, click-to-zoom and variant tabs.
    Scope everything to avoid leaking into other sections.
*/

/* ---- Gallery layout ---- */
.product-gallery {
    display: grid;
    grid-template-areas: "thumbs main";
    grid-template-columns: 92px 1fr;
    gap: 16px;
    align-items: start;
}

.product-gallery .gallery-thumbs-wrap {
    grid-area: thumbs;
    min-height: 0;
}

.product-gallery .gallery-thumbs {
    height: 10%;
}

/* Vertical thumbnails on desktop */
.gallery-thumbs .swiper-wrapper {
    flex-direction: column;
}

@media (min-width: 768px) {
    .gallery-thumbs {
        height: 470px;
    }

    .product-gallery .gallery-main {
        grid-area: main;
        min-width: 0;
    }
}

.product-gallery {
    display: grid;
    grid-template-areas: "thumbs main";
    grid-template-columns: 82px minmax(0, 520px);
    gap: 14px;
    align-items: start;
    justify-content: start;
}

.product-gallery .gallery-main {
    grid-area: main;
    width: 100%;
    max-width: 520px;
}

.gallery-main .swiper-slide {
    border: 1px solid var(--th-border-color);
    border-radius: 18px;
    overflow: hidden;
    background-color: var(--smoke-color2);
}

.gallery-main .swiper-slide a {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-main .swiper-slide img {
    display: block;
    width: 100%;
    height: 480px;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-gallery .gallery-thumbs-wrap {
    grid-area: thumbs;
    width: 82px;
}

.gallery-thumbs {
    height: 480px;
}

.gallery-thumbs .swiper-wrapper {
    flex-direction: column;
}

.gallery-thumbs .swiper-slide {
    width: 72px !important;
    height: 72px !important;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid var(--th-border-color);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
}

.gallery-thumbs .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 7px;
}

.gallery-thumbs .swiper-slide-thumb-active {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 2px rgba(87, 179, 62, 0.25);
}

/* Mobile: horizontal thumbnails below the main image */
@media (max-width: 767px) {
    .product-gallery {
        grid-template-areas:
            "main"
            "thumbs";
        grid-template-columns: 1fr;
        width: 100%;
    }

    .product-gallery .gallery-main {
        max-width: 100%;
    }

    .gallery-main .swiper-slide img {
        height: 360px;
    }

    .product-gallery .gallery-thumbs-wrap {
        width: 100%;
    }

    .gallery-thumbs {
        width: 100%;
        height: 80px;
    }

    .gallery-thumbs .swiper-wrapper {
        flex-direction: row;
    }

    .gallery-thumbs .swiper-slide {
        width: 72px !important;
        height: 72px !important;
        margin-right: 10px;
        margin-bottom: 0;
    }
}
/* ---- Variant tabs ---- */
.product-variants {
    margin-top: 26px;
    padding-top: 24px;
    border-top: 1px solid var(--th-border-color);
}

.product-variants .variant-title {
    display: block;
    font-family: var(--title-font);
    font-size: 16px;
    font-weight: 600;
    color: var(--title-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
}

.variant-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant-tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--title-font);
    color: var(--body-color);
    background-color: var(--white-color);
    border: 1px solid var(--th-border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.variant-tab:hover {
    border-color: var(--theme-color);
    color: var(--theme-color);
}

.variant-tab.active {
    background-color: var(--theme-color);
    border-color: var(--theme-color);
    color: var(--white-color);
}

.variant-info {
    margin-top: 18px;
}

.variant-info .variant-size {
    font-size: 15px;
    color: var(--title-color);
    margin-bottom: 6px;
}

.variant-info .variant-size .size-value {
    color: var(--theme-color);
    font-weight: 700;
}

.variant-info .variant-desc {
    font-size: 14px;
    color: var(--body-color);
    margin-bottom: 0;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-main .swiper-slide a:hover img,
    .variant-tab {
        transition: none;
    }
}