/* ===========================
   NAVBAR — HN Contra Incendios
   Mobile-first. Drawer minimal blanco.
   En páginas con .has-hero arranca transparente; al scrollear
   o abrir el menu vuelve al fondo blanco.
   =========================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #F65F01;
  box-shadow: 0 2px 16px rgba(15, 18, 22, 0.10);
  border-bottom: 2px solid #A03B00;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
}

body.has-hero .navbar {
  background: transparent;
  box-shadow: none;
  border-bottom-color: transparent;
}

body.has-hero.is-scrolled .navbar,
body.has-hero.menu-open .navbar {
  background: #F65F01;
  box-shadow: 0 2px 16px rgba(15, 18, 22, 0.10);
  border-bottom-color: #A03B00;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ---- Logo ---- */
.navbar-logo {
  position: relative;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
}

.navbar-logo-img {
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
}

/* ---- Hamburger ---- */
.navbar-toggle {
  position: relative;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  padding: 11px 9px;
  cursor: pointer;
}

.navbar-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.3s ease;
}

/* El drawer mobile abierto sigue con fondo naranja, así que el X
   queda blanco como en estado normal */
body.menu-open .navbar-toggle span {
  background: #fff;
}

.navbar-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.navbar-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   MENU DRAWER MOBILE — minimal
   Fondo blanco, items grandes en mayúsculas centrados,
   separadores tenues, underline rojo en el activo,
   CTAs apilados abajo del todo.
   =========================== */
.navbar-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  background: #F65F01;
  padding: 84px 22px 28px;
  list-style: none;
  margin: 0;
  z-index: 999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.navbar-menu.active {
  display: flex;
  animation: navbar-menu-fadein 0.22s ease-out both;
}

@keyframes navbar-menu-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.navbar-item {
  width: 100%;
  list-style: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.navbar-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 22px 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  transition: opacity 0.18s ease;
}

.navbar-link:hover,
.navbar-link:focus-visible,
.navbar-link:active {
  background: transparent;
  opacity: 0.75;
  color: #fff;
  transform: none;
}

/* Item activo: subrayado blanco corto centrado debajo del texto */
.navbar-link.is-active::after {
  content: '';
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ---- Bloque de CTAs abajo ---- */
.navbar-cta-block {
  list-style: none;
  width: 100%;
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: none;
}

.navbar-cta-wsp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 14px 22px;
  background: transparent;
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.50);
  border-radius: 999px;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.navbar-cta-wsp i {
  color: #25D366;
  font-size: 22px;
  line-height: 1;
}

.navbar-cta-wsp:hover,
.navbar-cta-wsp:focus-visible {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

/* CTA primario invertido: fondo blanco con texto naranja
   para destacar dentro del drawer naranja */
.navbar-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 14px 22px;
  background: #fff;
  color: #F65F01;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.navbar-cta-primary svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.navbar-cta-primary:hover,
.navbar-cta-primary:focus-visible {
  background: #1F252C;
  color: #fff;
}

.navbar-cta-primary:active {
  transform: translateY(1px);
}

body.menu-open {
  overflow: hidden;
}

/* ===========================
   Tablet / Desktop (>= 768px)
   Volver al menu inline. Mantengo el header existente.
   =========================== */
@media (min-width: 768px) {
  .navbar-container {
    padding: 14px 32px;
  }

  body.is-scrolled .navbar-container {
    padding: 10px 32px;
  }

  .navbar-toggle {
    display: none;
  }

  .navbar-menu {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: auto;
    height: auto;
    background: transparent;
    padding: 0;
    overflow: visible;
  }

  .navbar-item {
    width: auto;
    border-bottom: none;
  }

  .navbar-link {
    width: auto;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #fff;
    background: transparent;
    border-radius: 8px;
    white-space: nowrap;
    transition: color 0.25s ease, background 0.2s ease, text-shadow 0.3s ease;
  }

  .navbar-link:hover,
  .navbar-link:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    opacity: 1;
  }

  /* Sobre hero (header transparente): mismos links blancos pero con
     sombra para legibilidad sobre la foto del hero */
  body.has-hero .navbar-link {
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  }

  body.has-hero.is-scrolled .navbar-link {
    text-shadow: none;
  }

  /* Item activo desktop: underline blanco más chico */
  .navbar-link.is-active::after {
    bottom: 4px;
    width: 18px;
    height: 2px;
    background: #fff;
  }

  /* CTA block: oculto el WhatsApp del bloque (queda solo el FAB), Cotizar inline */
  .navbar-cta-block {
    list-style: none;
    margin-top: 0;
    padding-top: 0;
    width: auto;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    margin-left: 4px;
  }

  .navbar-cta-wsp {
    display: none;
  }

  /* CTA primario en desktop: invertido (fondo blanco, texto naranja)
     para contrastar con el header naranja */
  .navbar-cta-primary {
    width: auto;
    min-height: 0;
    padding: 10px 20px;
    font-size: 13px;
    letter-spacing: 0.08em;
    background: #fff;
    color: #F65F01;
    box-shadow: 0 4px 14px rgba(15, 18, 22, 0.14);
  }

  .navbar-cta-primary svg {
    width: 14px;
    height: 14px;
  }

  .navbar-cta-primary:hover,
  .navbar-cta-primary:focus-visible {
    background: #1F252C;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 18, 22, 0.22);
  }

  body.is-scrolled .navbar-cta-primary {
    box-shadow: 0 2px 8px rgba(15, 18, 22, 0.18);
  }
}

@media (min-width: 1024px) {
  .navbar-container {
    padding: 16px 40px;
  }

  .navbar-logo-img {
    height: 48px;
  }

  .navbar-link {
    font-size: 14px;
    padding: 10px 16px;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .navbar,
  .navbar-link,
  .navbar-toggle,
  .navbar-toggle span,
  .navbar-cta-primary,
  .navbar-cta-wsp {
    transition: none;
  }
  .navbar-menu.active {
    animation: none;
  }
}
