/**
 * Product Gallery Carousel Styles
 */

.woocommerce-product-gallery.logon-carousel-initialized {
    position: relative;
}

/* Outer wrapper for thumbnails and navigation */
.logon-thumbnails-outer-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Thumbnail carousel wrapper */
.logon-thumbnails-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
    padding: 20px 30px;
}

/* WooCommerce flex-control-thumbs base styling */
.woocommerce div.product div.images .flex-control-thumbs {
    overflow: inherit;
    zoom: 1;
    margin: 0;
    padding: 0;
}

.logon-thumbnails-carousel-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Thumbnail list styling */
.logon-thumbnails-carousel-wrapper.flex-control-nav.flex-control-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0px;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
    width: max-content;
    transition: transform 0.3s ease;
    height: 115px;
}

.logon-thumbnails-carousel-wrapper.flex-control-nav.flex-control-thumbs li {
    margin: 0;
    padding: 0;
    list-style: none;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: #fff;
    padding: 4px;
    flex-shrink: 0;
    width: 100px;
}

.logon-thumbnails-carousel-wrapper.flex-control-nav.flex-control-thumbs li.flex-active,
.logon-thumbnails-carousel-wrapper.flex-control-nav.flex-control-thumbs li.logon-thumb-active {
    border-color: #2c3e50;
    background-color: #F5F5F5;
}

.logon-thumbnails-carousel-wrapper.flex-control-nav.flex-control-thumbs li img {
    display: block !important;
    width: 100%;
    height: 100px !important;
    object-fit: cover;
    border-radius: 10px;
    background-color: #F5F5F5;
    visibility: visible !important;
    opacity: 1 !important;
}

/* WooCommerce thumbnail images styling */
.woocommerce div.product div.images .flex-control-thumbs li img {
    cursor: pointer;
    opacity: 1;
    margin: 0;
}

/* Navigation buttons - positioned relative to outer wrapper but outside it */
.logon-gallery-nav {
    background: transparent;
    color: #0D47A1;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    z-index: 10;
    position: absolute;
    top: 87%;
    transform: translateY(-50%);
}

.logon-gallery-nav-prev {
    left: -13px;
}

.logon-gallery-nav-next {
    right: -13px;
}

button.logon-gallery-nav:hover,
button.logon-gallery-nav:focus {
    background-color: transparent !important;
    color: #4fc3f7 !important;
}

.logon-gallery-nav:hover:not(.disabled) {
    color: #4fc3f7;
    transform: translateY(-50%) scale(1.1);
}

.logon-gallery-nav:active:not(.disabled) {
    transform: translateY(-50%) scale(0.95);
}

.logon-gallery-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.logon-gallery-nav svg {
    width: 48px;
    height: 48px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

/* WooCommerce product images styling */
.woocommerce div.product div.images img {
    display: block;
    width: 100%;
    height: 400px;
    box-shadow: none;
    object-fit: contain;
}

/* Flex viewport styling */
.flex-viewport {
    background-color: #F5F5F5;
    border-radius: 10px;
    padding: 20px;
}

/* Flex slide styling - rounded frames for gallery images */
.flex-slide,
.woocommerce-product-gallery__image {
    background-color: #F5F5F5;
    border-radius: 10px;
    padding: 20px;
    margin: 0;
}

.flex-slide img,
.woocommerce-product-gallery__image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Ensure gallery images are properly styled */
.woocommerce-product-gallery.logon-carousel-initialized .woocommerce-product-gallery__image,
.woocommerce-product-gallery.logon-carousel-initialized .flex-slide {
    position: relative;
    background-color: #F5F5F5;
    border-radius: 10px;
    padding: 20px;
}

.woocommerce-product-gallery.logon-carousel-initialized .woocommerce-product-gallery__image img,
.woocommerce-product-gallery.logon-carousel-initialized .flex-slide img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Fallback styling for thumbnails if wrapper class isn't applied */
.flex-control-nav.flex-control-thumbs:not(.logon-thumbnails-carousel-wrapper) {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    justify-content: center;
}

.flex-control-nav.flex-control-thumbs:not(.logon-thumbnails-carousel-wrapper) li {
    margin: 0;
    padding: 0;
    list-style: none;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: #fff;
    padding: 4px;
}

.flex-control-nav.flex-control-thumbs:not(.logon-thumbnails-carousel-wrapper) li:hover,
.flex-control-nav.flex-control-thumbs:not(.logon-thumbnails-carousel-wrapper) li.flex-active {
    border-color: #2c3e50;
}

.flex-control-nav.flex-control-thumbs:not(.logon-thumbnails-carousel-wrapper) li img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
    .logon-thumbnails-wrapper {
        padding: 0 50px;
    }

    .logon-gallery-nav-prev {
        left: -50px;
    }

    .logon-gallery-nav-next {
        right: -50px;
    }

    .logon-gallery-nav svg {
        width: 40px;
        height: 40px;
    }

    .logon-thumbnails-carousel-wrapper.flex-control-nav.flex-control-thumbs li {
        width: 90px;
    }

    .logon-thumbnails-carousel-wrapper.flex-control-nav.flex-control-thumbs li img {
        height: 90px;
    }
}

@media (max-width: 480px) {
    .logon-thumbnails-wrapper {
        padding: 0 45px;
    }

    .logon-gallery-nav-prev {
        left: -10px;
    }

    .logon-gallery-nav-next {
        right: -10px;
    }

    .logon-gallery-nav svg {
        width: 36px;
        height: 36px;
    }

    .logon-thumbnails-carousel-wrapper.flex-control-nav.flex-control-thumbs li {
        width: 100vw;
    }

    .logon-thumbnails-carousel-wrapper.flex-control-nav.flex-control-thumbs li img {
        height: 80px;
    }
}
