/**
 * WooCommerce Product Gallery - Premium v5
 */

/* =====================================================
   CONTAINER
   ===================================================== */
.wc-product-gallery-wrapper {
    display: flex;
    gap: 12px;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* =====================================================
   VERTICAL THUMBNAILS (Desktop only)
   ===================================================== */
.wc-gallery-thumbs {
    display: flex;
    flex-direction: column;
    width: 85px;
    flex-shrink: 0;
    position: relative;
}

.wc-gallery-thumbs-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.wc-gallery-thumbs-inner::-webkit-scrollbar {
    width: 4px;
}

.wc-gallery-thumbs-inner::-webkit-scrollbar-track {
    background: transparent;
}

.wc-gallery-thumbs-inner::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.wc-gallery-thumb {
    width: 75px;
    height: 75px;
    min-height: 75px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f5f5f5;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.wc-gallery-thumb:hover {
    border-color: #ccc;
}

.wc-gallery-thumb.active {
    border-color: #1a1a1a;
}

.wc-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =====================================================
   MAIN IMAGE
   ===================================================== */
.wc-gallery-main-wrap {
    flex: 1;
    min-width: 0;
}

.wc-gallery-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
}

.wc-gallery-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.wc-gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wc-gallery-slide.active {
    opacity: 1;
    z-index: 1;
}

.wc-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

/* =====================================================
   ARROWS
   ===================================================== */
.wc-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wc-gallery-main:hover .wc-gallery-arrow {
    opacity: 1;
}

.wc-gallery-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.wc-gallery-arrow svg {
    width: 20px;
    height: 20px;
    color: #333;
}

.wc-gallery-arrow-prev { left: 12px; }
.wc-gallery-arrow-next { right: 12px; }

/* =====================================================
   DOTS
   ===================================================== */
.wc-gallery-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(255,255,255,0.95);
    padding: 10px 16px;
    border-radius: 24px;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.wc-gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wc-gallery-dot:hover {
    background: #999;
}

.wc-gallery-dot.active {
    background: #1a1a1a;
}

/* =====================================================
   LIGHTBOX / FULLSCREEN
   ===================================================== */
.wc-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.wc-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.wc-lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.wc-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.wc-lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.wc-lightbox-close svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.wc-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.wc-lightbox-arrow:hover {
    background: rgba(255,255,255,0.2);
}

.wc-lightbox-arrow svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.wc-lightbox-arrow-prev { left: 20px; }
.wc-lightbox-arrow-next { right: 20px; }

.wc-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

/* =====================================================
   MOBILE STYLES
   ===================================================== */
@media screen and (max-width: 767px) {
    .wc-product-gallery-wrapper {
        display: block !important;
    }
    
    /* HIDE thumbnails completely on mobile */
    .wc-gallery-thumbs {
        display: none !important;
    }
    
    .wc-gallery-main {
        border-radius: 8px;
    }
    
    .wc-gallery-arrow {
        opacity: 1;
        width: 36px;
        height: 36px;
    }
    
    .wc-gallery-arrow svg {
        width: 18px;
        height: 18px;
    }
    
    .wc-gallery-arrow-prev { left: 8px; }
    .wc-gallery-arrow-next { right: 8px; }
    
    .wc-gallery-dots {
        padding: 8px 12px;
        gap: 6px;
        bottom: 12px;
    }
    
    .wc-gallery-dot {
        width: 8px;
        height: 8px;
    }
    
    .wc-lightbox-close,
    .wc-lightbox-arrow {
        width: 40px;
        height: 40px;
    }
    
    .wc-lightbox-arrow-prev { left: 10px; }
    .wc-lightbox-arrow-next { right: 10px; }
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
.wc-gallery-thumb:focus-visible,
.wc-gallery-arrow:focus-visible,
.wc-gallery-dot:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

button {
    font-family: inherit;
}
