/**
 * Winloo Product Gallery Styles
 * Modern, beautiful gallery for WooCommerce products
 */

/* ============================================
   Main Gallery Container
   ============================================ */
.winloo-product-gallery-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

/* ============================================
   Main Image Slider
   ============================================ */
.winloo-gallery-main {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 15px;
}

.winloo-gallery-main-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f9fa;
}

.winloo-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 1;
}

.winloo-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.winloo-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    overflow: hidden;
}

.winloo-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.winloo-image-container:hover .winloo-gallery-image {
    transform: scale(1.05);
}

/* Zoom Indicator */
.winloo-zoom-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.winloo-image-container:hover .winloo-zoom-indicator {
    opacity: 1;
    transform: scale(1.1);
}

.winloo-zoom-indicator i {
    color: #333;
    font-size: 16px;
}

/* Lightbox Trigger */
.winloo-lightbox-trigger {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    text-indent: -9999px;
    overflow: hidden;
}

/* Navigation Buttons */
.winloo-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
    z-index: 15;
}

.winloo-nav-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
}

.winloo-gallery-main:hover .winloo-nav-btn {
    opacity: 1;
    visibility: visible;
}

.winloo-nav-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.winloo-nav-btn i {
    color: #333;
    font-size: 18px;
}

.winloo-nav-btn:active {
    transform: scale(0.95);
}

/* Gallery Counter Wrapper */
.winloo-gallery-counter-wrapper {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

/* Gallery Counter */
.winloo-gallery-counter {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.winloo-gallery-counter .winloo-current {
    font-weight: 600;
}

/* Original Img Badge */
.winloo-original-img-badge {
    background: rgba(254, 137, 0, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(254, 137, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Standard Img Badge in Counter (for featured images) */
.winloo-standard-img-badge-counter {
    background: rgba(52, 152, 219, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    backdrop-filter: blur(10px);
}

/* Standard Image Badge (for featured/admin uploaded images) */
.winloo-standard-img-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(52, 152, 219, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10;
}

/* Standard badge on thumbnails */
.winloo-thumb-standard-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(52, 152, 219, 0.95);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
    z-index: 5;
}

/* ============================================
   Thumbnail Gallery
   ============================================ */
.winloo-gallery-thumbs {
    width: 100%;
    overflow: hidden;
}

.winloo-thumbs-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
    -webkit-overflow-scrolling: touch;
}

.winloo-thumbs-container::-webkit-scrollbar {
    height: 4px;
}

.winloo-thumbs-container::-webkit-scrollbar-track {
    background: transparent;
}

.winloo-thumbs-container::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.winloo-thumbs-container::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.winloo-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.winloo-thumb:hover {
    border-color: #fe8900;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 137, 0, 0.3);
}

.winloo-thumb.active {
    border-color: #fe8900;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(254, 137, 0, 0.2);
}

.winloo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.winloo-thumb:hover img {
    transform: scale(1.1);
}

.winloo-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.winloo-thumb.active .winloo-thumb-overlay {
    background: rgba(254, 137, 0, 0.1);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .winloo-gallery-main-slider {
        aspect-ratio: 4 / 3;
    }
    
    .winloo-nav-btn {
        width: 40px;
        height: 40px;
        opacity: 1;
        visibility: visible;
    }
    
    .winloo-nav-btn i {
        font-size: 16px;
    }
    
    .winloo-zoom-indicator {
        width: 35px;
        height: 35px;
        opacity: 1;
    }
    
    .winloo-zoom-indicator i {
        font-size: 14px;
    }
    
    .winloo-thumb {
        width: 70px;
        height: 70px;
    }
    
    .winloo-gallery-counter-wrapper {
        bottom: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .winloo-gallery-counter {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .winloo-original-img-badge,
    .winloo-standard-img-badge-counter {
        font-size: 10px;
        padding: 5px 8px;
    }
    
    .winloo-standard-img-badge {
        font-size: 10px;
        padding: 5px 8px;
        top: 10px;
        left: 10px;
    }
    
    .winloo-thumb-standard-badge {
        font-size: 8px;
        padding: 2px 5px;
    }
}

@media (max-width: 480px) {
    .winloo-gallery-main-slider {
        aspect-ratio: 1 / 1;
        border-radius: 8px;
    }
    
    .winloo-gallery-main {
        border-radius: 8px;
    }
    
    .winloo-thumb {
        width: 60px;
        height: 60px;
    }
    
    .winloo-thumbs-container {
        gap: 8px;
    }
}

/* ============================================
   Loading State
   ============================================ */
.winloo-gallery-image[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.winloo-gallery-image[loading="lazy"].loaded {
    opacity: 1;
}

/* ============================================
   PhotoSwipe Lightbox Customization
   ============================================ */
.pswp__bg {
    background: rgba(0, 0, 0, 0.9);
}

.pswp__img {
    cursor: zoom-in;
}

.pswp__button--close {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    width: 45px;
    height: 45px;
}

.pswp__button--arrow {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    width: 45px;
    height: 45px;
}

.pswp__button--arrow:hover {
    background: #fff;
}

/* ============================================
   Accessibility
   ============================================ */
.winloo-thumb:focus,
.winloo-nav-btn:focus {
    outline: 2px solid #fe8900;
    outline-offset: 2px;
}

/* ============================================
   Animation for Slide Change
   ============================================ */
@keyframes winlooFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.winloo-slide.active {
    animation: winlooFadeIn 0.4s ease;
}

