/* Essential Addons for Elementor Product Carousel Overlap Fix */

/* Container and wrapper fixes */
.eael-woo-product-carousel-container {
    overflow: visible !important;
}

.eael-woo-product-carousel-container .eael-woo-product-carousel {
    overflow: visible !important;
}

.eael-woo-product-carousel-container .swiper-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0 !important;
}

/* Product slide fixes */
.eael-woo-product-carousel-container .swiper-slide {
    width: auto !important;
    min-width: 280px !important;
    max-width: 350px !important;
    flex: 0 0 auto !important;
    margin-right: 20px !important;
    box-sizing: border-box !important;
}

.eael-woo-product-carousel-container .product {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Preset-specific fixes */
.eael-woo-product-carousel-container.preset-1 .eael-product-carousel {
    margin: 0 !important;
    width: 100% !important;
    min-height: 400px !important;
}

.eael-woo-product-carousel-container.preset-2 .eael-product-carousel {
    margin: 0 !important;
    width: 100% !important;
    min-height: 400px !important;
}

.eael-woo-product-carousel-container.preset-3 .eael-product-carousel {
    margin: 0 !important;
    width: 100% !important;
    min-height: 400px !important;
}

/* Product details wrapper */
.eael-woo-product-carousel-container .product-details-wrap {
    padding: 15px !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.eael-woo-product-carousel-container .product-details {
    flex: 1 !important;
    width: 100% !important;
}

/* Image wrapper fixes */
.eael-woo-product-carousel-container .product-image-wrap {
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
}

.eael-woo-product-carousel-container .image-wrap {
    width: 100% !important;
    height: 250px !important;
    overflow: hidden !important;
}

.eael-woo-product-carousel-container .image-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Grid fallback fixes for non-initialized carousels */
.eael-woo-product-carousel-container .eael-woo-product-carousel:not(.swiper-initialized) .swiper-wrapper.products {
    display: grid !important;
    gap: 20px !important;
    grid-auto-columns: minmax(280px, 1fr) !important;
    grid-auto-flow: column !important;
    overflow-x: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

.eael-woo-product-carousel-container .eael-woo-product-carousel:not(.swiper-initialized) .swiper-wrapper.products .product {
    margin: 0 !important;
    width: 100% !important;
    min-width: 280px !important;
}

/* Responsive fixes */
@media (max-width: 1024px) {
    .eael-woo-product-carousel-container .swiper-slide {
        min-width: 250px !important;
        max-width: 300px !important;
    }
}

@media (max-width: 768px) {
    .eael-woo-product-carousel-container .swiper-slide {
        min-width: 220px !important;
        max-width: 280px !important;
        margin-right: 15px !important;
    }
    
    .eael-woo-product-carousel-container .image-wrap {
        height: 200px !important;
    }
}

@media (max-width: 480px) {
    .eael-woo-product-carousel-container .swiper-slide {
        min-width: 200px !important;
        max-width: 250px !important;
        margin-right: 10px !important;
    }
    
    .eael-woo-product-carousel-container .image-wrap {
        height: 180px !important;
    }
    
    .eael-woo-product-carousel-container .product-details-wrap {
        padding: 10px !important;
    }
}

/* -------------------------------------------------------------------------
   Two-line clamp for product titles within EAEL Woo Product Carousel
   Ensures titles from WooCommerce/Elementor templates clamp to 2 lines
   ------------------------------------------------------------------------- */
.eael-woo-product-carousel-container .product .woocommerce-loop-product__title,
.eael-woo-product-carousel-container .product .woocommerce-loop-product__title a,
.eael-woo-product-carousel-container .product .product-title,
.eael-woo-product-carousel-container .product .product-title a,
.eael-woo-product-carousel-container .product .eael-product-title,
.eael-woo-product-carousel-container .product .eael-product-title a,
.eael-woo-product-carousel-container .product .elementor-heading-title,
.eael-woo-product-carousel-container .product .elementor-heading-title a,
.eael-woo-product-carousel-container .product .product-details-wrap h1,
.eael-woo-product-carousel-container .product .product-details-wrap h1 a,
.eael-woo-product-carousel-container .product .product-details-wrap h2,
.eael-woo-product-carousel-container .product .product-details-wrap h2 a,
.eael-woo-product-carousel-container .product .product-details-wrap h3,
.eael-woo-product-carousel-container .product .product-details-wrap h3 a {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
    min-height: 2.4em !important;
    max-height: 2.4em !important;
}
