/**
 * MitraMobile Woo Product Carousel with Swiper.js (Elementor Pro Style)
 */

/* Swiper Container */
.mitramobile-woo-product-carousel.swiper-container {
    position: relative;
    overflow: visible; /* Allow content to be visible outside container */
    width: 100%;
    height: auto;
    padding: 0 10px; /* Add padding to prevent content cutoff */
}

.mitramobile-woo-product-carousel .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.mitramobile-woo-product-carousel .swiper-slide {
    flex-shrink: 0;
    width: auto;
    height: auto;
    position: relative;
    transition-property: transform;
    display: flex;
    align-items: stretch;
    overflow: visible; /* Ensure slide content is visible */
}

/* Product Item Styling */
.mitramobile-woo-product-carousel .mitramobile-product-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mitramobile-woo-product-carousel .mitramobile-product-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Navigation Arrows (Elementor Pro Style) */
.mitramobile-woo-product-carousel .swiper-button-prev,
.mitramobile-woo-product-carousel .swiper-button-next {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: #333;
    font-size: 18px;
}

.mitramobile-woo-product-carousel .swiper-button-prev:hover,
.mitramobile-woo-product-carousel .swiper-button-next:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.mitramobile-woo-product-carousel .swiper-button-prev {
    left: 10px;
}

.mitramobile-woo-product-carousel .swiper-button-next {
    right: 10px;
}

.mitramobile-woo-product-carousel .swiper-button-prev.swiper-button-disabled,
.mitramobile-woo-product-carousel .swiper-button-next.swiper-button-disabled {
    opacity: 0.35;
    cursor: auto;
    pointer-events: none;
}

/* Remove default Swiper button styles */
.mitramobile-woo-product-carousel .swiper-button-prev:after,
.mitramobile-woo-product-carousel .swiper-button-next:after {
    display: none;
}

/* Pagination Dots (Elementor Pro Style) */
.mitramobile-woo-product-carousel .swiper-pagination {
    position: relative;
    margin-top: 20px;
    text-align: center;
}

.mitramobile-woo-product-carousel .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 50%;
    background: #ddd;
    opacity: 1;
    margin: 0 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mitramobile-woo-product-carousel .swiper-pagination-bullet-active {
    background: #007cba;
    transform: scale(1.2);
}

.mitramobile-woo-product-carousel .swiper-pagination-bullet:hover {
    background: #007cba;
    opacity: 0.8;
}

/* Equal Height Support */
.mitramobile-woo-product-carousel .swiper-slide > .elementor-element {
    height: 100%;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .mitramobile-woo-product-carousel .swiper-button-prev,
    .mitramobile-woo-product-carousel .swiper-button-next {
        width: 36px;
        height: 36px;
        margin-top: -18px;
        font-size: 16px;
    }
    
    .mitramobile-woo-product-carousel .swiper-button-prev {
        left: 5px;
    }
    
    .mitramobile-woo-product-carousel .swiper-button-next {
        right: 5px;
    }
}

@media (max-width: 768px) {
    .mitramobile-woo-product-carousel .swiper-button-prev,
    .mitramobile-woo-product-carousel .swiper-button-next {
        width: 32px;
        height: 32px;
        margin-top: -16px;
        font-size: 14px;
    }
    
    .mitramobile-woo-product-carousel .swiper-pagination {
        margin-top: 15px;
    }
    
    .mitramobile-woo-product-carousel .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        margin: 0 3px;
    }
}

/* RTL Support */
.rtl .mitramobile-woo-product-carousel .swiper-button-prev {
    right: 10px;
    left: auto;
}

.rtl .mitramobile-woo-product-carousel .swiper-button-next {
    left: 10px;
    right: auto;
}

/* CSS Variables for Elementor Pro compatibility */
.mitramobile-woo-product-carousel {
    --swiper-slides-to-display: 3;
    --swiper-slides-gap: 10px;
}

/* Gap between slides */
.mitramobile-woo-product-carousel .swiper-slide {
    margin-right: var(--swiper-slides-gap);
}

.mitramobile-woo-product-carousel .swiper-slide:last-child {
    margin-right: 0;
}

/* Autoplay pause indicator */
.mitramobile-woo-product-carousel.swiper-paused {
    opacity: 0.8;
}

/* Loading state */
.mitramobile-woo-product-carousel.swiper-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Smooth slide transitions */
.mitramobile-woo-product-carousel .swiper-slide-active {
    opacity: 1;
}

.mitramobile-woo-product-carousel .swiper-slide-duplicate-active {
    opacity: 1;
}

/* -------------------------------------------------------------------------
   Two-line clamp for product titles within Swiper carousel
   Ensures titles from WooCommerce/Elementor templates clamp to 2 lines
   ------------------------------------------------------------------------- */
html body .mitramobile-woo-product-carousel .mitramobile-product-title,
html body .mitramobile-woo-product-carousel .mitramobile-product-title a,
html body .mitramobile-woo-product-carousel .woocommerce-loop-product__title,
html body .mitramobile-woo-product-carousel .woocommerce-loop-product__title a,
html body .mitramobile-woo-product-carousel .mitramobile-product-content h1,
html body .mitramobile-woo-product-carousel .mitramobile-product-content h1 a,
html body .mitramobile-woo-product-carousel .mitramobile-product-content h2,
html body .mitramobile-woo-product-carousel .mitramobile-product-content h2 a,
html body .mitramobile-woo-product-carousel .mitramobile-product-content h3,
html body .mitramobile-woo-product-carousel .mitramobile-product-content 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;
}
