/* =============================================
   VARIABLES Y CONFIGURACIÓN GLOBAL
   ============================================= */

/* Paleta de colores */
:root {
  --color-azul-oscuro: #285260;  
  --color-azul-medio:  #548C92; 
  --color-azul-claro:  #B4D7D8;  
  --color-crema:       #E0D7CF; 
  --color-arena:       #AB9072;  
  --color-positivo:    #188038;  
  --color-negativo:    #d93025;
  --color-neutro:      #666666;       
  --color-texto-gen:   #1a1a1a;
  --color-texto-prin:  #2C3E50;
  --color-texto-sec:   #BDC3C7;
  --color-fondo:       #ffffff;
}

@font-face {
  font-family: 'Inter';
  src: url('../../../paquetesDescargados/Inter/static/Inter_18pt-Light.ttf') format('truetype');
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: 'Inter';
}

a {
  text-decoration: none;
  color: var(--color-texto-gen);
}

/* Todo des-seleccionable */
html, body, * {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

/* Pero estos sí se pueden seleccionar */
input, textarea {
  user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
}

/* =============================================
   LAYOUT BASE
   ============================================= */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  /* En la página de noticias bloqueamos el scroll global */
  overflow-y: hidden;
  background-color: #ffffff;
}

.homeContainer {
  height: 100vh;          /* altura fija, sin scroll */
  overflow: hidden;       /* bloquea el scroll del contenedor */
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffffff;
}

/* =============================================
   HEADER FIJO
   ============================================= */

.seccionFija {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 98%;
  padding-top: 25px;
  position: fixed;
  z-index: 999;
  background-color: #ffffff;
  max-width: 1500px;
  border: none;
  box-shadow: none;
}

.arriba {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: transparent;
  gap: 16px;
}

.homeContainer .contenedorLogo {
  height: 60px;
}

.homeContainer .contenedorLogoEmpresa {
  height: 100%;
}

.homeContainer .logo::selection {
  background-color: rgb(200, 200, 200);
}

.homeContainer .arriba .logo {
  height: 100%;
}

/* =============================================
   BARRA DE BÚSQUEDA
   ============================================= */

.homeContainer .baraBusqueda {
  position: relative;
  width: 500px;
  max-width: 500px;
  min-width: 200px;
  flex-shrink: 1;
  height: 45px;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  border-radius: 20px;
  box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(100, 100, 100, 0.1);
  margin-left: 28px;
  background: #fff;
}

.homeContainer .baraBusquedaactivada {
  border-radius: 20px 20px 0 0;
  box-shadow: none;
}

.homeContainer .baraBusqueda a {
  height: 100%;
  margin-left: 10px;
}

.homeContainer .baraBusqueda a .logoAlpha {
  height: 100%;
}

.logoAlpha:hover {
  transform: scale(1.05);
}

.homeContainer .baraBusqueda .input {
  outline: none;
  border: none;
  height: 80%;
  width: 50%;
  font-size: 16px;
  font-weight: normal;
  margin-left: 10px;
  background-color: inherit;
  text-transform: uppercase;
}

.homeContainer .baraBusqueda .input::placeholder {
  text-transform: none;
  font-size: 16px;
  font-weight: normal;
}

/* ── AUTOCOMPLETE DROPDOWN — diseño rico ── */
.autocomplete-items {
  display: none; /* oculto por defecto — JS lo muestra con display:block */
  position: absolute;
  z-index: 9999;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(84, 140, 146, 0.18);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(40, 82, 96, 0.16);
}

/* Cada resultado */
.posibleResult {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  cursor: pointer;
  background: #fff;
  border-bottom: 1px solid rgba(84, 140, 146, 0.07);
  transition: background 0.12s ease;
}
.posibleResult:last-child { border-bottom: none; }

.posibleResult:hover,
.posibleResult.autocomplete-active {
  background: rgba(84, 140, 146, 0.07);
}

/* Texto: nombre + ticker */
.ac-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ac-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1c1c1c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-ticker {
  font-size: 11.5px;
  font-weight: 700;
  color: #548C92;
  letter-spacing: 0.04em;
}

/* Highlight del texto buscado */
.posibleResult mark {
  background: none;
  color: #285260;
  font-weight: 800;
}

/* Flecha derecha */
.ac-arrow {
  flex-shrink: 0;
  color: #c0d5d7;
  display: flex;
  align-items: center;
  transition: color 0.12s;
}
.posibleResult:hover .ac-arrow,
.posibleResult.autocomplete-active .ac-arrow {
  color: #548C92;
}

.homeContainer .contenido .baraBusquedaactivada {
  border-radius: 20px 20px 0 0;
  box-shadow: none;
}

/* =============================================
   PERFIL USUARIO
   ============================================= */

.perfilUsuario {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background-color: #f8f9fa;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  margin-right: 20px;
}

.perfilUsuario:hover {
  background-color: #e6f0f2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.perfilCirculo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-azul-medio, #548C92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(84,140,146,0.2);
  transition: transform 0.2s ease;
}

.perfilUsuario:hover .perfilCirculo {
  transform: scale(1.1);
}

.nombreUsuario {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

/* =============================================
   BOTONES LOGIN Y SIGN IN
   ============================================= */

.contenedorBotonLogin {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.botonesAuth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.botonLogin,
.botonSignin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 2px solid var(--color-azul-medio);
  transition: transform .18s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  cursor: pointer;
}

.botonLogin {
  background: var(--color-azul-medio);
  color: #fff;
}

.botonLogin:hover {
  background: var(--color-azul-oscuro);
  border-color: var(--color-azul-oscuro);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(84,140,146,.18);
}

.botonSignin {
  background: transparent;
  color: var(--color-azul-medio);
}

.botonSignin:hover {
  background: var(--color-azul-medio);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(84,140,146,.18);
}

.botonLogin:focus-visible,
.botonSignin:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-azul-claro) 65%, transparent);
}

/* Alternancia por estado de sesión */
body[data-online="0"] .botonesAuth {
  display: flex !important;
}

body[data-online="0"] .perfilUsuario {
  display: none !important;
}

body[data-online="1"] .botonesAuth {
  display: none !important;
}

body[data-online="1"] .perfilUsuario {
  display: flex !important;
}

/* =============================================
   MENÚ MÓVIL
   ============================================= */

.menu-hamburguesa {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-azul-medio);
  cursor: pointer;
  padding: 10px;
  z-index: 1101;
}

.menu-mobile,
#menuMobile {
  display: block;
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 360px;
  height: 100vh;
  background-color: var(--color-fondo);
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  transition: right .3s ease;
  z-index: 1300; /* encima del bottom-nav (1200) */
  padding-top: 80px;
  overflow-y: auto;
}

.menu-mobile.menu-abierto,
#menuMobile.menu-abierto {
  right: 0;
}

.menu-overlay,
#menuOverlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 1250; /* encima del bottom-nav (1200) */
}

.menu-overlay.activo,
#menuOverlay.activo {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-mobile-contenido {
  padding: 20px;
}

.menu-mobile-profile {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.menu-mobile-profile i {
  font-size: 32px;
  color: var(--color-azul-medio);
}

.menu-mobile-profile span {
  font-size: 16px;
  color: var(--color-texto-gen);
  font-weight: 500;
}

.menu-mobile-item {
  display: block;
  padding: 15px 20px;
  color: var(--color-texto-gen);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
  transition: all .3s ease;
}

.menu-mobile-item:hover {
  background-color: var(--color-azul-claro);
  color: var(--color-azul-oscuro);
}

.menu-mobile-item.activo {
  background-color: var(--color-azul-medio);
  color: white;
}

.menu-cerrar {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-azul-medio);
  cursor: pointer;
  padding: 10px;
}

/* =============================================
   NAVEGACIÓN
   ============================================= */

.paginas {
  display: flex;
  flex-flow: row;
  justify-content: space-between;
  width: 92%;
  margin-top: 20px;
  background-color: #edefef;
  border: none;
}

.paginas .elementoNav {
  background-color: #edefef;
  width: 100%;
  font-size: 14px;
  display: flex;
  flex-flow: row;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding-top: 2px;
  padding-bottom: 2px;
  color: var(--color-texto-gen);
}

.paginas .elementoNav:hover {
  background-color: var(--color-azul-medio) !important;
  border: 1px solid var(--color-azul-medio);
  color: #fff !important;
  cursor: pointer;
}

.news {
  background-color: var(--color-azul-medio) !important;
  border: 1px solid var(--color-azul-medio);
  color: #fff !important;
}

/* NAV MODERNO — override solo desktop, igual que profile */
@media (min-width: 769px) {
  .paginas {
    position: sticky;
    display: flex;
    flex-flow: row;
    justify-content: space-between;
    overflow: auto;
    scrollbar-width: none;
    gap: 0;
    align-items: stretch;
    width: 92%;
    margin: 25px auto 16px auto;
    padding: 6px 12px;
    background: color-mix(in srgb, var(--color-fondo) 82%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid color-mix(in srgb, var(--color-azul-claro) 45%, transparent);
    box-shadow: 0 8px 28px rgba(40, 82, 96, 0.10);
    border-radius: 16px;
  }
  .paginas .elementoNav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    letter-spacing: 0.1px;
    color: var(--color-texto-prin);
    background: transparent;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
    width: auto;
  }
  .paginas .elementoNav h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 600;
  }
  .paginas .elementoNav:hover {
    background: color-mix(in srgb, var(--color-azul-claro) 26%, transparent) !important;
    border-color: color-mix(in srgb, var(--color-azul-claro) 55%, transparent) !important;
    color: var(--color-azul-oscuro) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(84, 140, 146, 0.16);
  }
  .paginas .elementoNav:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-azul-claro) 65%, transparent);
  }
  .paginas .news {
    background: linear-gradient(135deg, var(--color-azul-medio), var(--color-azul-oscuro)) !important;
    border-color: var(--color-azul-medio) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(40, 82, 96, 0.28);
  }
}

/* =============================================
   CONTENIDO PRINCIPAL
   ============================================= */

.contenido {
  position: absolute !important;
  width: 90%;
  max-width: 1350px;
  margin-top: 0;
  margin-bottom: 40px;
  flex: 1;
  display: flex;
  justify-content: center;
}

body .contenido.contenido-news {
  position: fixed !important;
  top: 165px;
  left: 50%;
  transform: translateX(-50%);
  /* Termina justo antes del footer (~90px) */
  bottom: 74px;
  margin: 0;
  padding: 0;
  width: 90%;
  max-width: 1350px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;       /* CRÍTICO: nada escapa hacia afuera */
  z-index: 1;
}

/* =============================================
   FOOTER
   ============================================= */
.alpha-footer {
  grid-area: footer;
  width: 100%;
  background: #F4F9FA;
  border-top: 2px solid var(--color-azul-medio);
  font-size: 0.875rem;
  /* Footer fijo en la parte inferior del viewport */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.alpha-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Home (logo + texto) */
.alpha-footer__home-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-azul-oscuro);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  transition: opacity 0.15s ease;
}
.alpha-footer__home-link:hover { opacity: 0.7; }
.alpha-footer__home-link:hover .alpha-footer__logo { transform: scale(1.08); }

.alpha-footer__logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  transition: transform .2s ease;
}

.alpha-footer__home-text {
  font-size: 0.875rem;
}

/* Navegacion central */
.alpha-footer__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.alpha-footer__sep {
  color: var(--color-azul-medio);
  font-size: 0.8rem;
  padding: 0 2px;
  opacity: 0.4;
}

.alpha-footer__link {
  text-decoration: none;
  color: var(--color-azul-medio);
  font-weight: 400;
  font-size: 0.875rem;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.alpha-footer__link:hover {
  color: var(--color-azul-oscuro);
  background: rgba(84,140,146,0.08);
}

/* Iconos sociales */
.alpha-footer__social {
  display: flex;
  align-items: center;
  gap: 6px;
}

.alpha-footer__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--color-azul-medio);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-azul-medio);
  transition: color 0.15s ease, border-color 0.15s ease,
              background 0.15s ease, transform 0.15s ease;
}
.alpha-footer__icon i { font-size: 0.82rem; }
.alpha-footer__icon:hover {
  color: #ffffff;
  background: var(--color-azul-medio);
  border-color: var(--color-azul-medio);
  transform: translateY(-1px);
}

.footer-logo-link {
  display: flex;
  align-items: center;
}

/* Mobile */
@media (max-width: 600px) {
  .alpha-footer__inner {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    text-align: center;
  }
  .alpha-footer__nav { flex-wrap: wrap; justify-content: center; }
}


/* =============================================
   BOTTOM TAB BAR - MOVIL
   ============================================= */
@media (max-width: 768px) {

  /* — Header móvil igual que profile — */
  .seccionFija {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 98%;
    padding-top: 25px;
    position: fixed;
    z-index: 999;
    background-color: transparent;
  }

  .arriba {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .botonesAuth {
    display: none;
    justify-content: flex-end;
    position: absolute;
    top: 13px;
    right: 5px;
    width: auto;
  }

  .perfilUsuario {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    background-color: #f8f9fa;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: absolute;
    top: 13px;
    right: -20px;
    z-index: 15;
  }

  .homeContainer .baraBusqueda {
    width: calc(100% - 30px);
    max-width: 450px;
    height: 40px;
    margin: 0 auto;
    overflow: visible;
    box-sizing: border-box;
    order: 2;
    display: flex;
    margin-top: 40px;
    margin-left: 0;
    z-index: 10;
  }

  /* — Contenido móvil genérico — */
  .contenido {
    display: block;
    margin-top: 130px;
    padding: 0 5px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    top: auto;
  }

  /* News móvil: fixed entre header y bottom-nav */
  body .contenido.contenido-news {
    position: fixed !important;
    top: 120px;
    left: 0;
    right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom));
    margin: 0;
    padding: 0 5px;
    width: 100%;
    max-width: 100vw;
    transform: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body .contenido.contenido-news .news-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 10px 8px;
    gap: 6px;
    overflow: hidden;
  }

  body .contenido.contenido-news .news-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body .contenido.contenido-news .news-list-wrapper {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  body .contenido.contenido-news .news-feed {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .seccionFija .paginas {
    display: none !important;
  }

  .menu-hamburguesa {
    display: none !important;
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    display: flex;
    align-items: stretch;
    background: var(--color-fondo);
    border-top: 1px solid rgba(84, 140, 146, 0.18);
    box-shadow: 0 -4px 20px rgba(40, 82, 96, 0.10);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 8px;
    gap: 3px;
    cursor: pointer;
    border: none;
    background: none;
    border-top: 2px solid transparent;
    transition: border-color 0.15s, color 0.15s;
    text-decoration: none;
    color: var(--color-neutro);
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav__item.activo,
  .bottom-nav__item[aria-current="page"] {
    border-top-color: var(--color-azul-medio);
    color: var(--color-azul-oscuro);
  }

  .bottom-nav__icon {
    font-size: 18px;
    line-height: 1;
  }

  .bottom-nav__label {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
  }

  .bottom-nav__drawer {
    position: fixed;
    bottom: 58px;
    left: 0;
    right: 0;
    z-index: 1199;
    background: var(--color-fondo);
    border-top: 0.5px solid rgba(84, 140, 146, 0.2);
    box-shadow: 0 -4px 20px rgba(40, 82, 96, 0.12);
    padding: 10px 16px 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
  }

  .bottom-nav__drawer.abierto {
    transform: translateY(0);
  }

  .bottom-nav__drawer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 10px;
    border: 0.5px solid rgba(84, 140, 146, 0.2);
    background: #f5f9f9;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-azul-medio);
    font-size: 10px;
    font-weight: 500;
  }

  .bottom-nav__drawer-item i {
    font-size: 16px;
  }

  /* Footer oculto en móvil — el bottom-nav lo reemplaza */
  .alpha-footer {
    display: none !important;
  }
}

/* Ocultar el bottom-nav en desktop */
@media (min-width: 769px) {
  .bottom-nav,
  .bottom-nav__drawer {
    display: none !important;
  }
}


.perfilUsuario {
  display: none;
  align-items: center;
  gap: 5px;
  margin-left: 5px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: #f8f9fa;
  border: 1px solid transparent;
  transition: background 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.perfilUsuario:hover {
  background: #e6f0f2;
}
.perfilUsuario a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
}
.nombreUsuario {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.perfilCirculo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-azul-medio);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

/* === Premium gold === */
.perfilUsuario.is-premium {
  background: linear-gradient(135deg, rgba(182,138,58,0.13), rgba(210,178,95,0.06));
  border-color: rgba(182,138,58,0.38);
  box-shadow: 0 2px 10px rgba(182,138,58,0.15);
}
.perfilUsuario.is-premium:hover {
  background: linear-gradient(135deg, rgba(182,138,58,0.20), rgba(210,178,95,0.10));
}
.perfilUsuario.is-premium .perfilCirculo {
  background: linear-gradient(135deg, #B68A3A, #D2B25F);
  box-shadow: 0 0 0 2px rgba(182,138,58,0.22);
}
.perfilUsuario.is-premium .nombreUsuario {
  color: #8A6423;
}

/* ── Global site nav ── */
.busqueda-af-nav {
  display: flex; gap: 4px; align-items: center; flex-shrink: 0;
}
.busqueda-af-nav .af-nav__link {
  display: inline-flex; align-items: center; text-decoration: none;
  color: rgba(26,26,26,0.70); font-size: 14px; font-weight: 600;
  padding: 8px 10px; border-radius: 12px; border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap; cursor: pointer;
}
.busqueda-af-nav .af-nav__link:hover {
  background: rgba(0,0,0,0.04); color: rgba(26,26,26,0.92);
}
.busqueda-af-nav .af-nav__link.is-active {
  background: rgba(84,140,146,0.12); color: #285260;
  border: 1px solid rgba(84,140,146,0.35);
}
.busqueda-nav-toggle {
  display: none; border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.7); backdrop-filter: blur(10px);
  border-radius: 12px; padding: 10px 12px; cursor: pointer; line-height: 1; flex-shrink: 0;
}
.busqueda-nav-toggle i { font-size: 16px; color: rgba(26,26,26,0.75); }
.busqueda-nav-mobile {
  display: none; position: absolute; top: calc(100% + 8px);
  left: 16px; right: 16px; background: #fff;
  border: 1px solid rgba(0,0,0,0.08); border-radius: 16px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.12); padding: 10px; z-index: 4000;
}
.busqueda-nav-mobile .af-nav__link { display: block; padding: 11px 12px; border-radius: 12px; }

@media (max-width: 768px) {
  .seccionFija .paginas { display: none !important; }
  .menu-hamburguesa { display: none !important; }
  .busqueda-af-nav { display: none; }
  .busqueda-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .seccionFija.is-open .busqueda-nav-mobile { display: block; }
  .seccionFija.is-open .busqueda-nav-toggle { border-color: rgba(84,140,146,0.35); }
  .menu-mobile-section-label {
    font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--color-azul-medio, #548C92);
    padding: 16px 16px 6px; opacity: 0.7;
  }
  .menu-mobile-item i { width: 18px; text-align: center; margin-right: 8px; opacity: 0.7; }
}

@media (max-width: 1100px) {
  .baraBusqueda {
    width: 340px;
  }
  .busqueda-af-nav .af-nav__link {
    font-size: 13px;
    padding: 7px 8px;
  }
}

@media (max-width: 900px) {
  .baraBusqueda {
    width: 260px;
  }
  .busqueda-af-nav {
    gap: 2px;
  }
  .busqueda-af-nav .af-nav__link {
    font-size: 12px;
    padding: 6px 7px;
  }
}

/* =============================================
   NEWS — UNIFIED REDESIGN (cards + logo header)
   ============================================= */

/* ── Footer hidden on news page ── */
body.page-news .alpha-footer { display: none !important; }
body.page-news .contenido.contenido-news { bottom: 0 !important; }

/* ── Shell ── */
.news-shell {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: 0;
  padding: 12px 20px 12px;
}

/* ── Header ── */
.news-header {
  padding: 14px 16px;
  border: 1px solid rgba(40,82,96,0.08);
  border-radius: 14px;
  margin-bottom: 14px;
  flex-shrink: 0;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(40,82,96,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Company identity ── */
.news-company-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.news-company-logo-wrap {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: #f0f4f4;
  border: 1px solid rgba(84,140,146,0.18);
  box-shadow: 0 2px 8px rgba(40,82,96,0.10), inset 0 1px 0 rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-company-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}

.news-company-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--color-azul-oscuro);
  background: linear-gradient(135deg, var(--color-azul-claro) 0%, #d6eced 100%);
}

.news-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  margin: 0;
}

.news-subtitle {
  font-size: 0.82rem;
  color: #999;
  margin-top: 2px;
}

.news-subtitle-sep { margin: 0 4px; opacity: 0.35; }

.news-ticker {
  font-weight: 700;
  color: var(--color-azul-medio);
}

.news-updated { font-size: 0.75rem; color: #bbb; }

.news-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.news-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(84,140,146,0.20);
  background: rgba(84,140,146,0.07);
  color: #548C92;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.3s ease;
  outline: none;
  flex-shrink: 0;
}
.news-refresh i { font-size: 0.82rem; }
.news-refresh:hover {
  background: #548C92;
  color: #fff;
  border-color: #548C92;
}
.news-refresh:active {
  transform: rotate(180deg);
}

/* ── Body / wrapper ── */
.news-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.news-list-wrapper {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Feed ── */
.news-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;           /* hard kill horizontal scroll */
  padding: 4px 2px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-feed::-webkit-scrollbar { width: 5px; }
.news-feed::-webkit-scrollbar-track { background: transparent; }
.news-feed::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 999px; }

/* ── CARDS ── */
.news-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 13px;
  background: #ffffff;
  border: 1px solid rgba(40,82,96,0.08);
  border-left: 1px solid rgba(40,82,96,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  overflow: visible;
  box-shadow: 0 2px 8px rgba(40,82,96,0.06);
}

/* Primary: accent line by default */
.news-card--primary {
  border-left: 3px solid #548C92;
}

/* When a sibling is hovered, primary loses its line */
.news-feed:has(.news-card:hover) .news-card--primary:not(:hover) {
  border-left: 1px solid rgba(40,82,96,0.10);
}
/* JS fallback */
.news-card--primary.primary-hidden {
  border-left: 1px solid rgba(40,82,96,0.10) !important;
}

/* Hovered card always gets accent line — ONLY hovered card */
.news-card:hover,
.news-card--hovered {
  border-left: 3px solid #548C92 !important;
  border-color: rgba(84,140,146,0.28);
  box-shadow: 0 8px 28px rgba(40,82,96,0.13);
  transform: translateY(-1px);
}

.news-card a { text-decoration: none; }

/* ── Logo ── */
.news-card__logo-col {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}
.news-card__logo {
  width: 38px; height: 38px; border-radius: 10px;
  object-fit: contain; background: #f4f8f8;
  border: 1px solid rgba(84,140,146,0.13); padding: 5px; display: block;
}
.news-card__logo-fallback {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #B4D7D8, #548C92);
  color: #fff; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ── Content col ── */
.news-card__content-col {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px;
}

/* ── Meta row ── */
.news-card__meta-top { display: flex; align-items: center; gap: 5px; }
.news-card__source { font-size: 0.71rem; font-weight: 700; color: #548C92; white-space: nowrap; text-transform: capitalize; }
.news-card__dot { width: 3px; height: 3px; border-radius: 50%; background: #cdd6d8; flex-shrink: 0; }
.news-card__time { font-size: 0.71rem; color: #b0bec5; white-space: nowrap; flex-shrink: 0; }

.news-card__sent-inline {
  margin-left: auto; flex-shrink: 0;
  font-size: 0.67rem; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.news-card__sent-inline.news-sentiment--bullish { background: rgba(24,128,56,0.09);   color: #188038; }
.news-card__sent-inline.news-sentiment--bearish { background: rgba(217,48,37,0.08);   color: #d93025; }
.news-card__sent-inline.news-sentiment--neutral { background: rgba(102,102,102,0.07); color: #999;    }

/* ── Title — plain h3, no <a> wrapper ── */
.news-card__title {
  font-size: 0.91rem; font-weight: 600; color: #1a2a2e;
  line-height: 1.46; margin: 0; display: block;
  overflow: hidden; max-height: calc(1.46em * 2); word-break: break-word;
}

/* ── Bottom row ── */
.news-card__bottom-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }

.news-card__details-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.69rem; font-weight: 600; color: #548C92;
  background: rgba(84,140,146,0.07); border: 1px solid rgba(84,140,146,0.18);
  border-radius: 999px; padding: 3px 11px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s; line-height: 1;
}
.news-card__details-btn i { font-size: 0.57rem; transition: transform 0.22s ease; }
.news-card__details-btn.is-open i { transform: rotate(180deg); }
.news-card__details-btn:hover,
.news-card__details-btn.is-open { background: #548C92; color: #fff; border-color: #548C92; }

.news-card__open-link {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(84,140,146,0.07); border: 1px solid rgba(84,140,146,0.15);
  color: #548C92; font-size: 0.62rem;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.news-card__open-link:hover { background: #548C92; color: #fff !important; border-color: #548C92; }

/* ── Drawer ── */
.news-card__drawer { overflow: hidden; max-height: 0; opacity: 0; transition: max-height 0.30s ease, opacity 0.22s ease; }
.news-card__drawer.is-open { max-height: 280px; opacity: 1; }

.news-card__snippet { font-size: 0.80rem; color: #4e5e62; line-height: 1.58; margin: 8px 0; word-break: break-word; }

.news-card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.news-tag { font-size: 0.63rem; padding: 2px 8px; border-radius: 999px; background: rgba(40,82,96,0.05); color: #7a9aa0; font-weight: 600; }

.news-card__read-more {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.71rem; font-weight: 700; color: #fff !important;
  background: #548C92; border-radius: 999px; padding: 6px 16px;
  text-decoration: none !important; transition: background 0.15s, transform 0.12s;
}
.news-card__read-more:hover { background: #285260 !important; transform: translateY(-1px); }
.news-card__read-more i { font-size: 0.62rem; }

/* Hide legacy */
.news-card__footer       { display: none !important; }
.news-sentiment          { display: none !important; }
.news-card__snippet-wrap { display: none !important; }
.news-card__expand-btn   { display: none !important; }

/* ── AlphaAI Summary Box ── */
.aai-card {
  flex-shrink: 0;
  background: #fafcfc;
  border: 1px solid rgba(84,140,146,0.18);
  border-top: 2px solid #548C92;
  border-left: 3px solid #548C92;
  border-radius: 0 14px 14px 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(40,82,96,0.06);
}

.aai-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.aai-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aai-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(84,140,146,0.08);
  border: 1px solid rgba(84,140,146,0.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.aai-icon svg { width: 16px; height: 16px; }

.aai-name-row {
  display: flex; flex-direction: column; gap: 2px;
}

.aai-name {
  font-size: 0.88rem; font-weight: 700;
  color: #1a2a2e;
  display: flex; align-items: center; gap: 7px;
}

.aai-pill {
  display: inline-flex; align-items: center;
  background: rgba(84,140,146,0.10);
  border: 1px solid rgba(84,140,146,0.25);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.05em; color: #548C92;
}

.aai-label {
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #aabcc0;
}

.aai-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, #548C92, #285260);
  color: #fff;
  border: none; border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.74rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: opacity 0.18s, transform 0.12s;
  outline: none;
}
.aai-btn i { font-size: 0.72rem; }
.aai-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.aai-btn:active { transform: translateY(0); }
.aai-btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.aai-divider {
  border: none;
  border-top: 1px solid rgba(84,140,146,0.10);
  margin: 12px 0;
}

/* Idle */
.aai-body-idle { display: flex; align-items: center; gap: 8px; }
.aai-idle-icon { font-size: 0.78rem; color: #548C92; flex-shrink: 0; }
.aai-idle-text { font-size: 0.78rem; color: #aabcc0; }

/* Loading */
.aai-body-loading { display: flex; align-items: center; gap: 5px; }
.aai-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #548C92;
  animation: aai-bounce 1.1s infinite ease-in-out both;
}
.aai-dot:nth-child(2) { animation-delay: 0.16s; }
.aai-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes aai-bounce {
  0%,80%,100% { transform: scale(0.7); opacity: 0.35; }
  40%          { transform: scale(1.1); opacity: 1; }
}
.aai-loading-text { font-size: 0.76rem; color: #b0bec5; margin-left: 4px; }

/* Result */
.aai-result-text {
  font-size: 0.82rem; line-height: 1.68;
  color: #3a4e55; margin: 0;
}

/* AI summary inline highlights */
.aai-hl-bold { font-weight: 700; color: #243b42; }
.aai-hl-down { font-weight: 700; color: #d93025; }
.aai-hl-up   { font-weight: 700; color: #188038; }

.aai-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.aai-tag {
  font-size: 0.62rem; font-weight: 600; color: #548C92;
  background: rgba(84,140,146,0.08);
  border: 1px solid rgba(84,140,146,0.18);
  border-radius: 999px; padding: 2px 9px;
}

.aai-footer-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(84,140,146,0.10);
}
.aai-footer-label {
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: #aabcc0;
}
.aai-sentiment { display: flex; align-items: center; gap: 6px; }
.aai-sent-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.aai-sent-text { font-size: 0.72rem; font-weight: 700; }
.aai-sent-dot.bullish  { background: #188038; }
.aai-sent-text.bullish { color: #188038; }
.aai-sent-dot.bearish  { background: #d93025; }
.aai-sent-text.bearish { color: #d93025; }
.aai-sent-dot.neutral  { background: #888; }
.aai-sent-text.neutral { color: #888; }

/* Mobile */
@media (max-width: 768px) {
  .aai-card { padding: 12px 13px; border-radius: 12px; }
  .aai-name { font-size: 0.82rem; }
  .aai-btn { padding: 6px 13px; font-size: 0.70rem; }
  .aai-icon { width: 30px; height: 30px; border-radius: 8px; }
  .aai-icon svg { width: 14px; height: 14px; }
}

/* ── Empty state ── */
.news-empty {
  flex: 1; border-radius: 18px; border: 1px dashed rgba(172,144,114,0.4);
  background: rgba(180,215,216,0.07); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 22px; text-align: center; gap: 10px;
}
.news-empty i { font-size: 1.6rem; color: #548C92; }
.news-empty p { font-size: 0.9rem; color: #BDC3C7; }

/* ── Loading ── */
.news-loading { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: #BDC3C7; padding: 20px 4px; }
.news-loading-dot { width: 8px; height: 8px; border-radius: 50%; background: #548C92; animation: news-pulse 0.9s infinite ease-in-out; }
@keyframes news-pulse {
  0%   { transform: scale(0.9); opacity: 0.5; }
  50%  { transform: scale(1.2); opacity: 1;   }
  100% { transform: scale(0.9); opacity: 0.5; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  body .contenido.contenido-news {
    position: fixed !important;
    top: 120px; left: 0; right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom));
    margin: 0; padding: 0; width: 100%; max-width: 100vw; transform: none;
    display: flex; flex-direction: column; overflow: hidden;
  }
  .news-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 12px; gap: 0; overflow: hidden; }
  .news-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .news-list-wrapper { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .news-feed { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .news-company-logo-wrap { width: 42px; height: 42px; border-radius: 11px; }
  .news-company-logo-fallback { font-size: 18px; }
  .news-card { gap: 10px; padding: 12px 13px; border-radius: 12px; }
  .news-card__logo,
  .news-card__logo-fallback { width: 32px !important; height: 32px !important; border-radius: 8px; }
  .news-card__title { font-size: 0.85rem; }
}

/* =============================================
   AI TRIAL BANNER — PREMIUM LOCK (News)
   Replicado del lock del AI Analysis en busqueda.css
   ============================================= */
:root {
  --gold-a:    #B68A3A;
  --gold-b:    #D2B25F;
  --gold-c:    #E8C97A;
  --gold-glow: rgba(182, 138, 58, 0.22);
  --gold-bg:   rgba(182, 138, 58, 0.07);
  --gold-border: rgba(182, 138, 58, 0.35);
}

#newsAiLockMessage.ai-lock-message { display: none; max-width: 420px; }

.ai-trial-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(182,138,58,0.10) 0%, rgba(210,178,95,0.05) 100%);
  border: 1px solid var(--gold-border);
  box-shadow: 0 2px 14px var(--gold-glow);
  position: relative;
  overflow: hidden;
  animation: trialBannerIn 0.35s ease both;
}
@keyframes trialBannerIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-trial-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,220,130,0.12) 50%, transparent 65%);
  background-size: 200% 100%;
  animation: trialShimmer 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes trialShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.ai-trial-banner__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.ai-trial-banner__headline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-a);
}
.ai-trial-banner__sub {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-trial-banner__btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--gold-a);
  background: linear-gradient(135deg, var(--gold-a) 0%, var(--gold-b) 100%);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 10px var(--gold-glow), 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.ai-trial-banner__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(182,138,58,0.35), 0 2px 6px rgba(0,0,0,0.10);
  filter: brightness(1.08);
}
.ai-trial-banner__btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px var(--gold-glow);
}
@media (max-width: 500px) {
  .ai-trial-banner { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .ai-trial-banner__sub { white-space: normal; }
  .ai-trial-banner__btn { width: 100%; text-align: center; }
}
