/* =========================================================
   WCH Header — estilos del widget
   Prefijo: .wch-header (evita choques con la clase "header" del contenedor)
   ========================================================= */

.wch-header,
.wch-header *,
.wch-header *::before,
.wch-header *::after { box-sizing: border-box; }

.wch-header ul { list-style: none; margin: 0; padding: 0; }
.wch-header li { margin: 0; padding: 0; }
.wch-header a { text-decoration: none; }
.wch-header button { font-family: inherit; cursor: pointer; }

/* ---------- Header principal ---------- */
.wch-header {
  position: fixed;
  top: 14px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1000;
  padding: 0 20px;
}

.wch-header__container {
  position: relative;
  width: 100%;
  max-width: 1224px;
  height: 60px;
  border-radius: 50px;
  background: #D9D9D933;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #fff;
}

/* ---------- Logo ---------- */
.wch-header__logo {
  display: flex;
  align-items: center;
  max-width: 191px;
  height: 32px;
  color: #fff;
}

.wch-header__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.wch-header__logo-text {
  font-weight: 700;
  font-size: 16px;
  color: inherit;
  white-space: nowrap;
}

/* ---------- Menú ---------- */
.wch-header__nav {
  display: flex;
  justify-content: center;
}

.wch-header__menu {
  display: flex;
  align-items: center;
  gap: var(--wch-menu-gap, 24px);
}

.wch-header__menu-item { position: relative; }

.wch-header__menu-item > a,
.wch-header__menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  line-height: 100%;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 0;
  position: relative;
  transition: opacity .2s ease;
}

/* Evita estilos de botón del tema (hover/focus) */
.wch-header__menu-toggle:hover,
.wch-header__menu-toggle:focus,
.wch-header__burger:hover,
.wch-header__burger:focus {
  background: none;
  box-shadow: none;
}

.wch-header__menu-item > a:hover,
.wch-header__menu-toggle:hover { opacity: .75; }

.wch-header__menu-item > a::after,
.wch-header__menu-toggle::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: #FFF;
  transition: width .3s ease;
}
.wch-header__menu-item > a:hover::after,
.wch-header__menu-toggle:hover::after { width: 100%; }

.wch-header__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  transition: transform .3s ease;
}

.wch-header__chevron svg,
.wch-header__chevron i {
  width: 1em;
  height: 1em;
  font-size: inherit;
  fill: currentColor;
}

.wch-header__menu-item--has-submenu.is-open .wch-header__chevron {
  transform: rotate(180deg);
}

.wch-header__empty { font-size: 12px; opacity: .7; }

/* ---------- Submenú (4 columnas desktop) ---------- */
.wch-header__submenu {
  position: fixed;
  top: calc(100% - 2px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(calc(100vw - 40px), 1224px);
  min-height: 123px;
  padding: 22px 40px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  background: linear-gradient(164.61deg, rgba(1, 32, 63, 0.9) 42.71%, rgba(3, 84, 165, 0) 88.32%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
  z-index: 999;
  display: flex;
  align-items: center;
}

.wch-header__menu-item--has-submenu.is-open .wch-header__submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.wch-header__submenu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 32px;
  align-content: center;
  width: 100%;
}

.wch-header__submenu-grid a {
  display: block;
  color: #FFFFFF;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.5px;
  padding: 6px 0;
  transition: color .2s ease, transform .2s ease;
}

.wch-header__submenu-grid a:hover {
  color: #7fc3ff;
  transform: translateX(3px);
}

/* ---------- Columna botón ---------- */
.wch-header__actions {
  display: flex;
  justify-content: flex-end;
}

.wch-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 50px;
  background-color: #0665E8;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0px 4px 12px 0px #EA461325;
}

.wch-header__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.15);
}

/* ---------- Burger (oculto en desktop) ---------- */
.wch-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px;
}

.wch-header__mobile-actions,
.wch-header__mobile-footer,
.wch-header__mobile-logo { display: none; }

.wch-header__burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}

.wch-header__burger span:nth-child(2) { width: 65%; }

.wch-header__burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.wch-header__burger.is-active span:nth-child(2) { opacity: 0; }
.wch-header__burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .wch-header__container {
    padding: 0 20px;
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .wch-header { padding: 0 12px; }

  .wch-header__container {
    grid-template-columns: 1fr auto;
    padding: 0 20px;
  }

  .wch-header__burger { display: flex; }

  /* !important: el control "Desenfoque" de Elementor genera una regla más específica
     y, si el blur sigue activo, el menú fixed se ancla a la barra y deja márgenes. */
  .wch-header__container:has(.wch-header__nav.is-open) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Panel: ancho completo, alto según el contenido.
     Todos los bloques comparten la misma separación (--wch-mobile-gap). */
  .wch-header__nav {
    --wch-mobile-bg: rgba(1, 20, 40, 0.96);
    --wch-mobile-gap: 20px;
    --wch-mobile-radius: 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: auto;
    max-height: 100vh;
    max-height: 100dvh;
    background: var(--wch-mobile-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 0 0 var(--wch-mobile-radius) var(--wch-mobile-radius);
    padding: 90px 28px 28px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: var(--wch-mobile-gap);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .35s ease, visibility .35s ease;
    z-index: 900;
    overflow-y: auto;
  }

  /* Área de los enlaces del submenú: fila completa */
  .wch-mobile-sw-full .wch-header__submenu-grid {
    justify-items: stretch;
  }

  /* Área del ítem = ancho del texto (opción "Solo el ancho del texto") */
  .wch-mobile-w-text .wch-header__menu-item > a,
  .wch-mobile-w-text .wch-header__menu-toggle {
    width: auto;
  }

  /* Menú centrado verticalmente (opción "Centro de la pantalla") */
  .wch-mobile-v-center .wch-header__nav {
    top: 50%;
    transform: translateY(-50%);
    padding: 28px;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    border-radius: var(--wch-mobile-radius);
  }

  /* Menú a pantalla completa (va después de la regla anterior para tener prioridad) */
  .wch-mobile-s-full .wch-header__nav {
    top: 0;
    bottom: 0;
    transform: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding: 100px 28px 40px;
    border-radius: 0;
  }

  .wch-mobile-s-full.wch-mobile-v-center .wch-header__nav {
    justify-content: center;
  }

  .wch-header__mobile-logo {
    display: flex;
    align-self: center;
    justify-content: center;
    width: 160px;
    height: 28px;
    flex-shrink: 0;
    color: #fff;
  }

  .wch-header__mobile-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .wch-header__nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .wch-header__menu {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--wch-mobile-menu-gap, var(--wch-mobile-gap));
    width: 100%;
  }

  .wch-header__menu-item {
    width: 100%;
    text-align: left;
  }

  .wch-header__menu-item > a,
  .wch-header__menu-toggle {
    font-size: 16px;
    padding: 10px 0;
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  /* Submenú mobile: lista colapsable */
  .wch-header__submenu {
    position: static;
    transform: none;
    width: 100% !important;
    max-width: 100%;
    min-height: 0 !important;
    padding: 0;
    border-radius: 0;
    background: transparent !important;
    background-image: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    margin-top: 0;
    display: block;

    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity .3s ease, max-height .35s ease, visibility .3s, padding .3s ease;
  }

  .wch-header__menu-item--has-submenu.is-open .wch-header__submenu {
    transform: none;
    opacity: 1;
    visibility: visible;
    max-height: 800px;
    padding: 0;
    margin-top: var(--wch-mobile-submenu-offset, var(--wch-mobile-gap));
  }

  .wch-header__submenu-grid {
    grid-template-columns: 1fr;
    gap: var(--wch-mobile-submenu-gap, var(--wch-mobile-gap));
    justify-items: start;
  }

  .wch-header__submenu-grid a {
    font-size: 14px;
    padding: 6px 0;
    text-align: left;
  }

  .wch-header__actions { display: none; }

  .wch-header__mobile-actions {
    display: flex;
    justify-content: flex-start;
    width: 100%;
  }

  .wch-header__mobile-footer {
    display: block;
    width: 100%;
    padding-top: var(--wch-mobile-gap);
    border-top: 2px solid #fff;
    text-align: center;
  }

  .wch-header__mobile-footer p {
    margin: 0;
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
  }

  .wch-header__social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--wch-mobile-gap);
    margin-top: var(--wch-mobile-gap);
  }

  .wch-header__social-links a {
    display: flex;
    color: #fff;
    font-size: 22px;
    line-height: 1;
  }

  .wch-header__social-links svg,
  .wch-header__social-links i {
    width: 1em;
    height: 1em;
    font-size: inherit;
    fill: currentColor;
  }

  .wch-header__burger {
    position: fixed;
    top: 10px;
    right: 32px;
    height: auto;
    z-index: 1001;
    background: transparent;
  }

  .wch-header__logo {
    max-width: 160px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .wch-header__container { padding: 0 16px; }
  .wch-header__logo { max-width: 140px; }
  .wch-header__burger { right: 28px; }
}
