/*
 * navbar.css — Calendly-style navbar (standalone, copy-paste ready)
 *
 * USAGE — paste this HTML inside your <body>, then link this file + navbar.js:
 *
 *   <header class="navbar">
 *     <div class="nav-container">
 *       <div class="nav-left">
 *         <a href="/" class="nav-logo">
 *           <img src="assets/img/logo-blue.png" alt="Aviso Funer" height="36">
 *         </a>
 *       </div>
 *       <nav class="nav-center" aria-label="Navegación principal">
 *         <a href="#">Beneficios</a>
 *         <a href="#">Automatización</a>
 *         <a href="#">Vista previa</a>
 *         <a href="#">Planes</a>
 *       </nav>
 *       <div class="nav-right">
 *         <a href="empresas.html" class="login-link">Log in</a>
 *         <a href="#" class="cta-btn">Comienza</a>
 *         <button class="hamburger" aria-label="Abrir menú" aria-expanded="false">
 *           <span></span><span></span><span></span>
 *         </button>
 *       </div>
 *     </div>
 *     <div class="mobile-menu" aria-hidden="true">
 *       <a href="#">Beneficios</a>
 *       <a href="#">Automatización</a>
 *       <a href="#">Vista previa</a>
 *       <a href="#">Planes</a>
 *       <div class="mobile-menu__actions">
 *         <a href="empresas.html" class="login-link">Log in</a>
 *         <a href="#" class="cta-btn">Comienza</a>
 *       </div>
 *     </div>
 *   </header>
 */

/* ── Reset ──────────────────────────────────────────────────────────── */
.navbar *,
.navbar *::before,
.navbar *::after {
  box-sizing: border-box;
}

/* ── Navbar shell ───────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9375rem;
}

/* Reserve top space when scrolling to anchors so section lands below navbar */
html {
  scroll-padding-top: 72px;
}

/* Push page content below the fixed navbar */
body:has(.navbar) {
  padding-top: 72px;
}

/* ── Container ──────────────────────────────────────────────────────── */
.nav-container {
  max-width: 1200px;
  width: 100%;
  height: 72px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Left: logo ─────────────────────────────────────────────────────── */
.nav-left {
  flex: 1;
  display: flex;
  align-items: center;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.nav-logo img {
  display: block;
  height: 24px;
  width: auto;
}

/* ── Center: links ──────────────────────────────────────────────────── */
.nav-center {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-center a {
  text-decoration: none;
  color: #1a1a2e;
  font-weight: 500;
  font-size: 0.9375rem;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.nav-center a:hover {
  color: #0069ff;
}

/* ── Right: login + CTA + hamburger ────────────────────────────────── */
.nav-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.login-link {
  text-decoration: none;
  color: #1a1a2e;
  font-weight: 500;
  font-size: 0.9375rem;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.login-link:hover {
  color: #0069ff;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: #0069ff;
  color: #fff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.cta-btn:hover {
  background: #0055d4;
  box-shadow: 0 4px 14px rgba(0, 105, 255, 0.28);
}

/* ── Hamburger (hidden on desktop) ─────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s ease;
}

.hamburger:hover {
  background: #f4f4f4;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1a1a2e;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, width 0.25s ease;
  transform-origin: center;
}

/* Animated X when open */
.navbar.is-open .hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar.is-open .hamburger span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.navbar.is-open .hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile menu ────────────────────────────────────────────────────── */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 8px 28px 20px;
}

.mobile-menu a {
  display: block;
  padding: 12px 0;
  text-decoration: none;
  color: #1a1a2e;
  font-weight: 500;
  font-size: 1rem;
  border-bottom: 1px solid #f0f0f0;
  transition: color 0.18s ease;
}

.mobile-menu a:last-of-type {
  border-bottom: none;
}

.mobile-menu a:hover {
  color: #0069ff;
}

.mobile-menu__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  flex-wrap: wrap;
}

.mobile-menu__actions .login-link {
  font-size: 1rem;
}

.mobile-menu__actions .cta-btn {
  font-size: 0.9375rem;
}

.navbar.is-open .mobile-menu {
  display: flex;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-center {
    display: none;
  }

  .nav-right .login-link,
  .nav-right .cta-btn {
    display: none;
  }

  .hamburger {
    display: flex;
  }
}
