* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-fondo);
  color: var(--texto-principal);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding-top: 52px;
  padding-bottom: 58px;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* --- BARRA SUPERIOR --- */
.menu-superior {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background-color: var(--bg-nav);
  border-bottom: 1px solid var(--borde-sutil);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
}

.branding {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--texto-principal);
}

/* Escarapela CSS */
.escarapela {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFD700 18%, #57ACFF 20%, #57ACFF 42%, #FFFFFF 44%, #FFFFFF 68%, #57ACFF 70%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.marca-texto {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 2px;
}

.menu-derecha {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fecha-actual {
  font-size: 12px;
  color: var(--texto-secundario);
  font-weight: 400;
}

.btn-tema {
  background: var(--bg-panel);
  border: 1px solid var(--borde-sutil);
  color: var(--texto-principal);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-tema:hover {
  border-color: var(--acento-azul);
}

/* --- BARRA INFERIOR DE NAVEGACIÓN --- */
.menu-inferior {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background-color: var(--bg-nav);
  border-top: 1px solid var(--borde-sutil);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  overflow-x: auto;
  z-index: 1000;
}

.nav-btn {
  text-decoration: none;
  color: var(--texto-secundario);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-btn:hover {
  color: var(--acento-azul);
  background: rgba(87, 172, 255, 0.08);
}

.nav-btn.activo {
  color: var(--acento-cian);
  font-weight: 900;
  background: rgba(87, 172, 255, 0.12);
}

/* --- ESTRUCTURA TRIPARTITA RESPONSIVA (3 NIVELES) --- */
.contenedor-principal {
  max-width: 1760px;
  margin: 0 auto;
  padding: 16px;
}

.bloque-tripartito {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

/* Laterales fijos de 300px en pantallas >= 900px */
.panel-lateral {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-lateral.oculto-admin {
  display: none !important;
}

/* Nivel 1: Pantalla muy ancha (>= 1400px) -> Todo convive sin scroll */
.panel-central {
  flex: 1;
  min-width: 0;
  background-color: var(--bg-panel);
  border-radius: 14px;
  border: 1px solid var(--borde-sutil);
  box-shadow: var(--sombra-card);
  padding: 16px;
}

/* Nivel 2: Pantalla mediana (900px a 1399px) -> Laterales intactos + Centro con scroll interno */
@media (min-width: 900px) and (max-width: 1399px) {
  .panel-central {
    overflow-x: auto;
  }
}

/* Nivel 3: Celular / Chica (< 900px) -> Prioridad total al centro, se ocultan laterales */
@media (max-width: 899px) {
  .panel-lateral {
    display: none !important;
  }
  .contenedor-principal {
    padding: 8px;
  }
  .panel-central {
    width: 100%;
    overflow-x: auto;
    padding: 12px 8px;
  }
  .fecha-actual {
    display: none;
  }
}

/* --- CAJAS DE PUBLICIDAD (BANNERS Y VIDEOS) --- */
.slot-banner {
  width: 100%;
  background-color: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--borde-sutil);
  overflow: hidden;
  position: relative;
}

.slot-premium {
  height: 175px;
}

.slot-alto-impacto {
  height: 460px;
}

.slot-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slot-banner iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

.banner-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}

.btn-audio-ad {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: rgba(87, 172, 255, 0.92);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

/* --- CARRUSEL DINÁMICO DE SOCIOS (BUCLE INFINITO SUAVE) --- */
@keyframes scrollCarruselInfinito {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.carrusel-seccion {
  margin: 24px 0;
  overflow: hidden;
  position: relative;
  /* Bordes suaves para que no corte de golpe */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}

.carrusel-seccion.oculto-admin {
  display: none !important;
}

.carrusel-pista {
  display: flex;
  width: max-content;
  gap: 16px;
  padding: 6px 16px 12px 0; /* El padding-right = gap evita cualquier salto al reiniciar */
  animation: scrollCarruselInfinito 45s linear infinite;
  will-change: transform;
}

/* Se frena suave cuando el usuario apoya el mouse encima */
.carrusel-seccion:hover .carrusel-pista {
  animation-play-state: paused;
}

.carrusel-tarjeta {
  flex: 0 0 360px;
  height: 205px;
  background-color: var(--bg-card);
  border-radius: 18px;
  border: 1px solid var(--borde-sutil);
  overflow: hidden;
  position: relative;
}

.carrusel-tarjeta img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 600px) {
  .carrusel-tarjeta {
    flex: 0 0 80vw;
    height: 185px;
  }
  .carrusel-pista {
    animation-duration: 35s;
  }
}
/* --- FOOTER --- */
.footer-global {
  text-align: center;
  padding: 40px 20px 20px;
  border-top: 1px solid var(--borde-sutil);
  margin-top: 40px;
}

.footer-marca {
  font-weight: 900;
  letter-spacing: 8px;
  font-size: 14px;
  color: var(--texto-apagado);
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 10px;
  color: var(--texto-apagado);
  letter-spacing: 1px;
}
/* --- ESTILOS PANTALLA DÓLAR --- */
.seccion-header { margin-bottom: 16px; }
.seccion-titulo { font-size: 16px; font-weight: 900; letter-spacing: 3px; text-transform: uppercase; }
.seccion-sub { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--acento-azul); margin-top: 4px; }
.punto-vivo { width: 7px; height: 7px; border-radius: 50%; background: var(--acento-verde); display: inline-block; }

/* Tabla Dólares */
.tabla-scroll { overflow-x: auto; padding-bottom: 8px; }
.tabla-dolar { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0 8px; }
.tabla-dolar th { color: var(--acento-azul); font-size: 10px; font-weight: 900; letter-spacing: 1px; padding: 6px 8px; text-align: center; }
.tabla-dolar th:first-child { text-align: left; }
.tabla-dolar td { background: var(--bg-fila); padding: 12px 8px; text-align: center; font-size: 12px; border-top: 1px solid var(--borde-sutil); border-bottom: 1px solid var(--borde-sutil); }
.tabla-dolar td:first-child { border-left: 1px solid var(--borde-sutil); border-radius: 20px 0 0 20px; text-align: left; padding-left: 16px; font-weight: 800; }
.tabla-dolar td:last-child { border-right: 1px solid var(--borde-sutil); border-radius: 0 20px 20px 0; text-align: left; color: var(--texto-secundario); font-size: 11px; }
.precio-venta { font-size: 16px; font-weight: 900; font-family: monospace; color: var(--texto-principal); }
.precio-compra { font-size: 13px; font-weight: 600; font-family: monospace; color: var(--acento-azul); }
.var-pos { color: var(--acento-verde); font-weight: 800; }
.var-neg { color: var(--acento-rojo); font-weight: 800; }
.var-neu { color: var(--texto-apagado); font-weight: 700; }

/* Divisas Regionales */
.divisor-sutil { height: 1px; background: var(--borde-sutil); margin: 22px 0; }
.grid-divisas { display: grid; grid-template-columns: repeat(5, minmax(135px, 1fr)); gap: 10px; }
.card-divisa { background: var(--bg-card); border: 1px solid var(--borde-sutil); border-radius: 12px; padding: 14px 12px; }
.divisa-nom { font-size: 11px; font-weight: 900; }
.divisa-reg { font-size: 9px; color: var(--acento-azul); margin-bottom: 10px; }
.divisa-lbl { font-size: 8px; font-weight: 800; color: var(--acento-azul); letter-spacing: 1px; }
.divisa-val { font-size: 19px; font-weight: 900; font-family: monospace; margin-bottom: 6px; }
.divisa-fila { display: flex; justify-content: space-between; font-size: 10px; color: var(--texto-secundario); margin-top: 4px; font-family: monospace; }
.divisa-eq { color: var(--acento-verde); font-weight: 800; }

/* Grilla de 6 Indicadores */
.grid-indicadores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1100px) { .grid-indicadores { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 650px) { .grid-indicadores { grid-template-columns: 1fr; } }

.card-ind { background: var(--bg-card); border: 1px solid var(--borde-sutil); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; min-height: 290px; }
.ind-titulo { color: var(--acento-verde); font-size: 10px; font-weight: 900; letter-spacing: 1px; }
.ind-sub { color: var(--texto-apagado); font-size: 8px; margin-top: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--borde-sutil); }
.ind-centro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 0; }
.ind-valor-grande { font-size: 28px; font-weight: 900; font-family: monospace; }
.ind-badge { font-size: 9px; font-weight: 800; padding: 3px 8px; border-radius: 5px; margin-top: 6px; letter-spacing: 0.5px; }
.ind-desc { font-size: 9.5px; color: var(--texto-secundario); line-height: 1.35; padding-top: 10px; border-top: 1px solid var(--borde-sutil); }

/* Barras y gráficos internos de indicadores */
.barra-bloques { display: flex; gap: 3px; width: 100%; height: 34px; margin-bottom: 12px; }
.bloque-item { flex: 1; border-radius: 3px; background: var(--borde-sutil); }
.barras-verticales { display: flex; align-items: flex-end; justify-content: space-around; width: 100%; height: 120px; padding-top: 16px; }
.col-barra { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.barra-v-relleno { width: 26px; border-radius: 4px; min-height: 8px; }
.rulo-fila { display: flex; justify-content: space-between; width: 100%; font-size: 10px; color: var(--texto-secundario); margin-top: 5px; font-family: monospace; }/* =========================================================
   ANIMACIONES Y DINAMISMO GLOBAL (CARGA + HOVER)
   ========================================================= */

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulsoVivo {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  50% { transform: scale(1.25); opacity: 0.85; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

@keyframes crecerBarraV {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* 1. Punto verde "En vivo" latiendo */
.punto-vivo {
  animation: pulsoVivo 2s infinite;
}

/* 2. Entrada suave de paneles, banners y carrusel */
.panel-central,
.slot-banner,
.carrusel-tarjeta {
  animation: fadeSlideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.slot-banner,
.carrusel-tarjeta {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.slot-banner:hover,
.carrusel-tarjeta:hover {
  transform: translateY(-3px);
  border-color: var(--acento-azul);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

/* 3. Filas de la tabla Dólar (entrada escalonada + hover) */
.tabla-dolar tbody tr {
  animation: fadeSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.tabla-dolar tbody tr:nth-child(1) { animation-delay: 0.04s; }
.tabla-dolar tbody tr:nth-child(2) { animation-delay: 0.08s; }
.tabla-dolar tbody tr:nth-child(3) { animation-delay: 0.12s; }
.tabla-dolar tbody tr:nth-child(4) { animation-delay: 0.16s; }
.tabla-dolar tbody tr:nth-child(5) { animation-delay: 0.20s; }
.tabla-dolar tbody tr:nth-child(6) { animation-delay: 0.24s; }
.tabla-dolar tbody tr:nth-child(7) { animation-delay: 0.28s; }

.tabla-dolar tbody tr td {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.tabla-dolar tbody tr:hover td {
  background-color: rgba(87, 172, 255, 0.09);
  border-color: rgba(87, 172, 255, 0.35);
}

/* 4. Tarjetas de Divisas Regionales */
.card-divisa {
  animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card-divisa:nth-child(1) { animation-delay: 0.06s; }
.card-divisa:nth-child(2) { animation-delay: 0.12s; }
.card-divisa:nth-child(3) { animation-delay: 0.18s; }
.card-divisa:nth-child(4) { animation-delay: 0.24s; }
.card-divisa:nth-child(5) { animation-delay: 0.30s; }

.card-divisa:hover {
  transform: translateY(-5px);
  border-color: var(--acento-azul);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

/* 5. Tarjetas de Indicadores del Dólar */
.card-ind {
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card-ind:nth-child(1) { animation-delay: 0.08s; }
.card-ind:nth-child(2) { animation-delay: 0.16s; }
.card-ind:nth-child(3) { animation-delay: 0.24s; }
.card-ind:nth-child(4) { animation-delay: 0.32s; }
.card-ind:nth-child(5) { animation-delay: 0.40s; }
.card-ind:nth-child(6) { animation-delay: 0.48s; }

.card-ind:hover {
  transform: translateY(-6px);
  border-color: var(--acento-azul);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

/* 6. Barras verticales del Radar creciendo desde abajo */
.barra-v-relleno {
  transform-origin: bottom;
  animation: crecerBarraV 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
/* =========================================================
   MEJORAS VISUALES DÓLAR: PASTILLAS, CONVERSOR, GRÁFICOS Y GAUGE
   ========================================================= */
.oculto { display: none !important; }

.seccion-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.resumen-conviene {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--texto-secundario);
  background: var(--bg-card);
  border: 1px solid var(--borde-sutil);
  padding: 6px 12px;
  border-radius: 10px;
}
.resumen-conviene strong { color: var(--texto-principal); }

/* Conversor Rápido */
.conversor-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--borde-sutil);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.conv-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-fila);
  border: 1px solid var(--borde-sutil);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--acento-azul);
}
.conv-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--texto-principal);
  font-family: monospace;
  font-size: 14px;
  font-weight: 900;
  width: 115px;
}
.conv-resultados {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.conv-chip {
  background: var(--bg-fila);
  border: 1px solid var(--borde-sutil);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.conv-chip span { color: var(--texto-secundario); font-weight: 700; }
.conv-chip strong { color: var(--acento-verde); font-family: monospace; }

/* Pastillas de variación y filas clickeables */
.var-pill {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  font-family: monospace;
  white-space: nowrap;
}
.pill-pos { color: #22C55E; background: rgba(34, 197, 94, 0.12); }
.pill-neg { color: #EF4444; background: rgba(239, 68, 68, 0.12); }
.pill-neu { color: var(--texto-apagado); background: rgba(148, 163, 184, 0.1); }

.fila-dolar-click { cursor: pointer; }
.fila-dolar-click.fila-activa td {
  background-color: rgba(87, 172, 255, 0.12);
  border-color: var(--acento-azul);
}
.badge-graf { font-size: 11px; opacity: 0.55; transition: opacity 0.2s; }
.fila-dolar-click:hover .badge-graf { opacity: 1; }
.sparkline-svg { display: block; margin: 0 auto; }

.fila-grafico td {
  background: transparent !important;
  border: none !important;
  padding: 8px 0 !important;
}
.graf-panel {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--acento-azul);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.graf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.graf-rangos { display: flex; gap: 6px; }
.btn-rango {
  background: var(--bg-fila);
  color: var(--texto-secundario);
  border: 1px solid var(--borde-sutil);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.btn-rango.activo, .btn-rango:hover {
  background: var(--acento-azul);
  color: #fff;
  border-color: var(--acento-azul);
}
.graf-svg { width: 100%; height: 170px; display: block; }
.graf-eje-fechas {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--texto-apagado);
  font-family: monospace;
  margin-top: 4px;
}

/* Banderas reales en Divisas Regionales */
.divisa-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.divisa-head .divisa-reg { margin-bottom: 0; }
.flag-img {
  width: 26px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--borde-sutil);
  flex-shrink: 0;
}

/* Velocímetro BTC y Barra RSI */
.gauge-svg { width: 165px; height: auto; display: block; }
.rsi-track {
  width: 100%;
  height: 10px;
  background: var(--borde-sutil);
  border-radius: 6px;
  position: relative;
}
.rsi-fill { height: 100%; border-radius: 6px; transition: width 0.6s ease; }
.rsi-marca {
  position: absolute;
  top: 14px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  color: var(--texto-apagado);
  font-family: monospace;
}
.rsi-marca::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 50%;
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.35);
}

.graf-cuerpo {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.graf-eje-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 0 22px;
  font-size: 10px;
  font-family: monospace;
  color: var(--texto-apagado);
  text-align: right;
  min-width: 54px;
}
.graf-svg-wrap {
  flex: 1;
  min-width: 0;
}