/* =========================================
   HEADER PERSONALIZADO
   ========================================= */

.custom-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  transition:
    background-color 0.3s ease,
    backdrop-filter 0.3s ease,
    padding 0.3s ease;
  background-color: transparent;
  padding: 20px 0;
}

/* Estado al hacer scroll */
.custom-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.9); /* Blanco opaco */
  backdrop-filter: blur(8px); /* Efecto cristal / difuminado */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); /* Sombra muy sutil */
  padding: 12px 0; /* Un poco más comprimido al hacer scroll */
}

/* --- Ajuste para páginas internas (no Landing) --- */
/* WordPress le pone la clase .home al body solo en la portada. 
   A las demás páginas, las empujamos hacia abajo la misma altura del header. */
body:not(.home) {
  padding-top: 85px;
}

/* Opcional: Hace que el header en las páginas internas arranque ya opaco 
   y no transparente, para que sea siempre legible sobre el texto. */
body:not(.home) .custom-header {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Contenedor interno usando la clase de layout existente */
.custom-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* LOGO */
.header-logo {
  display: flex;
  align-items: center;
}

.header-logo a {
  text-decoration: none;
  color: var(--color-text);
}

.logo-text {
  font-family: "Playfair Display", serif; /* O la tipografía de tu título */
  font-size: 22px; /* Ajusta este valor */
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* contenedor link generado por WP */
.custom-logo-link {
  display: block;
}

/* imagen del logo */
.custom-logo {
  max-width: 280px !important;
  width: 100%;
  height: auto;
  display: block;
}

/* NAVEGACIÓN DESKTOP */
.header-nav-desktop {
  display: flex;
  align-items: center;
  margin-left: auto; /* Empuja navegación y redes a la derecha */
  margin-right: 40px;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

.nav-links li a {
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 300;
  transition: opacity 0.3s;
}

.nav-links li a:hover {
  opacity: 0.5;
}

/* REDES SOCIALES DESKTOP */
.header-socials-desktop {
  display: flex;
  gap: 15px;
  align-items: center;
}

.social-icon {
  color: var(--color-text);
  display: flex;
  align-items: center;
  transition:
    transform 0.3s,
    opacity 0.3s;
}

.social-icon:hover {
  transform: translateY(-2px);
  opacity: 0.7;
}

/* BOTÓN HAMBURGUESA */
.custom-menu-toggle {
  display: none; /* Oculto en Desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background-color: transparent !important; /* !important para ganarle a GeneratePress */
  box-shadow: none !important;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10000; /* Por encima del overlay siempre */
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--color-text, #000);
  transition: all 0.3s ease;
}

/* Animación a la X */
.custom-menu-toggle.is-active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.custom-menu-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.custom-menu-toggle.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* OVERLAY MÓVIL */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  background-color: #ffffff;
  z-index: 9998; /* Justo debajo del botón hamburguesa */
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mobile-menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 50px;
}

.mobile-nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.mobile-nav-links li a {
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--text-lg); /* Tamaño grande estilo Framer */
  font-weight: 400;
}

.mobile-socials {
  display: flex;
  gap: 30px;
}

/* MEDIA QUERIES */
/* Usamos 900px o 768px dependiendo de cuándo quieres que el menú colapse */
@media (max-width: 900px) {
  .header-nav-desktop,
  .header-socials-desktop {
    display: none;
  }

  .custom-menu-toggle {
    display: flex;
  }
}
