/* Páginas de nodos del árbol de pactos: nacional, comunidad, provincia, municipio y centro */

:root {
  --alm-verde: #6a9f98;
  --alm-verde-osc: #4f7f78;
  --alm-verde-claro: #ddedeb;
  --alm-texto: #2f3b3a;
  --alm-gris: #6c757d;
}

/* ---------- Migas de pan ---------- */
.nodo-migas {
  width: 100%;
  margin-bottom: 8px;
}
.nodo-migas ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 0;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}
.nodo-migas li {
  color: var(--alm-gris);
}
.nodo-migas li + li::before {
  content: "›";
  padding: 0 8px;
  color: #b5c9c6;
}
.nodo-migas a {
  color: var(--alm-verde-osc);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #b5c9c6;
}
.nodo-migas a:hover {
  text-decoration-color: currentColor;
}
.nodo-migas li[aria-current] {
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Título del nodo ---------- */
.section-title .nodo-nombre {
  font-size: 30px;
  font-weight: 700;
  color: var(--alm-texto);
  margin: 4px 0 2px;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
  background: none;
  border-radius: 0;
  display: block;
  text-align: center;
  line-height: 1.2;
  text-wrap: balance;
}
.section-title .nodo-nombre::before,
.section-title .nodo-nombre::after {
  display: none;
}
.nodo-subtitulo {
  color: var(--alm-gris);
  font-size: 15px;
  text-align: center;
  line-height: 1.5;
}
.nodo-subtitulo a {
  color: var(--alm-verde-osc);
  white-space: nowrap;
}
.nodo-acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  margin-top: 4px;
}
.nodo-acciones .navegador-cursos h3.form-title {
  margin: 0;
}
.nodo-acciones .btn-nav-curso {
  margin-top: 0;
}
.nodo-form-actualizar {
  display: inline;
  margin: 0;
}
.nodo-btn-icono {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  line-height: 0;
}
.nodo-btn-compartir,
.nodo-btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.nodo-btn-compartir {
  background: var(--alm-verde);
  color: #fff;
  border: none;
  padding: 0 18px;
  cursor: pointer;
}
.nodo-btn-compartir:hover {
  background: var(--alm-verde-osc);
}
.nodo-btn-whatsapp {
  justify-content: center;
  width: 40px;
  background: #25d366;
  color: #fff;
  font-size: 20px;
}
.nodo-btn-whatsapp:hover {
  color: #fff;
  background: #1da851;
}

/* ---------- Selector de idioma ---------- */
.nodo-idiomas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.nodo-idiomas .btn {
  margin: 0;
}

/* ---------- Cifras ---------- */
.nodo-cifras {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  text-align: center;
}
.nodo-cifras div {
  display: flex;
  flex-direction: column;
}
.nodo-cifras strong {
  font-size: 40px;
  line-height: 1.1;
  color: var(--alm-verde-osc);
  font-variant-numeric: tabular-nums;
}
.nodo-cifras span {
  font-size: 16px;
  color: var(--alm-texto);
}

/* ---------- Pestañas (nacional) ---------- */
.nodo-pestanas {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}
.nodo-pestanas button {
  border: 1px solid var(--alm-verde);
  background: #fff;
  color: var(--alm-verde-osc);
  border-radius: 20px;
  padding: 8px 18px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
}
.nodo-pestanas button.activa {
  background: var(--alm-verde);
  color: #fff;
}

/* ---------- Lista de nodos hijos ---------- */
.nodo-lista {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  text-align: left;
}
.nodo-lista li + li {
  border-top: 1px solid #e3eeec;
}
.nodo-lista a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 10px;
  color: var(--alm-texto);
  text-decoration: none;
  border-radius: 6px;
}
.nodo-lista a:hover,
.nodo-lista a:focus-visible {
  background: var(--alm-verde-claro);
}
.nodo-lista-nombre {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  line-height: 1.3;
}
.nodo-lista-nombre small {
  display: block;
  color: var(--alm-gris);
  font-size: 13px;
}
.nodo-lista-total {
  font-weight: 700;
  font-size: 18px;
  color: var(--alm-verde-osc);
  font-variant-numeric: tabular-nums;
}
.nodo-lista .bi-chevron-right {
  color: #a9c3bf;
}

/* ---------- Municipio: buscador y tabla de centros ---------- */
.municipio-buscador {
  position: relative;
  margin-bottom: 10px;
}
.municipio-buscador .bi-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--alm-gris);
}
.municipio-buscador input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 40px;
  border: 1px solid #b5c9c6;
  border-radius: 24px;
  font-size: 16px; /* evita el zoom automático en iOS */
}
.municipio-buscador input:focus {
  outline: 2px solid var(--alm-verde);
  outline-offset: 1px;
}
.municipio-filtros {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  font-size: 14px;
  color: var(--alm-gris);
  margin-bottom: 8px;
  text-align: left;
}
.municipio-filtros label {
  cursor: pointer;
}
.tabla-centros {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
}
.tabla-centros th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--alm-gris);
  border-bottom: 2px solid var(--alm-verde-claro);
  padding: 8px;
}
.tabla-centros td {
  padding: 10px 8px;
  border-bottom: 1px solid #e3eeec;
  vertical-align: top;
  color: var(--alm-texto);
}
.tabla-centros tbody tr:hover {
  background: #f4f9f8;
}
.tabla-centros .col-codigo {
  font-variant-numeric: tabular-nums;
  color: var(--alm-gris);
  white-space: nowrap;
}
.tabla-centros .col-nombre a {
  color: var(--alm-verde-osc);
  font-weight: 600;
}
.tabla-centros .col-direccion {
  color: var(--alm-gris);
}
.tabla-centros .col-pactos {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tabla-centros tr.sin-pactos .col-pactos {
  color: #b0b8b7;
  font-weight: 400;
}
.municipio-vacio {
  color: var(--alm-gris);
  padding: 16px 0;
}
#municipio-mas {
  margin-top: 12px;
}

/* ---------- Móvil ---------- */
@media (max-width: 767px) {
  .section-title .nodo-nombre {
    font-size: 24px;
  }
  .nodo-cifras strong {
    font-size: 32px;
  }
  .nodo-acciones .navegador-cursos h3.form-title {
    font-size: 24px !important;
  }

  /* La tabla de centros pasa a tarjetas */
  .tabla-centros thead {
    display: none;
  }
  .tabla-centros,
  .tabla-centros tbody,
  .tabla-centros tr,
  .tabla-centros td {
    display: block;
    width: 100%;
  }
  .tabla-centros tr {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 10px 64px 10px 4px;
    border-bottom: 1px solid #e3eeec;
  }
  .tabla-centros tr[hidden] {
    display: none;
  }
  .tabla-centros td {
    border: none;
    padding: 1px 0;
  }
  .tabla-centros .col-nombre {
    font-size: 16px;
  }
  .tabla-centros .col-codigo,
  .tabla-centros .col-direccion {
    font-size: 13px;
  }
  .tabla-centros .col-codigo::before {
    content: "Cód. ";
  }
  .tabla-centros .col-nombre { order: 1; }
  .tabla-centros .col-direccion { order: 2; }
  .tabla-centros .col-codigo { order: 3; }
  .tabla-centros .col-pactos {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    font-size: 20px;
    color: var(--alm-verde-osc);
  }
}
