/* Alcaldía BGA – Trámites y servicios 1.2.0
   Contrastes WCAG 2.1 AA sobre blanco: texto #111827 (17:1), secundario #374151 (10:1), verde #0E5A2D con texto blanco (8,2:1),
   enlace y enfoque #0B3D91 (9:1), borde de campos #4B5563 (7,6:1), borde de tarjetas #D1D5DB (decorativo; el contenido no depende de él).
   Tarjeta 1.1.0 (relaciones calculadas, WCAG 1.4.3 texto ≥4,5:1 y 1.4.11 componentes ≥3:1):
   etiqueta de dependencia blanco sobre #0E5A2D 8,34:1 · valor de Costo/Duración/Modalidad #0E5A2D sobre blanco 8,34:1 · etiqueta del dato #374151 sobre blanco 10,31:1
   modalidad «Parcialmente en línea» #7C2D12 sobre #FFEDD5 8,18:1 (borde #C2410C 5,18:1) · «En línea» #14532D sobre #DCFCE7 8,30:1 (borde #166534 7,13:1)
   «Presencial» #1E3A8A sobre #DBEAFE 8,49:1 (borde #1E40AF 8,72:1) · tipo #111827 sobre #F3F4F6 16,12:1 · desplegable: título #111827 y subtítulo #374151 sobre #F9FAFB 16,98:1 y 9,86:1
   botón blanco sobre #0E5A2D 8,34:1 (hover #0A4423 11,27:1) · enlace de requisitos #0B3D91 sobre blanco 10,04:1 · pendiente [Por completar] #374151.
   Panel de filtros 1.2.0: título #0E5A2D sobre #F9FAFB 7,98:1 · etiquetas #111827 sobre #F9FAFB 16,98:1 · ayuda y lupa #374151 sobre #F9FAFB 9,86:1 (sobre blanco 10,31:1) · borde de campos #4B5563 sobre blanco 7,56:1 (WCAG 1.4.11 ≥3:1)
   chip: texto #0A4423 sobre #E7F6EC 10,08:1, etiqueta #0E5A2D sobre #E7F6EC 7,46:1, borde #0E5A2D · «Limpiar filtros» #0E5A2D sobre blanco 8,34:1 · select activo: borde #0E5A2D 2px · enlaces #0B3D91 sobre #F9FAFB 9,61:1.
   Quiebres del panel: ≥1024 px hasta 4 columnas de filtros · 601–1023 px 2 columnas · ≤600 px 1 columna · ≤700 px los filtros por lista van en un desplegable «Filtros (n)» (el buscador siempre visible).
   Puntos de quiebre: ≥1024 px dos zonas (contenido + panel de 380 px) · 701–1023 px dos zonas con panel de 300 px · ≤700 px el panel pasa debajo con 3 columnas ·
   ≤480 px el panel pasa a una columna (icono a la izquierda) y el botón ocupa todo el ancho · ≤600 px filtros apilados · 320 px sin desplazamiento horizontal. */
.bga-tr, .bga-trd { color: #111827; font-size: 1rem; line-height: 1.6; max-width: 100%; overflow-wrap: break-word; }
.bga-tr *, .bga-tr *::before, .bga-tr *::after, .bga-trd *, .bga-trd *::before, .bga-trd *::after { box-sizing: border-box; }
.bga-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Filtros (1.2.0) */
.bga-tr [hidden] { display: none !important; }
.bga-tr__filtro { margin: 0 0 12px; }
.bga-tr__panelf { padding: 20px; border: 1px solid #D1D5DB; border-radius: 12px; background: #F9FAFB; min-width: 0; }
.bga-tr__cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; }
.bga-tr .bga-tr__tit-panel { margin: 0; padding: 0; color: #0E5A2D; font-size: 1.1875rem; font-weight: 700; line-height: 1.3; }
.bga-tr__buscador { margin: 0 0 16px; }
.bga-tr__lbl, .bga-tr__campo label { display: block; margin: 0 0 6px; color: #111827; font-weight: 700; }
.bga-tr__caja { position: relative; display: block; }
.bga-tr__caja .bga-tr__ico--lupa { position: absolute; left: 14px; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: #374151; pointer-events: none; }
.bga-tr .bga-tr__caja input[type="search"] { display: block; width: 100% !important; max-width: 100%; min-width: 0; min-height: 52px; margin: 0; padding: 10px 52px 10px 46px; border: 1px solid #4B5563; border-radius: 8px; background: #FFFFFF; color: #111827; font: inherit; font-size: 1.0625rem; -webkit-appearance: none; appearance: none; }
.bga-tr .bga-tr__caja input[type="search"]::-webkit-search-cancel-button, .bga-tr .bga-tr__caja input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.bga-tr .bga-tr__caja input[type="search"]:hover, .bga-tr select.bga-tr__sel:hover { border-color: #0E5A2D; }
.bga-tr__borrar { position: absolute; right: 4px; top: 50%; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -22px 0 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #374151; cursor: pointer; }
.bga-tr__borrar:hover { background: #E5E7EB; color: #111827; }
.bga-tr__borrar .bga-tr__ico { width: 20px; height: 20px; }
.bga-tr__ayuda { margin: 6px 0 0; color: #374151; font-size: .9375rem; }
.bga-tr__grupo { margin: 0; padding: 0; border: 0; min-width: 0; }
.bga-tr__mfil { margin: 0; }
.bga-tr__mfil-sum { display: none; }
.bga-tr__campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; align-items: end; }
.bga-tr__campo { display: flex; flex-direction: column; min-width: 0; }
.bga-tr__campo label { margin-bottom: 6px; }
.bga-tr select.bga-tr__sel { display: block; width: 100% !important; max-width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 8px 40px 8px 12px; border: 1px solid #4B5563; border-radius: 8px; color: #111827; font: inherit; text-overflow: ellipsis; cursor: pointer; -webkit-appearance: none; appearance: none; background-color: #FFFFFF; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px 20px; }
.bga-tr select.bga-tr__sel--act { border: 2px solid #0E5A2D; padding: 7px 39px 7px 11px; font-weight: 700; color: #0A4423; }
.bga-tr select.bga-tr__sel:disabled { background-color: #E5E7EB; border-color: #6B7280; color: #374151; cursor: not-allowed; }
.bga-tr__acciones { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 16px 0 0; }
.bga-tr__boton { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px; border: 1px solid #0E5A2D; border-radius: 8px; background: #0E5A2D; color: #FFFFFF; font: inherit; font-weight: 700; line-height: 1.3; text-align: center; text-decoration: none; cursor: pointer; }
.bga-tr a.bga-tr__boton, .bga-trd a.bga-tr__boton { color: #FFFFFF; text-decoration: none; }
.bga-tr a.bga-tr__boton--2, .bga-trd a.bga-tr__boton--2 { color: #0E5A2D; }
.bga-tr__boton:hover { background: #0A4423; border-color: #0A4423; color: #FFFFFF; }
.bga-tr__boton--2 { background: #FFFFFF; color: #0E5A2D; }
.bga-tr__boton--2:hover { background: #E7F6EC; color: #0A4423; border-color: #0A4423; }
.bga-tr a.bga-tr__boton--2:hover, .bga-trd a.bga-tr__boton--2:hover { color: #0A4423; }
.bga-tr__boton--2.bga-tr__limpiar { min-height: 44px; padding: 8px 18px; }
/* Filtros activos («chips»): botones que se quitan uno a uno */
.bga-tr ul.bga-tr__chips { list-style: none !important; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px !important; padding: 0 !important; }
.bga-tr ul.bga-tr__chips li { list-style: none !important; margin: 0; max-width: 100%; }
.bga-tr__chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 44px; padding: 6px 12px 6px 16px; border: 1px solid #0E5A2D; border-radius: 999px; background: #E7F6EC; color: #0A4423; font: inherit; font-size: .9375rem; font-weight: 700; line-height: 1.3; text-align: left; cursor: pointer; }
.bga-tr__chip-etq { color: #0E5A2D; font-weight: 700; }
.bga-tr__chip-txt { min-width: 0; overflow-wrap: anywhere; }
.bga-tr__chip .bga-tr__ico { flex: none; width: 16px; height: 16px; }
.bga-tr__chip:hover { background: #D1FAE5; border-color: #0A4423; }
.bga-tr__estado { margin: 0 0 16px; color: #374151; font-weight: 700; }

/* Lista y tarjeta (1.1.0): una tarjeta por fila */
.bga-tr ul.bga-tr__lista { list-style: none !important; margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.bga-tr li.bga-tr__item { list-style: none !important; margin: 0; display: block; min-width: 0; }
.bga-tr li.bga-tr__item[hidden] { display: none !important; }
.bga-tr li::marker { content: none; }
.bga-tr__tarjeta { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px 24px; align-items: start; width: 100%; padding: 20px; border: 1px solid #D1D5DB; border-radius: 12px; background: #FFFFFF; }
.bga-tr__principal { min-width: 0; }
.bga-tr .bga-tr__titulo { margin: 0 0 12px; padding: 0; font-size: 1.25rem; line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; word-break: break-word; hyphens: auto; }
.bga-tr .bga-tr__titulo a { color: #0E5A2D; text-decoration: none; }
.bga-tr .bga-tr__titulo a:hover { text-decoration: underline; }
.bga-tr .bga-tr__titulo .bga-tr__ico { display: inline-block; width: 1em; height: 1em; margin-left: 8px; vertical-align: -.1em; }
.bga-tr__etiquetas { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; }
.bga-tr__pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 12px; border: 1px solid transparent; border-radius: 999px; font-size: .875rem; font-weight: 700; line-height: 1.35; text-transform: uppercase; overflow-wrap: anywhere; }
.bga-tr__pill .bga-tr__ico { flex: none; width: 16px; height: 16px; }
.bga-tr__pill--dep { background: #0E5A2D; border-color: #0E5A2D; color: #FFFFFF; }
.bga-tr__pill--parcial { background: #FFEDD5; border-color: #C2410C; color: #7C2D12; }
.bga-tr__pill--linea { background: #DCFCE7; border-color: #166534; color: #14532D; }
.bga-tr__pill--presencial { background: #DBEAFE; border-color: #1E40AF; color: #1E3A8A; }
.bga-tr__pill--otra, .bga-tr__pill--tipo { background: #F3F4F6; border-color: #4B5563; color: #111827; }
.bga-tr__resumen { margin: 0 0 12px; color: #111827; overflow-wrap: anywhere; }
.bga-tr__accion { margin: 0 0 16px; }
.bga-tr__pend { color: #374151; font-style: italic; }
.bga-tr .bga-tr__boton .bga-tr__ico { flex: none; width: 18px; height: 18px; margin-right: 8px; }
.bga-tr__req { border: 1px solid #E5E7EB; border-left: 4px solid #0E5A2D; border-radius: 8px; background: #F9FAFB; }
.bga-tr__req summary { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 12px 16px; cursor: pointer; list-style: none; color: #111827; }
.bga-tr__req summary::-webkit-details-marker { display: none; }
.bga-tr__req summary::marker { content: ""; }
.bga-tr__req summary .bga-tr__ico--doc { flex: none; width: 22px; height: 22px; color: #0E5A2D; }
.bga-tr__req-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.bga-tr__req-txt strong { color: #111827; font-size: 1rem; }
.bga-tr__req-txt span { color: #374151; font-size: .9375rem; }
.bga-tr__req summary .bga-tr__ico--chevron { flex: none; width: 22px; height: 22px; margin-left: auto; color: #0E5A2D; transition: transform .2s ease; }
.bga-tr__req[open] summary .bga-tr__ico--chevron { transform: rotate(180deg); }
.bga-tr__req-cuerpo { padding: 4px 16px 16px; overflow-wrap: anywhere; }
.bga-tr__req-cuerpo p { margin: 0 0 8px; }
.bga-tr__req-cuerpo ul, .bga-tr__req-cuerpo ol { margin: 0; padding-left: 1.5em; }
.bga-tr__req-cuerpo li { margin: 0 0 6px; }
.bga-tr__req-cuerpo a { color: #0B3D91; text-decoration: underline; }
/* Panel de datos clave: Costo | Duración | Modalidad */
.bga-tr__panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border: 1px solid #D1D5DB; border-radius: 12px; background: #FFFFFF; }
.bga-tr__dato { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 14px 8px; text-align: center; }
.bga-tr__dato + .bga-tr__dato { border-left: 1px solid #E5E7EB; }
.bga-tr__dato dt { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; }
.bga-tr__circulo { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: #0E5A2D; color: #FFFFFF; }
.bga-tr__circulo .bga-tr__ico { width: 22px; height: 22px; }
.bga-tr__etq { color: #374151; font-size: .875rem; font-weight: 700; }
.bga-tr__dato dd { margin: 0; color: #0E5A2D; font-size: .9375rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.bga-tr__dato dd.bga-tr__pend { color: #374151; font-weight: 400; }
.bga-tr__vacio { padding: 16px; border: 1px solid #D1D5DB; border-radius: 12px; background: #F3F4F6; }
.bga-tr__vacio p { margin: 0 0 12px; color: #111827; }
.bga-tr__mas-caja { margin: 24px 0 0; text-align: center; }
.bga-tr__aviso { padding: 12px 16px; border: 1px solid #D1D5DB; border-radius: 8px; }

/* Enfoque visible */
.bga-tr a:focus-visible, .bga-trd a:focus-visible, .bga-tr summary:focus-visible, .bga-tr button:focus-visible, .bga-tr input:focus-visible, .bga-tr select:focus-visible { outline: 3px solid #0B3D91; outline-offset: 2px; }

/* Página de detalle */
.bga-trd__migas ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 20px; padding: 0; font-size: .9375rem; }
.bga-trd__migas li + li::before { content: "/"; margin-right: 8px; color: #374151; }
.bga-trd__migas a, .bga-trd__volver a, .bga-trd__seccion a, .bga-trd__texto a { color: #0B3D91; text-decoration: underline; }
.bga-trd__resumen { font-size: 1.125rem; margin: 0 0 20px; }
.bga-trd__clave, .bga-trd__seccion { margin: 0 0 20px; padding: 20px; border: 1px solid #D1D5DB; border-radius: 12px; background: #FFFFFF; }
.bga-trd__clave { background: #F3F4F6; }
.bga-trd h2 { margin: 0 0 12px; color: #0E5A2D; font-size: 1.375rem; line-height: 1.3; }
.bga-trd__clave dl { margin: 0 0 16px; display: grid; gap: 8px; }
.bga-trd__clave dl > div { display: grid; grid-template-columns: 12em minmax(0, 1fr); gap: 8px; }
.bga-trd__clave dt { font-weight: 700; color: #374151; }
.bga-trd__clave dd { margin: 0; overflow-wrap: anywhere; }
.bga-trd__botones { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.bga-trd ul.bga-trd__lista, .bga-trd ol.bga-trd__lista { margin: 0; padding-left: 1.5em; }
.bga-trd__lista li { margin: 0 0 6px; }

/* Puntos de quiebre */
@media (max-width: 1023px) {
  .bga-tr__tarjeta { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px 20px; }
}
@media (max-width: 700px) {
  .bga-tr__tarjeta { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .bga-tr__panel { order: 2; }
  .bga-tr .bga-tr__titulo { font-size: 1.125rem; }
}
@media (max-width: 600px) {
  .bga-tr__campos { grid-template-columns: minmax(0, 1fr); }
  .bga-tr__acciones { flex-direction: column; align-items: stretch; }
  .bga-tr__acciones .bga-tr__boton, .bga-trd__botones .bga-tr__boton, .bga-tr__vacio .bga-tr__boton { width: 100%; }
  .bga-trd__clave, .bga-trd__seccion { padding: 16px; }
  .bga-trd__clave dl > div { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 480px) {
  .bga-tr__accion .bga-tr__boton { width: 100%; }
  .bga-tr__panel { grid-template-columns: minmax(0, 1fr); }
  .bga-tr__dato { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; text-align: left; }
  .bga-tr__dato + .bga-tr__dato { border-left: 0; border-top: 1px solid #E5E7EB; }
  .bga-tr__dato dt { flex-direction: row; gap: 12px; }
  .bga-tr__dato dd { text-align: right; flex: 1 1 auto; }
}
@media (max-width: 340px) {
  .bga-tr__dato { flex-wrap: wrap; }
  .bga-tr__dato dd { text-align: left; flex-basis: 100%; }
  .bga-tr__pill { font-size: .8125rem; }
}

/* Panel de filtros: 2 columnas en tableta, desplegable «Filtros (n)» en celular */
@media (min-width: 601px) and (max-width: 1023px) {
  .bga-tr__campos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .bga-tr__panelf { padding: 14px; }
  .bga-tr .bga-tr__tit-panel { font-size: 1.0625rem; }
  .bga-tr__cab .bga-tr__limpiar { width: 100%; }
  .bga-tr__mfil { border: 1px solid #D1D5DB; border-radius: 8px; background: #FFFFFF; }
  .bga-tr__mfil-sum { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; color: #111827; font-weight: 700; cursor: pointer; list-style: none; }
  .bga-tr__mfil-sum::-webkit-details-marker { display: none; }
  .bga-tr__mfil-sum::marker { content: ""; }
  .bga-tr__nfil { color: #0E5A2D; }
  .bga-tr__mfil-sum .bga-tr__ico--chevron { flex: none; width: 22px; height: 22px; margin-left: auto; color: #0E5A2D; transition: transform .2s ease; }
  .bga-tr__mfil[open] .bga-tr__mfil-sum .bga-tr__ico--chevron { transform: rotate(180deg); }
  .bga-tr__mfil .bga-tr__grupo { padding: 4px 14px 14px; }
}

/* Con JavaScript la búsqueda es instantánea y no hace falta el botón */
.bga-tr.bga-tr--js .bga-tr__buscar { display: none; }

@media (prefers-reduced-motion: reduce) { .bga-tr *, .bga-trd * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) {
  .bga-tr__tarjeta, .bga-tr__panel, .bga-tr__req, .bga-tr__panelf, .bga-tr__mfil, .bga-tr__chip, .bga-trd__clave, .bga-trd__seccion { border: 1px solid CanvasText; }
  .bga-tr__circulo, .bga-tr__pill { forced-color-adjust: none; }
  .bga-tr__boton, .bga-tr__borrar { border: 1px solid ButtonText; }
  .bga-tr select.bga-tr__sel { border: 1px solid FieldText; forced-color-adjust: auto; }
}
