/* =========================================================
HEADER FACTOR TELEVISIÓN — CSS (VERSIÓN FINAL)
========================================================= */

/* ---------- RESET ---------- */
body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  scroll-behavior: smooth;
}

/* ---------- CONTENEDOR PRINCIPAL DEL HEADER ---------- */
.ft-header {
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  position: relative;
  width: 100%;
  transition: box-shadow 0.3s ease;
  z-index: 9999; /* base */
}

.ft-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
}

/* ---------- BARRA SUPERIOR (HEADER MÓVIL) ---------- */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid #eee;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left img {
  height: 40px;
  cursor: pointer;
}

.header-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-date {
  font-size: 12px;
  color: #0070f3;
}

.header-title {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: 22px;
  letter-spacing: 0.4px;
  color: #111;
}

/* ---------- LOOP (TV / RADIO) ---------- */
.header-loop {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loop-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f7f9fc;
  border: 1px solid #cce3ff;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

.loop-dot {
  width: 8px;
  height: 8px;
  background: #0070f3;
  border-radius: 50%;
}

/* ---------- ACCIONES SUPERIORES ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.socials a {
  color: #111;
  text-decoration: none;
  font-size: 18px;
  transition: 0.2s;
}

.socials a:hover {
  color: #0070f3;
}

.icon-button {
  background: none;
  border: none;
  color: #0070f3;
  font-size: 20px;
  cursor: pointer;
  transition: 0.2s;
}

.icon-button:hover {
  color: #005ad1;
}

/* =========================================================
BARRA INFERIOR (HEADER DESKTOP + STICKY)
========================================================= */

.header-bottom {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 9998;
  transition: all 0.3s ease;
}

.header-bottom-inner {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 8px 24px;
  box-sizing: border-box;
}

.header-bottom.sticky .header-bottom-inner {
  grid-template-columns: auto 1fr auto;
}

/* Logo sticky (solo visible en sticky desktop) */
.logo-sticky {
  display: none;
  max-height: 38px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.header-bottom.sticky .logo-sticky {
  display: block;
  opacity: 1;
}

/* Categorías centradas */
.nav-categories {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-categories a {
  color: #111;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: 0.2s;
}

.nav-categories a:hover {
  color: #0070f3;
  background: #f3f8ff;
}

/* Acciones sticky desktop */
.sticky-actions {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

@media (min-width: 901px) {
  .header-bottom.sticky .sticky-actions {
    display: flex !important;
  }
}

/* ---------- STICKY HEADER ANIMATION ---------- */

.header-bottom.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
  animation: slideStickyIn 0.4s ease forwards;
}

@keyframes slideStickyIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ---------- ANIMACIÓN SALIDA SUAVE ---------- */
.header-bottom.returning {
  animation: slideStickyOutSoft 0.45s ease forwards;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.96);
}

@keyframes slideStickyOutSoft {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  60% {
    transform: translateY(8px);
    opacity: 0.95;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* =========================================================
BUSCADOR ANIMADO
========================================================= */

.search-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 120000 !important;
}

.search-overlay.active {
  display: block;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-overlay.active .search-backdrop {
  opacity: 1;
}

.search-bar {
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  animation: slideDown 0.4s ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  width: 90%;
  max-width: 900px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.search-box input {
  flex: 1;
  border: none;
  font-size: 16px;
  padding: 8px;
  outline: none;
}

.search-box button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
}

.search-box button i {
  color: #0070f3;
}

/* =========================================================
MENÚ FULLSCREEN (MÓVIL)
========================================================= */

.mobile-menu {
  position: fixed;
  inset: 0;
  background: #fff;
  display: none;
  z-index: 120001 !important;
}

.mobile-menu.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.mobile-menu-inner {
  width: 100%;
  max-width: 980px;
  padding: 24px;
  position: relative;
}

.mobile-menu-close {
  position: absolute;
  right: 26px;
  top: 22px;
  font-size: 26px;
  border: none;
  background: none;
  cursor: pointer;
}

.menu-title {
  font-weight: 800;
  font-size: 16px;
  color: #0070f3;
  text-transform: uppercase;
  margin: 12px 0 6px;
}

.mobile-menu-nav a {
  display: block;
  color: #111;
  text-decoration: none;
  font-weight: 700;
  padding: 14px 0;
  font-size: 18px;
}

.mobile-menu-nav hr {
  border: 0;
  border-top: 1px solid #eee;
}

/* =========================================================
RESPONSIVE — MÓVIL & DESKTOP
========================================================= */

@media (min-width: 901px) {
  .desktop-only { display: flex !important; }
  .mobile-only { display: none !important; }

  .header-top .icon-button.menu-toggle,
  .header-top .icon-button.search-toggle {
    display: inline-flex !important;
  }

  .header-bottom:not(.sticky) .icon-button.menu-toggle,
  .header-bottom:not(.sticky) .icon-button.search-toggle {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .nav-categories,
  .desktop-only,
  .header-bottom,
  .logo-sticky {
    display: none !important;
  }

  .header-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: all 0.3s ease;
  }

  body {
    padding-top: 72px;
  }

  body.scrolled .header-top {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 0.96);
  }

  .mobile-only {
    display: flex !important;
    gap: 12px;
    align-items: center;
  }

  .header-top .icon-button.menu-toggle,
  .header-top .icon-button.search-toggle {
    display: inline-block !important;
  }

  .sticky-actions {
    display: none !important;
  }
}

/* =========================================================
UTILIDAD
========================================================= */

body.ft-menu-open {
  overflow: hidden;
}

/* Ocultar título y fecha en móvil */
@media (max-width: 900px) {
  .header-date,
  .header-title {
    display: none !important;
  }
}

html {
  scroll-padding-top: 90px;
}

.ft-header img {
  user-select: none;
  -webkit-user-drag: none;
}

/* =========================================================
LIMPIEZA DE MENÚS WORDPRESS
========================================================= */

.nav-categories ul,
.nav-categories li,
.mobile-menu-nav ul,
.mobile-menu-nav li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nav-categories ul {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 22px !important;
  white-space: nowrap !important;
}

.mobile-menu-nav ul {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}

.nav-categories a,
.mobile-menu-nav a {
  color: #111 !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  transition: 0.2s !important;
  background: none !important;
}

.nav-categories a:hover,
.mobile-menu-nav a:hover {
  color: #0070f3 !important;
  background: #f3f8ff !important;
}

/* =========================================================
CORRECCIÓN DE CONTENEDOR ELEMENTOR
========================================================= */

#page, #masthead {
  margin: 0 !important;
  padding: 0 !important;
}

.elementor,
.elementor-section,
.e-con-boxed,
.e-con-inner {
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.ft-header {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  box-sizing: border-box !important;
}

html, body {
  overflow-x: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* =========================================================
FIX DEFINITIVO — HEADER SIEMPRE POR ENCIMA
========================================================= */

.ft-header {
  position: relative !important;
  z-index: 99999 !important;
  pointer-events: auto !important;
}
