/* =============================================================
 * ayudas.css · Estilos ESPECÍFICOS del directorio de ayudas.
 * Se carga sobre tokens.css + app.css (shell/tokens/botones unificados).
 * Extraído de la app de ayudas; sin shell ni tokens (los da el unificado).
 * ============================================================= */

/* Las migas de pan se estilan en app.css (única implementación). */

/* ============================================ ÚLTIMA PALABRA (deco) ============================================ */
.last-word { position: relative; display: inline-block; }
.last-word .word-deco { position: absolute; left: 0; bottom: -22px; width: 100%; height: 18px; pointer-events: none; display: block; }
.last-word .word-deco path { fill: var(--coral); }
h2 .last-word .word-deco { bottom: -22px; height: 20px; }
h1 .last-word .word-deco { bottom: -28px; height: 22px; }
.hero .last-word .word-deco path                  { fill: var(--coral); }
.section--sobre .last-word .word-deco path        { fill: var(--orange); }
.section--servicios .last-word .word-deco path    { fill: var(--teal); }
.section--proceso .last-word .word-deco path      { fill: var(--teal-darker); }
.section--relacionados .last-word .word-deco path { fill: var(--teal); }
.section--directorio .last-word .word-deco path   { fill: var(--teal); }
.cta-strip .last-word .word-deco path             { fill: var(--orange); }

/* ============================================ HERO ============================================ */
.hero { padding: 8px 0 64px; }
.hero__pitch { font-size: var(--t-body); line-height: var(--lh-body); color: var(--ink-soft); max-width: 760px; margin-bottom: 20px; }
.hero--ayudas h1, .hero--ficha h1 { max-width: 18ch; }
.hero--ficha { padding-top: 8px; }

/* Cabeceras SIN foto centradas, en coherencia con el marketplace y la home.
   El archivo de ayudas y sus fichas no llevan imagen, así que el hero (título,
   entrada, datos y CTA) va centrado como bloque. Las notas conservan su texto
   alineado a la izquierda para que se lean bien. */
.hero--ayudas, .hero--ficha { text-align: center; }
.hero--ayudas h1, .hero--ficha h1,
.hero--ayudas .hero__pitch, .hero--ficha .hero__pitch { margin-left: auto; margin-right: auto; }
.hero--ayudas .demo-aviso, .hero--ficha .demo-aviso { margin-left: auto; margin-right: auto; text-align: left; }
.hero--ficha .badges,
.hero--ficha .ficha-entidad,
.hero--ficha .datos-clave { justify-content: center; }
.hero--ficha .ayuda-cuenta { max-width: 520px; margin-left: auto; margin-right: auto; }
.hero--ficha .ayuda-cerrada { max-width: 640px; margin-left: auto; margin-right: auto; text-align: left; }

/* Aviso de datos de ejemplo */
.demo-aviso {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--orange-soft); border: 2px solid var(--orange);
  border-radius: 16px; padding: 16px 20px; max-width: 760px;
  font-size: 17px; line-height: 1.45; color: var(--ink); margin: 8px 0 0;
}
.demo-aviso__ic { width: 24px; height: 24px; color: var(--orange-dark); flex-shrink: 0; margin-top: 2px; }
.demo-aviso strong { font-weight: 700; }

/* ============================================ SECCIONES ============================================ */
.section { padding: 80px 0; background: var(--white); }
.section--directorio { padding-top: 48px; }
.services-head { text-align: center; margin-bottom: 48px; max-width: 760px; margin-left: auto; margin-right: auto; }
.services-head h2 { margin-bottom: 12px; }

/* ============================================ BADGES ============================================ */
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  padding: 5px 12px; border-radius: 999px; line-height: 1.2;
  background: var(--gray-bg); color: var(--ink-soft); border: 1.5px solid var(--gray-line);
}
.badge__icon { width: 14px; height: 14px; }
.badge__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.badge--nivel { background: var(--teal-soft); color: var(--teal-darker); border-color: transparent; }
.badge--tema { background: var(--white); color: var(--teal-darker); border-color: var(--teal); }
.badge--colectivo { background: var(--white); color: var(--ink-soft); border-color: var(--gray-line); }

/* Enfoque de género destacado (criterio clave del directorio).
   Fondo coral oscuro (no coral puro) para asegurar contraste AA del texto pequeño. */
.badge--genero { background: var(--coral-dark); color: var(--white); border-color: transparent; }

/* Estado del plazo, con semáforo de color */
.badge--estado { background: var(--white); border-color: var(--gray-line); }
.badge--estado-abierto    { color: var(--teal-darker); }
.badge--estado-abierto .badge__dot    { background: #1F9D57; }
.badge--estado-permanente { color: var(--teal-darker); }
.badge--estado-permanente .badge__dot { background: var(--teal); }
.badge--estado-proximo    { color: var(--orange-ink); }
.badge--estado-proximo .badge__dot    { background: var(--orange); }
.badge--estado-cerrado    { color: var(--ink-muted); }
.badge--estado-cerrado .badge__dot    { background: var(--ink-muted); }

/* ============================================ DIRECTORIO (layout de 2 columnas) ============================================ */
.directorio { display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: start; }

/* ---- Barra de filtros ---- */
.filtros { position: sticky; top: 20px; }
.filtros__top { display: none; margin-bottom: 16px; }
.filtros__toggle {
  display: inline-flex; align-items: center; gap: 10px;
  width: 100%; justify-content: center;
  padding: 14px 20px; border-radius: 14px;
  background: var(--teal); color: var(--white);
  font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.filtros__toggle-ic { width: 20px; height: 20px; }

.filtros__panel {
  background: var(--white); border: 2px solid var(--gray-line);
  border-radius: 24px; padding: 26px 24px;
  display: flex; flex-direction: column; gap: 22px;
}
.filtros__buscador { display: flex; flex-direction: column; gap: 10px; }
.filtros__search-wrap { position: relative; display: flex; align-items: center; }
.filtros__search-ic { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--ink-muted); pointer-events: none; }
.filtros__buscador input {
  width: 100%; padding: 14px 16px 14px 44px;
  border: 2px solid var(--gray-line); border-radius: 12px;
  font-family: var(--f-brand); font-size: 17px; background: var(--white); color: var(--ink);
}
.filtros__buscador input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }

.faceta { border: 0; padding: 0; }
.faceta__legend {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink); margin-bottom: 12px; padding: 0;
}
.faceta__list { list-style: none; display: flex; flex-direction: column; gap: 4px; }

/* Checkbox accesible personalizado */
.check { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; cursor: pointer; font-size: 16px; line-height: 1.3; color: var(--ink-soft); transition: background .15s; }
.check:hover { background: var(--teal-pale); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--gray-line); background: var(--white);
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
}
.check__box::after {
  content: ""; width: 11px; height: 6px; margin-top: -2px;
  border-left: 3px solid var(--white); border-bottom: 3px solid var(--white);
  transform: rotate(-45deg) scale(0); transition: transform .15s;
}
.check input:checked + .check__box { background: var(--teal); border-color: var(--teal); }
.check input:checked + .check__box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 3px solid var(--teal-darker); outline-offset: 2px; }
.check input:checked ~ .check__text { color: var(--ink); font-weight: 700; }
.check__text { flex: 1; }
.check__count { font-size: 13px; font-weight: 700; color: var(--ink-muted); background: var(--gray-bg); border-radius: 999px; padding: 1px 9px; }

.filtros__acciones { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.filtros__acciones .btn { width: 100%; justify-content: center; }

/* ---- Resultados ---- */
.resultados__cab { margin-bottom: 24px; }
.resultados__count { font-size: 20px; font-weight: 400; color: var(--ink); margin: 0; }
.resultados__count strong { font-size: 26px; color: var(--teal-darker); }
.resultados__count-total { color: var(--ink-muted); font-size: 17px; }
.resultados__vacio { background: var(--gray-bg); border-radius: 20px; padding: 48px 32px; text-align: center; }
.resultados__vacio p { margin-bottom: 12px; }

.ayudas-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

/* ---- Tarjeta de ayuda ---- */
.ayuda-card {
  background: var(--white); border: 2px solid var(--gray-line); border-radius: 22px;
  overflow: hidden; transition: all .25s ease; height: 100%;
}
.ayuda-card:hover { transform: translateY(-4px); border-color: var(--teal); box-shadow: 0 24px 50px -24px rgba(45,174,170,.35); }
.ayuda-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.ayuda-card__link:hover { text-decoration: none; color: inherit; }
.ayuda-card__body { padding: 24px 24px 18px; flex: 1 1 auto; display: flex; flex-direction: column; }
.ayuda-card__titulo { font-size: 22px; line-height: 1.25; margin-bottom: 12px; color: var(--ink); }
.ayuda-card:hover .ayuda-card__titulo { color: var(--teal-darker); }
.ayuda-card__entidad { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-muted); font-weight: 700; margin: 0 0 12px; }
.ayuda-card__entidad .ayuda-card__ic { width: 17px; height: 17px; flex-shrink: 0; color: var(--teal-dark); }
.ayuda-card__resumen {
  font-size: 16px; line-height: 1.5; color: var(--ink-soft); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ayuda-card__foot {
  border-top: 1px solid var(--gray-line); padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ayuda-card__dotacion { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.ayuda-card__dotacion .ayuda-card__ic { width: 18px; height: 18px; flex-shrink: 0; color: var(--coral); }
.ayuda-card__cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--teal-dark); white-space: nowrap; }
.ayuda-card__cta .ayuda-card__ic { width: 15px; height: 15px; }

/* ============================================ FICHA ============================================ */
.ficha-entidad { display: flex; align-items: center; gap: 10px; font-size: 19px; color: var(--ink-soft); margin: 0 0 16px; }
.ficha-entidad__ic { width: 22px; height: 22px; color: var(--teal-dark); flex-shrink: 0; }
.ficha-entidad strong { color: var(--ink); }

.datos-clave { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 28px 0 8px; }
.dato {
  flex: 1 1 220px; background: var(--teal-pale); border: 2px solid var(--teal-soft);
  border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.dato__ic { width: 24px; height: 24px; color: var(--teal-darker); margin-bottom: 6px; }
.dato__label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); }
.dato__valor { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.35; }

.ficha-ctas { margin-top: 32px; }
.ficha-ctas--centrado { text-align: center; margin-top: 40px; }

.ficha-cuerpo { font-size: 21px; line-height: 1.6; color: var(--ink-soft); }
.ficha-colectivos-label { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); margin: 20px 0 12px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--white); border: 2px solid var(--teal); color: var(--teal-darker); border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 700; }
.chip__ic { width: 16px; height: 16px; }
.chip--genero { background: var(--coral-dark); color: var(--white); border-color: transparent; }

.ficha-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.ficha-col h2 { font-size: 30px; margin-bottom: 24px; }
.lista-check { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.lista-check li { display: flex; align-items: flex-start; gap: 14px; font-size: 18px; line-height: 1.5; color: var(--ink-soft); }
.lista-check__ic { width: 24px; height: 24px; flex-shrink: 0; color: var(--teal); margin-top: 2px; }

/* Pasos (cómo solicitarla) */
.pasos { list-style: none; counter-reset: paso; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.paso { display: flex; flex-direction: column; gap: 12px; }
.paso__num {
  width: 56px; height: 56px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-darker);
  display: inline-flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
}
.paso__titulo { font-size: 21px; margin-bottom: 6px; }
.paso__desc { font-size: 17px; line-height: 1.5; color: var(--ink-soft); margin: 0; }

/* ============================================ CTA FINAL ============================================ */
.cta-strip { background: var(--teal-darker); padding: 72px 0; text-align: center; position: relative; color: var(--white); overflow: hidden; }
.cta-strip h2 { color: var(--white); margin-bottom: 20px; max-width: 720px; margin-left: auto; margin-right: auto; }
.cta-strip p { color: rgba(255,255,255,.85); font-size: 20px; margin-bottom: 32px; max-width: 640px; margin-left: auto; margin-right: auto; }
.cta-strip__tagline { font-family: var(--f-script); font-weight: 400; font-size: 52px; line-height: 1em; color: var(--orange); display: block; margin-bottom: 16px; user-select: none; }


/* ---- Banner de cookies (para paridad con el resto del sitio) ---- */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--white); border-top: 3px solid var(--teal); box-shadow: 0 -8px 30px -12px rgba(0,0,0,.25); }
.cookie-banner__in { max-width: var(--max-w); margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.cookie-banner__txt { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-soft); flex: 1 1 340px; }
.cookie-banner__txt a { color: var(--coral-dark); text-decoration: underline; }
.cookie-banner__btns { display: flex; gap: 12px; flex: 0 0 auto; }
.footer-legal__cfg { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: var(--ink); font-family: inherit; font-weight: 700; font-size: 24px; line-height: 1.5em; text-decoration: underline; }

/* ---- Responsive de contenido (sin shell, que lo da el unificado) ---- */
@media (max-width: 1024px) {
  .directorio { grid-template-columns: 1fr; gap: 24px; }
  .filtros { position: static; }
  .filtros__top { display: block; }
  .filtros__panel.is-collapsed { display: none; }
  .ficha-cols { grid-template-columns: 1fr; gap: 40px; }
  .pasos { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .ayudas-grid { grid-template-columns: 1fr; }
  .datos-clave { flex-direction: column; }
  .cookie-banner__btns { width: 100%; }
  .cookie-banner__btns .btn { flex: 1; text-align: center; }
}

/* ============================================ CUENTA ATRÁS + CONVOCATORIA CERRADA ============================================ */
.ayuda-cuenta { margin: 22px 0 4px; padding: 16px 20px; border: 1px solid var(--teal-soft); background: var(--teal-pale); border-radius: 16px; }
.ayuda-cuenta__label { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--teal-darker); font-size: 15px; }
.ayuda-cuenta__ic { width: 18px; height: 18px; flex-shrink: 0; }
.ayuda-cuenta__reloj { display: flex; gap: 14px; margin-top: 12px; }
.ayuda-cuenta__reloj span { display: flex; flex-direction: column; align-items: center; min-width: 50px; }
.ayuda-cuenta__reloj b { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ayuda-cuenta__reloj small { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 5px; }
.ayuda-cerrada { display: flex; gap: 12px; align-items: flex-start; margin: 22px 0 4px; padding: 14px 18px; border-radius: 14px; background: var(--gray-bg); color: var(--ink-soft); line-height: 1.5; }
.ayuda-cerrada__ic { width: 20px; height: 20px; flex-shrink: 0; color: var(--ink-muted); margin-top: 2px; }
.ayuda-cerrada a { color: var(--coral-dark); text-decoration: underline; }
