/* ==========================================================================
   Barra superior y cabecera
   El menú móvil (cajón lateral) se define en cssm/mobile.css.
   ========================================================================== */

/* ---- Barra superior ----------------------------------------------------- */

.barra {
  background: var(--indigo-3);
  color: #C9CBEF;
  font-size: .8rem;
}

.barra-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 40px;
}

.barra-datos {
  display: flex;
  align-items: center;
  gap: 24px;
}

.barra-item,
.barra-item a {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  white-space: nowrap;
}

.barra-item a { transition: color .15s; }
.barra-item a:hover { color: #fff; }

.barra .icono {
  width: 14px;
  height: 14px;
  opacity: .8;
}

/* Indicadores del día: los completa js/app.js desde /indicadores */
.indicadores {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  font-family: var(--ff-mono);
  font-size: .74rem;
  animation: indicadores-entrar .6s ease both;
}

.indicadores[hidden] { display: none; }

.indicador {
  display: flex;
  align-items: baseline;
  gap: .6em;
  white-space: nowrap;
}

.indicador dt {
  color: var(--c2);
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.indicador dd {
  color: #fff;
  font-weight: 500;
}

.indicador small {
  margin-left: 1px;
  color: var(--c2);
  font-size: .92em;
}

.indicador-flecha { margin-left: .5em; font-size: .7em; }
.indicador-flecha[data-variacion="sube"]::after { content: "▲"; color: #7FE3B0; }
.indicador-flecha[data-variacion="baja"]::after { content: "▼"; color: #FFA3A8; }
.indicador-flecha[data-variacion="igual"]::after { content: "■"; color: var(--c2); }

@keyframes indicadores-entrar {
  from { opacity: 0; transform: translateY(4px); }
}

/* ---- Cabecera ----------------------------------------------------------- */

.cabecera {
  position: sticky;
  top: 0;
  z-index: 900;
}

/* El vidrio va en un pseudo-elemento: un backdrop-filter en la propia cabecera
   la volvería contenedor del menú fijo y lo recortaría a su alto. */
.cabecera::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  transition: box-shadow .3s;
}

.cabecera.es-fija::before { box-shadow: 0 14px 34px -26px rgba(16, 15, 88, .6); }

/* Barra que avanza con el scroll de la página. Solo donde el navegador
   permite animaciones guiadas por scroll; en el resto no se muestra. */
.cabecera::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--c4), var(--c3));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .cabecera::after {
    animation: avance-lectura linear both;
    animation-timeline: scroll(root block);
  }
}

@keyframes avance-lectura { to { transform: scaleX(1); } }

.cabecera-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.cabecera-logo { flex: none; }

.cabecera-logo img {
  width: auto;
  height: 25px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-enlace {
  position: relative;
  padding: 10px 15px;
  border-radius: 10px;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 600;
  transition: color .15s, background-color .15s;
}

.nav-enlace:hover {
  background: var(--mist);
  color: var(--c5);
}

.nav-enlace.es-activo { color: var(--c3); }

.nav-enlace.es-activo::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 3px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
}

.nav-pie { display: none; }

.cabecera-acciones {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburguesa {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 46px;
  height: 46px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--c5);
  cursor: pointer;
}

.hamburguesa span {
  display: block;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .3s var(--ease), opacity .2s;
}

.hamburguesa[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburguesa[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburguesa[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.velo { display: none; }
