/* ============================================================
   Client reviews slider (global)
   ------------------------------------------------------------
   Markup: resources/views/frontend/inc/testimonials.blade.php
   Used on the homepage and every page that includes frontend.inc.review_section
   Behaviour: public/frontend/js/testimonials.js
   ============================================================ */

.tsm {
    --ts-navy: #061634;
    --ts-blue: #2563eb;
    --ts-ink: #0f172a;
    --ts-text: #475569;
    --ts-muted: #64748b;
    --ts-line: #e6ebf3;
    --ts-gold: #f59e0b;
    position: relative;
    padding: 90px 0;
    background:
        radial-gradient(700px 360px at 10% 0%, rgba(37, 99, 235, .08), transparent 70%),
        radial-gradient(600px 320px at 100% 100%, rgba(245, 158, 11, .07), transparent 70%),
        #f6f8fc;
    overflow: hidden;
}

.tsm *, .tsm *::before, .tsm *::after { box-sizing: border-box; }
.tsm--white { background: #fff; }
.tsm :focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 3px; border-radius: 12px; }

/* Header */
.tsm__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}
.tsm__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ts-blue);
}
.tsm__title { margin: 10px 0 8px; font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.15; color: var(--ts-ink); }
.tsm__sub { margin: 0; max-width: 560px; font-size: 1.02rem; line-height: 1.7; color: var(--ts-muted); }

.tsm__summary {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    padding: 14px 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--ts-line);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}
.tsm__score { font-size: 2.4rem; font-weight: 900; line-height: 1; color: var(--ts-ink); letter-spacing: -.03em; }
.tsm__summary-stars { color: var(--ts-gold); font-size: 14px; letter-spacing: 1px; }
.tsm__summary-stars .is-empty { color: #e2e8f0; }
.tsm__summary-text { display: block; margin-top: 3px; font-size: 13px; color: var(--ts-muted); }
.tsm__summary-text b { color: var(--ts-ink); }
.tsm__summary-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    padding-left: 16px;
    border-left: 1px solid var(--ts-line);
    font-size: 14px;
    font-weight: 800;
    color: var(--ts-blue);
    text-decoration: none;
    white-space: nowrap;
}
.tsm__summary-link:hover { text-decoration: underline; }
.tsm__summary-link i { font-size: 11px; }

/* Track: native horizontal scroll with snap, arrows are progressive enhancement */
.tsm__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * 22px) / 3);
    gap: 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 6px 2px 24px;
    margin: -6px -2px 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.tsm__track::-webkit-scrollbar { display: none; }

.tsm__card {
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: 22px;
    padding: 26px 24px 22px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.tsm__card:hover { transform: translateY(-4px); border-color: #c7d7fb; box-shadow: 0 22px 44px rgba(15, 23, 42, .10); }
.tsm__card::after {
    /* Large quote mark */
    content: "\201C";
    position: absolute;
    right: 18px; bottom: 58px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 88px;
    line-height: 1;
    color: #e8eefb;
    pointer-events: none;
}

.tsm__card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; position: relative; z-index: 1; }
.tsm__stars { color: var(--ts-gold); font-size: 14px; letter-spacing: 2px; white-space: nowrap; }
.tsm__stars .is-empty { color: #e2e8f0; }
.tsm__product {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 60%;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff5ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tsm__product:hover { background: #dbe8ff; color: #1e40af; }
.tsm__product i { font-size: 10px; }

.tsm__quote {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--ts-text);
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tsm__card.is-expanded .tsm__quote { -webkit-line-clamp: unset; display: block; }
.tsm__more {
    align-self: flex-start;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--ts-blue);
    cursor: pointer;
}
.tsm__more:hover { text-decoration: underline; }
.tsm__more[hidden] { display: none; }

.tsm__author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px dashed var(--ts-line);
}
.tsm__quote + .tsm__author, .tsm__more + .tsm__author { margin-top: 18px; }
.tsm__avatar {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dbe5fb;
}
.tsm__initial {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--c1, #2563eb), var(--c2, #0891b2));
}
.tsm__initial[hidden] { display: none; }
.tsm__who { min-width: 0; }
.tsm__name { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; color: var(--ts-ink); }
.tsm__verified { color: #10b981; font-size: 13px; }
.tsm__meta { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--ts-muted); }
.tsm__date { margin-left: auto; align-self: flex-start; font-size: 12px; font-weight: 600; color: #94a3b8; white-space: nowrap; }

/* Controls */
.tsm__controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 6px; }
.tsm__controls[hidden] { display: none; }
.tsm__progress { flex: 1; max-width: 260px; height: 4px; border-radius: 4px; background: #e2e8f0; overflow: hidden; }
.tsm__progress span { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #2563eb, #0891b2); transition: width .2s; }
.tsm__arrows { display: flex; gap: 10px; }
.tsm__arrow {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--ts-line);
    background: #fff;
    color: var(--ts-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.tsm__arrow:hover:not(:disabled) { background: var(--ts-navy); border-color: var(--ts-navy); color: #fff; }
.tsm__arrow:disabled { opacity: .4; cursor: default; }

/* Responsive */
@media (max-width: 1199.98px) {
    .tsm__track { grid-auto-columns: calc((100% - 22px) / 2); }
}
@media (max-width: 991.98px) {
    .tsm { padding: 64px 0; }
    .tsm__head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 767.98px) {
    .tsm__track { grid-auto-columns: 86%; gap: 14px; }
    .tsm__summary { width: 100%; flex-wrap: wrap; }
    .tsm__summary-link { margin-left: 0; padding-left: 0; border-left: 0; width: 100%; }
    .tsm__card { padding: 22px 18px 18px; }
    .tsm__score { font-size: 2rem; }
    .tsm__date { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .tsm * { transition: none !important; }
    .tsm__track { scroll-behavior: auto; }
}
