/* ===== CSS/header.css | Amazonía Viajes - Versión estable definitiva ===== */
:root {
  --av-verde: #0d911c; --av-dorado: #e8c046; --av-azul: #023877;
  --av-blanco: #ffffff; --av-gris: #f5f7f5; --av-texto: #1a1a1a;
  --av-sombra: 0 4px 20px rgba(0,0,0,0.15); --av-trans: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; }

/* ===== BARRA SUPERIOR ===== */
.av-topbar {
  background: linear-gradient(135deg, var(--av-azul), #0a2a12);
  color: white; padding: 8px 0; font-size: 0.85rem;
  position: sticky; top: 0; z-index: 1002; border-bottom: 2px solid var(--av-dorado);
}
.av-topbar-inner {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1600px; margin: 0 auto; padding: 0 20px; flex-wrap: wrap; gap: 10px;
}
.av-topbar-left, .av-topbar-right { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.av-top-item { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  color: rgb(255, 255, 255) !important; 
  text-decoration: none; 
  transition: var(--av-trans); 
}
.av-top-item:hover { color: var(--av-dorado) !important; transform: translateX(3px); }
.av-whatsapp { color: #25D366 !important; }

/* Iconos base */
.av-icon { width: 18px; height: 18px; stroke: currentColor !important; fill: none !important; stroke-width: 2; display: inline-block; vertical-align: middle; }

/* Redes sociales */
.av-social { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.15); display: grid; place-items: center; text-decoration: none; transition: var(--av-trans); }
.av-social .av-icon { width: 16px; height: 16px; stroke: white !important; }
.av-social:hover { transform: translateY(-3px) scale(1.15); }
.av-tiktok:hover { background: #000; box-shadow: 0 0 0 2px #25F4EE, 0 0 0 4px #FE2C55; }
.av-facebook:hover { background: #1877F2; box-shadow: 0 4px 12px rgba(24,119,242,0.5); }
.av-instagram:hover { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); box-shadow: 0 4px 12px rgba(225,48,108,0.5); }
.av-youtube:hover { background: #FF0000; box-shadow: 0 4px 12px rgba(255,0,0,0.5); }
.av-twitter:hover { background: #000; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }

/* ===== BARRA DEL MENÚ ===== */
.av-main-header {
  background: white; position: sticky; top: 46px; z-index: 1001;
  border-bottom: 3px solid var(--av-dorado); box-shadow: var(--av-sombra);
}
.av-main-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1600px; margin: 0 auto; padding: 8px 20px; gap: 15px;
}
.av-logo { font-size: 1.5rem; font-weight: 800; color: var(--av-verde); text-decoration: none; }

/* ===== MENÚ DESKTOP ===== */
.av-main-nav { display: flex; margin-left: auto; }
.av-nav-list { display: flex; list-style: none; gap: 4px; }
.av-nav-list > li { position: relative; } /* ✅ Clave: evita que submenú salga a la izquierda */
.av-nav-list > li > a {
  display: flex; align-items: center; gap: 5px; padding: 10px 14px;
  color: var(--av-texto); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  border-radius: 6px; transition: var(--av-trans); white-space: nowrap;
}
.av-nav-list > li > a:hover, .av-nav-list > li > a.av-active { background: var(--av-gris); color: var(--av-verde); }

/* Flecha */
.av-arrow { width: 14px; height: 14px; stroke: currentColor !important; fill: none !important; stroke-width: 2.5; transition: transform 0.3s ease; display: inline-block; }
.av-has-submenu:hover > a .av-arrow { transform: rotate(180deg); }

/* Submenús DESKTOP (CSS puro, estable) */
/* Submenús DESKTOP (con puente hover estable) */
.av-submenu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  min-width: 220px;
  background: white;
  border: 2px solid var(--av-dorado);
  border-radius: 8px;
  padding: 10px 0;
  list-style: none;
  z-index: 1000;
  box-shadow: var(--av-sombra);
  
  /* Transición suave */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  pointer-events: none;
}

/* ✅ PUENTE TRANSPARENTE: Mantiene el hover activo al bajar el mouse */
.av-submenu::before {
  content: '';
  position: absolute;
  top: -8px;      /* Cubre el espacio de 5px + 3px extra de margen */
  left: 0;
  width: 100%;
  height: 8px;
  background: transparent;
}

/* Mostrar al hover */
.av-has-submenu:hover > .av-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
/* Mostrar al hover */
.av-has-submenu:hover > .av-submenu {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.av-submenu a {
  display: block; padding: 10px 20px; color: var(--av-texto);
  text-decoration: none; transition: var(--av-trans);
}
.av-submenu a:hover { background: var(--av-verde); color: white; padding-left: 25px; }

/* Botón CTA */
.av-btn-cta { padding: 8px 16px; background: var(--av-dorado); color: var(--av-texto) !important; font-weight: 700; border-radius: 20px; text-decoration: none; transition: var(--av-trans); }
.av-btn-cta:hover { background: var(--av-verde); color: rgb(221, 21, 21) !important; transform: translateY(-2px); }

/* ===== MÓVIL ===== */
.av-hamburger { display: none; background: none; border: none; font-size: 1.5rem; color: var(--av-verde); cursor: pointer; padding: 8px; }
.av-close-btn { display: none; position: fixed; top: 115px; right: 15px; background: #dc3545; color: white; border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; z-index: 10002; }
.av-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; }

@media (max-width: 992px) {
  .av-hamburger { display: block; }
  .av-main-nav {
    position: fixed; top: 115px; right: -100%; width: 300px;
    height: calc(100vh - 115px); background: white; box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    transition: right 0.4s ease; overflow-y: auto; z-index: 1001;
    flex-direction: column; padding: 20px 0;
  }
  .av-main-nav.av-open { right: 0; }
  .av-nav-list { flex-direction: column; gap: 0; }
  .av-nav-list > li > a { padding: 15px 25px; border-bottom: 1px solid #eee; justify-content: space-between; font-size: 1rem; }
  
  /* Submenús MÓVIL (acordeón con clase .av-expanded) */
  .av-submenu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; border-left: 4px solid var(--av-dorado);
    background: var(--av-gris); padding: 0; max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease; pointer-events: auto;
  }
  .av-has-submenu.av-expanded > .av-submenu { max-height: 600px; padding: 10px 0; }
  .av-has-submenu.av-expanded > a .av-arrow { transform: rotate(180deg); }
  .av-submenu a { padding: 10px 25px; font-size: 0.95rem; }
  .av-submenu a:hover { background: var(--av-verde); color: white; padding-left: 32px; }
  
  .av-topbar-left span, .av-topbar-right span { display: none; }
  .av-social { width: 28px; height: 28px; }
}

@media (min-width: 993px) {
  .av-main-nav.av-open { right: auto !important; position: static; width: auto; height: auto; box-shadow: none; }
  .av-overlay, .av-close-btn { display: none !important; }
}

.av-lang-selector {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.8rem; color: rgba(255,255,255,0.9);
  margin-left: 15px; padding-left: 15px; border-left: 1px solid rgba(255,255,255,0.3);
}
.av-lang-link {
  color: white !important; text-decoration: none; transition: color 0.3s;
}
.av-lang-link:hover, .av-lang-link.av-lang-active {
  color: var(--av-dorado) !important; font-weight: 600;
}
.av-lang-separator { color: rgba(255,255,255,0.4); }