/**
 * Custom product gallery styles
 */

.custom-product-gallery {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: nowrap;
}

.custom-product-gallery .thumbnail-container {
    display: none;
}

@media (min-width: 769px) {
    .custom-product-gallery .thumbnail-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 80px;
        margin-right: 20px;
    }
}

@media (max-width: 992px) {
    .custom-product-gallery .main-image-container {
        width: 100% !important;
    }
}

.custom-product-gallery .thumbnail {
    width: 80px;
    height: 80px;
    cursor: pointer;
    object-fit: contain;
    padding: 5px;
    background: #fff;
}

.custom-product-gallery .thumbnail.active {
    border: 1px solid #ff4d00;
}

.custom-product-gallery .main-image-wrapper {
    flex-grow: 1;
    position: relative;
}

.custom-product-gallery .main-image-container {
    position: relative;
    text-align: center;
    background: #fff;
    padding: 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 380px;
    height: 380px;
}

.custom-product-gallery .main-image {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    cursor: zoom-in;
    object-fit: contain;
}

.custom-product-gallery .navigation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    position: relative;
}

.custom-product-gallery .scrollbar-container {
    display: none; /* Hidden on desktop */
    width: 100%;
    height: 2px;
    background-color: #ddd;
    position: relative;
    margin: 10px auto;
    max-width: 60%;
    cursor: pointer;
    border-radius: 2px;
}

.custom-product-gallery .scrollbar-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    background-color: #f95c00;
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 2px;
    box-shadow: 0 0 2px rgba(249, 92, 0, 0.3);
}

.custom-product-gallery .gallery-nav {
    background-color: #222;
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.custom-product-gallery .gallery-nav.prev {
    left: 0;
}

.custom-product-gallery .gallery-nav.next {
    right: 0;
}

/* Show navigation arrows only on mobile */
@media (max-width: 768px) {
    .custom-product-gallery .gallery-nav {
        display: flex;
    }
    
    .custom-product-gallery .scrollbar-container {
        display: block;
    }
    
    .custom-product-gallery .main-image-container {
        width: 285px;
        height: 285px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Fullscreen modal */
.gallery-fullscreen {
    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;
}

.gallery-fullscreen img {
    max-width: 90%;
    max-height: 90%;
}

.gallery-fullscreen .close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
}
