:root {
  --azul: #082b4c;
  --azul2: #0e5d8d;
  --rojo: #d71920;
  --gris: #f3f6f8;
  --texto: #173042;
  --borde: #dbe4ea;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--texto);
  line-height: 1.55;
}
a {
  text-decoration: none;
  color: inherit;
}
.container {
  width: min(1280px, 96%);
  margin: auto;
}
.topbar {
  background: #111111;
  color: #dbe8f1;
  font-size: 0.86rem;
}
.topbar .container {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  padding: 7px 0;
}
/* Barra institucional superior */
.topbar {
    width: 100%;
    background: red !important;
    color: #dbe8f1;
}

.topbar .container {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
    padding: 7px 0;
}

.topbar a {
    display: inline-block;
    margin: 0;
    color: #ffffff !important;
    text-decoration: none;
    white-space: nowrap;
}

.topbar a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.header {
  background: #fff;
  border-bottom: 1px solid var(--borde);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px #061f370f;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 0;
}
.brandmark {
  background: var(--azul);
  color: #fff;
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 4px;
}
.brand small {
  display: block;
  color: #607485;
}
.nav {
  display: flex;
  gap: 9px;
  font-size: 0.86rem;
  font-weight: 700;
}
.nav a {
  padding: 27px 0;
  position: relative;
}
.nav a:hover,
.nav a.active {
  color: var(--rojo);
}
.nav a.active:after,
.nav a:hover:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 3px;
  background: var(--rojo);
}
/* Estado activo de navegación: se marca la pestaña que coincide con data-page del body */
body[data-page="inicio"] .nav a[data-nav="inicio"],
body[data-page="formacion"] .nav a[data-nav="formacion"],
body[data-page="eventos"] .nav a[data-nav="eventos"],
body[data-page="observatorio"] .nav a[data-nav="observatorio"],
body[data-page="comisiones"] .nav a[data-nav="comisiones"],
body[data-page="empresas"] .nav a[data-nav="empresas"],
body[data-page="nosotros"] .nav a[data-nav="nosotros"] {
  color: var(--rojo);
}
body[data-page="inicio"] .nav a[data-nav="inicio"]:after,
body[data-page="formacion"] .nav a[data-nav="formacion"]:after,
body[data-page="eventos"] .nav a[data-nav="eventos"]:after,
body[data-page="observatorio"] .nav a[data-nav="observatorio"]:after,
body[data-page="comisiones"] .nav a[data-nav="comisiones"]:after,
body[data-page="empresas"] .nav a[data-nav="empresas"]:after,
body[data-page="nosotros"] .nav a[data-nav="nosotros"]:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 3px;
  background: var(--rojo);
}
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--borde);
  border-radius: 5px;
  font-size: 1.5rem;
  color: var(--azul);
  padding: 6px 10px;
  cursor: pointer;
}
.btn {
  display: inline-block;
  border-radius: 4px;
  padding: 10px 13px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}
.btn-red {
  background: var(--rojo);
  color: #fff;
}
.btn-blue {
  background: var(--azul2);
  color: #fff;
}
.btn-light {
  background: #fff;
  color: var(--azul);
}
.hero {
  background: linear-gradient(110deg, #111111, #8f1117);
  color: #fff;
  padding: 18px 0 42px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 50px;
  align-items: center;
}
.eyebrow {
  color: #8fd0f2;
  font-weight: 800;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.02;
  margin: 10px 0 18px;
}
.hero-lead {
  font-size: 1.16rem;
  max-width: 760px;
  color: #e8f4fa;
}
.hero-card {
  background: #ffffff12;
  border: 1px solid #ffffff30;
  border-radius: 10px;
  padding: 25px;
}
.section {
  padding: 58px 0;
}
.alt {
  background: var(--gris);
}
.section h2 {
  color: var(--azul);
  font-size: 2rem;
  margin: 0 0 8px;
}
.lead {
  color: #607485;
  margin: 0 0 28px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.grid4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.card {
    border: 1px solid var(--borde);
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 5px 18px #1730420c;
    min-width: 0;
}
.card h3 {
  color: var(--azul);
}
.card h3 {
    color: var(--azul);
    font-size: 0.95rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.card p {
    font-size: 0.82rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--azul2);
  background: #e9f5fb;
  padding: 5px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}
.kpi {
  border-top: 4px solid var(--azul2);
}
.kpi strong {
  font-size: 1.7rem;
  color: var(--azul);
  display: block;
}
.footer {
  background: #111111;
  color: #c8d6df;
  padding: 45px 0 25px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}
.footer h3 {
  color: #fff;
}
.footer a {
  display: block;
  margin: 7px 0;
}
.copyright {
  border-top: 1px solid #ffffff20;
  margin-top: 30px;
  padding-top: 20px;
  font-size: 0.84rem;
}
@media (max-width: 900px) {
  .menu-toggle {
    display: block;
  }
  .nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--borde);
    box-shadow: 0 12px 22px #061f371f;
    padding: 12px 4%;
  }
  .nav.open {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .nav a {
    padding: 12px 5px;
    border-bottom: 1px solid #edf2f5;
  }
  .nav a:after {
    display: none !important;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .grid,
  .grid4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
}
@media (max-width: 560px) {
  .topbar {
    display: none;
  }
  .brand small {
    display: none;
  }
  .brand b {
    font-size: 0.9rem;
  }
  .afiliate {
    display: none;
  }
  .grid,
  .grid4,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 24px 0 42px;
  }
}
/* V2.1 BLOQUE 3: EVENTOS Y CALENDARIO */
.events-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 22px;
}
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 230px;
  justify-content: flex-end;
  text-transform: capitalize;
}
.calendar-arrow {
  width: 38px;
  height: 38px;
  border: 1px solid var(--borde);
  background: #fff;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
}
.event-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 12px;
  margin-bottom: 20px;
}
.event-filters select,
.event-filters input {
  padding: 11px;
  border: 1px solid var(--borde);
  border-radius: 6px;
  background: #fff;
  font: inherit;
}
.calendar-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}
.calendar-card,
.agenda-panel {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(8, 43, 76, 0.06);
}
.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.weekdays span {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #637889;
  padding: 8px 0;
}
.calendar-day {
  position: relative;
  min-height: 70px;
  border: 1px solid #e4eaee;
  background: #fff;
  border-radius: 6px;
  padding: 8px;
  text-align: left;
  cursor: pointer;
}
.calendar-day:hover {
  border-color: var(--azul2);
  background: #f5f9fc;
}
.calendar-day.muted {
  border-color: transparent;
  background: transparent;
}
.event-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rojo);
  bottom: 9px;
  right: 9px;
}
.agenda-title {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--borde);
  padding-bottom: 12px;
}
.agenda-title h3 {
  margin: 3px 0;
  text-transform: capitalize;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  font-weight: 800;
  color: var(--rojo);
}
.count-badge {
  min-width: 30px;
  height: 30px;
  border-radius: 15px;
  background: var(--azul);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.agenda-item {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px solid var(--borde);
}
.event-date {
  display: flex;
  flex-direction: column;
}
.event-date b {
  color: var(--azul);
  text-transform: uppercase;
}
.event-date span,
.agenda-item p {
  font-size: 0.82rem;
  color: #607485;
}
.agenda-item h4 {
  margin: 6px 0 5px;
  color: var(--azul);
}
.agenda-item p {
  margin: 0;
}
.event-cta {
  margin-top: 32px;
  padding: 28px;
  background: var(--gris);
  border-left: 4px solid var(--rojo);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border-radius: 7px;
}
@media (max-width: 900px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
  .event-filters {
    grid-template-columns: 1fr 1fr;
  }
  .event-filters input {
    grid-column: 1/-1;
  }
}
@media (max-width: 600px) {
  .events-heading,
  .event-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .calendar-nav {
    justify-content: space-between;
  }
  .event-filters {
    grid-template-columns: 1fr;
  }
  .event-filters input {
    grid-column: auto;
  }
  .calendar-card {
    padding: 10px;
  }
  .calendar-day {
    min-height: 48px;
  }
  .agenda-item {
    grid-template-columns: 72px 1fr;
  }
}
.observatory-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}
.update-box {
  min-width: 250px;
  padding: 18px;
  border: 1px solid var(--borde);
  border-left: 4px solid var(--rojo);
  border-radius: 7px;
}
.update-box span,
.update-box small {
  display: block;
  color: #607485;
}
.update-box strong {
  display: block;
  color: var(--azul);
  margin: 5px 0;
}
.indicator-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 22px;
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 100%;
}
.kpi-card {
    padding: 14px;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 9px;
    min-width: 0;
    
}
.kpi-card[hidden] {
  display: none;
}
.kpi-card > span {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #607485;
}
.kpi-card strong {
  display: block;
  font-size: 1.8rem;
  color: var(--azul);
  margin: 7px 0;
}
.kpi-card em {
  font-size: 0.7rem;
  color: var(--rojo);
  font-style: normal;
  font-weight: 800;
}
.kpi-card small {
  color: #6c7f8c;
}
.observatory-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.75fr;
  gap: 22px;
  margin-top: 28px;
}
.chart-panel,
.reading-panel,
.source-panel {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 22px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.panel-heading select {
  padding: 9px;
  border: 1px solid var(--borde);
  border-radius: 5px;
}
.chart-panel canvas {
  width: 100%;
  height: auto;
}
.chart-note {
  font-size: 0.78rem;
  color: #718390;
}
.reading-panel hr {
  border: 0;
  border-top: 1px solid var(--borde);
  margin: 20px 0;
}
.source-panel {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  align-items: center;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.source-grid span {
  padding: 13px;
  background: var(--gris);
  text-align: center;
  font-weight: 800;
  color: var(--azul);
}
@media (max-width: 1000px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .observatory-layout,
  .source-panel {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 650px) {
  .observatory-intro,
  .kpi-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }
  .update-box {
    min-width: 0;
  }
  .panel-heading {
    flex-direction: column;
  }
}
/* ===== BLOQUE 4.2 MOTOR DE DATOS ===== */
.engine-loading,
.engine-warning {
  grid-column: 1/-1;
  padding: 28px;
  border: 1px dashed var(--borde);
  border-radius: 8px;
  background: var(--gris);
  color: #607485;
}
.engine-warning {
  border-left: 4px solid #b58a2a;
}
.engine-panel {
    margin-top: 18px;
    padding: 14px 18px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: #fff;
}
.engine-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin: 10px 0;
}
.engine-flow span {
  padding: 12px 16px;
  background: var(--gris);
  border-radius: 6px;
  font-weight: 800;
  color: var(--azul);
}
.engine-flow b {
  color: var(--rojo);
  font-size: 1.25rem;
}
@media (max-width: 650px) {
  .engine-flow {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }
  .engine-flow b {
    transform: rotate(90deg);
  }
}
/* ===== BLOQUE 4.2 MOTOR DE DATOS ===== */
.engine-loading,
.engine-warning {
  grid-column: 1/-1;
  padding: 28px;
  border: 1px dashed var(--borde);
  border-radius: 8px;
  background: var(--gris);
  color: #607485;
}
.engine-warning {
  border-left: 4px solid #b58a2a;
}
.engine-panel {
  margin-top: 30px;
  padding: 24px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: #fff;
}
.engine-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.engine-flow span {
  padding: 12px 16px;
  background: var(--gris);
  border-radius: 6px;
  font-weight: 800;
  color: var(--azul);
}
.engine-flow b {
  color: var(--rojo);
  font-size: 1.25rem;
}
@media (max-width: 650px) {
  .engine-flow {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }
  .engine-flow b {
    transform: rotate(90deg);
  }
}
/* ===== BLOQUE 4.2 MOTOR DE DATOS ===== */
.engine-loading,
.engine-warning {
  grid-column: 1/-1;
  padding: 28px;
  border: 1px dashed var(--borde);
  border-radius: 8px;
  background: var(--gris);
  color: #607485;
}
.engine-warning {
  border-left: 4px solid #b58a2a;
}
.engine-panel {
  margin-top: 30px;
  padding: 24px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: #fff;
}
.engine-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.engine-flow span {
  padding: 12px 16px;
  background: var(--gris);
  border-radius: 6px;
  font-weight: 800;
  color: var(--azul);
}
.engine-flow b {
  color: var(--rojo);
  font-size: 1.25rem;
}
@media (max-width: 650px) {
  .engine-flow {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }
  .engine-flow b {
    transform: rotate(90deg);
  }
}

/* ===== BLOQUE 4.3A · GOBERNANZA Y VIGENCIA ===== */
.governed-kpi .kpi-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.governed-kpi .kpi-heading > span {
  font-weight: 800;
  color: var(--azul);
}
.data-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-current {
  background: #e9f6ee;
  color: #17643a;
}
.status-soon {
  background: #fff5d9;
  color: #7a5a00;
}
.status-review {
  background: #fde9e9;
  color: #9c2525;
}
.status-pending {
  background: #eef1f4;
  color: #5c6873;
}
.governed-kpi .kpi-meta {
  display: grid;
  gap: 5px;
  margin: 14px 0;
}
.governed-kpi .kpi-meta small {
  display: block;
  line-height: 1.35;
  color: #5f7180;
}
@media (max-width: 520px) {
  .governed-kpi .kpi-heading {
    flex-direction: column;
  }
  .data-status {
    white-space: normal;
  }
}
/* =========================================================
   Logo institucional ACIEM - Encabezado
   ========================================================= */

.brand-logo {
  width: 72px;
  height: 64px;
  object-fit: contain;
  flex: 0 0 auto;
}
.footer .footer-logo {
  width: auto;
  height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto 14px;
}
.footer-grid > div:first-child {
  text-align: center;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text h4 {
    margin: 0;
    width: 190px;
    font-size: 0.80rem;
    line-height: 1.20;
    font-weight: 700;
}
.brand-text b {
  display: block;
}

.brand-text small {
  display: block;
  margin-top: 3px;
}
.reloj-institucional {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #4b5563;
  white-space: nowrap;
}

.reloj-separador {
  margin: 0 4px;
}

.reloj-zona {
  margin-left: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}
.reloj-institucional {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  column-gap: 5px;
  row-gap: 2px;
  min-width: 92px;
  font-size: 0.72rem;
  line-height: 1.15;
  white-space: nowrap;
  color: #536273;
}

#fecha-institucional {
  grid-column: 1 / 3;
  text-align: center;
}

.reloj-separador {
  display: none;
}

#hora-institucional {
  grid-column: 1;
  text-align: right;
}

.reloj-zona {
  grid-column: 2;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
}
.breadcrumb {
  font-size: 0.82rem;
  color: #6b7785;
  margin-top: 8px;
  margin-bottom: 8px;
}

.breadcrumb a {
  color: #6b7785;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #d71920;
  text-decoration: underline;
}
/* Migas de navegación */
.breadcrumbs {
  font-size: 0.78rem;
  color: #7a8794;
  margin-top: 6px;
  margin-bottom: 10px;
  font-weight: 400;
  opacity: 0.85;
}
/* ================================
   REDES SOCIALES - FOOTER
   ================================ */

.footer .redes-sociales {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 0;
    margin-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer .redes-titulo {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 8px;
}

.footer .redes-sociales a.red-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.2s ease,
                background-color 0.2s ease,
                border-color 0.2s ease;
}

.footer .redes-sociales a.red-social:hover {
    transform: translateY(-3px);
    background-color: #d71920;
    border-color: #d71920;
    color: #ffffff;
}
.footer .red-social svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

/* Tamaño controlado de los iconos sociales */
.footer .redes-sociales .red-social svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    min-width: 20px;
    min-height: 20px;
    display: block;
    fill: currentColor;
    flex: 0 0 20px;
}
.footer .redes-sociales a.red-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
}
/* =========================================
   CONTADOR DE VISITAS
   ========================================= */

.contador-visitas {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 12px;
    font-size: 0.82rem;
    color: #dbe8f1;
}

.contador-visitas strong {
    color: #ffffff;
    font-weight: 700;
}

.contador-icono {
    color: #ffffff;
    font-size: 0.75rem;
}
/* =====================================================
   ASISTENTE VIRTUAL ACIEM
   ===================================================== */

.aci-chat {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
}

.aci-chat-btn {
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: #c8102e;
    color: #ffffff;
    font-size: 25px;
    cursor: pointer;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25);
}

.aci-chat-btn:hover {
    transform: scale(1.05);
}

.aci-chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 380px;
    height: 570px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.28);
    display: none;
    border: 1px solid #ddd;
}

.aci-chat-panel.activo {
    display: block;
}

.aci-chat-header {
    height: 58px;
    padding: 0 14px;
    background: #c8102e;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aci-chat-header strong {
    display: block;
    font-size: 14px;
}

.aci-chat-header small {
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

.aci-chat-close {
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 26px;
    cursor: pointer;
}

.aci-chat-panel iframe {
    width: 100%;
    height: calc(100% - 58px);
    border: 0;
    display: block;
}

@media (max-width: 600px) {
    .aci-chat {
        right: 12px;
        bottom: 12px;
    }

    .aci-chat-panel {
        position: fixed;
        left: 8px;
        right: 8px;
        top: 8px;
        bottom: 80px;

        width: auto;
        height: auto;

        border-radius: 10px;
    }
}

    .aci-chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;

    width: min(440px, calc(100vw - 30px));
    height: min(680px, calc(100vh - 120px));

    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.28);
    display: none;
    border: 1px solid #ddd;
}
/* =====================================================
   BOTÓN FLOTANTE WHATSAPP ACIEM
   Esquina inferior derecha, inmediatamente encima del
   botón del Asistente Virtual (.aci-chat).
   ===================================================== */

.aci-whatsapp {
    position: fixed;
    right: 22px;              /* alineado con .aci-chat (escritorio) */
    bottom: 96px;             /* encima del botón del chat, sin invadir el panel abierto */
    width: 58px;              /* misma medida que .aci-chat-btn */
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25d366;      /* verde oficial WhatsApp */
    color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25);
    z-index: 9998;            /* debajo del chatbot (9999): el chat abierto pasa por encima del botón */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.aci-whatsapp svg {
    width: 30px;
    height: 30px;
    display: block;
    fill: currentColor;
}

.aci-whatsapp:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.aci-whatsapp:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .aci-whatsapp {
        right: 12px;          /* alineado con .aci-chat (móvil) */
        bottom: 82px;         /* encima de la ventana del chat en móvil (bottom: 80px) */
    }
}
/* Cabecera responsive: evita desbordamiento horizontal en la pantalla de inicio
   (el boton AFILIATE se salia del borde derecho en ventanas medianas y obligaba
   a mover el mouse / ver la barra de scroll horizontal) */
@media (max-width: 1250px) {
    .header-row {
        gap: 8px;
    }

    .nav {
        gap: 5px;
        font-size: 0.75rem;
    }
}

@media (max-width: 960px) {
    .afiliate {
        display: none;
    }
}
/* Ajuste móvil (v9): el encabezado no debe desbordar en celulares.
   En pantallas estrechas se oculta el reloj institucional y la marca
   se compacta para que el botón de menú (☰) quede siempre visible. */
@media (max-width: 480px) {
    .reloj-institucional {
        display: none;
    }

    .header-row {
        gap: 6px;
        min-height: 62px;
    }

    .brand {
        gap: 7px;
    }

    .brand-logo {
        width: 38px;
        height: auto;
    }

    .brand-text h4 {
        font-size: 0.72rem;
        line-height: 1.15;
    }

    .menu-toggle {
        padding: 5px 8px;
        font-size: 1.3rem;
    }
}
