.testimonial-section {
    width: 100% !important;
    overflow: hidden;
    position: relative;
    font-family: Arial, sans-serif;
}

.ts-bg-gradient-yes.testimonial-section {
    background: linear-gradient(135deg, var(--bg-grad-start, transparent), var(--bg-grad-end, transparent));
}

.testimonial-container {
    width: 100%;
    max-width: 100%;
    margin: auto;
    position: relative;
}

.ts-swiper-d1aefde5 {
    width: 100%;
}

.swiper-slide.h-auto {
    height: auto;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 30px;
    color: #fff;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.testimonial-card.layout-above {
    padding-top: 30px;
}

.quote-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--quote-grad-start, #38bdf8), var(--quote-grad-end, #6366f1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: none !important;
    color: white;
}

.testimonial-text-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.testimonial-text-inner {
    position: relative;
    overflow: hidden;
}

.testimonial-text {
    font-size: 18px;
    line-height: 1.6;
    color: #e2e8f0;
    margin-bottom: 5px;
    margin-top: 0;
}

.testimonial-text.truncate {
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Overriden by Elementor setting */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-link {
    font-size: 14px;
    color: var(--quote-grad-start, #38bdf8);
    font-weight: bold;
    display: inline-block;
    margin-bottom: 25px;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
    align-self: flex-start;
}

.read-more-link:hover {
    text-decoration: underline;
}

/* Hide read more link if content isn't truncated (controlled by JS) */
.read-more-link.hidden {
    display: none;
}

.testimonial-user, .testimonial-user-above {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: auto;
}

.testimonial-user-above {
    margin-bottom: 20px;
    margin-top: 0;
}

.testimonial-user img, .testimonial-user-above img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.user-details {
    display: flex;
    flex-direction: column;
    text-align: inherit;
}

.testimonial-user h3, .testimonial-user-above h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: #fff;
    margin-top: 0;
}

.testimonial-user span, .testimonial-user-above span {
    color: #cbd5e1;
    font-size: 14px;
}

.testimonial-controls {
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.testimonial-controls button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: #fff;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
    box-shadow: none !important;
    z-index: 10;
}

.testimonial-controls button:hover {
    transform: translateY(-4px) scale(1.05);
}

.dots {
    display: flex !important;
    gap: 8px;
    align-items: center;
    position: static !important;
    width: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.dots .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: 0.3s ease;
    opacity: 1;
    margin: 0 !important;
    display: block !important;
}

.dots .swiper-pagination-bullet-active {
    width: 25px;
    border-radius: 30px;
    background: var(--quote-grad-start, #38bdf8);
}

/* Popup Styles */
.ts-popup-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s ease;
}
.ts-popup-modal.active {
    visibility: visible;
    opacity: 1;
}
.ts-popup-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}
.ts-popup-box {
    position: relative;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 4px solid var(--quote-grad-start, #38bdf8);
    border-radius: 20px;
    padding: 50px 30px 30px; /* Extra top padding for close button */
    width: 90%;
    max-width: 600px;
    max-height: 80vh; /* Responsive height limit */
    display: flex;
    flex-direction: column;
    color: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: 0.3s ease;
    z-index: 1;
    box-sizing: border-box;
}
.ts-popup-modal.active .ts-popup-box {
    transform: translateY(0);
}
.ts-popup-close {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    color: #e2e8f0; cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.ts-popup-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.ts-popup-body {
    font-size: 16px;
    line-height: 1.6;
    color: #e2e8f0;
    overflow-y: auto; /* Scrollable content */
    padding-right: 10px; /* Space for scrollbar */
}
/* Custom Scrollbar for Popup Body */
.ts-popup-body::-webkit-scrollbar {
    width: 6px;
}
.ts-popup-body::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}
.ts-popup-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
.ts-popup-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

@media(max-width: 768px) {
    .testimonial-card {
        padding: 25px 20px;
    }
    .testimonial-text {
        font-size: 16px;
        line-height: 1.5;
    }
    .testimonial-user h3, .testimonial-user-above h3 {
        font-size: 16px;
    }
    .ts-popup-box {
        padding: 45px 20px 20px;
        width: 95%;
        max-height: 85vh;
    }
}