/* ============================================
   CED FAQ Plugin - Styles
   Font: Inter | Palette matches reference image
   ============================================ */

.ced-faq {
    --ced-bg: #f5f7fa;
    --ced-card: #ffffff;
    --ced-text: #0f1419;
    --ced-muted: #6b7785;
    --ced-accent: #4a6478;
    --ced-accent-dark: #3a5266;
    --ced-accent-soft: #e8edf2;
    --ced-border: #e1e7ee;
    --ced-shadow: 0 1px 3px rgba(15, 20, 25, 0.04), 0 4px 12px rgba(15, 20, 25, 0.04);
    --ced-shadow-hover: 0 4px 16px rgba(15, 20, 25, 0.08);

    --ced-font-title: 'Josefin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ced-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    font-family: var(--ced-font-body);
    max-width: 880px;
    margin: 0 auto;
    padding: 64px 24px;
    background: var(--ced-bg);
    color: var(--ced-text);
    box-sizing: border-box;
}

.ced-faq *,
.ced-faq *::before,
.ced-faq *::after {
    box-sizing: border-box;
}

.ced-faq svg {
    width: 100%;
    height: 100%;
    display: block;
    flex-shrink: 0;
}

/* El tema rellena los SVG. Nuestros iconos son de TRAZO (outline),
   no rellenos: forzamos fill:none y que el color venga del stroke. */
.ced-faq .ced-faq__icon svg,
.ced-faq .ced-faq__icon svg * {
    fill: none !important;
    stroke: currentColor !important;
}

/* ---------- Header ---------- */
.ced-faq__head {
    text-align: center;
    margin-bottom: 40px;
}

.ced-faq__title {
    font-family: var(--ced-font-title);
    font-size: clamp(34px, 5.2vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    color: var(--ced-text);
}

.ced-faq__subtitle {
    font-size: 17px;
    font-weight: 400;
    color: var(--ced-muted);
    margin: 0;
    line-height: 1.5;
}

/* ---------- List ---------- */
.ced-faq__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- Item ---------- */
.ced-faq__item {
    background: var(--ced-card);
    border: 1.5px solid transparent;
    border-radius: 16px;
    box-shadow: var(--ced-shadow);
    overflow: hidden;
    transition: border-color .35s ease, box-shadow .35s ease, transform .35s ease;
    opacity: 0;
    transform: translateY(12px);
    animation: cedFaqFadeIn .55s ease forwards;
}

.ced-faq__item:nth-child(1) { animation-delay: .05s; }
.ced-faq__item:nth-child(2) { animation-delay: .12s; }
.ced-faq__item:nth-child(3) { animation-delay: .19s; }
.ced-faq__item:nth-child(4) { animation-delay: .26s; }
.ced-faq__item:nth-child(5) { animation-delay: .33s; }
.ced-faq__item:nth-child(6) { animation-delay: .40s; }
.ced-faq__item:nth-child(7) { animation-delay: .47s; }
.ced-faq__item:nth-child(8) { animation-delay: .54s; }

@keyframes cedFaqFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.ced-faq__item:hover:not(.is-open) {
    box-shadow: var(--ced-shadow-hover);
}

.ced-faq__item.is-open {
    border-color: var(--ced-accent);
    box-shadow: var(--ced-shadow-hover);
}

/* ---------- Question (button) ---------- */
.ced-faq__q {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 22px 24px;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--ced-font-body) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: inherit;
    line-height: 1.4;
}

.ced-faq__q:hover,
.ced-faq__q:focus,
.ced-faq__q:active {
    background: transparent !important;
    background-color: transparent !important;
    color: inherit;
    box-shadow: none !important;
    transform: none;
}

.ced-faq__q:focus-visible {
    outline: 2px solid var(--ced-accent);
    outline-offset: -2px;
}

.ced-faq__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--ced-accent-soft);
    color: var(--ced-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .3s ease, color .3s ease, transform .3s ease;
}

.ced-faq__icon svg {
    width: 20px;
    height: 20px;
}

.ced-faq__item.is-open .ced-faq__icon {
    background: var(--ced-accent);
    color: #fff;
    transform: scale(1.04);
}

.ced-faq__q-text {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ced-text);
}

.ced-faq__toggle {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ced-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .35s cubic-bezier(.4, 0, .2, 1), background .3s ease;
}

.ced-faq__toggle svg {
    width: 16px;
    height: 16px;
}

.ced-faq__item.is-open .ced-faq__toggle {
    transform: rotate(-180deg);
    background: var(--ced-accent-dark);
}

/* ---------- Answer ---------- */
.ced-faq__a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .45s cubic-bezier(.4, 0, .2, 1);
}

.ced-faq__item.is-open .ced-faq__a {
    max-height: 2000px;
}

.ced-faq__a-inner {
    padding: 4px 24px 24px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .35s ease .1s, transform .35s ease .1s;
}

.ced-faq__item.is-open .ced-faq__a-inner {
    opacity: 1;
    transform: translateY(0);
}

.ced-faq__a-text {
    margin: 0;
    padding: 18px 22px;
    background: #f4f7fa;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.65;
    color: #2a3640;
}

.ced-faq__a-text strong {
    color: var(--ced-text);
    font-weight: 700;
}

/* ---------- Timeline ---------- */
.ced-faq__timeline {
    list-style: none;
    margin: 0;
    padding: 22px 22px;
    background: #f4f7fa;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ced-faq__tl-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.ced-faq__tl-num {
    flex-shrink: 0;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--ced-accent-soft);
    color: var(--ced-accent);
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ced-faq__tl-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}

.ced-faq__tl-title {
    color: var(--ced-accent);
    font-weight: 600;
    font-size: 16px;
}

.ced-faq__tl-desc {
    color: #4a5560;
    font-size: 15px;
    line-height: 1.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .ced-faq {
        padding: 48px 16px;
    }

    .ced-faq__head {
        margin-bottom: 28px;
    }

    .ced-faq__q {
        padding: 18px 16px;
        gap: 12px;
    }

    .ced-faq__icon {
        width: 38px;
        height: 38px;
    }

    .ced-faq__q-text {
        font-size: 15px;
    }

    .ced-faq__toggle {
        width: 32px;
        height: 32px;
    }

    .ced-faq__a-inner {
        padding: 4px 16px 18px;
    }

    .ced-faq__a-text,
    .ced-faq__timeline {
        padding: 16px 14px;
        font-size: 15px;
    }

    .ced-faq__tl-num {
        min-width: 38px;
        height: 38px;
        font-size: 13px;
    }
}

/* ============================================
   THEME OVERRIDE — alta especificidad
   Algunos temas (Hello/Elementor) pintan los <button>
   con fondo de color. Esto lo anula sin discusión.
   ============================================ */
section.ced-faq .ced-faq__list .ced-faq__item button.ced-faq__q,
section.ced-faq .ced-faq__list .ced-faq__item button.ced-faq__q:hover,
section.ced-faq .ced-faq__list .ced-faq__item button.ced-faq__q:focus,
section.ced-faq .ced-faq__list .ced-faq__item button.ced-faq__q:active,
section.ced-faq .ced-faq__list .ced-faq__item button.ced-faq__q:focus-visible {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--ced-text) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    text-transform: none !important;
    transform: none !important;
}

/* el cuadrito del icono SÍ conserva su fondo suave */
section.ced-faq .ced-faq__item .ced-faq__icon {
    background: var(--ced-accent-soft) !important;
    color: var(--ced-accent) !important;
}
section.ced-faq .ced-faq__item.is-open .ced-faq__icon {
    background: var(--ced-accent) !important;
    color: #fff !important;
}
/* el botón circular del toggle conserva su fondo */
section.ced-faq .ced-faq__item .ced-faq__toggle {
    background: var(--ced-accent) !important;
    color: #fff !important;
}
section.ced-faq .ced-faq__item.is-open .ced-faq__toggle {
    background: var(--ced-accent-dark) !important;
}

/* El tema (cmsmasters) inyecta button::before / button::after con
   fondo de color (hover). Eso pintaba la barra azul. Lo anulamos. */
section.ced-faq .ced-faq__q::before,
section.ced-faq .ced-faq__q::after,
section.ced-faq button.ced-faq__q::before,
section.ced-faq button.ced-faq__q::after {
    content: none !important;
    display: none !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    opacity: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}
