/* ── Gallery Wrapper ── */
.product-gallery {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
}

/* ── Gallery Main Wrapper (contains image + nav buttons) ── */
.gallery-main-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

/* ── Navigation Buttons (PC only) ── */
.gallery-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

.gallery-nav-button:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-nav-button svg {
    width: 20px;
    height: 20px;
    color: var(--text-color);
}

.gallery-nav-button--prev {
    left: 10px;
}

.gallery-nav-button--next {
    right: 10px;
}

/* ── Thumbnails (left on desktop) ── */
.gallery-thumbs-wrap {
    width: 80px;
    flex-shrink: 0;
}

.gallery-thumbs-embla {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc((96px + 8px) * 6);
    scrollbar-width: none;
}

.gallery-thumbs-embla::-webkit-scrollbar {
    display: none;
}

.gallery-thumbs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-thumb-slide {
    flex: 0 0 auto;
}

.gallery-thumb-slide img {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    display: block;
}

.gallery-thumb-slide img:hover,
.gallery-thumb-slide img.active {
    border-color: var(--primary-color);
}

/* ── Main Image Embla ── */
.gallery-main-embla {
    flex: 1;
    overflow: hidden;
    /* border-radius: var(--border-radius); */
    background: var(--light-color);
    width: 100%;
}

.gallery-main-container {
    display: flex;
}

.gallery-main-slide {
    flex: 0 0 100%;
    min-width: 0;
    aspect-ratio: 2 / 3;
}

.gallery-main-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Dots nav hidden by default (desktop) */
.gallery-dots {
    display: none;
}

/* ── Desktop: Show navigation buttons ── */
@media (min-width: 769px) {
    .gallery-nav-button {
        display: flex;
    }
}

/* ── Mobile: thumbs hidden, dot navigation over image bottom ── */
@media (max-width: 768px) { 
    .product-gallery {
        flex-direction: column;
        position: relative;
    }

    .gallery-main-wrapper {
        order: 1;
    }

    .gallery-main-embla {
        order: 1;
    }

    .gallery-main-slide {
        aspect-ratio: 2 / 3;
    }

    /* Hide thumbnail strip on phones */
    .gallery-thumbs-wrap {
        display: none;
    }

    /* Show dot navigation over bottom of main image */
    .gallery-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 6px;
        position: absolute;
        left: 50%;
        bottom: -15px;
        transform: translateX(-50%);
        z-index: 2;
    }

    .gallery-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        border: none;
        padding: 0;
        background-color: var(--border-color, #ddd);
        cursor: pointer;
        transition: var(--transition);
    }

    .gallery-dot.is-active {
        background-color: var(--primary-color);
        transform: scale(1.3);
    }
}
