/* IMPEX Testimonials Slider with Swiper.js */

.impex-testimonials-container {
    width: 100%;
    overflow: hidden;
}

.impex-testimonials-wrapper {
    width: 100%;
    max-width: none;
    margin: 60px auto;
    position: relative;
    padding: 40px 0 100px 0; /* Extra bottom padding for controls */
}

.impex-testimonials-swiper {
    width: 100%;
    padding-bottom: 100px;
    position: relative;
    overflow: visible;
}

.impex-swiper-wrapper {
    align-items: flex-end; /* Align slides to bottom so height change goes upward */
}

.impex-swiper-slide {
    width: 780px;
    height: 450px;
    opacity: 0.7;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Support both Swiper's native class and our custom class */
.swiper-slide-active.impex-swiper-slide,
.impex-swiper-slide-active,
.impex-swiper-slide.swiper-slide-active {
    opacity: 1 !important;
}

.impex-slide-inner {
    /* Background will be set via inline styles with gradient overlay and image */
    border-radius: 12px;
    padding: 60px 80px;
    height: 360px; /* Default height for inactive slides */
    max-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
               
    transform: scale(0.9);
    position: relative;
    overflow: hidden;
    background-blend-mode: multiply;
}

/* Pattern overlay - background image will be set via inline styles with dynamic URL */
.impex-slide-inner::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 150px;
    height: 150px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.3; /* Reduced opacity for subtle effect */
    pointer-events: none;
    z-index: 1;
}

/* Ensure content is above the pattern */
.testimonial-content {
    position: relative;
    z-index: 2;
}

/* Active (centered) slide - taller height */
.swiper-slide-active .impex-slide-inner,
.impex-swiper-slide-active .impex-slide-inner,
.impex-swiper-slide.swiper-slide-active .impex-slide-inner {
    height: 450px !important;
    max-height: 450px !important;
    transform: scale(1) !important;
    box-shadow: none !important;
}

/* Smooth transitions for prev/next slides */
.swiper-slide-prev .impex-slide-inner,
.swiper-slide-next .impex-slide-inner,
.impex-swiper-slide-prev .impex-slide-inner,
.impex-swiper-slide-next .impex-slide-inner {
    transition-delay: 0.05s;
}

.testimonial-content {
    color: #ffffff;
    text-align: left;
    max-width: 100%;
    width: 100%;
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    /* Use flexbox for consistent spacing */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Fallback for browsers that don't support gap with flexbox */
@supports not (gap: 20px) {
    .testimonial-text {
        margin-bottom: 20px !important;
    }
    
    .testimonial-author strong {
        margin-bottom: 20px !important;
    }
}

/* Fade content during transitions */
.impex-swiper-slide:not(.swiper-slide-active) .testimonial-content,
.impex-swiper-slide:not(.impex-swiper-slide-active) .testimonial-content {
    opacity: 0.85;
}

.testimonial-text {
    /* Elementor global typography with fallbacks */
    font-size: var(--e-global-typography-6a59e89-font-size, 20px);
    line-height: var(--e-global-typography-6a59e89-line-height, 1.6);
    letter-spacing: var(--e-global-typography-6a59e89-letter-spacing, 0.3px);
    color: #ffffff;
    margin: 0; /* Remove margin, gap handles spacing */
    font-weight: 400;
    font-family: inherit; /* Use Elementor's global font family */
}

.testimonial-text p {
    margin: 0;
    padding: 0;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 20px; /* 20px gap between author name and company */
    margin: 0; /* Remove margin, parent gap handles spacing */
}

.testimonial-author strong {
    display: block;
    /* Elementor global typography with fallbacks */
    font-size: var(--e-global-typography-0c5c4dd-font-size, 16px);
    line-height: var(--e-global-typography-0c5c4dd-line-height, 1.4);
    letter-spacing: var(--e-global-typography-0c5c4dd-letter-spacing, 1px);
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    margin: 0; /* Remove margin, gap handles spacing */
}

.author-company {
    /* Elementor global typography with fallbacks */
    font-size: var(--e-global-typography-c83a5f5-font-size, 14px);
    line-height: var(--e-global-typography-c83a5f5-line-height, 1.5);
    letter-spacing: var(--e-global-typography-c83a5f5-letter-spacing, 0.3px);
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
    display: block;
}

/* Controls Container */
.impex-controls-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1140px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px;
    z-index: 10;
}

/* Swiper Pagination */
.impex-swiper-pagination {
    position: static !important;
    display: flex;
    gap: 10px;
    width: auto !important;
}

.impex-swiper-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #d1d5db;
    opacity: 1;
    transition: all 0.3s ease;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}


.impex-swiper-pagination .swiper-pagination-bullet:hover {
    background: #9ca3af;
    transform: scale(1.2);
}

.impex-swiper-pagination .swiper-pagination-bullet-active {
    background: #F36C21 !important;
    width: 24px;
    height: 8px;
    border-radius: 4px;
    transform: scale(1);
}

/* Navigation Container */
.impex-navigation-container {
    display: flex;
    gap: 15px;
}

/* Navigation Buttons */
.impex-swiper-button-prev,
.impex-swiper-button-next {
    position: relative !important;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
}
.impex-swiper-button-prev:before,
.impex-swiper-button-next:before{ 
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 40px;
    padding: 1px;
    background: linear-gradient(
    147deg,
    var(--Color-Neutral-Neutral-neutral-800, rgba(22, 21, 25, 0.5)) 0%,
    rgba(22, 21, 25, 0.05) 52.51%,
    rgba(22, 21, 25, 0.25) 100.99%
  );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}
.impex-swiper-button-prev::after,
.impex-swiper-button-next::after {
    display: none;
}

.impex-swiper-button-prev svg,
.impex-swiper-button-next svg {
    width: 24px;
    height: 24px;
    color: #161519 !important;
}

.impex-swiper-button-prev svg path,
.impex-swiper-button-next svg path {
    stroke: #161519 !important;
    stroke-width: 2.5;
}

.impex-swiper-button-prev:hover,
.impex-swiper-button-next:hover {
    background: linear-gradient(147deg, #F36C214D 0%, #f76c2107 52.51%, #F36C2126 100.99%);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Remove old positioning styles - now handled by container */

/* Responsive Design */
@media (max-width: 1440px) {
    .impex-swiper-slide {
        width: 960px;
    }
}

@media (max-width: 1280px) {
    .impex-swiper-slide {
        width: 840px;
    }
    
    .impex-slide-inner {
        padding: 45px 55px;
        height: 350px;
        max-height: 350px;
    }
    
    .impex-swiper-slide-active .impex-slide-inner {
        height: 480px;
        max-height: 480px;
    }
}

@media (max-width: 1024px) {
    .impex-swiper-slide {
        width: 680px;
    }
    
    .impex-slide-inner {
        padding: 40px 45px;
        height: 320px;
        max-height: 320px;
    }
    
    .impex-swiper-slide-active .impex-slide-inner {
        height: 450px !important;
        max-height: 450px !important;
    }
    
    /* Testimonial text inherits from Elementor global typography */
    .testimonial-text {
        /* Uses Elementor global typography variables */
    }
}

@media (max-width: 1180px) {
    .impex-controls-container {
        max-width: calc(100% - 40px);
    }
}

@media (max-width: 768px) {
    .impex-testimonials-wrapper {
        margin: 60px 0;
        padding: 40px 0;
    }
    
    .impex-swiper-slide {
        width: 520px;
    }
    
    .impex-slide-inner {
        padding: 35px 35px;
        height: 280px;
        max-height: 280px;
    }
    
    .impex-swiper-slide-active .impex-slide-inner {
        height: 380px;
        max-height: 380px;
    }
    
    /* Typography inherits from Elementor global variables */
    .testimonial-text {
        /* Uses Elementor global typography variables */
    }
    
    .testimonial-author strong {
        /* Uses Elementor global typography variables */
    }
    
    .author-company {
        /* Uses Elementor global typography variables */
    }
    
    .impex-swiper-button-prev,
    .impex-swiper-button-next {
        width: 42px;
        height: 42px;
    }
    
    .impex-swiper-button-prev svg,
    .impex-swiper-button-next svg {
        width: 20px;
        height: 20px;
    }
    
    .impex-controls-container {
        padding: 0 15px;
    }
    
    .impex-swiper-pagination .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
    
    .impex-swiper-pagination {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .impex-swiper-slide {
        width: 340px;
    }
    
    .impex-slide-inner {
        padding: 30px 25px;
        height: 240px;
        max-height: 240px;
    }
    
    .impex-swiper-slide-active .impex-slide-inner {
        height: 320px;
        max-height: 320px;
    }
    
    /* Testimonial text uses Elementor global typography */
    .testimonial-text {
        /* Responsive handled by Elementor global typography */
    }
    
    .impex-swiper-button-prev,
    .impex-swiper-button-next {
        width: 38px;
        height: 38px;
    }
    
    .impex-swiper-button-prev svg,
    .impex-swiper-button-next svg {
        width: 18px;
        height: 18px;
    }
    
    .impex-swiper-pagination {
        gap: 8px;
    }
    
    .impex-controls-container {
        bottom: 20px;
        padding: 0 10px;
    }
    
    .impex-navigation-container {
        gap: 8px;
    }
    
    .impex-swiper-pagination .swiper-pagination-bullet {
        width: 7px;
        height: 7px;
    }
}

@media (max-width: 360px) {
    .impex-swiper-slide {
        width: 300px;
    }
    
    .impex-slide-inner {
        padding: 25px 20px;
        height: 190px;
    }
    
    .impex-swiper-slide-active .impex-slide-inner {
        height: 240px;
    }
    
    /* Testimonial text uses Elementor global typography */
    .testimonial-text {
        /* Responsive handled by Elementor global typography */
    }
}

/* Ensure proper text rendering */
.testimonial-text,
.testimonial-author {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hardware acceleration for smoother transitions */
.impex-swiper-slide {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform, opacity;
}

.impex-slide-inner {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: height, transform;
}

/* Smooth transition states */
.impex-swiper-slide-duplicate .impex-slide-inner,
.impex-swiper-slide-duplicate-active .impex-slide-inner,
.impex-swiper-slide-duplicate-next .impex-slide-inner,
.impex-swiper-slide-duplicate-prev .impex-slide-inner {
    transition-duration: 0.6s;
}

/* Prevent flickering during transitions */
.impex-testimonials-swiper {
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

.impex-swiper-wrapper {
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}