/* Navegación pública: mismas proporciones y comportamiento que la home. */
html { scroll-padding-top: 82px; }
:is(.header, .nav, .topbar, .crea-light-header)[data-crea-unified-nav] {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000 !important;
  min-height: 72px !important;
  height: 72px !important;
  background: rgba(3, 3, 3, .96) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}
/* Las barras que viven dentro del hero permanecen visibles al desplazarse. */
header.hero [data-crea-unified-nav],
header.hero-social [data-crea-unified-nav],
header.site-header [data-crea-unified-nav],
header.nav[data-crea-unified-nav],
body.page-crea-educa > nav[data-crea-unified-nav] {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
}
nav.nav[data-crea-unified-nav],
nav.topbar[data-crea-unified-nav] { padding: 0 clamp(18px, 4vw, 64px) !important; }
[data-crea-unified-nav] .brand img,
[data-crea-unified-nav] .crea-brand img { width: 132px; height: auto; max-width: 100%; }
[data-crea-unified-links] { align-items: center; }
[data-crea-unified-links] a:not(.pill):not(.btn):not(.crea-btn):not(.nav-cta) {
  color: #fff !important;
  font-family: Inter, Arial, sans-serif !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  line-height: 1.25;
}
[data-crea-unified-links] a:hover { color: #ff222d !important; }
[data-crea-unified-links] .pill,
[data-crea-unified-links] .nav-cta,
[data-crea-unified-links] .btn-red,
[data-crea-unified-links] .crea-btn-red {
  background: #ff151f !important;
  color: #fff !important;
  border-radius: 10px !important;
}
[data-crea-unified-nav] [data-crea-unified-toggle] {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  padding: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(255, 255, 255, .22) !important;
  border-radius: 9px !important;
  background: #0b0b0b !important;
  color: #fff !important;
  cursor: pointer;
}
[data-crea-unified-nav] [data-crea-unified-toggle]:focus-visible,
[data-crea-unified-links] a:focus-visible { outline: 2px solid #ff151f; outline-offset: 3px; }
[data-crea-unified-links] .nav-contact-mobile { display: none !important; }
@media (min-width: 981px) {
  [data-crea-unified-nav] [data-crea-nav-auto] { display: none !important; }
}

@media (max-width: 980px) {
  html { scroll-padding-top: 72px !important; }
  :is(.header, .nav, .topbar, .crea-light-header)[data-crea-unified-nav] {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding: 0 16px !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    background: rgba(3, 3, 3, .97) !important;
  }
  /* En home y en las páginas de servicios la barra exterior contiene la fila. */
  .header[data-crea-unified-nav],
  .crea-light-header[data-crea-unified-nav] { display: block !important; }
  .header[data-crea-unified-nav] > .nav,
  .crea-light-header[data-crea-unified-nav] .crea-nav {
    position: relative !important;
    height: 64px !important;
    min-height: 64px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }
  [data-crea-unified-nav] .container:has(> .brand):has(> [data-crea-unified-toggle]) {
    height: 64px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  [data-crea-unified-nav] .brand,
  [data-crea-unified-nav] .crea-brand { min-width: 0; max-height: 60px; flex: 0 1 auto; }
  [data-crea-unified-nav] .brand img,
  [data-crea-unified-nav] .crea-brand img,
  [data-crea-unified-nav] .brand-logo {
    width: auto !important;
    max-width: min(136px, 45vw) !important;
    max-height: 52px !important;
    object-fit: contain;
  }
  [data-crea-unified-nav] [data-crea-unified-toggle] {
    display: inline-flex !important;
    flex: 0 0 44px;
    margin: 0 0 0 auto !important;
    grid-area: auto !important;
  }
  [data-crea-unified-nav] .crea-mobile-toggle { font-size: 24px; }
  [data-crea-unified-links] {
    position: fixed !important;
    top: 64px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: calc(100dvh - 64px) !important;
    overflow-y: auto !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 8px 18px 20px !important;
    background: rgba(3, 3, 3, .985) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .1) !important;
    border-radius: 0 !important;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .34) !important;
    transform: none !important;
  }
  [data-crea-unified-links].is-open,
  [data-crea-unified-links].open,
  .nav-open [data-crea-unified-links] { display: flex !important; visibility: visible !important; opacity: 1 !important; pointer-events: auto !important; }
  [data-crea-unified-links] .nav-links { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 0 !important; width: 100% !important; }
  [data-crea-unified-nav] > .nav-cta,
  [data-crea-unified-nav] > .contact-btn { display: none !important; }
  [data-crea-unified-links] a,
  [data-crea-unified-links] a:not(.nav-cta) {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 10px 6px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .07) !important;
    font-size: 12px !important;
    white-space: normal !important;
  }
  [data-crea-unified-links] .pill,
  [data-crea-unified-links] .nav-cta,
  [data-crea-unified-links] .btn-red,
  [data-crea-unified-links] .crea-btn-red,
  [data-crea-unified-links] .nav-contact-mobile {
    display: flex !important;
    justify-content: center !important;
    margin-top: 12px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #ff151f !important;
    color: #fff !important;
  }
  .header[data-crea-unified-nav] + main,
  .crea-light-header[data-crea-unified-nav] + main,
  .crea-light-header[data-crea-unified-nav] + section { margin-top: 64px !important; }
  header.site-header:has(> [data-crea-unified-nav]) { min-height: 64px; }
  /* La barra del ERP se abre sin desplazar ni recortar el hero. */
  body.page-crea-empresarial .nav[data-crea-unified-nav] { grid-template-columns: none !important; }
  body.page-crea-empresarial .nav-menu[data-crea-unified-links] { z-index: 2001 !important; }
  body.page-crea-empresarial .nav-toggle[data-crea-unified-toggle] { z-index: 2002 !important; }
}
