/* ============================================================
   Estilos compartidos de las páginas por institución
   (instituciones/<id>.html). Reutiliza la paleta de style.css:
   dorado #e0dba5 / #7a5c00, rojo marca #b30000, tarjetas blancas.
   ============================================================ */

.institucion-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ---- Encabezado de la institución ---- */
.institucion-header {
  margin: 8px 0 28px;
}

.institucion-header .institucion-tipo {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #7a5c00;
  background: #f5f1cf;
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 10px;
}

.institucion-header h1 {
  font-size: 1.9rem;
  line-height: 1.2;
  color: #222;
  margin: 0 0 6px;
}

.institucion-header .institucion-entidad {
  color: #777;
  font-size: 0.95rem;
  margin: 0;
}

.institucion-header .institucion-meta {
  color: #999;
  font-size: 0.82rem;
  margin: 10px 0 0;
}
.institucion-header .institucion-meta a {
  color: #b30000;
  text-decoration: none;
}
.institucion-header .institucion-meta a:hover {
  text-decoration: underline;
}

/* ---- Grupos de producto ---- */
.producto-bloque {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  margin-bottom: 24px;
}

.producto-bloque__head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(224, 219, 165, 0.5);
}

.producto-bloque__head h2 {
  font-size: 1.15rem;
  color: #222;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modalidad-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7a5c00;
  background: #e0dba5;
  border-radius: 999px;
  padding: 3px 10px;
}

/* ---- Tabla de rendimientos ---- */
/* Permite scroll horizontal en pantallas angostas sin romper la tarjeta */
.tabla-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabla-rendimientos {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.tabla-rendimientos thead tr {
  background: #e0dba5;
}

.tabla-rendimientos th {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7a5c00;
  text-align: right;
  vertical-align: bottom;
  /* Los nombres de variante pueden ser largos: que envuelvan en vez de
     forzar scroll horizontal en pantallas angostas. */
  white-space: normal;
}
.tabla-rendimientos th:first-child {
  text-align: left;
  white-space: nowrap;
}

.tabla-rendimientos td {
  padding: 12px 16px;
  text-align: right;
  color: #555;
  border-bottom: 1px solid rgba(224, 219, 165, 0.3);
  white-space: nowrap;
}
.tabla-rendimientos td:first-child {
  text-align: left;
  font-weight: 600;
  color: #222;
}

.tabla-rendimientos tbody tr:last-child td {
  border-bottom: none;
}
.tabla-rendimientos tbody tr:hover {
  background: #fffdf6;
}

.tabla-rendimientos .tasa {
  font-weight: 700;
  color: #1f6b2e;
}
.tabla-rendimientos .tasa--cero {
  color: #bbb;
  font-weight: 500;
}
.tabla-rendimientos .sin-dato {
  color: #ccc;
}

/* Nota al pie de un producto (p. ej. variante derivada) */
.producto-nota {
  padding: 12px 20px 16px;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.5;
}
.producto-nota strong {
  color: #7a5c00;
}

/* Estados de carga / error */
.institucion-estado {
  text-align: center;
  color: #888;
  padding: 48px 16px;
  font-size: 0.95rem;
}
.institucion-estado.error {
  color: #b30000;
}

@media (max-width: 600px) {
  .institucion-header h1 { font-size: 1.5rem; }
  .tabla-rendimientos th,
  .tabla-rendimientos td { padding: 10px 12px; }
}

/* ── Secciones extra del hub por institución (tarjetas + promociones) ──
   Las genera scripts/generar-paginas-instituciones.js fuera del <main>
   (así la hidratación de tasas no las toca). Diseño base simple. */
.hub-extra { padding-top: 0; }
.hub-seccion { margin: 1.8rem 0; }
.hub-seccion h2 { font-size: 1.15rem; border-bottom: 2px solid #eee; padding-bottom: 0.4rem; margin-bottom: 0.8rem; }
.hub-seccion h3 { font-size: 0.95rem; margin: 1rem 0 0.4rem; color: #374151; }
.hub-tarjetas { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.7rem; }
.hub-tarjeta { border: 1px solid #e5e7eb; border-radius: 10px; padding: 0.7rem 0.85rem; background: #fff; }
.hub-tarjeta p { font-size: 0.83rem; color: #6b7280; margin: 0.3rem 0 0.45rem; }
.hub-chip { display: inline-block; font-size: 0.7rem; font-weight: 600; color: #6b7280; border: 1px solid #e5e7eb; border-radius: 999px; padding: 0.1rem 0.5rem; margin-right: 0.3rem; }
.hub-promos, .hub-globales { list-style: none; padding: 0; margin: 0; }
.hub-promos li, .hub-globales li { padding: 0.4rem 0; border-bottom: 1px solid #f1f2f4; font-size: 0.9rem; }
.hub-comercio { font-weight: 700; }
.hub-vence { color: #9aa0ab; font-size: 0.8rem; }
.hub-vacio, .hub-historico { font-size: 0.85rem; color: #6b7280; }
.hub-link-mas { font-size: 0.88rem; margin-top: 0.6rem; }
