/* AveSeena Media Carousel v1.3 — 2-col grid + mobile carousel */

/* When used as WooCommerce gallery replacement, kill the FlexSlider DOM
   elements that WooCommerce or the theme might inject. Do NOT set width on
   this wrapper — let WooCommerce's own .woocommerce-product-gallery CSS
   (and any theme override) decide the column width. */
.avs-carousel-woo-wrap .flex-control-thumbs,
.avs-carousel-woo-wrap .flex-viewport,
.avs-carousel-woo-wrap .woocommerce-product-gallery__image,
.avs-carousel-woo-wrap .woocommerce-product-gallery__trigger {
    display: none !important;
}

.avs-carousel-wrap {
    --avs-bg: #fff;
    --avs-grid-gap: 4px;

    position: relative;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.avs-carousel-wrap *,
.avs-carousel-wrap *::before,
.avs-carousel-wrap *::after {
    box-sizing: border-box;
}

/* Shared media rules */
.avs-slide img.avs-image,
.avs-slide video.avs-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ============================================================
   DESKTOP (≥769px) — 2-column equal grid
   ============================================================ */
@media (min-width: 769px) {
    /* Hide mobile carousel on desktop unless layout is mobile_only */
    .avs-carousel-wrap:not(.avs-layout-mobile_only) .avs-mobile-carousel {
        display: none;
    }

    .avs-layout-grid .avs-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--avs-grid-gap);
        background: var(--avs-bg);
    }
    .avs-layout-grid .avs-grid__tile {
        aspect-ratio: var(--avs-aspect, 1 / 1);
        overflow: hidden;
        background: var(--avs-bg);
    }
}

/* ============================================================
   MOBILE (≤768px) — always swipeable carousel
   ============================================================ */
@media (max-width: 768px) {
    .avs-grid {
        display: none !important;
    }

    .avs-mobile-carousel {
        position: relative;
        width: 100%;
        aspect-ratio: var(--avs-aspect, 1 / 1);
        background: var(--avs-bg);
        overflow: hidden;
    }
    .avs-mobile-carousel .swiper-slide {
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    .avs-dots {
        position: absolute;
        bottom: 12px;
        left: 0;
        right: 0;
        text-align: center;
        z-index: 10;
    }
    .avs-dots .swiper-pagination-bullet {
        background: #1a1a1a;
        opacity: 0.3;
        width: 8px;
        height: 8px;
        margin: 0 4px;
    }
    .avs-dots .swiper-pagination-bullet-active {
        opacity: 1;
    }
    .avs-arrow {
        display: none;
    }
}

/* ============================================================
   "Carousel on all devices" — desktop also shows the carousel
   ============================================================ */
.avs-layout-mobile_only .avs-mobile-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: var(--avs-aspect, 1 / 1);
    background: var(--avs-bg);
    overflow: hidden;
}
.avs-layout-mobile_only .avs-mobile-carousel .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.avs-layout-mobile_only .avs-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}
.avs-layout-mobile_only .avs-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}
.avs-layout-mobile_only .avs-arrow--prev { left: 12px; }
.avs-layout-mobile_only .avs-arrow--next { right: 12px; }
