/* Índice: cabecera fija, contacto, marca y menús. */
:root {
  --header-gutter: clamp(1rem, 2.1vw, 1.75rem);
  --topbar-height: 1.5rem;
  --nav-open-height: 3.75rem;
  --nav-compact-height: 2.875rem;
  --nav-open-content: 3.75rem;
  --nav-compact-content: 2.875rem;
  --header-reserve: calc(var(--topbar-height) + var(--nav-open-height));
  --header-duration: 400ms;
  --remote-duration: 500ms;
  --header-shadow: 0 3px 8px rgba(30, 43, 54, 0.13);
}
html:has(.header-frame) { scroll-padding-top: calc(var(--header-reserve) + var(--space-xs)); }
.header-frame { height: var(--header-reserve); background: var(--hero-background); }
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1030;
  background: var(--surface);
  box-shadow: var(--header-shadow);
  --nav-height: var(--nav-open-height);
  --nav-content-height: var(--nav-open-content);
  --nav-logo-height: var(--nav-content-height);
}
.site-header.navbar-shrink { --nav-height: var(--nav-compact-height); --nav-content-height: var(--nav-compact-content); }
.header-gutter { padding-inline: var(--header-gutter); }
.topbar { background: var(--primary); }
.topbar-contact { display: flex; align-items: center; flex-wrap: nowrap; gap: clamp(.625rem, 1.7vw, 1.5rem); min-height: var(--topbar-height); }
.topbar a { display: inline-flex; align-items: center; gap: .375rem; color: var(--surface); font-size: clamp(.875rem, 1.1vw, .9375rem); font-weight: var(--weight-label); white-space: nowrap; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar a:focus-visible { outline-color: var(--surface); outline-offset: 2px; }
.topbar svg { width: 1rem; height: auto; flex: none; }
.site-header .navbar { padding: calc((var(--nav-height) - var(--nav-content-height)) / 2) 0; transition: padding-block var(--header-duration) ease; }
.site-header .navbar-brand-row { display: flex; align-items: center; justify-content: space-between; min-height: var(--nav-content-height); transition: min-height var(--header-duration) ease; }
.brand-name { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; flex: none; }
.brand-symbol { display: block; width: auto; height: 44px; transition: height var(--header-duration) ease; }
.brand-divider { width: 1px; height: 38px; background: #C7D0D5; flex: none; }
.brand-wordmark { display: flex; flex-direction: column; line-height: 1; }
.brand-word { color: #4F7997; font-family: var(--font-heading); font-size: 28px; font-weight: 600; letter-spacing: -.035em; transition: font-size var(--header-duration) ease; }
.brand-caption { margin-top: 3px; color: #56636D; font-size: 12px; font-weight: 400; letter-spacing: normal; transition: font-size var(--header-duration) ease; }
.site-header.navbar-shrink .brand-name { gap: 10px; }
.site-header.navbar-shrink .brand-symbol { height: 32px; }
.site-header.navbar-shrink .brand-divider { height: 29px; }
.site-header.navbar-shrink .brand-word { font-size: 23px; }
.site-header.navbar-shrink .brand-caption { font-size: 10px; }
.site-header .nav-link { padding: .55rem .5rem; color: #344554; font-family: 'Segoe UI', sans-serif; font-size: 13px; font-weight: 600; white-space: nowrap; }
.site-header .nav-link:hover, .site-header .nav-link:focus-visible { color: var(--secondary); text-decoration: underline; }
.site-header .nav-link[aria-current="page"] { color: var(--secondary); text-decoration: underline; text-underline-offset: .3em; }
.site-header .dropdown-menu { border: var(--border); border-radius: var(--radius); box-shadow: var(--header-shadow); }
.site-header .dropdown-item { white-space: normal; color: var(--text); padding: .5rem .85rem; }
.site-header .dropdown-item:hover, .site-header .dropdown-item:focus { background: var(--ice); color: var(--secondary); }
.remote-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 2px 12px;
  margin-left: 20px;
  color: var(--primary);
  background: var(--transparent);
  border: 1px solid var(--primary);
  border-radius: 15px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Segoe UI', sans-serif;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.remote-link svg { width: 13px; height: 13px; flex: none; }
.remote-link:hover, .remote-link:focus-visible {
  color: #fff;
  background: #4F7997;
  border-color: var(--primary);
}
.site-header.navbar-shrink .remote-link { color: var(--surface); background: var(--primary); border-color: var(--primary); }
.site-header.navbar-shrink .remote-link:hover, .site-header.navbar-shrink .remote-link:focus-visible { color: #fff; background: #2F5670; border-color: #2F5670; transition-duration: 150ms; }
.menu-button { min-height: var(--control-height); border: var(--border-dark); color: var(--secondary); border-radius: var(--radius-sm); font-size: var(--small-size); }
@media (min-width: 1200px) { .site-header .dropdown-menu { min-width: 16rem; max-width: 22rem; } .site-header .dropdown-toggle { padding-inline: .8rem; } }
@media (min-width: 1366px) {
  .site-header .navbar-nav { gap: 4px; }
}
@media (max-width: 1199.98px) {
  .navbar-brand-row { width: 100%; }
  #menuPrincipal.show { max-height: calc(100dvh - var(--header-reserve)); overflow-y: auto; overscroll-behavior: contain; }
  #menuPrincipal { padding-inline: var(--focus-offset); }
  .site-header .nav-link { width: 100%; padding: .65rem 0; border-top: var(--border); text-align: left; }
  .site-header .dropdown-menu { box-shadow: none; margin-bottom: var(--space-xs); }
  .remote-link { margin: var(--space-xs) 0 var(--space-sm); }
}
@media (max-width: 479px) {
  .brand-name { gap: 8px; }
  .brand-symbol { height: 36px; }
  .brand-word { font-size: 23px; }
  .brand-caption { font-size: 10px; }
  .site-header.navbar-shrink .brand-symbol { height: 28px; }
}
@media (max-width: 399px) {
  .topbar a { gap: .25rem; }
  .topbar svg { width: .9375rem; }
}
@media (max-width: 359px) {
  .topbar-contact { padding-inline: .5rem; gap: .5rem; }
  .topbar a { font-size: .84375rem; }
}
@media (prefers-reduced-motion: reduce) {
  /* Excepción a brand.css para la reducción de la cabecera y el botón de asistencia. */
  .site-header :is(.navbar, .navbar-brand-row, .brand-mark) { transition-duration: var(--header-duration) !important; }
  .site-header .remote-link { transition-duration: var(--remote-duration), var(--remote-duration), 0s !important; }
}

