/* ================= VARIABLES DE DISEÑO ================= */
:root {
  --primary-color: #00439c;
  --primary-hover: #003377;
  --primary-rgb: 0, 67, 156;
  --accent-blue: #0070d1;
  --accent-hover: #005bb5;
  --accent-rgb: 0, 112, 209;
  --text-dark: #14171a;
  --text-muted: #5e6670;
  --bg-white: #ffffff;
  --bg-light: #f6f8fb;
  --border-light: rgba(0, 0, 0, 0.08);
  
  /* Curvas de animación de alta gama (PlayStation / Apple style) */
  --ease-elastic: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  
  --shadow-mega: 0 24px 48px -12px rgba(0, 30, 80, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ================= RESET ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================= BARRA SUPERIOR NEGRA (WHITE STAR) ================= */
.ws-top-bar {
  background-color: #000000;
  height: 38px;
  width: 100%;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1001;
}

.ws-top-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.ws-top-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ws-top-link:hover {
  opacity: 0.85;
  transform: translateY(-0.5px);
}

.ws-top-logo {
  height: 20px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  display: block;
}

/* ================= HEADER Y NAVBAR ================= */
.ps-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.ps-header.scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(0, 30, 80, 0.07);
}

.main-nav {
  position: relative;
  z-index: 1001;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  height: 70px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1001;
}

/* Logo */
.logo-wrapper {
  display: flex;
  align-items: center;
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform var(--ease-smooth);
}

.brand-logo:hover {
  transform: scale(1.04);
}

.brand-logo img {
  height: 46px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 67, 156, 0.12));
}

/* Menú Desktop */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 6px;
  margin-left: 32px;
  flex: 1;
  height: 100%;
  align-items: center;
}

.nav-item {
  position: static;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-btn {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9999px;
  position: relative;
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
  user-select: none;
}

.nav-btn:hover,
.nav-item.active .nav-btn {
  color: var(--primary-color);
  background-color: rgba(var(--primary-rgb), 0.06);
}

.nav-btn:active {
  transform: scale(0.97);
}

/* Flecha rotatoria elástica (Chevron) */
.chevron {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 2px solid #5a6472;
  border-bottom: 2px solid #5a6472;
  transform: rotate(45deg);
  margin-bottom: 2px;
  transition: transform 0.35s var(--ease-elastic), border-color 0.25s ease;
}

.nav-item.active .chevron,
.nav-item:hover .chevron {
  transform: rotate(-135deg);
  border-color: var(--primary-color);
}

/* Botón Iniciar Sesión con destello cinemático */
.nav-actions-right {
  display: flex;
  align-items: center;
  z-index: 100;
}

.btn-signin {
  position: relative;
  background: linear-gradient(135deg, #0070d1 0%, #005bb5 100%);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  padding: 8px 24px;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.35);
  transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s ease;
  white-space: nowrap;
}

.btn-signin:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.45);
}

.btn-signin:active {
  transform: translateY(0) scale(0.97);
}

/* Destello de luz pasando por el botón */
.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-25deg);
  transition: none;
}

.btn-signin:hover .btn-shimmer {
  animation: buttonShine 0.85s ease-in-out;
}

@keyframes buttonShine {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* ================= MEGA MENÚ DESKTOP (ANIMACIONES TOP-TIER) ================= */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-mega);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.28s var(--ease-elastic),
              transform 0.28s var(--ease-elastic),
              visibility 0.28s;
  padding: 36px 0 28px;
  pointer-events: none;
  z-index: 995;
}

/* Puente invisible entre el botón del navbar y el mega menú para evitar pérdida de cursor */
.mega-menu::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  width: 100%;
  height: 14px;
  display: block;
  background: transparent;
}

.nav-item.active .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.mega-menu-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Fila Superior: Tarjetas Interactivas */
.mega-grid {
  display: flex;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}

.mega-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-dark);
  width: 136px;
  padding: 12px 8px;
  border-radius: 14px;
  text-align: center;
  opacity: 0;
  transform: translateY(18px);
  transition: transform 0.25s var(--ease-elastic), background-color 0.2s ease;
  position: relative;
}

/* Entrada escalonada con retraso proporcional */
.nav-item.active .mega-card {
  animation: cardFlyIn 0.42s var(--ease-elastic) forwards;
  animation-delay: calc(var(--i) * 50ms);
}

@keyframes cardFlyIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mega-card:hover {
  transform: translateY(-6px) scale(1.03) !important;
  background-color: rgba(var(--primary-rgb), 0.035);
}

/* Halo luminoso detrás del icono */
.icon-halo {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  margin-bottom: 12px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.06) 0%, transparent 70%);
  transition: transform 0.3s var(--ease-bounce), filter 0.3s ease, background 0.3s ease;
}

.mega-card:hover .icon-halo {
  transform: scale(1.12);
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.15) 0%, transparent 75%);
  filter: drop-shadow(0 8px 16px rgba(var(--primary-rgb), 0.2));
}



.mega-icon {
  width: 52px;
  height: 52px;
  transition: transform 0.3s var(--ease-elastic);
}

.badge-icon {
  border-radius: 16px;
  box-shadow: 0 6px 14px rgba(0, 67, 156, 0.18);
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s ease;
}

.mega-card:hover .badge-icon {
  transform: scale(1.08) rotate(-1deg);
  box-shadow: 0 10px 22px rgba(0, 67, 156, 0.3);
}

.card-label {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #20242a;
  transition: color 0.2s ease, transform 0.2s ease;
}

.mega-card:hover .card-label {
  color: var(--primary-color);
}

/* Fila Inferior: Enlaces Secundarios con barra de acento */
.mega-sublinks {
  border-top: 1px solid var(--border-light);
  margin-top: 28px;
  padding-top: 22px;
  display: flex;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(10px);
}

.nav-item.active .mega-sublinks {
  animation: sublinksSlideIn 0.38s var(--ease-elastic) forwards 0.18s;
}

@keyframes sublinksSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mega-sublinks a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding: 4px 2px;
  transition: color 0.2s ease;
}

.mega-sublinks a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 0%;
  height: 2px;
  border-radius: 2px;
  background-color: var(--primary-color);
  transform: translateX(-50%);
  transition: width 0.25s var(--ease-smooth);
}

.mega-sublinks a:hover {
  color: var(--primary-color);
}

.mega-sublinks a:hover::after {
  width: 100%;
}

/* Fondo oscurecido con Blur (Exclusivo para el cuerpo de la página, estrictamente debajo del header) */
.desktop-backdrop {
  position: fixed;
  top: 108px; /* Altura total del header: 38px (barra negra) + 70px (barra blanca) */
  left: 0;
  width: 100vw;
  height: calc(100vh - 108px);
  background-color: rgba(10, 20, 40, 0.45);
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  z-index: 900; /* Siempre inferior al header (1000) y al mega menú (995) */
  pointer-events: none;
}

.desktop-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ================= BOTÓN HAMBURGUESA ANIMADO ================= */
.mobile-actions-left {
  display: none;
}

.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.hamburger-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.hamburger-box {
  width: 22px;
  height: 18px;
  position: relative;
  display: block;
}

.hamburger-line {
  display: block;
  position: absolute;
  height: 2.2px;
  width: 100%;
  background-color: #1f1f1f;
  border-radius: 2px;
  transition: transform 0.3s var(--ease-elastic), opacity 0.2s ease, top 0.3s var(--ease-elastic);
}

.line-top { top: 0; }
.line-mid { top: 8px; }
.line-bot { top: 16px; }

/* Transformación en 'X' al abrir */
.hamburger-btn.is-active .line-top {
  top: 8px;
  transform: rotate(45deg);
}

.hamburger-btn.is-active .line-mid {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.is-active .line-bot {
  top: 8px;
  transform: rotate(-45deg);
}

/* ================= MENÚ LATERAL MÓVIL (DRAWER) ================= */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 20, 40, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
  z-index: 2000;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: -340px;
  width: 320px;
  height: 100vh;
  background-color: var(--bg-white);
  box-shadow: 6px 0 30px rgba(0, 20, 60, 0.18);
  display: flex;
  flex-direction: column;
  transition: transform 0.38s var(--ease-elastic);
  z-index: 2001;
}

.mobile-drawer.active {
  transform: translateX(340px);
}

.drawer-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--primary-color);
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: #555555;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.25s var(--ease-elastic), background-color 0.2s ease;
}

.drawer-close-btn:hover {
  transform: rotate(90deg);
  background-color: #f0f3f8;
}

.drawer-accordion {
  list-style: none;
  padding: 12px 0;
  overflow-y: auto;
  flex: 1;
}

.accordion-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.accordion-header {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 22px;
  font-size: 15.5px;
  font-weight: 600;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--text-dark);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.accordion-header:hover {
  background-color: rgba(var(--primary-rgb), 0.03);
  color: var(--primary-color);
}

.accordion-header .chevron {
  transition: transform 0.32s var(--ease-elastic), border-color 0.25s ease;
}

.accordion-item.open .accordion-header .chevron {
  transform: rotate(-135deg);
  border-color: var(--primary-color);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.38s var(--ease-elastic);
  background-color: #f9fbfd;
}

.accordion-links {
  list-style: none;
  padding: 6px 24px 18px;
}

.accordion-links li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 14.5px;
  color: #3b424d;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
}

.accordion-links li a:hover {
  color: var(--primary-color);
  transform: translateX(4px);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary-color);
  display: inline-block;
  opacity: 0.7;
}

.dot-accent {
  background-color: #ff3366;
}

.accordion-subhead {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #8c96a4;
  padding: 14px 0 4px;
  font-weight: 700;
}

.drawer-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--border-light);
  background-color: #ffffff;
}

.drawer-btn-signin {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, #0070d1 0%, #005bb5 100%);
  color: #ffffff;
  padding: 12px;
  border-radius: 9999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
  transition: transform 0.2s ease;
}

.drawer-btn-signin:active {
  transform: scale(0.97);
}

/* ================= ADAPTATIVO MÓVIL (≤ 992px) ================= */
@media (max-width: 992px) {
  .ws-top-bar {
    height: 32px;
  }

  .ws-top-container {
    padding: 0 16px;
  }

  .ws-top-logo {
    height: 18px;
  }

  .nav-menu,
  .desktop-backdrop {
    display: none !important;
  }

  .mobile-actions-left {
    display: flex;
    align-items: center;
  }

  .nav-container {
    padding: 0 16px;
    height: 62px;
  }

  .logo-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .brand-logo img {
    height: 40px;
  }

  .btn-signin {
    padding: 6px 18px;
    font-size: 12.5px;
  }
}

/* Mini badge para móvil */
.badge-mini {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, #0070d1, #00357a);
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0, 67, 156, 0.3);
}


