.wc-advanced-gallery {
    max-width: 100%;
    margin: 0 auto;
}

/* Main Image Wrapper with arrows on both sides */
.gallery-main-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-direction: row-reverse;
    margin-bottom: 20px;
}

/* Main Image Container */
.gallery-main-container {
    flex: 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}

.gallery-main-swiper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Square aspect ratio */
}

.gallery-main-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.gallery-main-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Magnifying Glass Icon */
.gallery-zoom-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gallery-zoom-icon:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.gallery-zoom-icon svg {
    width: 22px;
    height: 22px;
    fill: #333;
}

/* Lightbox Styles */
.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-lightbox.active {
    display: block;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lightbox Swiper */
.lightbox-swiper {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 90vh;
}

.lightbox-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-swiper .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* Lightbox Navigation */
.lightbox-arrow-prev,
.lightbox-arrow-next {
    width: 60px !important;
    height: 60px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    transition: all 0.3s ease;
}

.lightbox-arrow-prev:hover,
.lightbox-arrow-next:hover {
    background: #fff !important;
    transform: scale(1.1);
}

.lightbox-arrow-prev::after,
.lightbox-arrow-next::after {
    font-size: 28px !important;
    font-weight: bold !important;
    color: #333 !important;
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: #fff;
    transform: rotate(90deg) scale(1.1);
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background: #333;
    border-radius: 2px;
}

.lightbox-close::before {
    transform: rotate(45deg);
}

.lightbox-close::after {
    transform: rotate(-45deg);
}

/* Lightbox Counter */
.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-family: 'Varela Round', sans-serif;
    color: #333;
    font-weight: 500;
    z-index: 100;
}

.lightbox-counter .current {
    font-weight: bold;
    font-size: 18px;
}

/* Main Image Navigation Arrows - OUTSIDE */
.gallery-arrow-prev,
.gallery-arrow-next {
    position: relative !important;
    width: 50px !important;
    height: 50px !important;
    flex-shrink: 0;
    margin: 0 !important;
    top: 0 !important;
}


.gallery-arrow-next {
  right:0;
  left:auto !important;
}

.gallery-arrow-prev {
  left:0;
  right:auto !important;
}



.gallery-arrow-prev::after,
.gallery-arrow-next::after {
    font-size: 24px !important;
    font-weight: bold !important;
    color: #333 !important;
}

/* Thumbnails Container */
.gallery-thumbnails-container {
    position: relative;
    padding: 0 50px; /* Space for arrows */
}

.gallery-thumbs-swiper {
    width: 100%;
    padding: 5px 0;
    direction: rtl; /* RTL for thumbnails */
}

.gallery-thumbs-swiper .swiper-slide {
    width: 100px !important; /* Fixed width for each thumbnail */
    height: 100px !important;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-thumbs-swiper .swiper-slide:hover {
    opacity: 0.75;
    transform: translateY(-2px);
}

.gallery-thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1;
}

.thumbnail-item {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-thumbs-swiper .swiper-slide-thumb-active .thumbnail-item {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
}

/* Thumbnail Navigation Arrows */
.thumb-arrow-prev,
.thumb-arrow-next {
    width: 36px !important;
    height: 36px !important;
    background: #fff !important;
    border: 1px solid #ddd;
    border-radius: 50% !important;
    transition: all 0.3s ease;
    top: 50% !important;
    margin-top: 0 !important;
}

.thumb-arrow-prev:hover,
.thumb-arrow-next:hover {
    background: #f5f5f5 !important;
    border-color: #999;
}

.thumb-arrow-prev::after,
.thumb-arrow-next::after {
    font-size: 16px !important;
    color: #333;
}

.thumb-arrow-prev {
    left: 0 !important;
}

.thumb-arrow-next {
    right: 0 !important;
}

.swiper-button-disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Hide thumbnail arrows when all thumbnails fit */
.gallery-thumbnails-container.hide-arrows .thumb-arrow-prev,
.gallery-thumbnails-container.hide-arrows .thumb-arrow-next {
    display: none !important;
}

.gallery-thumbnails-container.hide-arrows {
    padding: 0 !important;
}

/* Image Counter */
.gallery-counter {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    font-family:'Varela Round';
    color: #666;
    direction: ltr; /* Keep counter LTR */
}

.gallery-counter .current-image {
    font-weight: bold;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-main-wrapper {
        gap: 10px;
    }
    
    .gallery-arrow-prev,
    .gallery-arrow-next {
        width: 40px !important;
        height: 40px !important;
    }
    
    .gallery-arrow-prev::after,
    .gallery-arrow-next::after {
        font-size: 20px !important;
    }
    
    .gallery-thumbs-swiper .swiper-slide {
        width: 80px !important;
        height: 80px !important;
    }
    
    .gallery-thumbnails-container {
        padding: 0 40px;
    }
    
    .thumb-arrow-prev,
    .thumb-arrow-next {
        width: 32px !important;
        height: 32px !important;
    }
    
    .gallery-zoom-icon {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .gallery-zoom-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .lightbox-arrow-prev,
    .lightbox-arrow-next {
        width: 50px !important;
        height: 50px !important;
    }
    
    .lightbox-close {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }
    
    .lightbox-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .gallery-main-wrapper {
        gap: 8px;
    }
    
    .gallery-arrow-prev,
    .gallery-arrow-next {
        width: 35px !important;
        height: 35px !important;
    }
    
    .gallery-arrow-prev::after,
    .gallery-arrow-next::after {
        font-size: 18px !important;
    }
    
    .gallery-thumbs-swiper .swiper-slide {
        width: 70px !important;
        height: 70px !important;
    }
    
    .gallery-thumbnails-container {
        padding: 0 35px;
    }
    
    .gallery-zoom-icon {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
    
    .gallery-zoom-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .lightbox-arrow-prev,
    .lightbox-arrow-next {
        width: 45px !important;
        height: 45px !important;
    }
    
    .lightbox-arrow-prev::after,
    .lightbox-arrow-next::after {
        font-size: 24px !important;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .lightbox-counter {
        bottom: 15px;
        font-size: 13px;
        padding: 6px 14px;
    }
}