/* INREMA · Header global v1.1 · prefijo exclusivo inrema-header */
html:has([data-inrema-header]) { scroll-behavior: smooth; }

.inrema-header {
  --inrema-blue: #001763;
  --inrema-yellow: #ffb900;
  --inrema-white: #fff;
  --inrema-header-max: 1512px;
  --inrema-header-upper-height: 59px;
  --inrema-header-main-height: 147px;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--inrema-blue);
  font-family: "Segoe UI", "Arial", sans-serif;
  font-size: 16px;
  line-height: 1.35;
  z-index: 1000;
}
.inrema-header, .inrema-header *, .inrema-header *::before, .inrema-header *::after { box-sizing: border-box; }
.inrema-header a { text-decoration: none !important; }
.inrema-header button { font: inherit; }
.inrema-header :focus-visible { outline: 3px solid var(--inrema-yellow); outline-offset: 3px; }
.inrema-header .inrema-icon { width: 24px; height: 24px; display: block; flex: 0 0 auto; stroke: currentColor; }
.inrema-header__inner { width: min(calc(100% - 48px), var(--inrema-header-max)); margin: 0 auto; }

/* Upper header — desktop */
.inrema-header__upper {
  height: var(--inrema-header-upper-height);
  background: var(--inrema-blue);
  color: var(--inrema-white);
  overflow: hidden;
  transition: height .22s ease, opacity .22s ease;
}
.inrema-header__upper-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.inrema-header__socials, .inrema-header__mobile-socials { display: flex; align-items: center; gap: 27px; }
.inrema-header__social-link { display: inline-flex; align-items: center; justify-content: center; color: #fff !important; width: 25px; height: 30px; flex-shrink: 0; transition: opacity .2s ease, transform .2s ease; }
.inrema-header__social-link .inrema-icon { width: 22px; height: 22px; }
.inrema-header__socials .inrema-icon--social { width: 20px; height: 20px; fill: #fff; stroke: none; }
.inrema-header__socials .inrema-icon--social-facebook,
.inrema-header__socials .inrema-icon--social-tiktok { width: 19px; height: 19px; }
.inrema-header__socials .inrema-header__social-link[href]:hover { opacity: .82; transform: none; }
.inrema-header__social-link[href]:hover { opacity: .78; transform: translateY(-2px); }
.inrema-header__social-link--pending { cursor: default; }
.inrema-header__upper-divider, .inrema-header__contact-divider { width: 1px; height: 28px; background: rgba(255,255,255,.65); flex-shrink: 0; }
.inrema-header__contact { margin-left: auto; display: flex; align-items: center; gap: 35px; }
.inrema-header__contact a { display: inline-flex; gap: 12px; align-items: center; color: #fff !important; font-size: 17px; font-weight: 600; white-space: nowrap; }
.inrema-header__contact a:hover { opacity: .8; }
.inrema-header__contact .inrema-icon { width: 26px; height: 26px; stroke-width: 2.4; }

/* Main header */
.inrema-header__main { width: 100%; background: #fff; box-shadow: 0 1px 0 rgba(0,23,99,.06); }
.inrema-header__main-inner { min-height: var(--inrema-header-main-height); display: flex; gap: 24px; align-items: center; justify-content: space-between; transition: min-height .22s ease; }
.inrema-header__brand { display: block; flex-shrink: 0; line-height: 0; }
.inrema-header__logo { display: block; width: 267px; height: auto; max-width: none; transition: width .22s ease; }
.inrema-header__nav { margin-left: auto; margin-right: clamp(60px, 4vw, 76px); min-width: 0; }
.inrema-header__nav-list { display: flex; align-items: center; gap: clamp(16px, 1.85vw, 31px); list-style: none; margin: 0; padding: 0; }
.inrema-header__nav-item { position: relative; display: inline-flex; align-items: center; gap: 5px; min-height: 46px; white-space: nowrap; }
.inrema-header__nav-item > a { color: var(--inrema-blue) !important; font-size: clamp(14px, 1.11vw, 18px); font-weight: 700; line-height: 1.2; position: relative; padding: 11px 0; }
.inrema-header__nav-item > a:hover { color: #193475 !important; }
.inrema-header__nav-item.is-active > a::after { content: ""; background: var(--inrema-yellow); position: absolute; bottom: 0; height: 5px; left: 0; right: 0; }
.inrema-header__submenu-toggle { background: transparent !important; border: 0 !important; color: var(--inrema-blue) !important; padding: 5px 1px; cursor: pointer; }
.inrema-header__submenu-toggle .inrema-icon { width: 15px; height: 15px; stroke-width: 1.8; }
.inrema-header__submenu-toggle[aria-expanded="true"] .inrema-icon { transform: rotate(180deg); }
.inrema-header__submenu { position: absolute; top: 100%; left: -14px; width: max-content; min-width: 235px; max-width: 290px; background: #fff; border: 1px solid #e7eaf2; border-radius: 11px; box-shadow: 0 12px 35px rgba(0,23,99,.16); list-style: none; margin: 0; padding: 9px; z-index: 20; white-space: normal; }
.inrema-header__submenu[hidden] { display: none !important; }
.inrema-header__submenu li a { display: block; padding: 10px 11px; border-radius: 6px; font-size: 14px; color: var(--inrema-blue) !important; font-weight: 600; }
.inrema-header__submenu li a:hover { background: #f1f4fb; }
.inrema-header__cta { flex-shrink: 0; display: inline-flex; gap: 12px; align-items: center; justify-content: center; min-height: 57px; padding: 13px 21px; background: var(--inrema-yellow); color: #fff !important; border-radius: 13px; font-weight: 800; font-size: 17px; white-space: nowrap; box-shadow: 0 3px 0 rgba(181,130,0,.06); transition: filter .18s ease, transform .18s ease; }
.inrema-header__cta:hover { filter: brightness(.97); transform: translateY(-1px); }
.inrema-header__cta .inrema-icon { width: 31px; height: 31px; stroke-width: 2; }
.inrema-header__cta-short, .inrema-header__menu-toggle, .inrema-header__mobile-panel { display: none; }

/* Header contraído al desplazarse: gestionado por JS, sin depender del hero. */
.inrema-header.is-stuck { position: fixed; left: 0; right: 0; top: 0; width: 100%; z-index: 10000; box-shadow: 0 10px 28px rgba(0,23,99,.10); }
body.admin-bar .inrema-header.is-stuck { top: 32px; }
.inrema-header.is-stuck .inrema-header__upper { height: 0; opacity: 0; }
.inrema-header.is-stuck .inrema-header__main-inner { min-height: 83px; }
.inrema-header.is-stuck .inrema-header__logo { width: 208px; }
.inrema-header.is-stuck .inrema-header__cta { min-height: 49px; }
.inrema-header-spacer { display: block; height: 0; }

/* Laptop: conserva la jerarquía sin comprimir el menú. */
@media (max-width: 1480px) {
  .inrema-header__logo { width: 238px; }
  .inrema-header__main-inner { gap: 18px; }
  .inrema-header__nav-list { gap: 16px; }
  .inrema-header__cta { font-size: 15px; padding-inline: 15px; }
  .inrema-header__contact a { font-size: 15px; }
}

/* Tablet / móvil: tipografía y composición específicas, sin upper bar sobrecargado. */
@media (max-width: 1199px) {
  .inrema-header { --inrema-header-upper-height: 39px; --inrema-header-main-height: 90px; }
  .inrema-header__inner { width: min(calc(100% - 40px), var(--inrema-header-max)); }
  .inrema-header__upper-inner { justify-content: flex-end; }
  .inrema-header__socials, .inrema-header__upper-divider, .inrema-header__contact-divider, .inrema-header__email { display: none !important; }
  .inrema-header__contact { margin-left: 0; }
  .inrema-header__contact a { font-size: 14px; }
  .inrema-header__contact .inrema-icon { width: 17px; height: 17px; }
  .inrema-header__logo { width: 214px; }
  .inrema-header__nav { display: none; }
  .inrema-header__cta { margin-left: auto; min-height: 48px; padding: 9px 16px; font-size: 14px; border-radius: 10px; }
  .inrema-header__cta .inrema-icon { width: 22px; height: 22px; }
  .inrema-header__menu-toggle { display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 7px; border: 0; background: transparent !important; color: var(--inrema-blue); cursor: pointer; }
  .inrema-header__menu-toggle .inrema-icon { width: 32px; height: 32px; }
  .inrema-header__icon-close { display: none !important; }
  .inrema-header.is-menu-open .inrema-header__icon-menu { display: none !important; }
  .inrema-header.is-menu-open .inrema-header__icon-close { display: block !important; }
  .inrema-header__mobile-panel { display: block; position: absolute; top: 100%; left: 0; right: 0; width: 100%; background: #fff; border-top: 1px solid #e6e9f0; box-shadow: 0 14px 25px rgba(0,23,99,.16); padding: 14px 20px 24px; max-height: min(80vh, 680px); overflow: auto; z-index: 90; }
  .inrema-header__mobile-panel[hidden] { display: none !important; }
  .inrema-header__mobile-list { max-width: 760px; margin: 0 auto; padding: 0; list-style: none; }
  .inrema-header__mobile-list li { border-bottom: 1px solid #eff1f5; }
  .inrema-header__mobile-list a { display: block; padding: 14px 9px; font-size: 16px; font-weight: 700; color: var(--inrema-blue) !important; }
  .inrema-header__mobile-list a:hover { background: #f5f7fb; }
  .inrema-header__mobile-extras { display: grid; gap: 14px; max-width: 760px; margin: 18px auto 0; }
  .inrema-header__mobile-extras > a { display: inline-flex; gap: 10px; align-items: center; font-size: 13px; color: var(--inrema-blue) !important; font-weight: 600; }
  .inrema-header__mobile-extras > a .inrema-icon { width: 18px; height: 18px; }
  .inrema-header__mobile-socials { gap: 17px; }
  .inrema-header__mobile-socials .inrema-header__social-link { width: 36px; height: 36px; background: var(--inrema-blue); border-radius: 50%; }
  .inrema-header__mobile-socials .inrema-icon { width: 18px; height: 18px; }
  .inrema-header.is-stuck .inrema-header__main-inner { min-height: 76px; }
  .inrema-header.is-stuck .inrema-header__logo { width: 190px; }
}
@media (max-width: 690px) {
  .inrema-header { --inrema-header-main-height: 78px; }
  .inrema-header__inner { width: calc(100% - 28px); }
  .inrema-header__main-inner { gap: 9px; }
  .inrema-header__logo { width: clamp(128px, 39vw, 165px); }
  .inrema-header__cta { min-height: 40px; padding: 8px 10px; border-radius: 9px; font-size: 13px; gap: 5px; }
  .inrema-header__cta .inrema-icon { width: 19px; height: 19px; }
  .inrema-header__cta-full { display: none; }
  .inrema-header__cta-short { display: inline; }
  .inrema-header__menu-toggle { width: 39px; height: 39px; }
  .inrema-header__menu-toggle .inrema-icon { width: 28px; height: 28px; }
  .inrema-header.is-stuck .inrema-header__main-inner { min-height: 66px; }
  .inrema-header.is-stuck .inrema-header__logo { width: clamp(125px, 36vw, 151px); }
}
@media (max-width: 360px) {
  .inrema-header__inner { width: calc(100% - 20px); }
  .inrema-header__logo { width: 126px; }
  .inrema-header__cta { padding-inline: 8px; }
}
@media (max-width: 782px) {
  body.admin-bar .inrema-header.is-stuck { top: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  html:has([data-inrema-header]) { scroll-behavior: auto; }
  .inrema-header *, .inrema-header *::before, .inrema-header *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
