/* =========================================
   TESTIMONIAL SECTION
========================================= */

.testimonial-section {
    position: relative;
    width: 100%;
    padding: 80px 0 110px;
    overflow: hidden;
    isolation: isolate;
    background: var(--section-bg);
    font-family: 'Poppins', sans-serif;
    color: var(--heading-color);
}

/* =========================================
   ANIMATED BACKGROUND
========================================= */

.testimonial-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.testimonial-wave {
    position: absolute;
    width: 38%;
    height: 115%;
    opacity: 0.35;
    will-change: transform;
}

.testimonial-wave g {
    stroke: var(--primary-light);
}

.wave-left {
    left: -5%;
    top: -10%;
    animation: testimonialWaveLeft 8s ease-in-out infinite alternate;
}

.wave-right {
    right: -5%;
    top: -15%;
    animation: testimonialWaveRight 10s ease-in-out infinite alternate;
}

.testimonial-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.45;
    will-change: transform;
}

.shape-one {
    width: 320px;
    height: 320px;
    top: -180px;
    left: 15%;
    background: radial-gradient(circle,
            rgba(2, 163, 191, 0.18),
            transparent 70%);
    animation: testimonialFloatOne 6s ease-in-out infinite;
}

.shape-two {
    width: 400px;
    height: 400px;
    bottom: -240px;
    left: -100px;
    background: radial-gradient(circle,
            rgba(0, 96, 199, 0.15),
            transparent 70%);
    animation: testimonialFloatTwo 8s ease-in-out infinite;
}

.shape-three {
    width: 350px;
    height: 350px;
    right: 5%;
    top: 15%;
    background: radial-gradient(circle,
            rgba(255, 204, 72, 0.18),
            transparent 70%);
    animation: testimonialFloatThree 7s ease-in-out infinite;
}

/* =========================================
   CONTAINER
========================================= */

.testimonial-container {
    width: min(1275px, calc(100% - 50px));
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* =========================================
   HEADING
========================================= */

.testimonial-heading {
    margin-bottom: 60px;
}

.testimonial-eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 17px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.eyebrow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    font-size: 15px;
    font-weight: 900;
    color: var(--accent-secondary);
}

.testimonial-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.testimonial-heading h2 {
    margin: 0;
    max-width: 650px;
    color: var(--heading-color);
    font-size: clamp(30px, 3vw, 36px);
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -1.5px;
}

.testimonial-heading h2 span {
    color: var(--primary-color);
}

/* =========================================
   CAROUSEL CONTROLS
========================================= */

.testimonial-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-bottom: 5px;
}

.testimonial-arrow {
    width: 51px;
    height: 51px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: var(--body-bg);
    color: var(--primary-color);
    font-size: 27px;
    cursor: pointer;
    transition: var(--transition);
}

.testimonial-arrow:hover {
    background: var(--primary-color);
    color: var(--light-text);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 96, 199, 0.2);
}

.testimonial-arrow:active {
    transform: scale(0.95);
}

.testimonial-arrow:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =========================================
   SLIDER
========================================= */

.testimonial-slider {
    width: 100%;
    overflow: hidden;
}

.testimonial-track {
    display: flex;
    align-items: stretch;
    gap: 48px;
    transition: transform 0.35s ease-in-out;
    will-change: transform;
}

/* =========================================
   TESTIMONIAL CARD
========================================= */

.testimonial-card {
    flex: 0 0 calc((100% - 96px) / 3);
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 20px 16px;
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    box-shadow: 0 2px 2px rgba(6, 24, 61, 0.03);
    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 45px rgba(6, 24, 61, 0.09);
}

/* Card title */

.testimonial-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 22px;
}

.testimonial-card-heading h3 {
    margin: 0;
    color: var(--heading-color);
    font-size: 17px;
    font-weight: 600;
}

.quote-icon {
    color: var(--accent-secondary);
    font-size: 31px;
    line-height: 1;
    font-weight: 900;
}

/* Testimonial text */

.testimonial-message {
    flex-grow: 1;
    margin: 0;
    color: var(--text-color);
    font-size: 15.5px;
    line-height: 1.56;
    font-style: italic;
}

/* Divider */

.testimonial-divider {
    width: 100%;
    height: 1px;
    margin: 20px 0 16px;
    background: var(--border-color);
}

/* =========================================
   CARD FOOTER
========================================= */

.testimonial-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.testimonial-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--accent-color);
    font-size: 21px;
    white-space: nowrap;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-avatar {
    width: 59px;
    height: 59px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    background: linear-gradient(135deg,
            var(--section-bg),
            var(--body-bg));
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 700;
    box-shadow: inset 0 0 0 4px var(--body-bg);
}

.testimonial-author h4 {
    margin: 0 0 2px;
    color: var(--heading-color);
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
}

.testimonial-author span {
    display: block;
    color: var(--text-color);
    font-size: 13px;
    white-space: nowrap;
}

/* =========================================
   BACK TO TOP
========================================= */

.testimonial-back-top {
    position: absolute;
    right: 25px;
    bottom: 25px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    transition: var(--transition);
}

.testimonial-back-top:hover {
    color: var(--primary-dark);
}

/* =========================================
   SCROLL REVEAL
========================================= */

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(25px);
    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.testimonial-card.reveal-card {
    opacity: 0;
    transform: translateY(25px);
}

.testimonial-card.reveal-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   BACKGROUND KEYFRAMES
========================================= */

@keyframes testimonialWaveLeft {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }

    100% {
        transform: translate3d(35px, -25px, 0) rotate(4deg);
    }
}

@keyframes testimonialWaveRight {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }

    100% {
        transform: translate3d(-35px, 30px, 0) rotate(-5deg);
    }
}

@keyframes testimonialFloatOne {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 25px);
    }
}

@keyframes testimonialFloatTwo {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(25px, -30px);
    }
}

@keyframes testimonialFloatThree {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-30px, 25px);
    }
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {

    .testimonial-track {
        gap: 25px;
    }

    .testimonial-card {
        flex-basis: calc((100% - 25px) / 2);
    }

    .testimonial-heading {
        margin-bottom: 45px;
    }
}

@media (max-width: 767px) {

    .testimonial-section {
        padding: 60px 0 85px;
    }

    .testimonial-container {
        width: calc(100% - 35px);
    }

    .testimonial-heading {
        margin-bottom: 35px;
    }

    .testimonial-heading-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 22px;
    }

    .testimonial-heading h2 {
        font-size: 30px;
        letter-spacing: -1px;
    }

    .testimonial-controls {
        align-self: flex-end;
    }

    .testimonial-arrow {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .testimonial-track {
        gap: 18px;
    }

    .testimonial-card {
        flex-basis: 100%;
        padding: 22px 18px 17px;
        border-radius: 22px;
    }

    .testimonial-message {
        font-size: 14.5px;
    }

    .testimonial-card-footer {
        flex-wrap: wrap;
    }

    .testimonial-rating {
        font-size: 19px;
    }

    .testimonial-avatar {
        width: 50px;
        height: 50px;
    }

    .testimonial-author h4 {
        font-size: 15px;
    }

    .testimonial-author span {
        font-size: 12px;
    }

    .testimonial-wave {
        width: 70%;
    }

    .testimonial-back-top {
        right: 12px;
        bottom: 15px;
    }
}

/* Respect reduced motion preference */

@media (prefers-reduced-motion: reduce) {

    .testimonial-wave,
    .testimonial-bg-shape {
        animation: none !important;
    }

    .reveal-on-scroll,
    .testimonial-card,
    .testimonial-track {
        transition: none !important;
    }
}