/* =============================================
   TST HEADER v5.1 — Design System v5
   ============================================= */

:root {
  --tst-brand:       #305180;
  --tst-brand-dark:  #1E3A5F;
  --tst-brand-mid:   #254368;
  --tst-lime:        #E1FA59;
  --tst-lime-dark:   #B8CC30;
  --tst-live:        #E63946;
  --tst-wta:         #6A4C93;
  --tst-wta-light:   #C9B0E8;
  --tst-off-white:   #F7F6F2;
  --tst-ink-10:      #E4E3DC;
  --font-main:       'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
}

/* ── RESET ── */
.tst-header, .tst-header *,
.tst-mob-bar, .tst-mob-bar *,
.tst-mob-ham-drawer, .tst-mob-ham-drawer * {
  box-sizing: border-box; margin: 0; padding: 0;
  font-family: var(--font-main);
}

/* Neutralizar Elementor */
.elementor-widget-shortcode .elementor-widget-container { padding: 0 !important; }

/* ── HEADER SHELL ── */
.tst-header {
  background: var(--tst-brand-dark);
  width: 100%; display: block;
  position: sticky; top: 0; z-index: 99999;
}

/* ── INNER ── */
.tst-inner {
  width: 100%; max-width: 1400px;
  margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; height: 100%;
}

/* ══════════════════════════════════════════
   TICKER
══════════════════════════════════════════ */
.tst-ticker {
  background: #131c32; height: 30px; overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.tst-ticker-live {
  display: flex; align-items: center; gap: 7px;
  padding-right: 18px; border-right: 1px solid rgba(255,255,255,.09);
  flex-shrink: 0; height: 100%;
}
.tst-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--tst-live); flex-shrink: 0;
  animation: tst-blink 1.2s ease-in-out infinite;
}
@keyframes tst-blink { 0%,100%{opacity:1} 50%{opacity:.15} }
.tst-live-label {
  font-size: 9px; font-weight: 800; letter-spacing: .12em;
  color: var(--tst-live); text-transform: uppercase; white-space: nowrap;
}
.tst-ticker-track { flex: 1; overflow: hidden; padding-left: 18px; }
.tst-ticker-inner {
  display: flex; white-space: nowrap;
  animation: tst-scroll 36s linear infinite;
}
.tst-ticker-inner:hover { animation-play-state: paused; }
@keyframes tst-scroll { from{transform:translateX(0)} to{transform:translateX(-50%)} }
.tst-ticker-seg { font-size: 11px; color: rgba(200,215,240,.5); flex-shrink: 0; }
.tst-ticker-sep { font-size: 11px; color: rgba(255,255,255,.14); flex-shrink: 0; padding: 0 16px; }

/* ══════════════════════════════════════════
   MAIN NAV
══════════════════════════════════════════ */
.tst-nav {
  height: 60px; background: var(--tst-brand-dark);
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: relative;
}

/* ── Logo ── */
.tst-logo-zone {
  display: flex; align-items: center; text-decoration: none;
  flex-shrink: 0; padding-right: 24px;
  border-right: 1px solid rgba(255,255,255,.08);
  height: 100%;
}
.tst-logo-img {
  display: block; height: auto; max-height: 36px;
  width: auto; object-fit: contain;
}

/* ── Nav links (desktop ATP/WTA) ── */
.tst-nav-links {
  display: flex; align-items: stretch;
  flex: 1; height: 100%; padding-left: 24px;
}

/* ── Nav group (dropdown container) ── */
.tst-nav-group { position: relative; display: flex; align-items: stretch; }

/* ── Pill button (ATP / WTA) — hover en desktop ── */
.tst-nav-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 100%;
  border: none; background: none; cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: border-color 200ms, background 150ms;
}
/* Estado hover / open: solo borde inferior, SIN fondo rojo */
.tst-nav-pill--atp:hover,
.tst-nav-pill--atp.open { border-bottom-color: var(--tst-lime); background: rgba(255,255,255,.04); }
.tst-nav-pill--wta:hover,
.tst-nav-pill--wta.open { border-bottom-color: var(--tst-wta-light); background: rgba(255,255,255,.04); }

.tst-pill-logo { display: block; height: auto; object-fit: contain; }
.tst-atp-logo  { height: 20px; }
.tst-wta-logo  { height: 17px; filter: brightness(0) invert(1) opacity(.85); }

.tst-pill-chevron {
  color: rgba(255,255,255,.4);
  transition: transform 200ms, color 150ms;
  flex-shrink: 0;
}
.tst-nav-pill:hover .tst-pill-chevron,
.tst-nav-pill.open  .tst-pill-chevron { color: rgba(255,255,255,.8); }
.tst-nav-pill.open  .tst-pill-chevron { transform: rotate(180deg); }

/* ── Dropdown ── */
.tst-dropdown {
  display: none; position: absolute; top: 60px; left: 0;
  background: #fff; min-width: 200px;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
  border-top: 3px solid; z-index: 99999; overflow: hidden;
}
.tst-dropdown.open { display: block; }
.tst-dropdown--atp { border-top-color: var(--tst-lime); }
.tst-dropdown--wta { border-top-color: var(--tst-wta); }
.tst-dropdown--ham { border-top-color: var(--tst-lime); left: auto; right: 0; min-width: 180px; }

.tst-dd-link {
  display: block; padding: 13px 18px;
  font-size: 13px; font-weight: 500; color: #1A1A1A;
  text-decoration: none; border-bottom: .5px solid var(--tst-ink-10);
  transition: background 120ms, padding-left 120ms;
}
.tst-dd-link:last-child { border-bottom: none; }
.tst-dd-link:hover { background: var(--tst-off-white); padding-left: 22px; }

/* ── Nav right ── */
.tst-nav-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; margin-left: auto; padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.07); height: 100%;
}

/* ── Links institucionales (desktop, reemplazan el ham oculto) ── */
.tst-inst-links {
  display: flex; align-items: center; gap: 4px;
}
.tst-inst-link,
.tst-inst-link:link,
.tst-inst-link:visited {
  font-size: 12px; font-weight: 600;
  color: rgba(220,232,255,.65) !important; text-decoration: none !important;
  padding: 4px 10px; border-radius: var(--radius-sm);
  transition: color 150ms, background 150ms;
  white-space: nowrap; background: transparent !important;
}
.tst-inst-link:hover { color: rgba(255,255,255,.95) !important; background: rgba(255,255,255,.07) !important; }

/* ── Iconos sociales más grandes ── */
.tst-soc {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: rgba(220,232,255,.75); flex-shrink: 0;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.tst-soc:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); color: #fff; }
.tst-soc svg { width: 16px; height: 16px; }

/* ── Hamburger button — solo en desktop para links extra si hay muchos ── */
.tst-hamburger {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 36px; height: 36px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md); cursor: pointer;
  transition: background 150ms;
}
.tst-hamburger:hover { background: rgba(255,255,255,.12); }
.tst-hamburger span {
  display: block; width: 16px; height: 1.5px;
  background: rgba(220,232,255,.8); border-radius: 2px;
  transition: transform .2s, opacity .2s; transform-origin: center;
}
.tst-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.tst-hamburger.open span:nth-child(2) { opacity: 0; }
.tst-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.tst-ham-group { align-items: center; }

/* ══════════════════════════════════════════
   SUBNAV — con indicador de página activa
══════════════════════════════════════════ */
.tst-subnav {
  background: #162035; border-bottom: 1px solid rgba(255,255,255,.05); height: 34px;
}
.tst-sn {
  font-size: 11px; font-weight: 600; color: rgba(200,220,255,.55);
  padding: 0 13px; height: 34px; display: flex; align-items: center;
  text-decoration: none; white-space: nowrap; letter-spacing: .01em;
  border-bottom: 2px solid transparent; flex-shrink: 0;
  transition: color 150ms, border-color 150ms;
}
.tst-sn:hover { color: rgba(230,240,255,.85); border-bottom-color: rgba(255,255,255,.2); }

/* Activo: detectado por clase .tst-sn--active (se agrega via JS al cargar) */
.tst-sn--active {
  color: rgba(230,240,255,.95) !important;
  border-bottom-color: rgba(255,255,255,.5) !important;
}

.tst-sn--hot { color: var(--tst-lime) !important; font-weight: 700; }
.tst-sn--hot:hover { color: #f2ff80 !important; border-bottom-color: var(--tst-lime); }
.tst-sn--hot.tst-sn--active { border-bottom-color: var(--tst-lime) !important; }
.tst-sn--hot::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; margin-right: 6px;
  display: inline-block; flex-shrink: 0; vertical-align: middle;
}

/* ══════════════════════════════════════════
   MOBILE BOTTOM BAR — más visible
══════════════════════════════════════════ */
.tst-mob-bar {
  display: none;
  flex-direction: column;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 99998;
  background: var(--tst-brand-dark);
  border-top: 2px solid rgba(255,255,255,.18);
  box-shadow: 0 -4px 24px rgba(0,0,0,.45);
  transition: box-shadow 200ms;
}
.tst-mob-bar.scrolled {
  box-shadow: 0 -6px 36px rgba(0,0,0,.6);
}

/* Panel (submenú que sube desde la barra) */
.tst-mob-panel {
  display: none; background: var(--tst-brand-dark);
  border-top: .5px solid rgba(255,255,255,.12);
  padding-bottom: 2px;
}
.tst-mob-panel.open { display: block; }
.tst-mob-panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 8px; border-bottom: .5px solid rgba(255,255,255,.1);
}
.tst-mob-badge {
  font-size: 10px; font-weight: 900; padding: 2px 8px; border-radius: 3px;
}
.tst-mob-badge--atp { background: #fff; color: var(--tst-brand-dark); }
.tst-mob-badge--wta { background: var(--tst-wta); color: #fff; }
.tst-mob-panel-title {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.4); letter-spacing: .07em; text-transform: uppercase;
}
.tst-mob-panel-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; font-size: 14px; font-weight: 500; color: #fff;
  text-decoration: none; border-bottom: .5px solid rgba(255,255,255,.07);
  transition: background 120ms;
}
.tst-mob-panel-link:last-child { border-bottom: none; }
.tst-mob-panel-link:hover { background: rgba(255,255,255,.05); }
.tst-mob-panel-link span { color: rgba(255,255,255,.3); font-size: 16px; }

/* Tabs row — más altos y con label de texto */
.tst-mob-tabs { display: flex; }
.tst-mob-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 10px 8px 16px;
  border: none; background: none; cursor: pointer; position: relative;
  transition: background 150ms;
}
.tst-mob-tab--atp { border-right: .5px solid rgba(255,255,255,.12); }
.tst-mob-tab:hover { background: rgba(255,255,255,.06); }
.tst-mob-tab.open  { background: rgba(255,255,255,.08); }

/* Label debajo del logo — oculto en mobile */
.tst-mob-tab-label {
  display: none;
}

/* Indicador top */
.tst-mob-tab-dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 40px; height: 3px; border-radius: 0 0 3px 3px; opacity: 0;
  transition: opacity 200ms;
}
.tst-mob-tab.open .tst-mob-tab-dot { opacity: 1; }
.tst-mob-tab--atp .tst-mob-tab-dot { background: var(--tst-lime); }
.tst-mob-tab--wta .tst-mob-tab-dot { background: var(--tst-wta-light); }

/* Logos en tabs */
.tst-mob-tab-logo { height: 24px; width: auto; object-fit: contain; display: block; }
.tst-mob-atp-logo { filter: brightness(0) invert(1); }
.tst-mob-wta-logo { filter: brightness(0) invert(1) opacity(.85); }

/* Flecha */
.tst-mob-tab-arrow {
  color: rgba(255,255,255,.35);
  transition: transform 200ms, color 150ms;
}
.tst-mob-tab--atp .tst-mob-tab-arrow { color: rgba(225,250,89,.55); }
.tst-mob-tab--wta .tst-mob-tab-arrow { color: rgba(201,176,232,.55); }
.tst-mob-tab.open .tst-mob-tab-arrow { transform: rotate(180deg); }

/* ── Mobile ham drawer ── */
.tst-mob-ham-drawer {
  display: none; flex-direction: column;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 99997;
  background: var(--tst-brand-dark);
  border-top: 1px solid rgba(255,255,255,.12);
  transform: translateY(100%);
  transition: transform 260ms cubic-bezier(.4,0,.2,1);
}
.tst-mob-ham-drawer.open {
  transform: translateY(0);
}
.tst-mob-ham-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; font-size: 15px; font-weight: 600;
  color: rgba(255,255,255,.8); text-decoration: none;
  border-bottom: .5px solid rgba(255,255,255,.07);
  transition: background 120ms;
}
.tst-mob-ham-link:last-child { border-bottom: none; }
.tst-mob-ham-link:hover,
.tst-mob-ham-link:focus,
.tst-mob-ham-link.active { background: rgba(255,255,255,.05); color: var(--tst-lime); }
.tst-mob-ham-link span { opacity: .3; font-size: 18px; }

/* ══════════════════════════════════════════
   HOVER-OPEN en desktop — IDs específicos para
   máxima compatibilidad (sin :has, sin pointer:fine)
══════════════════════════════════════════ */
@media (hover: hover) {
  /* ATP */
  #tst-atp-group:hover > .tst-nav-pill--atp {
    border-bottom-color: var(--tst-lime);
    background: rgba(255,255,255,.04);
  }
  #tst-atp-group:hover > .tst-nav-pill--atp .tst-pill-chevron {
    color: rgba(255,255,255,.8);
    transform: rotate(180deg);
  }
  #tst-atp-group:hover > #tst-atp-menu { display: block; }

  /* WTA */
  #tst-wta-group:hover > .tst-nav-pill--wta {
    border-bottom-color: var(--tst-wta-light);
    background: rgba(255,255,255,.04);
  }
  #tst-wta-group:hover > .tst-nav-pill--wta .tst-pill-chevron {
    color: rgba(255,255,255,.8);
    transform: rotate(180deg);
  }
  #tst-wta-group:hover > #tst-wta-menu { display: block; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .tst-inner { padding: 0 20px; }
  .tst-nav-pill { padding: 0 12px; }
  .tst-logo-zone { padding-right: 16px; }
  .tst-nav-right { padding-left: 12px; gap: 6px; }
  .tst-inst-links { display: none !important; }
}

@media (min-width: 1025px) {
  .tst-ham-group { display: none !important; }
}

@media (max-width: 680px) {
  /* Top bar: logo centrado + hamburger derecha */
  .tst-nav { height: 52px; }
  .tst-nav .tst-inner {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    padding: 0 14px; gap: 0; align-items: center;
  }
  .tst-logo-zone {
    grid-column: 2; justify-content: center;
    border-right: none; padding-right: 0; height: auto;
  }
  .tst-logo-img { max-height: 30px; max-width: 150px; }
  /* Ocultar nav desktop */
  .tst-nav-links { display: none; }
  .tst-nav-right {
    grid-column: 3; justify-self: end;
    border-left: none; padding-left: 0; height: auto; gap: 0;
  }
  /* Ocultar social e inst-links en mobile */
  .tst-soc { display: none; }
  .tst-inst-links { display: none; }
  /* Mostrar bottom bar */
  .tst-mob-bar { display: flex; }
  /* Mostrar ham drawer */
  .tst-mob-ham-drawer { display: flex; }
  /* Padding bottom al body para que la bottom bar no tape contenido */
  body { padding-bottom: 80px; }
  /* Ticker más chico */
  .tst-ticker { height: 26px; }
  .tst-ticker-seg { font-size: 10px; }
  .tst-ticker-live { padding-right: 12px; }
  .tst-ticker-track { padding-left: 12px; }
  .tst-ticker .tst-inner { padding: 0 14px; }
  /* Subnav oculto en mobile */
  .tst-subnav { display: none; }
  /* Hamburger siempre visible en mobile */
  .tst-ham-group { display: flex !important; }
}

@media (max-width: 380px) {
  .tst-nav .tst-inner { padding: 0 10px; }
  .tst-logo-img { max-height: 26px; max-width: 120px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .tst-ticker-inner { animation: none !important; }
  .tst-live-dot     { animation: none !important; }
  .tst-dd-link, .tst-soc, .tst-nav-pill,
  .tst-mob-tab, .tst-mob-ham-drawer { transition: none !important; }
}
