/* =========================
   VARIABLES DEL HEADER
   ========================= */

:root {
  --header-height: 96px;
  --header-background: #ffffff;
  --header-text: #1e293b;
  --header-muted: #64748b;
  --header-border: #e2e8f0;
  --header-overlay: rgba(11, 23, 39, 0.35);
}

/* Evita que el contenido quede debajo del header fijo */
html {
  scroll-padding-top: var(--header-height);
}

body.menu-open {
  overflow: hidden;
}

/* =========================
   ENLACE DE ACCESIBILIDAD
   ========================= */

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1rem;
  color: #ffffff;
  background-color: #0b1727;
  border-radius: 2px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* =========================
   HEADER GENERAL
   ========================= */

.header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  background-color: var(--header-background);
  border-bottom: 1px solid var(--header-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 2rem;
}

/* =========================
   LOGO
   ========================= */

.logo {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.logo a {
  display: inline-flex;
  align-items: center;
}

.logo img,
.logo .custom-logo {
  display: block;
  width: auto;
  max-width: 250px;
  height: 100px;
  object-fit: contain;
}

/*
WordPress puede envolver el logo dentro
de un enlace con la clase custom-logo-link.
*/
.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

/* =========================
   MENÚ DE ESCRITORIO
   ========================= */

.desktop-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
}

.desktop-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 2vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.desktop-menu li {
  position: relative;
  margin: 0;
}

.desktop-menu a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--header-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.25s ease;
}

.desktop-menu a::after {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 1px;
  content: "";
  background-color: var(--header-text);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.25s ease;
}

.desktop-menu a:hover,
.desktop-menu a:focus-visible,
.desktop-menu .current-menu-item > a,
.desktop-menu .current_page_item > a {
  color: var(--header-text);
}

.desktop-menu a:hover::after,
.desktop-menu a:focus-visible::after,
.desktop-menu .current-menu-item > a::after,
.desktop-menu .current_page_item > a::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* =========================
   CONTACTO
   ========================= */

.header-contact {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}

.header-contact span {
  margin-bottom: 0.2rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--header-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-contact a {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 900;
  color: var(--header-text);
  transition: opacity 0.25s ease;
}

.header-contact a:hover,
.header-contact a:focus-visible {
  opacity: 0.65;
}

/* =========================
   BOTÓN MÓVIL
   ========================= */

.mobile-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: var(--header-text);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease;
}

.mobile-toggle:hover,
.mobile-toggle:focus-visible {
  background-color: #f8fafc;
  border-color: var(--header-border);
}

.mobile-toggle svg {
  width: 28px;
  height: 28px;
  pointer-events: none;
}

/* =========================
   MENÚ MÓVIL
   ========================= */

.mobile-menu {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  display: none;
  flex-direction: column;
  padding: 2.5rem 2rem;
  overflow-y: auto;
  background-color: var(--header-background);
  border-top: 1px solid var(--header-border);
}

.mobile-menu.is-active {
  display: flex;
  animation: mobileMenuEnter 0.25s ease;
}

.mobile-menu-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-menu-list li {
  margin: 0;
  border-bottom: 1px solid var(--header-border);
}

.mobile-menu-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 65px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--header-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    color 0.25s ease,
    padding-left 0.25s ease;
}

.mobile-menu-list a::after {
  font-size: 1.2rem;
  font-weight: 300;
  content: "→";
}

.mobile-menu-list a:hover,
.mobile-menu-list a:focus-visible,
.mobile-menu-list .current-menu-item > a,
.mobile-menu-list .current_page_item > a {
  padding-left: 0.5rem;
  color: var(--header-muted);
}

.mobile-menu-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: auto;
  padding-top: 3rem;
}

.mobile-menu-contact span {
  margin-bottom: 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--header-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mobile-menu-contact a {
  font-size: clamp(1.5rem, 7vw, 2rem);
  font-weight: 900;
  color: var(--header-text);
}

@keyframes mobileMenuEnter {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1100px) {
  .desktop-menu {
    gap: 1rem;
  }

  .desktop-menu a {
    font-size: 0.6875rem;
  }

  .header-contact a {
    font-size: 1rem;
  }
}

@media (max-width: 1024px) {
  .desktop-nav,
  .header-contact {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .header-inner {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 80px;
  }

  .logo img,
  .logo .custom-logo {
    max-width: 155px;
    height: 48px;
  }

  .mobile-menu {
    padding: 2rem 1.25rem;
  }
}

@media (max-width: 380px) {
  .logo img,
  .logo .custom-logo {
    max-width: 135px;
    height: 44px;
  }

  .mobile-toggle {
    width: 44px;
    height: 44px;
  }
}

/* =========================
   MOVIMIENTO REDUCIDO
   ========================= */

@media (prefers-reduced-motion: reduce) {
  .mobile-menu.is-active {
    animation: none;
  }

  .desktop-menu a,
  .desktop-menu a::after,
  .mobile-menu-list a,
  .mobile-toggle {
    transition: none;
  }
}