/* Base Swiper Styles incase Elementor doesn't load them */
.swiper-container,
.swiper {
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    z-index: 1;
}

.swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    transition-property: transform;
    box-sizing: content-box;
}

.swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
}

/* Custom Styles */
.tm-testimonials-container {
    background-color: #000;
    color: #fff;
    padding: 60px 40px;
    position: relative;
    border-radius: 20px;
    text-align: center;
    overflow: hidden;
}

.tm-testimonials-swiper {
    width: 100%;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    /* Critical for Swiper */
    min-height: 300px;
    /* Prevent collapse */
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    /* Ensure slide is visible */
    opacity: 1 !important;
    visibility: visible !important;
    height: auto;
    /* Let content determine height */
}

.tm-testimonial-slide {
    max-width: 800px;
    width: 100%;
    /* Ensure content takes space */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.tm-testimonial-image img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
}

.tm-testimonial-content {
    font-size: 18px;
    line-height: 1.6;
    font-weight: 500;
}

.tm-testimonial-rating {
    font-size: 24px;
    color: #fff;
    display: flex;
    gap: 10px;
}

.tm-testimonial-arrow {
    background-color: #fff;
    color: #000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.tm-arrow-prev {
    left: 10px;
}

.tm-arrow-next {
    right: 10px;
}

/* Override Elementor Styles */
.tm-testimonial-arrow:after {
    display: none;
    content: '' !important;
}

.tm-testimonial-arrow i {
    font-size: 20px;
}

.tm-testimonial-button-wrapper {
    margin-top: 30px;
}

.tm-testimonial-btn {
    background-color: #fff;
    color: #000;
    padding: 15px 30px;
    font-weight: bold;
    font-size: 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    border-radius: 30px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.tm-testimonial-btn:hover {
    transform: translateY(-3px);
}

/* Modal Styling */
.tm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    /* Higher z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.tm-modal-container {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.tm-modal-container .tm-testimonial-form-wrapper {
    background: transparent;
    padding: 0;
    border-radius: 0;
    max-width: 100%;
    color: #333;
}

.tm-modal-container .tm-form-group label {
    color: #333;
}

.tm-modal-container .tm-form-group input[type="text"],
.tm-modal-container .tm-form-group input[type="email"],
.tm-modal-container .tm-form-group textarea {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.tm-modal-container .tm-submit-btn {
    background: #000;
    color: #fff;
    width: 100%;
}

.tm-modal-container .tm-submit-btn:hover {
    background: #333;
}

.tm-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: color 0.3s;
}

.tm-modal-close:hover {
    color: #ff0000;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tm-testimonials-container {
        padding: 40px 20px;
    }

    .tm-testimonial-content {
        font-size: 16px;
    }

    .tm-testimonial-arrow {
        width: 35px;
        height: 35px;
        /* Move arrows below on mobile? Or keep overlapping */
    }

    .tm-arrow-prev {
        left: 0px;
    }

    .tm-arrow-next {
        right: 0px;
    }
}