/* ============================================================
   assets/css/header.css — Header Responsivo
   SIN cortes, SIN superposiciones, MENÚ FUNCIONAL
============================================================ */

header {
  --nav-height: 60px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid rgba(91, 33, 182, 0.1);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 12px;
  height: var(--nav-height);
  gap: 4px;
}

/* ── Logo ──────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #1a0e35;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.logo:hover { opacity: 0.8; }

.logo-icon-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-icon-wrap img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  color: #1a0e35;
  letter-spacing: -0.5px;
}

.logo-text small {
  font-size: 0.48rem;
  font-weight: 500;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: none;
}

@media (min-width: 1024px) {
  .logo { gap: 8px; }
  .logo-icon-wrap img { width: 30px; height: 30px; }
  .logo-text { font-size: 0.75rem; }
  .logo-text small { display: block; }
}

@media (min-width: 1400px) {
  .logo { gap: 10px; }
  .logo-icon-wrap img { width: 32px; height: 32px; }
  .logo-text { font-size: 0.85rem; }
}

@media (max-width: 600px) {
  .logo-text { display: none; }
  .logo { gap: 4px; }
}

/* ── Desktop Navigation ──────────────────────────── */
nav[aria-label="Navegación principal"] {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.desktop-nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1px;
  flex-wrap: nowrap;
  flex: 1;
  justify-content: center;
}

.desktop-nav li {
  flex-shrink: 0;
}

.desktop-nav a {
  display: flex;
  align-items: center;
  padding: 2px 3px;
  font-size: 0.6rem;
  font-weight: 500;
  color: #3a2c5a;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 3px;
  transition: all 0.2s;
  line-height: 1.1;
  letter-spacing: -0.6px;
  height: 100%;
}

.desktop-nav a:hover {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
}

.desktop-nav a[aria-current="page"] {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

.desktop-nav a.nav-highlight {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  font-weight: 600;
}

.desktop-nav a.nav-cta-reserve {
  background: var(--purple-mid);
  color: #fff !important;
  padding: 3px 6px;
  border-radius: 50px;
  font-size: 0.58rem;
  font-weight: 600;
  margin: 0 1px;
}

.desktop-nav a.nav-cta-reserve:hover {
  background: #3a1f6a;
}

.desktop-nav .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 3px;
  background: #25D366;
  color: #fff !important;
  border-radius: 3px;
  font-size: 0.55rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  width: 18px;
  height: 18px;
}

.desktop-nav .nav-cta:hover {
  background: #1ebe5c;
  transform: scale(1.1);
}

.desktop-nav .nav-cta svg {
  width: 10px;
  height: 10px;
}

@media (min-width: 1280px) {
  .desktop-nav a { padding: 3px 4px; font-size: 0.65rem; }
  .desktop-nav a.nav-cta-reserve { padding: 4px 8px; font-size: 0.62rem; }
  .desktop-nav .nav-cta { padding: 3px 4px; width: 20px; height: 20px; }
  .desktop-nav .nav-cta svg { width: 12px; height: 12px; }
}

@media (min-width: 1400px) {
  .desktop-nav a { padding: 4px 5px; font-size: 0.72rem; }
  .desktop-nav a.nav-cta-reserve { padding: 5px 10px; font-size: 0.68rem; }
  .desktop-nav .nav-cta { padding: 4px 5px; width: 22px; height: 22px; }
  .desktop-nav .nav-cta svg { width: 13px; height: 13px; }
}

/* ── Mostrar/ocultar nav según viewport ──────────── */
@media (max-width: 1279px) {
  .desktop-nav { display: none; }
  .mobile-menu-btn { display: flex; }
}

@media (min-width: 1280px) {
  .mobile-menu-btn { display: none; }
  .mob-nav { display: none !important; }
  .mob-nav-overlay { display: none !important; }
}

/* ── Hamburguesa ──────────────────────────────── */
.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  color: #1a0e35;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mobile-menu-btn:hover {
  background: rgba(124, 58, 237, 0.1);
}

.mobile-menu-btn:active {
  background: rgba(124, 58, 237, 0.15);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Menú móvil drawer ──────────────────────────── */
.mob-nav {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(280px, 85vw);
  background: #fff;
  z-index: 9999;
  box-shadow: -2px 0 20px rgba(0, 0, 0, 0.12);
  padding: 12px 0 32px;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  will-change: transform;
}

.mob-nav:not([hidden]) {
  transform: translateX(0);
  pointer-events: auto;
}

.mob-nav[hidden] {
  transform: translateX(100%);
  pointer-events: none;
}

.mob-nav-close {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #5a4d72;
  cursor: pointer;
  padding: 8px 16px;
  width: 100%;
  border-bottom: 1px solid #ede9fe;
  transition: color 0.2s;
}

.mob-nav-close:active {
  color: #7c3aed;
}

.mob-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mob-nav li a {
  display: block;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1a0e35;
  text-decoration: none;
  border-bottom: 1px solid #f5f3ff;
  transition: all 0.2s;
}

.mob-nav li a:active {
  background: #f5f3ff;
  color: #7c3aed;
}

.mob-nav .mob-cta {
  display: block;
  margin: 20px 16px 0;
  padding: 12px 16px;
  background: #25D366;
  color: #fff !important;
  border-radius: 50px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.mob-nav .mob-cta:active {
  background: #1ebe5c;
}

/* Overlay oscuro */
.mob-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s;
  cursor: pointer;
}

.mob-nav-overlay.active {
  display: block;
  opacity: 1;
}

/* ── Active states ──────────────────────────────── */
body[data-page="nosotros"] .desktop-nav a[href="/nosotros"],
body[data-page="nosotros"] .mob-nav a[href="/nosotros"],
body[data-page="articulos"] .desktop-nav a[href="/articulos"],
body[data-page="articulos"] .mob-nav a[href="/articulos"],
body[data-page="herramientas"] .desktop-nav a[href="/herramientas"],
body[data-page="herramientas"] .mob-nav a[href="/herramientas"] {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
}
