/**
 * Testimonials Custom Slider Fix
 * Fixes positioning issues while preserving original design
 */

/* Ensure proper container height for custom slider */
.testimonials-custom-slider .testimonial-slides-container {
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

/* Fix slide positioning for custom jQuery slider */
.testimonial-slide {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.testimonial-slide[data-slide="0"] {
    opacity: 1;
}

/* Override any custom styles to use original CSS framework */
.xb-testimonial .xb-item--inner {
    background-color: var(--color-white) !important;
    box-shadow: 0px 4px 4px 0px #EEEFF4 !important;
    padding: 60px 62px !important;
    border-radius: 20px !important;
    margin: 0 auto;
    max-width: none !important;
}

.xb-testimonial .xb-item--img {
    padding-bottom: 35px !important;
    margin-bottom: 30px !important;
    border-bottom: 1px solid #E8EAF3 !important;
}

.xb-testimonial .xb-item--content {
    font-size: 20px !important;
    font-weight: 500 !important;
    line-height: 37.5px !important;
    color: #4E566D !important;
    margin-bottom: 40px !important;
    font-style: normal !important;
}

.xb-testimonial .xb-item--ratting {
    margin-bottom: 10px !important;
}

.xb-testimonial .xb-item--title {
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.98px !important;
    margin-bottom: 5px !important;
}

.xb-testimonial .xb-item--position {
    margin: 0 !important;
    color: #888 !important;
    font-size: 14px !important;
}

/* Mobile responsiveness - Tablet */
@media (max-width: 1199px) {
    .testimonial-slide .xb-testimonial {
        max-width: 520px !important;
        min-height: 480px !important;
        padding: 45px 35px !important;
    }
    
    .testimonial-slide .xb-item--content {
        font-size: 17px !important;
        max-width: 420px !important;
    }
    
    .testimonial-slide .xb-item--title {
        font-size: 20px !important;
    }
    
    .testimonial-slide .xb-item--position {
        font-size: 15px !important;
    }
}

/* Mobile responsiveness - Phone */
@media (max-width: 767px) {
    .swiper-wrapper.testimonial-slides-container {
        min-height: 400px !important;
        overflow: visible !important;
    }
    
    #testimonials-slider {
        height: 400px !important;
        overflow: visible !important;
    }
    
    .testimonial-slide {
        min-height: 400px !important;
        padding: 5px !important;
        height: 400px !important;
    }
    
    .testimonial-slide .xb-testimonial {
        max-width: 100% !important;
        min-height: 380px !important;
        padding: 25px 20px !important;
        margin: 0 5px !important;
    }
    
    .testimonial-slide .xb-item--img img,
    .testimonial-slide .xb-item--img svg {
        width: 50px !important;
        height: 50px !important;
        padding: 8px !important;
    }
    
    .testimonial-slide .xb-item--img {
        margin-bottom: 15px !important;
    }
    
    .testimonial-slide .xb-item--content {
        font-size: 15px !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
        max-width: 100% !important;
    }
    
    .testimonial-slide .xb-item--content::before,
    .testimonial-slide .xb-item--content::after {
        font-size: 30px !important;
    }
    
    .testimonial-slide .xb-item--content::before {
        top: -10px !important;
        left: -8px !important;
    }
    
    .testimonial-slide .xb-item--content::after {
        bottom: -20px !important;
        right: -8px !important;
    }
    
    .testimonial-slide .xb-item--title {
        font-size: 17px !important;
        margin-bottom: 4px !important;
    }
    
    .testimonial-slide .xb-item--position {
        font-size: 13px !important;
        letter-spacing: 0.3px !important;
    }
    
    .testimonial-slide .xb-item--ratting {
        margin-bottom: 12px !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .swiper-wrapper.testimonial-slides-container {
        min-height: 370px !important;
    }
    
    #testimonials-slider {
        height: 370px !important;
    }
    
    .testimonial-slide {
        min-height: 370px !important;
        height: 370px !important;
    }
    
    .testimonial-slide .xb-testimonial {
        min-height: 350px !important;
        padding: 20px 15px !important;
        margin: 0 3px !important;
    }
    
    .testimonial-slide .xb-item--img {
        margin-bottom: 12px !important;
    }
    
    .testimonial-slide .xb-item--img img,
    .testimonial-slide .xb-item--img svg {
        width: 45px !important;
        height: 45px !important;
        padding: 6px !important;
    }
    
    .testimonial-slide .xb-item--content {
        font-size: 14px !important;
        line-height: 1.4 !important;
        margin-bottom: 16px !important;
    }
    
    .testimonial-slide .xb-item--content::before,
    .testimonial-slide .xb-item--content::after {
        font-size: 25px !important;
    }
    
    .testimonial-slide .xb-item--title {
        font-size: 16px !important;
        margin-bottom: 3px !important;
    }
    
    .testimonial-slide .xb-item--position {
        font-size: 12px !important;
        letter-spacing: 0.2px !important;
    }
    
    .testimonial-slide .xb-item--ratting {
        margin-bottom: 10px !important;
    }
}

/* Fix for Swiper wrapper positioning */
.swiper-wrapper.testimonial-slides-container {
    position: relative !important;
    overflow: visible !important;
    min-height: 550px;
}

/* Ensure slider container has proper height */
#testimonials-slider {
    height: 550px !important;
    overflow: visible !important;
}

/* Force visibility and positioning for slides */
.testimonial-slide {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    transition: opacity 0.8s ease-in-out !important;
}

/* Force testimonial card visibility */
.testimonial-slide .xb-testimonial {
    width: 100% !important;
    max-width: 600px !important;
    min-height: 500px !important;
    text-align: center !important;
    padding: 50px 40px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 auto !important;
}

/* Force inner elements visibility */
.testimonial-slide .xb-item--inner {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    height: 100% !important;
    visibility: visible !important;
}

.testimonial-slide .xb-item--img,
.testimonial-slide .xb-item--content,
.testimonial-slide .xb-item--bottom,
.testimonial-slide .xb-item--ratting,
.testimonial-slide .xb-item--title,
.testimonial-slide .xb-item--position {
    display: block !important;
    visibility: visible !important;
}

/* Google Logo & Image styling */
.testimonial-slide .xb-item--img {
    margin-bottom: 35px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.testimonial-slide .xb-item--img img,
.testimonial-slide .xb-item--img svg {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50% !important;
    background: #f8f9fa !important;
    padding: 15px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1) !important;
}

/* Content styling - More prominent */
.testimonial-slide .xb-item--content {
    margin-bottom: 40px !important;
    font-size: 18px !important;
    line-height: 1.8 !important;
    color: #2c3e50 !important;
    font-style: italic !important;
    font-weight: 400 !important;
    max-width: 480px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    position: relative !important;
}

.testimonial-slide .xb-item--content::before {
    content: '"' !important;
    font-size: 60px !important;
    color: #e9ecef !important;
    position: absolute !important;
    top: -20px !important;
    left: -20px !important;
    line-height: 1 !important;
    font-family: serif !important;
}

.testimonial-slide .xb-item--content::after {
    content: '"' !important;
    font-size: 60px !important;
    color: #e9ecef !important;
    position: absolute !important;
    bottom: -40px !important;
    right: -20px !important;
    line-height: 1 !important;
    font-family: serif !important;
}

/* Bottom section - Better spacing */
.testimonial-slide .xb-item--bottom {
    margin-top: auto !important;
}

.testimonial-slide .xb-item--ratting {
    margin-bottom: 20px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.testimonial-slide .xb-item--title {
    margin-bottom: 8px !important;
    font-size: 22px !important;
    color: #2c3e50 !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
}

.testimonial-slide .xb-item--position {
    margin: 0 !important;
    color: #6c757d !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* Ensure proper centering */
.testimonial-slide .xb-testimonial {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}