/* Preguntas frecuentes (preguntas-frecuentes.html) */

.faq-page {
    --faq-blue: #004aad;
    --faq-line: #e6eaf1;
    --faq-muted: #5b6474;
    background: #ffffff;
}

.faq-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Cabecera ─────────────────────────────────────────────────────────────── */
.faq-hero {
    background: linear-gradient(180deg, #f3f7fd 0%, #ffffff 100%);
    text-align: center;
    padding: 64px 0 40px;
}
.faq-hero h1 {
    font-size: clamp(2rem, 4.5vw, 2.9rem);
    color: #1a1a1a;
    margin: 0 0 12px;
}
.faq-hero p {
    color: #1a1a1a;
    max-width: 620px;
    margin: 0 auto 28px;
    line-height: 1.6;
}
.faq-search {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}
.faq-search i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--faq-muted);
    pointer-events: none;
}
.faq-search input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 16px;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #d9dfe8;
    border-radius: 999px;
    padding: 15px 22px 15px 50px;
    box-shadow: 0 8px 28px rgba(15, 30, 60, .08);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.faq-search input:focus {
    border-color: var(--faq-blue);
    box-shadow: 0 8px 28px rgba(0, 74, 173, .14);
}

/* ── Distribución: temas a la izquierda, preguntas a la derecha ───────────── */
.faq-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    padding-top: 24px;
    padding-bottom: 80px;
}
.faq-cats {
    position: sticky;
    top: 94px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.faq-cat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #1a1a1a;
    font-weight: 500;
    font-size: .95rem;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.faq-cat i {
    width: 18px;
    text-align: center;
    color: var(--faq-muted);
    transition: color .2s;
}
.faq-cat:hover { background: #f3f6fb; }
.faq-cat.is-active {
    background: #eaf1fb;
    color: var(--faq-blue);
}
.faq-cat.is-active i { color: var(--faq-blue); }

.faq-content { max-width: 800px; }

/* ── Grupos y preguntas ───────────────────────────────────────────────────── */
.faq-group {
    scroll-margin-top: 100px;
    margin-bottom: 44px;
}
.faq-group[hidden] { display: none; }
.faq-group h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.35rem;
    color: #1a1a1a;
    margin: 0 0 14px;
}
.faq-group h2 i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #eaf1fb;
    color: var(--faq-blue);
    font-size: 1rem;
}

.faq-item {
    border-bottom: 1px solid var(--faq-line);
    scroll-margin-top: 100px;
}
.faq-item[hidden] { display: none; }
.faq-item:first-of-type { border-top: 1px solid var(--faq-line); }
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 4px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.45;
    transition: color .2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover,
.faq-item summary:focus-visible { color: var(--faq-blue); outline: none; }
.faq-item summary i {
    flex: 0 0 auto;
    font-size: .85rem;
    color: var(--faq-muted);
    transition: transform .25s ease, color .2s;
}
.faq-item[open] summary { color: var(--faq-blue); }
.faq-item[open] summary i {
    transform: rotate(180deg);
    color: var(--faq-blue);
}
.faq-answer {
    padding: 0 4px 20px;
    animation: faq-open .25s ease;
}
.faq-answer p {
    margin: 0;
    color: #3a4250;
    line-height: 1.75;
}
.faq-answer a { color: var(--faq-blue); }
@keyframes faq-open {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.faq-empty {
    text-align: center;
    color: var(--faq-muted);
    padding: 40px 0;
}
.faq-empty a { color: var(--faq-blue); }

.faq-cta-mail {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

/* ── Móvil / tablet: temas como fila de pestañas fija bajo el menú ───────── */
@media (max-width: 900px) {
    .faq-hero { padding: 40px 0 28px; }
    .faq-layout {
        display: block;
        padding-top: 0;
        padding-bottom: 56px;
    }
    .faq-cats {
        top: 70px;
        z-index: 5;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 -20px 24px;
        padding: 12px 20px;
        background: rgba(255, 255, 255, .96);
        border-bottom: 1px solid var(--faq-line);
    }
    .faq-cats::-webkit-scrollbar { display: none; }
    .faq-cat {
        flex: 0 0 auto;
        border: 1px solid var(--faq-line);
        border-radius: 999px;
        padding: 8px 14px;
        font-size: .88rem;
        white-space: nowrap;
    }
    .faq-cat.is-active { border-color: var(--faq-blue); }
    .faq-group, .faq-item { scroll-margin-top: 140px; }
    .faq-group h2 { font-size: 1.2rem; }
    .faq-group h2 i { width: 34px; height: 34px; }
    .faq-item summary { padding: 16px 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .faq-answer { animation: none; }
    .faq-item summary i { transition: none; }
}
