/* ===========================================================================
   CONECTAMUNICIPIO — Sistema de diseño v2 «Sabana cálida»
   Evolución de la identidad de la Fase 11, no un reemplazo: se conservan
   verde río, mango, arena y la trenza del vueltiao. Lo que cambia: verde
   más hondo en header y pie, mosaico bento, radios 20/28/34, iconos SVG
   en lugar de emoji y UN SOLO ACENTO por pantalla.
   Regla de oro: el mango marca la acción principal; el caribe solo estados.
   Accesibilidad primero: cuerpo 17px+, objetivos táctiles >=52px, foco
   visible, movimiento reducido respetado.
   Los nombres de clase de la v1 se conservan a propósito: las 49 plantillas
   heredan el rediseño sin tocarlas una por una.
   ======================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,800&family=Figtree:wght@400;500;600;700&display=swap');

:root {
  /* --- Color --------------------------------------------------------- */
  --rio-hondo: #06332C;    /* v2: header, pie, superficies grandes */
  --rio: #0E5E52;          /* primario: botones, enlaces */
  --rio-oscuro: #0A4239;   /* se conserva por compatibilidad con la v1 */
  --caribe: #2FA98C;       /* estados positivos, resuelto */
  --mango: #F09A3E;        /* acento ÚNICO: llamados a la acción */
  --mango-suave: #FCE8CF;
  --arena: #F6F1E6;        /* fondo de página */
  --arena-2: #EFE7D6;      /* bloques secundarios */
  --sabana: var(--arena);  /* alias v1 */
  --noche: #17302A;        /* tinta: texto principal */
  --tenue: #4F6862;        /* texto auxiliar y metadatos: 5,3:1 sobre arena (antes 3,5:1, M11) */
  --borde: #E3DACA;
  --blanco: #FFFFFF;
  --wa: #25D366;           /* solo el botón de WhatsApp */

  --cm-primary: var(--rio);   /* re-mapea el color del tenant (RN-11) */

  /* --- Radios por jerarquía ------------------------------------------ */
  --r-xl: 34px;   /* bloques grandes y franjas */
  --r-lg: 28px;   /* tarjetas y mosaicos */
  --r-md: 20px;   /* filas internas */
  --r-pill: 999px;
  --radius: var(--r-md);   /* alias v1: no romper plantillas existentes */

  /* --- Sombras -------------------------------------------------------- */
  --sh-1: 0 3px 12px rgba(6,51,44,.07);
  --sh-2: 0 4px 16px rgba(6,51,44,.08);
  --sh-3: 0 4px 18px rgba(6,51,44,.08);
  --sh-hover: 0 16px 34px rgba(6,51,44,.14);
}

/* --- Base tipográfica generosa ------------------------------------------ */
html { font-size: 17px; }
body {
  font-family: 'Figtree', system-ui, 'Segoe UI', sans-serif;
  background: var(--arena);
  color: var(--noche);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, .display-font {
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--noche);
}
a { color: var(--rio); text-decoration: none; }
a:hover { color: var(--rio-hondo); }
.text-muted, small.text-muted { color: var(--tenue) !important; }

/* --- La firma: trenza del vueltiao (v2: tinta + mango cruzados) --------- */
.trenza {
  height: 14px;
  background:
    repeating-linear-gradient(45deg, rgba(23,48,42,.9) 0 9px, rgba(0,0,0,0) 9px 18px),
    repeating-linear-gradient(-45deg, rgba(240,154,62,.95) 0 9px, rgba(0,0,0,0) 9px 18px),
    var(--arena);
}
.trenza-fina { height: 10px; }

/* --- Header (v2: verde río hondo, plano) -------------------------------- */
.cm-header { background: var(--rio-hondo); color: #fff; }
.cm-header a { color: #fff; }
.cm-header .brand-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-size: 1.25rem;
}
.cm-header .container { flex-wrap: wrap; row-gap: .5rem; }

/* Marca en cuadro redondeado mango (sustituye al emoji) */
.cm-brand-mark {
  width: 46px; height: 46px; border-radius: 14px; background: var(--mango);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Buscador del header: píldora translúcida */
.cm-search-pill {
  display: flex; align-items: center; gap: .6rem;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-pill);
  padding: .5rem 1.1rem;
}
.cm-search-pill input {
  background: transparent; border: 0; color: #fff; font-size: 15px;
  width: 100%; outline: none; min-height: 30px;
}
.cm-search-pill input::placeholder { color: rgba(255,255,255,.6); }
.cm-search-pill button { background: transparent; border: 0; padding: 0; line-height: 0; }

/* Botones del header */
.btn-ghost-light {
  color: #fff; font-size: 15px; font-weight: 600;
  padding: .65rem 1.2rem; border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--r-pill); background: transparent; min-height: 46px;
}
.btn-ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; }
/* Se sube la especificidad con `.cm-header`: si no, `.cm-header a { color:#fff }`
   gana y el texto queda blanco sobre blanco ("Crear cuenta" invisible). */
.btn-solid-light,
.cm-header .btn-solid-light {
  color: var(--rio-hondo); font-size: 15px; font-weight: 700;
  padding: .7rem 1.3rem; background: #fff; border: 0;
  border-radius: var(--r-pill); min-height: 46px;
}
.btn-solid-light:hover,
.cm-header .btn-solid-light:hover { background: var(--arena-2); color: var(--rio-hondo); }

/* --- Botones: grandes, redondos, altura mínima 52px --------------------- */
.btn {
  border-radius: var(--r-pill);
  font-weight: 700;
  padding: .75rem 1.5rem;
  min-height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-sm { min-height: 44px; padding: .5rem 1.1rem; font-size: .95rem; }
.btn-lg { min-height: 60px; padding: 1rem 2rem; font-size: 1.1rem; }
.btn-cm-primary { background: var(--cm-primary); border-color: var(--cm-primary); color: #fff; }
.btn-cm-primary:hover, .btn-cm-primary:focus { background: var(--rio-hondo); border-color: var(--rio-hondo); color: #fff; }
.btn-mango {
  background: var(--mango); border-color: var(--mango); color: var(--rio-hondo);
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; letter-spacing: -0.02em;
}
.btn-mango:hover { background: #e18a2f; border-color: #e18a2f; color: var(--rio-hondo); }
.btn-outline-cm { background: #fff; border: 1px solid var(--borde); color: var(--noche); font-weight: 700; }
.btn-outline-cm:hover { background: var(--arena-2); color: var(--noche); }
.btn-success, .bg-success { background-color: var(--wa) !important; border-color: var(--wa) !important; }
.bg-cm-primary, .badge.bg-cm-primary { background-color: var(--cm-primary) !important; }

/* --- Chips de estado (se entienden de un vistazo, sin leer) ------------- */
.badge { border-radius: var(--r-pill); font-weight: 700; padding: .5rem .9rem; }
.cm-chip {
  display: inline-block; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 700; padding: .45rem 1rem;
}
.cm-chip-resuelto   { background: #DFF0E9; color: var(--rio); }
.cm-chip-gestion    { background: #FCE8CF; color: #8A5416; }
.cm-chip-recibido   { background: #E3E8E6; color: #3E534C; }
.cm-chip-verificado { background: var(--rio-hondo); color: #fff; }

/* --- Tarjetas ------------------------------------------------------------ */
.card {
  border: none; border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-hover); }
.card-img-top { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.list-group-item { border-color: rgba(23,48,42,.08); }
.list-group-item:first-child { border-top-left-radius: var(--r-md); border-top-right-radius: var(--r-md); }
.list-group-item:last-child { border-bottom-left-radius: var(--r-md); border-bottom-right-radius: var(--r-md); }

/* --- Héroe: textura tejida sobre verde ---------------------------------- */
.cm-hero-wrap { background: var(--rio-hondo); padding: 0 1.5rem 1.5rem; }
.cm-hero {
  border-radius: 40px;
  color: #fff;
  background-image:
    radial-gradient(880px 360px at 82% -6%, rgba(240,154,62,.32), rgba(0,0,0,0) 62%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 16px, rgba(0,0,0,0) 16px 32px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.04) 0 16px, rgba(0,0,0,0) 16px 32px),
    linear-gradient(158deg, #06332C 0%, #0E5E52 58%, #147A63 100%);
}
.cm-hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 4.4rem); text-wrap: pretty; }
.cm-hero .lead { color: #D8EDE5; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.45; }
.cm-eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  background: rgba(255,255,255,.12); border-radius: var(--r-pill);
  padding: .45rem 1.1rem; color: #CFE8DE; font-size: 14px; font-weight: 600;
}
.cm-eyebrow .dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--caribe); }

/* Buscador protagonista: píldora blanca con botón mango */
.cm-hero .cm-searchbox {
  display: flex; align-items: center; background: #fff;
  border-radius: var(--r-pill); padding: .45rem .45rem .45rem 1.6rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}
.cm-hero .cm-searchbox .form-control {
  border: 0; box-shadow: none; font-size: 1.15rem; padding-left: .9rem;
  background: transparent; min-height: 52px;
}
.cm-hero .cm-searchbox .form-control::placeholder { color: var(--tenue); }
.cm-hero .btn-buscar {
  background: var(--mango); border: 0; color: var(--rio-hondo);
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 1.15rem; border-radius: var(--r-pill);
  padding: .95rem 2.2rem; min-height: 56px; flex-shrink: 0;
}
.cm-hero .btn-buscar:hover { background: #e18a2f; color: var(--rio-hondo); }

/* Sugerencias bajo el buscador */
.cm-suggest {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #EAF6F1; font-size: 15px; font-weight: 600;
  padding: .55rem 1.15rem; border-radius: var(--r-pill);
}
.cm-suggest:hover { background: rgba(255,255,255,.2); color: #fff; }

/* Cifras del héroe */
.cm-stat .n {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  letter-spacing: -0.025em; color: var(--mango); font-size: 2.35rem; line-height: 1;
}
.cm-stat .t { color: #CFE8DE; font-size: 15px; margin-top: .25rem; }

/* --- Mosaico bento: las puertas del municipio --------------------------- */
.cm-bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.15rem; }
.cm-tile {
  border-radius: var(--r-lg); padding: 1.6rem;
  display: flex; flex-direction: column; gap: .7rem; justify-content: flex-end;
  min-height: 190px; background: #fff; color: var(--noche);
  box-shadow: var(--sh-2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cm-tile:hover { transform: translateY(-3px); box-shadow: var(--sh-hover); }
.cm-tile .cm-tile-title {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  letter-spacing: -0.025em; font-size: 1.35rem; line-height: 1.1;
}
.cm-tile .cm-tile-sub { font-size: 1rem; margin-top: .35rem; color: var(--tenue); }
.cm-tile svg { stroke: var(--rio); }

/* Variantes: solo dos destacadas por pantalla (regla del acento único) */
.cm-tile-wide { grid-column: span 2; }
.cm-tile-rio { background: var(--rio); color: #fff; }
.cm-tile-rio .cm-tile-title { color: #fff; font-size: 1.75rem; }
.cm-tile-rio .cm-tile-sub { color: #B6DCD0; }
.cm-tile-rio svg { stroke: #fff; }
.cm-tile-mango { background: var(--mango); color: var(--rio-hondo); }
.cm-tile-mango .cm-tile-title { color: var(--rio-hondo); font-size: 1.75rem; }
.cm-tile-mango .cm-tile-sub { color: #5C3F17; }
.cm-tile-mango svg { stroke: var(--rio-hondo); }
.cm-tile-dashed {
  background: var(--arena-2); border: 2px dashed #C9BBA0; box-shadow: none;
  flex-direction: row; align-items: center; justify-content: space-between;
}
.cm-tile-dashed:hover { box-shadow: none; }
.cm-tile-dashed .cm-tile-sub { color: #5E6E68; }

/* --- Chips de módulo (compatibilidad v1, restilizados a v2) ------------- */
.module-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; background: var(--blanco); border-radius: var(--r-lg);
  padding: 1.1rem .6rem; min-height: 112px;
  color: var(--noche); font-weight: 700; font-size: 1rem; text-align: center;
  box-shadow: var(--sh-2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.module-chip:hover { transform: translateY(-3px); color: var(--rio); box-shadow: var(--sh-hover); }
.module-chip .icon { font-size: 1.9rem; line-height: 1; }
.module-chip svg { stroke: var(--rio); }

/* --- Título de sección con regla degradada ------------------------------ */
.section-title {
  display: flex; align-items: center; gap: 1rem;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  letter-spacing: -0.025em;
}
.section-title::after {
  content: ""; flex: 1; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, var(--mango), rgba(240,154,62,0) 78%);
}

/* --- Filas internas (listas de reportes, etc.) -------------------------- */
.cm-row {
  display: flex; align-items: center; gap: .9rem;
  padding: 1rem 1.1rem; background: var(--arena); border-radius: 18px;
}
.cm-row .t { flex-grow: 1; font-size: 1rem; }
.cm-row .m { color: var(--tenue); font-size: 14px; flex-shrink: 0; }

/* --- Franja de llamado a la acción -------------------------------------- */
.cm-cta { background: var(--mango); border-radius: var(--r-xl); padding: 2.6rem 3rem; color: var(--rio-hondo); }
.cm-cta h2, .cm-cta h5 { color: var(--rio-hondo); }
.cm-cta p { color: #5C3F17; }

/* --- Pie (v2: tinta, no verde) ------------------------------------------ */
.cm-footer { background: var(--noche); color: #A9C4BB; }
.cm-footer h5, .cm-footer h6, .cm-footer .h5, .cm-footer .h6 { color: #fff; }
.cm-footer a { color: #D6E7E0; }
.cm-footer a:hover { color: #fff; text-decoration: underline; }
.cm-footer .cm-legal { color: #8FAAA1; font-size: 14px; }

/* --- Accesibilidad ------------------------------------------------------- */
:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  .card, .module-chip, .cm-tile { transition: none; }
  .card:hover, .module-chip:hover, .cm-tile:hover { transform: none; }
}

/* --- Móvil: cambia el orden, no solo el tamaño -------------------------- */
@media (max-width: 991px) {
  .cm-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-tile-wide { grid-column: span 2; }
  .cm-hero-wrap { padding: 0 .75rem .75rem; }
  .cm-hero { border-radius: var(--r-xl); }
}
@media (max-width: 576px) {
  .cm-header .brand-title { font-size: 1.05rem; }
  .cm-tile { min-height: 150px; padding: 1.2rem; }
  .cm-tile .cm-tile-title { font-size: 1.15rem; }
  .cm-tile-rio .cm-tile-title, .cm-tile-mango .cm-tile-title { font-size: 1.35rem; }
  .module-chip { min-height: 96px; font-size: .9rem; }
  .cm-hero .cm-searchbox { flex-direction: column; gap: .6rem; padding: .8rem; border-radius: var(--r-xl); }
  .cm-hero .cm-searchbox .form-control { text-align: center; padding-left: 0; }
  .cm-hero .btn-buscar { width: 100%; }
  .cm-cta { padding: 1.8rem 1.5rem; }
}

/* ===========================================================================
   v2.1 — Navegación, estados vacíos y tacto móvil
   Añadidos, no reemplazos: el vocabulario de arriba se conserva intacto.
   Motivo de cada bloque explicado donde corresponde.
   ======================================================================== */

/* --- Navegación global en el header -------------------------------------
   Antes el header solo llevaba marca, buscador y cuenta: para ir al mapa o
   al directorio había que bajar hasta el pie. Los módulos son el producto,
   así que deben estar siempre a un toque. */
.cm-nav { display: flex; align-items: center; gap: .15rem; }
.cm-nav a {
  color: rgba(255,255,255,.86);
  font-weight: 600;
  font-size: .95rem;
  padding: .55rem .85rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}
.cm-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
/* La página actual se marca: sin esto el usuario pierde el hilo de dónde está. */
.cm-nav a[aria-current="page"] { background: rgba(255,255,255,.16); color: #fff; }

/* --- Botón hamburguesa y cajón móvil ------------------------------------
   48px reales de objetivo táctil (WCAG 2.5.5 pide 44). */
.cm-burger {
  display: none;
  width: 48px; height: 48px;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.12);
  border: 0; border-radius: 14px;
  color: #fff; cursor: pointer;
  flex-shrink: 0;
}
.cm-burger:hover { background: rgba(255,255,255,.2); }

.cm-drawer {
  position: fixed; inset: 0 0 0 auto;
  width: min(86vw, 340px);
  background: var(--rio-hondo);
  z-index: 1050;
  transform: translateX(100%);
  transition: transform .22s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1rem 2rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.cm-drawer[data-abierto="1"] { transform: translateX(0); }
.cm-drawer a, .cm-drawer button {
  color: #fff; font-weight: 600; font-size: 1.05rem;
  padding: .95rem 1rem; border-radius: var(--r-md);
  background: transparent; border: 0; text-align: left; width: 100%;
  min-height: 52px; display: flex; align-items: center; gap: .7rem;
}
.cm-drawer a:hover, .cm-drawer a:focus-visible { background: rgba(255,255,255,.12); color: #fff; }
.cm-drawer a[aria-current="page"] { background: rgba(255,255,255,.16); }
.cm-drawer .cm-drawer-sep { height: 1px; background: rgba(255,255,255,.16); margin: .6rem .5rem; }
.cm-drawer .cm-drawer-tit {
  color: rgba(255,255,255,.55); font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; padding: .8rem 1rem .2rem;
}
.cm-velo {
  position: fixed; inset: 0; background: rgba(6,51,44,.55);
  z-index: 1040; opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.cm-velo[data-abierto="1"] { opacity: 1; pointer-events: auto; }
body[data-menu-abierto="1"] { overflow: hidden; }

@media (max-width: 991px) {
  .cm-nav { display: none; }
  .cm-burger { display: flex; }
}

/* --- Título de página ---------------------------------------------------
   Las plantillas usaban <h2> como título principal y ninguna página tenía
   <h1>. Eso penaliza en buscadores y rompe el índice de encabezados con el
   que navegan los lectores de pantalla. Esta clase deja el <h1> con el
   tamaño visual que ya tenía el <h2>, así el cambio es semántico, no estético. */
.page-title {
  font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.15rem);
  margin-bottom: .35rem;
}
.page-lead { color: var(--tenue); font-size: 1.02rem; max-width: 62ch; }
.page-head { margin-bottom: 1.5rem; }

/* --- Estado vacío profesional -------------------------------------------
   Sustituye a los avisos secos tipo «No hay noticias». Un módulo vacío no
   es un error: es una invitación. Sin contenido que mostrar, la pantalla
   debe explicar qué aparecerá aquí y ofrecer la acción que lo llena. */
.cm-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.cm-empty-icon {
  width: 76px; height: 76px; margin: 0 auto 1.15rem;
  border-radius: 24px;
  background: var(--mango-suave);
  display: flex; align-items: center; justify-content: center;
  color: var(--rio-hondo);
}
.cm-empty h3 {
  font-size: 1.3rem; margin-bottom: .5rem; color: var(--noche);
}
.cm-empty p {
  color: var(--tenue); max-width: 46ch; margin: 0 auto 1.4rem; font-size: 1rem;
}
.cm-empty .cm-empty-acciones {
  display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap;
}
@media (max-width: 576px) {
  .cm-empty { padding: 2.2rem 1.1rem; border-radius: var(--r-md); }
  .cm-empty-icon { width: 64px; height: 64px; border-radius: 20px; }
  .cm-empty .cm-empty-acciones .btn { width: 100%; }
}

/* --- Carrusel táctil de tarjetas ----------------------------------------
   En móvil, seis tarjetas apiladas obligan a un scroll vertical eterno y
   entierran lo que viene después. En horizontal se ve la primera completa y
   la segunda asomando, que es la señal de «hay más» sin necesidad de flechas.
   Deliberadamente NO se aplica a texto largo ni a formularios. */
@media (max-width: 767px) {
  .cm-scroller {
    display: flex !important;
    gap: .85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Sangrado hasta el borde: la tarjeta cortada se ve como intención. */
    margin: 0 -0.75rem; padding: .25rem .75rem 1rem;
  }
  .cm-scroller::-webkit-scrollbar { display: none; }
  .cm-scroller > * {
    flex: 0 0 82%;          /* deja asomar la siguiente */
    max-width: 82%;
    scroll-snap-align: start;
  }
}

/* --- Pestañas de filtro --------------------------------------------------
   Reemplazan a los <select> sin etiqueta. El estado activo tiene que verse
   de un vistazo, no adivinarse. */
.cm-tabs {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.cm-tabs a {
  padding: .6rem 1.1rem;
  border-radius: var(--r-pill);
  background: var(--blanco);
  border: 1px solid var(--borde);
  color: var(--noche);
  font-weight: 600; font-size: .95rem;
  min-height: 46px; display: inline-flex; align-items: center;
  white-space: nowrap;
}
.cm-tabs a:hover { border-color: var(--rio); color: var(--rio); }
.cm-tabs a[aria-current="true"] {
  background: var(--rio); border-color: var(--rio); color: #fff;
}
@media (max-width: 767px) {
  /* En móvil se deslizan en lugar de romper la línea en tres filas. */
  .cm-tabs {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin: 0 -0.75rem 1.25rem; padding: 0 .75rem .3rem;
  }
  .cm-tabs::-webkit-scrollbar { display: none; }
}

/* --- Campos de formulario legibles --------------------------------------
   Pensado para adultos mayores: etiqueta siempre visible (nunca solo
   placeholder), campo alto y foco inequívoco. */
.cm-field { margin-bottom: 1.15rem; }
.cm-field label, .form-label {
  font-weight: 600; color: var(--noche); margin-bottom: .35rem; display: block;
}
.form-control, .form-select {
  border-radius: var(--r-md);
  border: 1.5px solid var(--borde);
  padding: .8rem 1rem;
  font-size: 1rem;
  min-height: 52px;
  background: var(--blanco);
  color: var(--noche);
}
.form-control:focus, .form-select:focus {
  border-color: var(--rio);
  box-shadow: 0 0 0 4px rgba(14,94,82,.14);
  outline: none;
}
.form-text { color: var(--tenue); }
.invalid-feedback, .errorlist { color: #B23B2E; font-weight: 600; }
.errorlist { list-style: none; padding: 0; margin: .35rem 0 0; font-size: .93rem; }

/* --- Foco visible en TODO lo interactivo --------------------------------
   Quien navega con teclado necesita saber siempre dónde está parado. */
a:focus-visible, button:focus-visible,
.btn:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--mango);
  outline-offset: 2px;
  border-radius: 6px;
}
.cm-header a:focus-visible, .cm-drawer a:focus-visible,
.cm-footer a:focus-visible, .cm-burger:focus-visible {
  outline-color: #fff;
}

/* --- Salto al contenido -------------------------------------------------- */
.cm-skip {
  position: absolute; left: -9999px; top: 0; z-index: 1100;
  background: var(--mango); color: var(--rio-hondo);
  padding: .85rem 1.25rem; border-radius: 0 0 var(--r-md) 0; font-weight: 700;
}
.cm-skip:focus { left: 0; }

/* --- Guardas de desbordamiento ------------------------------------------
   El scroll horizontal accidental es el defecto móvil más delator. Estas
   reglas atajan las causas habituales: medios sin límite y tablas anchas. */
img, video, canvas, svg:not(.cm-icon) { max-width: 100%; height: auto; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
pre, code { white-space: pre-wrap; word-break: break-word; }
.text-break-word { overflow-wrap: anywhere; }

/* --- Lectura cómoda en páginas legales ----------------------------------- */
.cm-prosa { max-width: 68ch; font-size: 1.05rem; line-height: 1.72; }
.cm-prosa h2 { font-size: 1.4rem; margin: 2.2rem 0 .7rem; }
.cm-prosa h3 { font-size: 1.15rem; margin: 1.7rem 0 .5rem; }
.cm-prosa p, .cm-prosa li { color: #33463F; }
.cm-prosa ul, .cm-prosa ol { padding-left: 1.3rem; }
.cm-prosa li { margin-bottom: .45rem; }

/* --- Acordeón de preguntas frecuentes ------------------------------------ */
.cm-acordeon { border: 1px solid var(--borde); border-radius: var(--r-lg); overflow: hidden; background: var(--blanco); }
.cm-acordeon details + details { border-top: 1px solid var(--borde); }
.cm-acordeon summary {
  cursor: pointer; padding: 1.15rem 1.35rem; font-weight: 700;
  color: var(--noche); font-size: 1.05rem; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 56px;
}
.cm-acordeon summary::-webkit-details-marker { display: none; }
.cm-acordeon summary::after {
  content: ""; width: 11px; height: 11px; flex-shrink: 0;
  border-right: 2.5px solid var(--rio); border-bottom: 2.5px solid var(--rio);
  transform: rotate(45deg); transition: transform .18s ease;
}
.cm-acordeon details[open] summary::after { transform: rotate(-135deg); }
.cm-acordeon summary:hover { background: var(--arena); }
.cm-acordeon .cm-acordeon-cuerpo { padding: 0 1.35rem 1.35rem; color: #33463F; line-height: 1.7; }

/* --- Respeta a quien pidió menos movimiento ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* =========================================================================
   Ajustes de la prueba móvil (oct-2026). Cada bloque cita su hallazgo del
   informe «Conecta en el celular».
   ========================================================================= */

/* A6 — Cabecera en una sola línea en el celular. El nombre puede partirse
   en dos renglones, pero el botón de menú ya no baja a otra fila (la
   cabecera ocupaba el 19 % de la pantalla en todas las páginas). */
@media (max-width: 991px) {
  .cm-header { padding-top: .7rem !important; padding-bottom: .7rem !important; }
  .cm-header .container { flex-wrap: nowrap; }
  .cm-brand { min-width: 0; }
  .cm-header .brand-title { font-size: 1.02rem; line-height: 1.15; }
  .cm-brand-mark { width: 40px; height: 40px; border-radius: 12px; }
}
@media (min-width: 992px) { .cm-brand { flex-shrink: 0; } }

/* M1 — En el celular el buscador queda en la primera pantalla: héroe más
   compacto y buscador en una sola fila (antes se apilaba en tres pisos). */
@media (max-width: 576px) {
  .cm-hero-wrap { padding: 0 .5rem .5rem; }
  .cm-hero { padding: 1.4rem 1.1rem 1.6rem !important; }
  .cm-hero .container-xl { padding: 0; }
  .cm-hero .cm-eyebrow { margin-bottom: .9rem !important; font-size: 13px; padding: .35rem .85rem; }
  .cm-hero h1 { font-size: 1.9rem; margin-bottom: .6rem !important; }
  .cm-hero .lead { font-size: 1rem; margin-bottom: 1rem !important; }
  .cm-hero .cm-searchbox { flex-direction: row; gap: .35rem; padding: .3rem .3rem .3rem .85rem; border-radius: var(--r-pill); }
  .cm-hero .cm-searchbox svg { width: 20px; height: 20px; }
  .cm-hero .cm-searchbox .form-control { text-align: left; padding-left: .3rem; font-size: 1rem; min-height: 46px; }
  .cm-hero .btn-buscar { width: auto; padding: .6rem 1rem; font-size: 1rem; min-height: 46px; }
}

/* M2 — Aviso de cookies compacto: una franja, no un tercio de la pantalla. */
.cm-cookie {
  position: fixed; z-index: 2000; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: .75rem;
  background: var(--noche); color: #E7F1ED; border-radius: 16px;
  padding: .55rem .55rem .55rem 1rem; font-size: 14px; line-height: 1.35;
  box-shadow: 0 10px 30px rgba(6,51,44,.25);
}
.cm-cookie a { color: #fff; text-decoration: underline; }
.cm-cookie button {
  flex-shrink: 0; border: 0; border-radius: var(--r-pill);
  background: var(--mango); color: var(--rio-hondo); font-weight: 800;
  padding: .55rem 1rem; min-height: 40px;
}

/* M3 — Los componentes de Bootstrap en los colores de la marca (salían con
   el azul por defecto: pestaña activa del panel, paginación, casillas...). */
:root {
  --bs-primary: #0E5E52; --bs-primary-rgb: 14, 94, 82;
  --bs-link-color: #0E5E52; --bs-link-color-rgb: 14, 94, 82;
  --bs-link-hover-color: #06332C; --bs-link-hover-color-rgb: 6, 51, 44;
}
.list-group { --bs-list-group-active-bg: var(--rio-hondo); --bs-list-group-active-border-color: var(--rio-hondo); }
.pagination {
  --bs-pagination-color: var(--rio); --bs-pagination-hover-color: var(--rio-hondo);
  --bs-pagination-active-bg: var(--rio-hondo); --bs-pagination-active-border-color: var(--rio-hondo);
  --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(240,154,62,.35);
}
.btn-outline-primary {
  --bs-btn-color: var(--rio); --bs-btn-border-color: var(--rio);
  --bs-btn-hover-bg: var(--rio); --bs-btn-hover-border-color: var(--rio); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--rio-hondo); --bs-btn-active-border-color: var(--rio-hondo); --bs-btn-active-color: #fff;
}
.form-check-input:checked { background-color: var(--rio); border-color: var(--rio); }
.form-control:focus, .form-select:focus { border-color: var(--rio); box-shadow: 0 0 0 .25rem rgba(14,94,82,.18); }

/* M12 — En el celular, el menú del panel de gestión es una fila deslizable:
   antes sus seis opciones ocupaban la primera pantalla. */
@media (max-width: 767px) {
  .cm-dash-nav { display: flex; flex-direction: row; gap: .4rem; overflow-x: auto; scrollbar-width: none;
                 box-shadow: none !important; padding-bottom: .25rem; }
  .cm-dash-nav::-webkit-scrollbar { display: none; }
  .cm-dash-nav .list-group-item { flex-shrink: 0; width: auto; white-space: nowrap; border-radius: var(--r-pill) !important;
                                  border: 1px solid var(--borde); padding: .55rem .95rem; }
  .cm-dash-nav .list-group-item + .list-group-item { border-top-width: 1px; margin-top: 0; }
}

/* B1 — Pie de página: enlaces con aire para el dedo (medían 22 px). */
.cm-foot-links a { display: inline-block; padding: .55rem 0; }

/* M9 — Filtros del directorio plegados: primero se ven los negocios. */
.cm-filtros { margin-bottom: 1.2rem; }
.cm-filtros > summary {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none;
  min-height: 44px; padding: .5rem 1rem; border-radius: var(--r-pill);
  border: 1px solid var(--borde); background: #fff; font-weight: 700;
}
.cm-filtros > summary::-webkit-details-marker { display: none; }
.cm-filtros[open] > summary { background: var(--rio-hondo); border-color: var(--rio-hondo); color: #fff; }
.cm-filtros .cm-filtros-body { margin-top: .9rem; }

