/* =========================
 Layout global: header, menú, footer
========================= */
/* Header base */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
/* Estado transparente (home antes del scroll) */
.header-transparent { background: transparent; }
/* Estado con scroll (home tras el scroll) */
.header.scrolled {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
/* === Estado estático para páginas secundarias (Servicio/Contacto) === */
.header--static {
  background: #fff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
/* Contenedor interno del header */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
/* Logo (solo imagen) */
.logo { display: flex; align-items: center; }
.logo-img { width: 180px; height: auto; transition: filter 0.3s; }
/* Navegación desktop */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-weight: 500;
}

.nav-desktop a,
.nav-desktop .nav-item {
  font-weight: inherit;
  position: relative;
  transition: color 0.3s;
  cursor: pointer;
}

.nav-desktop .nav-item {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.nav-item-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Home antes del scroll → enlaces blancos */
.header:not(.scrolled):not(.header--static) .nav-desktop a, 
.header:not(.scrolled):not(.header--static) .nav-desktop .nav-item { color: #fff; }
/* Con scroll o estático → enlaces corporativos */
.header.scrolled .nav-desktop a,
.header.scrolled .nav-desktop .nav-item,
.header.header--static .nav-desktop a, 
.header.header--static .nav-desktop .nav-item {
  color: var(--color-primary);
}
/* Subrayado animado en hover (desktop y móvil) */
.nav-desktop a::after,
.nav-desktop .nav-item::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  transition: width 0.3s;
  position: absolute;
  left: 0;
  bottom: -4px;
}
.nav-desktop a:hover::after,
.nav-desktop .nav-item:hover::after { width: 100%; }
.nav-desktop a:hover, 
.nav-desktop .nav-item:hover{ color: var(--color-secondary); }

.nav-item--megamenu {
  position: relative;
}

/* Botón hamburguesa */
.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-btn span {
  width: 24px;
  height: 2px;
  transition: background 0.3s;
  /* En home transparente → blanco, en scroll/estático → corporativo */
  background: #fff;
}
.header.scrolled .menu-btn span,
.header.header--static .menu-btn span {
  background: var(--color-primary);
}

/* Menú móvil (off-canvas) */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: #fff;
  padding: 5rem 2rem;
  transition: right 0.3s ease;
  z-index: 1001;
}
.mobile-menu.open { right: 0; }
.mobile-menu nav {
  display: flex;
  flex-direction: column;
}
/* Enlaces del móvil: corporativos */
.mobile-menu a {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
  position: relative;
  transition: color 0.3s;
}

.mobile-menu a::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  transition: width 0.3s;
  position: absolute;
  left: 0;
  bottom: -4px;
}
.mobile-menu a:hover::after { width: 100%; }
.mobile-menu a:hover { color: var(--color-secondary); }

.mobile-nav {
  display: flex;
  flex-direction: column;
}

.mobile-link {
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--color-primary);
  padding: 0.4rem 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.mobile-submenu {
  list-style: none;
  margin: 0 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mobile-submenu[hidden] {
  display: none;
}

/* Overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.menu-overlay.open {
  opacity: 1;
  pointer-events: all;
}

  /* Botones con submenú */
.mobile-toggle {
  display: inline-flex;
  align-items: center;
}

/* Flecha */
.mobile-toggle::after {
  content: '▾';
  font-size: 0.85rem;
  opacity: 0.6;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Abierto */
.mobile-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
  opacity: 1;
}

/* Footer */
.footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--color-muted);
  background: #fff;
  font-size: 0.95rem;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}
/* Enlaces legales del footer */
.footer a {
  color: var(--color-primary);
  text-decoration: underline;
  margin: 0 0.25em;
  transition: color 0.2s ease;
}
.footer a:hover,
.footer a:focus-visible {
  color: var(--color-secondary);
}
/* Bloque redes sociales */
.footer-social {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
/* Botones/iconos de redes */
.footer-social .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; /* tamaño del botón */
  height: 40px;
  border-radius: 50%;
  color: var(--color-primary); /* icono via currentColor */
  background: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.footer-social .social-link:hover,
.footer-social .social-link:focus-visible {
  color: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(31,58,77,0.12);
}
/* SVG iconos */
.footer-social .icon {
  width: 22px;
  height: 22px;
  fill: currentColor; /* usa el color del enlace (primary/secondary) */
}
/* Accesibilidad (foco teclado) */
.footer-social .social-link:focus-visible {
  outline: 3px solid #7aa0b9;
  outline-offset: 2px;
}

/* =========================
   VIAJES MENU (paneles)
========================= */

.viajes-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 999;
  width: max-content;
}

.viajes-menu li,
.viajes-menu a,
.viajes-menu button {
  cursor: pointer;
}

.viajes-menu a::after {
  content: none !important;
}

.viajes-menu.is-open {
  pointer-events: auto;
}

/* Panel base */
.viajes-panel {
  position: absolute;
  top: 0;
  left: 0;
  background: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,.08);
  display: none;
  width: max-content;
  border-radius: 8px;
  border: 1px solid var(--color-secondary);
}

/* Panel visible */
.viajes-panel.is-active {
  display: block;
}

.viajes-panel[data-level="1"] {
  position: relative;
  left: 0;
  transform: none;
}

.viajes-panel[data-level="1"] .viajes-link {
  font-weight: 600;
}

.viajes-panel[data-level="2"] .viajes-link {
  font-weight: 500;
}

.viajes-panel[data-level="3"] .viajes-link {
  padding-left: 0;
  font-weight: 400;
}

/* Listas */
.viajes-list {
  list-style: none;
  margin: 0;
  padding: 1rem 1.5rem;
}

.viajes-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0 0.35rem 1.2rem;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: var(--color-primary);
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.3s;
  font-weight: 500;
}

/* Texto real (subrayable) */
.viajes-text {
  position: relative;
}

/* Subrayado SOLO del texto */
.viajes-text::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  transition: width 0.3s;
}

/* Hover */
.viajes-link:hover .viajes-text::after {
  width: 100%;
}

/* Flecha visual para elementos con hijos */

.has-children > .viajes-link::before {
  content: '‹';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 0.9em;
}

/* Columnas automáticas (países y ciudades) */
.viajes-list--columns {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0.5rem;
  column-gap: 3rem;
}

.viajes-list--columns:has(li:nth-child(5)) {
  grid-template-rows: repeat(4, auto);
  grid-template-columns: none;
  grid-auto-flow: column;
}

.viajes-list--columns {
  direction: rtl;
}

.viajes-list--columns > * {
  direction: ltr;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .menu-btn { display: flex; }
  .logo-img { width: 150px; }
}