/**
 * SpaceTemplate Testimonials Section Styles
 * Author: MAB (https://www.linkedin.com/in/bouazizi-med-achref/)
 */

.st-testimonials-section,
.st-testimonials-section *,
.st-testimonials-section *::before,
.st-testimonials-section *::after {
    box-sizing: border-box;
}

.st-testimonials-section {
    padding: 5.5rem 1.5rem;
    background: #FAF7F2;
    border-top: 1px solid rgba(184, 142, 118, 0.16);
    border-bottom: 1px solid rgba(184, 142, 118, 0.16);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.st-testimonials-container {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Header & Intro */
.st-testimonials-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 3.5rem auto;
}

.st-testimonials-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.1rem;
    background: rgba(184, 142, 118, 0.1);
    border: 1px solid rgba(184, 142, 118, 0.28);
    border-radius: 999px;
    font-family: 'Jost', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8C654E;
    margin-bottom: 1.25rem;
}

.st-testimonials-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #B88E76;
    box-shadow: 0 0 8px rgba(184, 142, 118, 0.6);
}

.st-testimonials-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 500;
    line-height: 1.18;
    color: #2D2825;
    margin: 0 0 1rem 0;
    letter-spacing: -0.01em;
}

.st-testimonials-title em {
    font-style: italic;
    color: #8C654E;
    font-weight: 400;
}

.st-testimonials-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.95rem, 1.5vw, 1.08rem);
    font-weight: 400;
    line-height: 1.65;
    color: #6E645F;
    margin: 0 0 1.5rem 0;
}

/* Aggregate Rating Summary */
.st-testimonials-summary-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 1.35rem;
    background: #FFFFFF;
    border: 1px solid rgba(184, 142, 118, 0.2);
    border-radius: 999px;
    box-shadow: 0 4px 18px rgba(45, 40, 37, 0.04);
    font-family: 'Jost', sans-serif;
    font-size: 0.84rem;
    color: #4A423D;
}

.st-stars-cluster {
    display: inline-flex;
    gap: 2px;
    color: #D4AF37;
}

.st-star-icon {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.st-summary-score {
    font-weight: 600;
    color: #2D2825;
}

.st-summary-divider {
    color: rgba(184, 142, 118, 0.35);
}

/* Grid of Cards (Desktop & Tablet) */
.st-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
    margin-bottom: 3.5rem;
    width: 100%;
}

@media (max-width: 1024px) and (min-width: 769px) {
    .st-testimonials-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Single Card */
.st-testimonial-card {
    background: #FFFFFF;
    border: 1px solid rgba(184, 142, 118, 0.18);
    border-radius: 14px;
    padding: 2.2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 4px 20px rgba(45, 40, 37, 0.03);
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
}

.st-testimonial-card:hover {
    transform: translateY(-4px);
    border-color: rgba(184, 142, 118, 0.38);
    box-shadow: 0 12px 32px rgba(184, 142, 118, 0.12);
}

.st-card-watermark-quote {
    position: absolute;
    top: 1.4rem;
    right: 1.8rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 4.5rem;
    line-height: 1;
    color: rgba(184, 142, 118, 0.12);
    user-select: none;
    pointer-events: none;
}

/* Card Top: Stars & Badge */
.st-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 2;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.st-card-stars {
    display: flex;
    gap: 3px;
    color: #D4AF37;
    flex-shrink: 0;
}

.st-verified-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.65rem;
    background: rgba(184, 142, 118, 0.08);
    border: 1px solid rgba(184, 142, 118, 0.22);
    border-radius: 999px;
    font-family: 'Jost', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #8C654E;
    flex-shrink: 0;
}

.st-check-svg {
    width: 11px;
    height: 11px;
    fill: currentColor;
}

/* Card Quote Body */
.st-card-quote {
    font-family: 'Inter', sans-serif;
    font-size: 0.96rem;
    line-height: 1.68;
    color: #3E3733;
    margin: 0 0 1.8rem 0;
    flex-grow: 1;
    position: relative;
    z-index: 2;
    padding: 0;
}

/* Card Author Info */
.st-card-author {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(184, 142, 118, 0.12);
    position: relative;
    z-index: 2;
}

.st-author-avatar-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(184, 142, 118, 0.3);
    background: linear-gradient(135deg, #F3ECE6 0%, #E6DBD2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-author-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.st-author-monogram {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #7D5741;
    letter-spacing: 0.05em;
    user-select: none;
}

.st-author-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.st-author-name {
    font-family: 'Jost', sans-serif;
    font-size: 0.94rem;
    font-weight: 600;
    color: #2D2825;
    margin: 0 0 2px 0;
    letter-spacing: 0.01em;
}

.st-author-role {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    color: #8A7E77;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottom Callout in Testimonials */
.st-testimonials-footer-cta {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding-top: 1rem;
}

.st-testimonials-footer-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    font-style: italic;
    color: #5C524C;
    margin: 0 0 1.25rem 0;
}

.st-testimonials-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.95rem 2.2rem;
    background: #2D2825;
    color: #FFFFFF;
    font-family: 'Jost', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(45, 40, 37, 0.15);
    transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.st-testimonials-btn:hover {
    background: #8C654E;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(140, 101, 78, 0.25);
}

.st-testimonials-guarantee {
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    color: #8C7F78;
    margin-top: 0.85rem;
}

/* ==========================================================================
   Mobile Controls (Hidden on Desktop & Tablet)
   ========================================================================== */
.st-testimonials-mobile-nav {
    display: none;
}

/* ==========================================================================
   Mobile Touch Carousel (Screen Width <= 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .st-testimonials-section {
        padding: 3.75rem 0 3.25rem 0 !important;
        overflow: hidden !important;
    }

    .st-testimonials-header {
        padding: 0 1.25rem !important;
        margin-bottom: 1.75rem !important;
    }

    .st-testimonials-title {
        font-size: clamp(1.85rem, 6vw, 2.3rem) !important;
        line-height: 1.2 !important;
    }

    .st-testimonials-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
        margin-bottom: 1.25rem !important;
    }

    .st-testimonials-summary-bar {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.4rem 0.65rem !important;
        padding: 0.65rem 1rem !important;
        max-width: calc(100% - 2.5rem) !important;
        margin: 0 auto !important;
        font-size: 0.78rem !important;
        border-radius: 16px !important;
    }

    .st-testimonials-summary-bar .st-summary-divider {
        display: none !important;
    }

    /* Transform Grid into Horizontal Touch-Swipeable Carousel */
    .st-testimonials-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
        gap: 1rem !important;
        padding: 0.5rem 1.25rem 1.25rem 1.25rem !important;
        margin: 0 0 0.5rem 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    .st-testimonials-grid::-webkit-scrollbar {
        display: none !important;
    }

    /* Card Sizing in Carousel (86% width allows clear peek of next slide) */
    .st-testimonial-card {
        flex: 0 0 86% !important;
        width: 86% !important;
        max-width: 86% !important;
        min-width: 270px !important;
        scroll-snap-align: center !important;
        scroll-snap-stop: normal !important;
        padding: 1.75rem 1.35rem !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    .st-card-quote {
        font-size: 0.92rem !important;
        line-height: 1.62 !important;
        margin: 0 0 1.4rem 0 !important;
    }

    .st-card-watermark-quote {
        font-size: 3.5rem !important;
        top: 1rem !important;
        right: 1.2rem !important;
    }

    /* Interactive Mobile Carousel Controls */
    .st-testimonials-mobile-nav {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.85rem !important;
        margin: 0.75rem auto 2.25rem auto !important;
        padding: 0 1.25rem !important;
    }

    .st-testimonials-nav-btn {
        width: 36px !important;
        height: 36px !important;
        border-radius: 50% !important;
        border: 1px solid rgba(184, 142, 118, 0.35) !important;
        background: #FFFFFF !important;
        color: #2D2825 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease !important;
        box-shadow: 0 2px 8px rgba(45, 40, 37, 0.05) !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
    }

    .st-testimonials-nav-btn:active {
        transform: scale(0.92) !important;
        background: #FAF7F2 !important;
    }

    .st-testimonials-dots {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .st-testimonials-dot {
        width: 8px !important;
        height: 8px !important;
        border-radius: 50% !important;
        background: rgba(184, 142, 118, 0.3) !important;
        border: none !important;
        padding: 0 !important;
        cursor: pointer !important;
        transition: width 0.25s ease, background-color 0.25s ease, border-radius 0.25s ease !important;
    }

    .st-testimonials-dot.is-active {
        width: 24px !important;
        border-radius: 999px !important;
        background: #B88E76 !important;
    }

    .st-testimonials-footer-cta {
        padding: 0 1.25rem !important;
    }

    .st-testimonials-footer-text {
        font-size: 1.2rem !important;
    }

    .st-testimonials-btn {
        width: 100% !important;
        max-width: 340px !important;
        padding: 0.9rem 1.5rem !important;
    }
}
