/* Shared header geometry: protect the brand from flex compression. */
.header { padding: 10px 0; background: var(--white); transition: box-shadow .2s; max-height: 100dvh; overflow-y: auto; }
.header .header-inner {
  display: grid; grid-template-columns: 132px minmax(0, 1fr) 70px 248px;
  align-items: center; gap: 16px; min-height: 56px;
}
.header .header-brand { display: block; width: 132px; min-width: 132px; grid-column: 1; grid-row: 1; }
.header .logo-img { display: block; width: 132px; height: auto; max-width: none; object-fit: contain; }
.header .nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; grid-column: 2; grid-row: 1; }
.header .nav a { flex: 0 0 auto; white-space: nowrap; font-size: 14px; line-height: 1.5; }
.header .country-selector { grid-column: 3; grid-row: 1; width: 70px; margin: 0; justify-content: center; }
.header .header-cta, .header .header-login {
  grid-column: 4; grid-row: 1; justify-self: end;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; max-width: 248px; padding: 10px 18px;
  white-space: nowrap; font-size: 14px; line-height: 1.5; font-weight: 600; border-radius: 8px;
}
.header .header-login { color: var(--aicon-blue); border: 1.5px solid var(--aicon-blue-40); background: transparent; }
.header .header-login:hover { border-color: var(--aicon-blue); background: var(--aicon-blue-10); }
.header .header-login svg { flex: 0 0 15px; }
.header .nav-toggle { display: none; background: transparent; border: 0; padding: 8px; color: inherit; margin: 0; }
.nav-toggle svg { display: block; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Collapse before the longest localized action competes with the eight links. */
@media (max-width: 1279px) {
  .header { padding: 8px 0; }
  .header .header-inner { grid-template-columns: minmax(108px, 1fr) 70px 44px; gap: 0 12px; min-height: 48px; }
  .header .header-brand { width: 108px; min-width: 108px; }
  .header .logo-img { width: 108px; height: auto; }
  .header .country-selector { grid-column: 2; }
  .header .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; grid-column: 3; grid-row: 1; }
  .header .nav { display: none; grid-column: 1 / -1; grid-row: 2; flex-direction: column; align-items: stretch; width: 100%; gap: 0; padding: 12px 0; margin-top: 8px; background: #fff; border-top: 1px solid rgba(0,0,0,.08); }
  .header .nav.is-open { display: flex; }
  .header .nav a { display: block; padding: 12px 4px; min-height: 44px; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 15px; white-space: nowrap; }
  .header .nav a:last-child { border-bottom: 0; }
  .header .header-cta, .header .header-login { display: none; grid-column: 1 / -1; grid-row: 3; width: 100%; max-width: none; margin: 8px 0 0; white-space: normal; text-align: center; }
  .header .nav.is-open ~ .header-cta, .header .nav.is-open ~ .header-login { display: flex; }
}
#soluciones, #rubros, #clientes { scroll-margin-top: 100px; }
