/* Body class to prevent scrolling when lightbox is open */
body.gorilla-lightbox-open {
    overflow: hidden;
}

.gorilla-product-gallery-widget {
    max-width: 100%;
    margin-bottom: 20px;
}

.gorilla-gallery-main-image {
    margin-bottom: 15px;
    text-align: center;
}

.gorilla-gallery-main-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px !important;
}

.gorilla-gallery-main-image {
    cursor: zoom-in;
    position: relative;
}

.gorilla-gallery-main-image::after {
    /*content: "🔍";*/
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gorilla-gallery-main-image:hover::after {
    opacity: 1;
}

.gorilla-gallery-thumbnails-container {
    overflow: hidden;
}

.gorilla-gallery-thumbnails-wrapper {
    overflow: hidden;
}

.gorilla-gallery-thumbnails {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Default styling for 4+ thumbnails */
.gorilla-gallery-thumbnail {
    flex: 1;
    cursor: pointer;
    transition: opacity 0.3s ease;
    opacity: 0.5;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

/* Fixed width/height for less than 4 thumbnails */
.gorilla-gallery-thumbnails[data-count="1"] .gorilla-gallery-thumbnail,
.gorilla-gallery-thumbnails[data-count="2"] .gorilla-gallery-thumbnail,
.gorilla-gallery-thumbnails[data-count="3"] .gorilla-gallery-thumbnail {
    flex: none;
    width: 130px;
    height: 130px;
}

.gorilla-gallery-thumbnails[data-count="1"],
.gorilla-gallery-thumbnails[data-count="2"],
.gorilla-gallery-thumbnails[data-count="3"] {
    justify-content: flex-start;
}

.gorilla-gallery-thumbnail.active {
    opacity: 1;
}

.gorilla-gallery-thumbnail:hover {
    opacity: 0.8;
}

.gorilla-gallery-thumbnail img {
    display: block;
    border-radius: 8px !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox Styles */
.gorilla-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

.gorilla-lightbox.active {
    display: flex;
}

.gorilla-lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.gorilla-lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px !important;
    margin-bottom: 20px;
}

.gorilla-lightbox-close {
    position: absolute;
    top: 5px;
    right: 0;
    background: #FFF !important;
    border: none !important;
    color: #121212 !important;
    font-size: 40px !important;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.gorilla-lightbox-close:hover {
    opacity: 0.8;
}

/* Lightbox Thumbnails */
.gorilla-lightbox-thumbnails {
    display: flex;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    justify-content: center;
    align-items: center;
}

.gorilla-lightbox-thumbnail {
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
    opacity: 0.6;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 8px;
    /*border: 2px solid transparent;*/
}

.gorilla-lightbox-thumbnail.active {
    opacity: 1;
    border-color: #fff;
    /*transform: scale(1.05);*/
}

.gorilla-lightbox-thumbnail:hover {
    opacity: 0.9;
    /*transform: scale(1.02);*/
}

.gorilla-lightbox-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Scrollbar styling for lightbox thumbnails */
.gorilla-lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gorilla-lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.gorilla-lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.gorilla-lightbox-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .gorilla-gallery-thumbnails {
        gap: 5px;
    }
    
    /* Disable lightbox on mobile */
    .gorilla-gallery-main-image {
        cursor: default;
    }
    
    .gorilla-gallery-main-image::after {
        display: none;
    }
    
    .gorilla-lightbox {
        display: none !important;
    }
}