:root {
  --eafh-green: #2255A2;
  --eafh-green-dark: #173C73;
  --eafh-lime: #6EA2E5;
  --eafh-white: #ffffff;
  --eafh-ink: #1D3152;
  --eafh-muted: #66758c;
  --eafh-line: rgba(34, 85, 162, 0.16);
  --eafh-shadow: 0 18px 50px rgba(23, 60, 115, 0.15);
  --eafh-header-bg: rgba(255,255,255,1);
  --eafh-top: 18px;
  --eafh-max-width: 1500px;
  --eafh-logo-width: 72px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 116px;
}

.eafh-header,
.eafh-header * {
  box-sizing: border-box;
}

.eafh-header {
  position: fixed;
  top: var(--eafh-top);
  left: 0;
  right: 0;
  z-index: 999999;
  width: 100%;
  padding: 0 22px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: none;
}

.admin-bar .eafh-header {
  top: calc(var(--eafh-top) + 32px);
  z-index: 99998;
}


/* Smart hero offset: no external spacer is created. On tablet/mobile the
   plugin adds internal top padding to the hero itself, so its background
   continues behind the fixed floating menu while the text moves down. */
.eafh-offset-target,
.eafh-offset-content,
.eafh-mobile-hero-target {
  box-sizing: border-box !important;
}

.eafh-bar {
  width: min(var(--eafh-max-width), 100%);
  min-height: 78px;
  margin: 0 auto;
  padding: 10px 15px 10px 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  border-radius: 14px;
  background: var(--eafh-header-bg);
  border: 1px solid rgba(34, 85, 162, 0.10);
  box-shadow: 0 14px 38px rgba(23, 60, 115, 0.14);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
  transition: background .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.eafh-header.eafh-scrolled .eafh-bar {
  box-shadow: 0 18px 46px rgba(23, 60, 115, 0.18);
  border-color: rgba(34, 85, 162, 0.14);
}

.eafh-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

.eafh-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--eafh-logo-width);
  flex: 0 0 var(--eafh-logo-width);
  max-width: 27vw;
}

.eafh-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}

.eafh-brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1;
}

.eafh-brand-name {
  display: block;
  margin: 0;
  color: var(--eafh-green-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: .1px;
  white-space: nowrap;
}

.eafh-brand-subtitle {
  display: block;
  margin-top: 5px;
  color: var(--eafh-green);
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 1.55px;
  white-space: nowrap;
}

/* Desktop WordPress menu */
.eafh-nav {
  min-width: 0;
}

.eafh-menu-list,
.eafh-menu-list ul,
.eafh-mobile-menu-list,
.eafh-mobile-menu-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.eafh-menu-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.eafh-menu-list > li {
  position: relative;
  margin: 0;
}

.eafh-menu-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--eafh-ink) !important;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.15;
  text-decoration: none !important;
  white-space: nowrap;
  border: 0 !important;
  box-shadow: none !important;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.eafh-menu-list > li > a:hover,
.eafh-menu-list > li > a:focus,
.eafh-menu-list > .current-menu-item > a,
.eafh-menu-list > .current-menu-ancestor > a {
  color: var(--eafh-green) !important;
  background: color-mix(in srgb, var(--eafh-lime) 14%, transparent);
  transform: translateY(-1px);
}

/* Desktop submenus */
.eafh-menu-list .sub-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 100;
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.98);
  border: 1px solid var(--eafh-line);
  box-shadow: 0 20px 55px rgba(23,60,115,.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.eafh-menu-list li:hover > .sub-menu,
.eafh-menu-list li:focus-within > .sub-menu,
.eafh-menu-list li.eafh-submenu-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Invisible hover bridge between the parent item and dropdown.
   This prevents the submenu from closing while the pointer crosses the gap. */
.eafh-menu-list > li > .sub-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}

/* Same protection for third-level submenus that open sideways. */
.eafh-menu-list .sub-menu .sub-menu::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -12px;
  width: 12px;
}

.eafh-menu-list .sub-menu li {
  position: relative;
}

.eafh-menu-list .sub-menu a {
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  white-space: normal;
}

.eafh-menu-list .sub-menu a:hover,
.eafh-menu-list .sub-menu a:focus {
  background: rgba(110,162,229,.14);
  color: var(--eafh-green) !important;
}

.eafh-menu-list .sub-menu .sub-menu {
  left: calc(100% + 8px);
  top: -8px;
}

/* CTA */
.eafh-buy,
.eafh-mobile-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  color: var(--eafh-white) !important;
  background: linear-gradient(135deg, var(--eafh-green) 0%, var(--eafh-green-dark) 100%);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 14px 30px rgba(34, 85, 162, 0.24) !important;
  border: 0 !important;
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}

.eafh-buy:hover,
.eafh-buy:focus,
.eafh-mobile-buy:hover,
.eafh-mobile-buy:focus {
  transform: translateY(-2px);
  background: var(--eafh-green-dark);
  color: var(--eafh-white) !important;
}

/* Language */
.eafh-language {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.eafh-language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 58px;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(34, 85, 162, 0.08);
  color: var(--eafh-ink);
  cursor: pointer;
}

.eafh-language-toggle:hover,
.eafh-language.eafh-language-open .eafh-language-toggle {
  background: var(--eafh-green);
}

.eafh-language-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.eafh-language-flag img {
  display: block;
  width: 22px;
  height: auto;
  border-radius: 2px;
}

.eafh-language-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--eafh-ink);
  transition: transform .2s ease, border-top-color .2s ease;
}

.eafh-language-toggle:hover .eafh-language-caret,
.eafh-language.eafh-language-open .eafh-language-caret {
  border-top-color: #fff;
}

.eafh-language.eafh-language-open .eafh-language-caret {
  transform: rotate(180deg);
}

.eafh-language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 58px;
  margin: 0;
  padding: 7px;
  list-style: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--eafh-line);
  box-shadow: 0 18px 45px rgba(23, 60, 115, 0.17);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

.eafh-language.eafh-language-open .eafh-language-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.eafh-language-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 34px;
  border-radius: 10px;
}

.eafh-language-item a:hover,
.eafh-language-item.current-lang a {
  background: rgba(110,162,229,.16);
}

/* Mobile button */
.eafh-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: rgba(34, 85, 162, 0.08);
  color: var(--eafh-ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.eafh-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 14px;
}

.eafh-toggle-icon span {
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease, top .2s ease;
}

.eafh-toggle-icon span:first-child { top: 3px; }
.eafh-toggle-icon span:last-child { top: 10px; }
.eafh-open .eafh-toggle-icon span:first-child { top: 6px; transform: rotate(45deg); }
.eafh-open .eafh-toggle-icon span:last-child { top: 6px; transform: rotate(-45deg); }

.eafh-mobile {
  width: min(680px, calc(100% - 44px));
  margin: 10px auto 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  border: 1px solid var(--eafh-line);
  box-shadow: 0 20px 55px rgba(23,60,115,.17);
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.eafh-open .eafh-mobile {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.eafh-mobile-menu-list > li > a,
.eafh-mobile-menu-list .sub-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 9px;
  color: var(--eafh-ink) !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 750;
}

.eafh-mobile-menu-list > li > a:hover,
.eafh-mobile-menu-list .sub-menu a:hover,
.eafh-mobile-menu-list .current-menu-item > a {
  background: rgba(110,162,229,.14);
  color: var(--eafh-green) !important;
}

.eafh-mobile-menu-list li {
  position: relative;
}

.eafh-mobile-menu-list .menu-item-has-children > a {
  padding-right: 54px;
}

.eafh-mobile-submenu-toggle {
  position: absolute;
  top: 4px;
  right: 5px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(34,85,162,.08);
  color: var(--eafh-green-dark);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.eafh-mobile-submenu-toggle:hover,
.eafh-mobile-submenu-toggle:focus {
  background: rgba(110,162,229,.18);
  color: var(--eafh-green);
  outline: none;
}

.eafh-mobile-submenu-toggle::before,
.eafh-mobile-submenu-toggle::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .22s ease, opacity .22s ease;
}

.eafh-mobile-submenu-toggle::after {
  transform: rotate(90deg);
}

.eafh-mobile-menu-list .eafh-mobile-submenu-open > .eafh-mobile-submenu-toggle::after {
  transform: rotate(0);
  opacity: 0;
}

.eafh-mobile-menu-list .sub-menu {
  max-height: 0;
  margin: 0 0 0 14px;
  padding: 0 0 0 10px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  border-left: 2px solid rgba(34,85,162,.12);
  transform: translateY(-4px);
  transition: max-height .34s ease, opacity .22s ease, transform .22s ease, margin .22s ease, visibility .22s ease;
}

.eafh-mobile-menu-list .eafh-mobile-submenu-open > .sub-menu {
  max-height: 1400px;
  margin: 4px 0 7px 14px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.eafh-mobile-menu-list .sub-menu .sub-menu {
  margin-left: 10px;
}

.eafh-mobile {
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.eafh-mobile-buy {
  width: 100%;
  margin-top: 10px;
}

.eafh-language--mobile-top {
  display: none;
}

@media (max-width: 1180px) {
  .eafh-header { padding: 0 14px; }
  .eafh-logo { width: min(var(--eafh-logo-width), 78px); flex-basis: min(var(--eafh-logo-width), 78px); }
  .eafh-brand { gap: 10px; }
  .eafh-brand-name { font-size: 17px; }
  .eafh-brand-subtitle { font-size: 7.5px; letter-spacing: 1.2px; }
  .eafh-menu-list a { padding: 0 9px; font-size: 12px; }
  .eafh-bar { gap: 10px; }
}

@media (max-width: 980px) {
  .eafh-bar {
    grid-template-columns: auto 1fr auto auto;
    min-height: 70px;
    padding: 9px 10px 9px 14px;
  }

  .eafh-logo { width: min(var(--eafh-logo-width), 72px); flex-basis: min(var(--eafh-logo-width), 72px); max-width: none; }
  .eafh-brand { max-width: 64vw; }
  .eafh-brand-name { font-size: 16px; }
  .eafh-brand-subtitle { font-size: 7px; letter-spacing: 1px; }
  .eafh-toggle-text { display: none; }
  .eafh-toggle { width: 44px; min-width: 44px; min-height: 44px; padding: 0; }
  .eafh-nav,
  .eafh-language--desktop,
  .eafh-buy { display: none; }
  .eafh-language--mobile-top,
  .eafh-toggle { display: inline-flex; }
}

@media (max-width: 782px) {
  .admin-bar .eafh-header { top: calc(var(--eafh-top) + 46px); }
}

@media (max-width: 560px) {
  .eafh-header { padding: 0 10px; }
  .eafh-bar {
    grid-template-columns: minmax(0,1fr) auto auto;
    border-radius: 13px;
  }
  .eafh-logo { width: min(var(--eafh-logo-width), 62px); flex-basis: min(var(--eafh-logo-width), 62px); max-width: none; }
  .eafh-brand { gap: 8px; max-width: 72vw; }
  .eafh-brand-name { font-size: 14px; }
  .eafh-brand-subtitle { margin-top: 4px; font-size: 6.2px; letter-spacing: .8px; }
  .eafh-language--mobile-top { display: none; }
  .eafh-toggle-text { display: none; }
  .eafh-toggle { width: 44px; padding: 0; }
  .eafh-mobile { width: calc(100% - 20px); border-radius: 13px; }
}


/* Phone-only correction for the white band that can be introduced by a
   mobile theme/page wrapper before the first hero. The JS applies the exact
   negative margin dynamically; these rules make the visual hero itself own
   the top area and prevent a white flash while its image loads. */
@media (max-width: 560px) {
  .eafh-mobile-hero-target,
  .eafh-mobile-top-gap-fixed {
    position: relative;
  }

  .hero-extranjeria.eafh-mobile-hero-target,
  .hero-extranjeria.eafh-mobile-top-gap-fixed {
    background: #14233b !important;
  }

  .hero-extranjeria.eafh-mobile-hero-target > img,
  .hero-extranjeria.eafh-mobile-top-gap-fixed > img {
    top: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
  }
}
