/* ========================================= */
/* PREGUNTAS FRECUENTES                      */
/* Usa los tokens de styles.css del sitio    */
/* ========================================= */

/* ---------- Hero ---------- */
.faq-hero {
    padding-bottom: 40px;
    text-align: center;
}

.faq-hero .badge { margin-bottom: 22px; }

.faq-hero h1 {
    font-size: 1.9rem;
    max-width: 760px;
    margin: 0 auto 18px;
}

.faq-hero > p {
    color: var(--color-text-muted);
    font-size: 1.02rem;
    max-width: 560px;
    margin: 0 auto 32px;
}

/* ---------- Layout ---------- */
.faq-body {
    padding-top: 20px;
}

.faq-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

/* ---------- Categorías ---------- */
.faq-cats {
    position: sticky;
    top: 74px;
    z-index: 5;
    margin: 0 -20px;
    padding: 10px 20px;
    background: var(--color-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.faq-cats-label {
    display: none;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}

.faq-cats ul {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.faq-cats ul::-webkit-scrollbar { display: none; }

.faq-cats a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--color-border-soft);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.faq-cats a:hover { color: var(--color-text); border-color: var(--color-border-soft); }

.faq-cats a.active {
    color: var(--color-on-accent);
    background: var(--color-accent);
    border-color: transparent;
    box-shadow: 0 4px 18px var(--shadow-color);
}

/* ---------- Grupos ---------- */
.faq-group {
    scroll-margin-top: 150px;
}

.faq-group + .faq-group { margin-top: 48px; }

.faq-group[hidden] { display: none; }

.faq-group-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border-soft);
}

.faq-group-head h2 {
    font-size: 1.25rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Item del acordeón ---------- */
.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: 14px;
    scroll-margin-top: 150px;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.faq-item[hidden] { display: none; }

.faq-item:hover { border-color: var(--color-border-soft); }

.faq-item.open {
    border-color: var(--color-accent);
    background: var(--color-surface-2);
    box-shadow: 0 16px 40px var(--shadow-color), 0 0 0 1px var(--color-accent-soft);
}

.faq-item h3 {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.faq-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 64px;
    padding: 18px 18px;
    background: transparent;
    border: none;
    border-radius: 14px;
    color: var(--color-text);
    font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
}

.faq-q { text-wrap: pretty; }

.faq-icon {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-border-soft);
    background: var(--color-surface);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-text-muted);
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease, background 0.3s ease;
}

.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }

.faq-trigger:hover .faq-icon { border-color: var(--color-accent); }

.faq-item.open .faq-icon {
    background: var(--color-accent);
    border-color: transparent;
    transform: rotate(180deg);
}

.faq-item.open .faq-icon::before,
.faq-item.open .faq-icon::after { background: var(--color-on-accent); }

.faq-item.open .faq-icon::after { transform: translate(-50%, -50%) rotate(0deg); }

/* Panel animado con grid-rows (sin alturas fijas) */
.faq-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.faq-item.open .faq-panel { grid-template-rows: 1fr; }

.faq-panel-inner {
    overflow: hidden;
    min-height: 0;
}

.faq-answer {
    padding: 0 18px 22px 18px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.faq-item.open .faq-answer {
    opacity: 1;
    transform: none;
    transition-delay: 0.08s;
}

.faq-answer p + p,
.faq-answer p + ul,
.faq-answer ul + p { margin-top: 12px; }

.faq-answer strong { color: var(--color-text); font-weight: 600; }

.faq-answer ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-answer li {
    position: relative;
    padding-left: 18px;
}

.faq-answer li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
}

.faq-answer mark,
.faq-q mark {
    background: var(--color-accent-soft);
    color: var(--color-text);
    border-radius: 3px;
    padding: 0 2px;
}

/* ---------- CTA final ---------- */
.faq-cta {
    position: relative;
    margin-top: 64px;
    padding: 36px 24px;
    border-radius: 20px;
    background: var(--color-surface);
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}

.faq-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: var(--color-accent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}

.faq-cta .eyebrow { justify-content: center; }

.faq-cta h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.faq-cta p {
    color: var(--color-text-muted);
    max-width: 480px;
    margin: 0 auto 26px;
}

.faq-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

/* ---------- Breakpoints ---------- */
@media (min-width: 480px) {
    .faq-cats { margin: 0 -32px; padding: 10px 32px; }
    .faq-cta-actions { flex-direction: row; flex-wrap: wrap; }
}

@media (min-width: 768px) {
    .faq-hero h1 { font-size: 2.4rem; }
    .faq-cats { margin: 0; padding: 10px 0; }
    .faq-trigger { padding: 20px 24px; gap: 18px; font-size: 1rem; }
    .faq-answer { padding: 0 24px 26px 24px; font-size: 0.92rem; }
    .faq-cta { padding: 52px 40px; }
    .faq-cta h2 { font-size: 1.8rem; }
}

@media (min-width: 1024px) {
    .faq-layout {
        grid-template-columns: 250px minmax(0, 1fr);
        gap: 56px;
        align-items: start;
    }

    .faq-cats {
        top: 120px;
        padding: 0;
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .faq-cats-label { display: block; }

    .faq-cats ul {
        flex-direction: column;
        gap: 6px;
        overflow: visible;
    }

    .faq-cats a {
        border-radius: 12px;
        padding: 11px 16px;
        white-space: normal;
    }

    .faq-group,
    .faq-item { scroll-margin-top: 130px; }
}

@media (min-width: 1280px) {
    .faq-hero h1 { font-size: 2.7rem; }
}

/* ---------- PC: versión grande ----------
   Mismas medidas que Inicio y Nosotros (css/secciones-pc.css):
   contenedor de hasta 1400px y tipografías con clamp(). Le gana al
   tope de 1200px que styles.css le pone a <section>. */
@media (min-width: 768px) {
    .faq-hero,
    .faq-body {
        width: min(1400px, 92%);
        max-width: none;
        margin: 0 auto;
    }

    .faq-hero { padding: 160px 0 clamp(48px, 4vw, 72px); }
    .faq-body { padding: 0 0 clamp(80px, 7vw, 130px); }

    .faq-hero .badge {
        gap: 12px;
        margin-bottom: 36px;
        padding: 12px 24px;
        font-size: clamp(13px, 0.9vw, 15px);
    }

    .faq-hero .badge .dot { width: 10px; height: 10px; }

    .faq-hero h1 {
        max-width: 18em;
        margin-bottom: 32px;
        font-size: clamp(38px, 3.6vw, 68px);
        line-height: 1.12;
    }

    .faq-hero > p {
        max-width: 38em;
        margin-bottom: 0;
        font-size: clamp(17px, 1.25vw, 21px);
        line-height: 1.6;
    }

    .faq-trigger {
        min-height: 80px;
        padding: clamp(22px, 1.7vw, 30px) clamp(24px, 2vw, 36px);
        gap: 24px;
        border-radius: 20px;
        font-size: clamp(16px, 1.2vw, 21px);
    }

    .faq-item { border-radius: 20px; }

    .faq-icon { width: 42px; height: 42px; }
    .faq-icon::before,
    .faq-icon::after { width: 15px; }

    .faq-answer {
        padding: 0 clamp(24px, 2vw, 36px) clamp(26px, 2vw, 34px);
        max-width: 72ch;
        font-size: clamp(15px, 1.05vw, 18px);
        line-height: 1.7;
    }

    .faq-list { gap: 16px; }

    .faq-group + .faq-group { margin-top: clamp(56px, 5vw, 88px); }

    .faq-group-head { margin-bottom: 26px; padding-bottom: 20px; }
    .faq-group-head h2 { font-size: clamp(24px, 2vw, 36px); }

    .faq-cta {
        margin-top: clamp(72px, 6vw, 110px);
        padding: clamp(56px, 5vw, 88px) clamp(40px, 4vw, 72px);
        border-radius: 24px;
    }

    .faq-cta .eyebrow { font-size: clamp(13px, 0.9vw, 15px); }

    .faq-cta h2 {
        margin-bottom: 18px;
        font-size: clamp(28px, 2.6vw, 48px);
    }

    .faq-cta p {
        max-width: 36em;
        margin-bottom: 36px;
        font-size: clamp(16px, 1.15vw, 19px);
        line-height: 1.6;
    }

    .faq-cta-actions { gap: 16px; }

    .faq-cta-actions .btn {
        min-height: 56px;
        padding: 16px 32px;
        font-size: clamp(15px, 1vw, 17px);
    }
}

@media (min-width: 1024px) {
    .faq-layout {
        grid-template-columns: clamp(250px, 21vw, 330px) minmax(0, 1fr);
        gap: clamp(56px, 5vw, 96px);
    }

    /* debajo de la barra de arriba (alto: clamp(104px, 8vw, 132px)) */
    .faq-cats { top: calc(clamp(104px, 8vw, 132px) + 28px); }

    .faq-cats-label { margin-bottom: 18px; font-size: clamp(12px, 0.85vw, 14px); }

    .faq-cats ul { gap: 10px; }

    .faq-cats a {
        min-height: 52px;
        padding: 14px 20px;
        border-radius: 14px;
        font-size: clamp(14px, 1vw, 17px);
    }

    .faq-group,
    .faq-item { scroll-margin-top: calc(clamp(104px, 8vw, 132px) + 32px); }
}
