/* 0. Επιβολή 100% πλάτους (Αγνοεί το Layer bricks) */
html body .advance-product-gallery-wrapper .woocommerce-product-gallery {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

/* 1. Επιβολή Grid 2 στηλών (Desktop) */
html body .advance-product-gallery-wrapper .woocommerce-product-gallery__wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--adv-gallery-gap, 15px) !important;
    width: 100% !important;
    margin: 0 !important;
}

/* 2. Σωστή προσαρμογή στο κελί */
.advance-product-gallery-wrapper .woocommerce-product-gallery__wrapper > div {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

/* 3. Ratio 3/4 και γέμισμα */
.advance-product-gallery-wrapper .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: 100% !important; 
    aspect-ratio: 3 / 4 !important;
    object-fit: cover !important;
    display: block !important;
}

/* 4. Απόκρυψη περιττών controls */
.advance-product-gallery-wrapper .flex-control-nav,
.advance-product-gallery-wrapper .flex-direction-nav,
.advance-product-gallery-wrapper .woocommerce-product-gallery__trigger {
    display: none !important;
}

/* 5. Styling για τα Videos στο Grid */
.advance-product-gallery-wrapper .adv-gallery-video-item iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

/* 6. Swipe Slider για Tablet & Mobile */
@media (max-width: 991px) {
    html body .advance-product-gallery-wrapper .woocommerce-product-gallery__wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth;
        gap: 10px !important; 
        scrollbar-width: none; 
    }

    .advance-product-gallery-wrapper .woocommerce-product-gallery__wrapper::-webkit-scrollbar {
        display: none;
    }

    .advance-product-gallery-wrapper .woocommerce-product-gallery__wrapper > div {
        flex: 0 0 100% !important;
        scroll-snap-align: center !important;
    }
    
    .advance-product-gallery-wrapper .woocommerce-product-gallery {
        position: relative !important;
    }

    /* Swipe Badges: Z-INDEX 9999 για να νικάει το video */
    .advance-product-gallery-wrapper .woocommerce-product-gallery::after {
        position: absolute;
        bottom: 15px;
        right: 15px; 
        background-color: rgba(0, 0, 0, 0.6);
        color: #ffffff;
        padding: 6px 14px;
        border-radius: 50px;
        font-size: 13px;
        font-weight: 500;
        pointer-events: none;
        z-index: 99 !important; 
        backdrop-filter: blur(4px);
        opacity: 0; 
        transition: opacity 0.3s ease; 
    }

    .advance-product-gallery-wrapper.can-scroll-right .woocommerce-product-gallery::after {
        content: 'Swipe \2192'; 
        opacity: 1;
        animation: swipeHintRight 2s infinite ease-in-out;
    }

    .advance-product-gallery-wrapper.can-scroll-left .woocommerce-product-gallery::after {
        content: '\2190 Back'; 
        opacity: 1;
        animation: swipeHintLeft 2s infinite ease-in-out;
    }
}

@keyframes swipeHintRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}
@keyframes swipeHintLeft {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-6px); }
}