/* ═══════════════════════════════════════════════════════════════════
   VIVEBUCEO — header.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── HEADER BASE ─────────────────────────────────────────────────── */
#vb-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 9999;
  height: var(--vb-header-height);
  display: flex; align-items: center;
  transition: background 0.35s ease, box-shadow 0.35s ease, height 0.35s ease;
  /* Crítico: permitir que los submenús se vean fuera del header */
  overflow: visible;
}

/* El inner también debe permitir overflow para los submenús */
.vb-header-inner {
  overflow: visible;
}

#vb-header.is-transparent { background: transparent; }

#vb-header.is-scrolled {
  background: rgba(4,30,46,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  height: 60px;
}

#vb-header.is-solid {
  background: var(--vb-deep);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* Gradient sobre el hero */
#vb-header.is-transparent::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(4,30,46,0.55) 0%, transparent 100%);
  z-index: -1; pointer-events: none;
}

/* ── INNER ───────────────────────────────────────────────────────── */
.vb-header-inner {
  width: 100%;
  max-width: var(--vb-max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  overflow: visible; /* necesario para que los submenús sean visibles */
  position: relative;
}

/* ── LOGO ────────────────────────────────────────────────────────── */
.vb-logo { flex-shrink: 0; }
.vb-logo img { height: 44px; width: auto; display: block; transition: height 0.35s ease; }
#vb-header.is-scrolled .vb-logo img { height: 36px; }

/* ── NAV DESKTOP ─────────────────────────────────────────────────── */
.vb-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
  list-style: none;
  margin: 0; padding: 0;
}

.vb-nav > li {
  list-style: none;
  position: relative;
  /* Crea zona de hover continua entre el link y el submenú */
  padding-bottom: 10px;
  margin-bottom: -10px;
}

.vb-nav > li > a {
  display: flex; align-items: center; gap: 4px;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 13.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  position: relative;
}

.vb-nav > li > a:hover {
  color: #1ab3c8;
  background: rgba(255,255,255,0.07);
}

.vb-nav > li.current-menu-item > a,
.vb-nav > li.current-menu-parent > a,
.vb-nav > li.current-menu-ancestor > a { color: #1ab3c8; }

/* ── SUBMENÚS PC ─────────────────────────────────────────────────── */
.vb-nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #041e2e;
  border-top: 2px solid #1ab3c8;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  list-style: none;
  padding: 6px 0;
  margin: 0;
  z-index: 99999;
  /* CSS hover como base — funciona aunque el JS cargue tarde */
  display: none;
}

/* CSS puro: hover en li muestra el sub-menu directo */
.vb-nav > li.menu-item-has-children:hover > .sub-menu {
  display: block;
}

/* Sub-submenú: a la derecha */
.vb-nav .sub-menu li.menu-item-has-children {
  position: relative;
}
.vb-nav .sub-menu li.menu-item-has-children > .sub-menu {
  top: 0;
  left: 100%;
  border-top: none;
  border-left: 2px solid #1ab3c8;
  border-radius: 0 10px 10px 10px;
}
.vb-nav .sub-menu li.menu-item-has-children:hover > .sub-menu {
  display: block;
}

/* JS también puede añadir is-open para control adicional */
.vb-nav .sub-menu.is-open { display: block; }

.vb-nav .sub-menu li { list-style: none; }
.vb-nav .sub-menu a {
  display: block;
  padding: 10px 18px;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  text-transform: none; letter-spacing: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.vb-nav .sub-menu li:last-child a { border-bottom: none; }
.vb-nav .sub-menu a:hover { color: #1ab3c8; background: rgba(255,255,255,0.05); }

/* Flecha en ítems con hijos */
.vb-nav .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-left: 4px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.vb-nav .menu-item-has-children:hover > a::after { transform: rotate(180deg); }

/* ── CTA en nav ──────────────────────────────────────────────────── */
.vb-nav .menu-item-cta > a {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 100px !important;
  padding: 8px 20px !important;
  color: rgba(255,255,255,0.95) !important;
}
.vb-nav .menu-item-cta > a:hover {
  background: #ffffff !important;
  color: #041e2e !important;
  border-color: #ffffff !important;
}

/* ── HAMBURGUESA ─────────────────────────────────────────────────── */
.vb-burger {
  display: none;
  flex-direction: column; gap: 5px;
  background: transparent; border: none;
  cursor: pointer; padding: 6px;
  z-index: 10000;
}
.vb-burger span {
  display: block;
  width: 24px; height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.vb-burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.vb-burger.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.vb-burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MENÚ MÓVIL OVERLAY ──────────────────────────────────────────── */
#vb-mob-nav {
  position: fixed;
  inset: 0;
  background: rgba(4,30,46,0.98);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 72px;
  overflow-y: auto;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  scrollbar-width: none;
}
#vb-mob-nav::-webkit-scrollbar { display: none; }
#vb-mob-nav.is-open { opacity: 1; pointer-events: auto; }

#vb-mob-close {
  position: fixed;
  top: 16px; right: 20px;
  background: none; border: none;
  color: #fff; cursor: pointer;
  z-index: 10000;
  padding: 8px;
  opacity: 0.8;
}
#vb-mob-close:hover { opacity: 1; }

.vb-mob-nav-inner {
  width: 100%;
  max-width: 360px;
  padding: 0 24px 40px;
  list-style: none;
  margin: 0;
}

/* Todos los li del menú móvil */
.vb-mob-nav-inner li { list-style: none; }

/* Links de primer nivel en móvil */
.vb-mob-nav-inner > li > a {
  display: block;
  text-align: center;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 20px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: color 0.2s;
}
.vb-mob-nav-inner > li > a:hover { color: #1ab3c8; }
.vb-mob-nav-inner > li.current-menu-item > a { color: #1ab3c8; }

/* Submenús en móvil — ocultos por defecto */
.vb-mob-nav-inner .sub-menu {
  display: none;
  list-style: none;
  padding: 0;
  background: rgba(255,255,255,0.04);
  border-radius: 0 0 8px 8px;
  margin-bottom: 4px;
}
.vb-mob-nav-inner .sub-menu.is-open { display: block; }

.vb-mob-nav-inner .sub-menu li a {
  display: block;
  text-align: center;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 15px; font-weight: 500;
  text-transform: none; letter-spacing: 0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: color 0.2s;
}
.vb-mob-nav-inner .sub-menu li:last-child a { border-bottom: none; }
.vb-mob-nav-inner .sub-menu li a:hover { color: #1ab3c8; }

/* Botón toggle submenú */
.vb-sub-toggle {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 8px 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}
.vb-sub-toggle:hover,
.vb-sub-toggle.is-open { color: #1ab3c8; background: rgba(26,179,200,0.05); }
.vb-sub-toggle svg { transition: transform 0.2s; }
.vb-sub-toggle.is-open svg { transform: rotate(180deg); }

/* CTA en móvil */
.vb-mob-nav-inner .menu-item-cta {
  margin-top: 24px;
  text-align: center;
}
.vb-mob-nav-inner .menu-item-cta > a {
  display: inline-block;
  background: #1ab3c8;
  color: #ffffff;
  border-radius: 100px;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: none;
  text-transform: uppercase;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .vb-nav { display: none; }
  .vb-burger { display: flex; }
  .vb-header-inner { padding: 0 20px; }

  /* Móvil transparente: absolute sobre el hero */
  #vb-header.is-transparent,
  #vb-header.is-transparent.is-scrolled {
    position: absolute;
    background: transparent;
    box-shadow: none;
    height: var(--vb-header-height);
  }

  /* Móvil sólido: relative, fluye en el documento */
  #vb-header.is-solid {
    position: relative;
    background: var(--vb-deep);
  }
}

@media (max-width: 600px) {
  .vb-logo img { height: 34px; }
}
