/* Corrección aislada para evitar que reglas del navegador deformen los SVG del encabezado. */
.site-header .nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.site-header .nav a {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  line-height: 1.2;
}

.site-header .nav .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  overflow: hidden;
}

.site-header .nav .nav-icon svg {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  fill: none;
  stroke: #078ca4;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topline .top-phone svg {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  fill: #c8f442;
  stroke: none;
}

@media (min-width: 821px) and (max-width: 1400px) {
  .site-header {
    gap: 12px;
    padding-left: 4vw;
    padding-right: 4vw;
  }

  .site-header > .brand {
    flex: 0 0 180px;
    width: 180px;
    height: 76px;
  }

  .site-header > .header-phone {
    flex: 0 0 182px;
    gap: 7px;
  }

  .site-header > .header-phone b {
    font-size: 17px;
  }

  .site-header > .nav {
    flex: 0 1 auto;
    gap: 12px;
    font-size: 14px;
  }

  .site-header > .nav .nav-icon,
  .site-header > .nav .nav-icon svg {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
  }

  .site-header > .language-switch {
    flex: 0 0 auto;
  }

  .site-header > .header-cta {
    flex: 0 0 auto;
    padding: 11px 13px;
  }
}

@media (max-width: 820px) {
  .site-header .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-header .nav a {
    flex-direction: row;
    justify-content: flex-start;
  }
}

/* Encabezado y navegación responsive: desktop, tablet y móvil */
.site-header {
  position: relative;
  isolation: isolate;
  gap: clamp(10px, 1.5vw, 24px);
}
.site-header > .brand { flex-shrink: 0; }
.site-header > .nav { flex: 1 1 auto; justify-content: center; }
.menu-toggle {
  display: none;
  appearance: none;
  border: 1px solid #dbe5ee;
  background: #fff;
  color: #071a38;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 9px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 44px;
  position: relative;
  z-index: 30;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 821px) {
  .site-header > .nav { display: flex; position: static; }
  .menu-toggle { display: none !important; }
}
@media (max-width: 820px) {
  .site-header {
    height: auto;
    min-height: 78px;
    padding: 10px 4vw;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  .site-header > .brand { width: clamp(118px, 22vw, 170px); height: 58px; flex: 0 1 auto; }
  .site-header > .header-phone { display: none; }
  .site-header > .menu-toggle { display: inline-flex; order: 5; }
  .site-header > .language-switch { display: flex; gap: 5px; flex: 0 0 auto; }
  .site-header > .header-cta { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; border-radius: 9px; }
  .site-header > .header-cta .header-wa-label { display: none; }
  .site-header > .nav {
    display: flex;
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    z-index: 25;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 10px 4vw 16px;
    background: #fff;
    border-top: 1px solid #e8eef4;
    box-shadow: 0 16px 28px rgba(7, 26, 56, .16);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    max-height: min(70vh, 430px);
    overflow-y: auto;
  }
  .site-header > .nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .site-header > .nav a {
    display: flex;
    width: 100%;
    min-height: 48px;
    padding: 12px 10px;
    border-bottom: 1px solid #edf1f5;
    font-size: 15px;
    white-space: normal;
  }
  .site-header > .nav a:last-child { border-bottom: 0; }
}
@media (max-width: 420px) {
  .site-header { gap: 7px; padding-left: 3vw; padding-right: 3vw; }
  .site-header > .brand { width: 112px; height: 52px; }
  .site-header > .language-switch button { padding: 2px; }
  .site-header > .menu-toggle { width: 40px; height: 40px; flex-basis: 40px; }
  .site-header > .header-cta { width: 40px; height: 40px; flex-basis: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-toggle span, .site-header > .nav { transition: none; }
}


/* Primera fila superior: tipografía e iconos más visibles */
.topline {
  min-height: 42px;
  padding: 7px clamp(12px, 2vw, 28px);
  gap: 13px;
  font-size: clamp(12px, 1vw, 14px);
  line-height: 1.4;
}
.topline .pulse {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
}
.topline .top-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 700;
}
.topline .top-phone svg {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  flex-basis: 22px;
}
.topline .top-social svg,
.topline .top-actions .social-icons a,
.topline .top-actions .social-icons img {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
}
@media (max-width: 820px) {
  .topline { min-height: 40px; gap: 9px; font-size: 12px; padding: 7px 3vw; }
  .topline .top-phone { font-size: 13px; gap: 6px; }
  .topline .top-phone svg { width: 20px; height: 20px; max-width: 20px; max-height: 20px; flex-basis: 20px; }
  .topline .top-social svg,
  .topline .top-actions .social-icons a,
  .topline .top-actions .social-icons img { width: 20px; height: 20px; max-width: 20px; max-height: 20px; }
}
@media (max-width: 520px) {
  .topline { gap: 7px; font-size: 11px; }
  .topline .top-copy { line-height: 1.3; }
  .topline .top-phone { font-size: 12px; }
}

/* Estado inicial seguro del menú móvil: oculto hasta pulsar el botón. */
@media (max-width: 820px) {
  .site-header > .nav:not(.is-open) {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-8px) !important;
  }
  .site-header > .nav.is-open {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }
}
