/* Header sticky + top bar */

.eg-site-header-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: auto;
  max-height: none;
  margin: 0;
  background: transparent;
  overflow: visible;
}

.eg-site-header-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--eg-header-fill);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--eg-border);
  box-shadow: inset 0 1px 0 var(--eg-glass);
}

.eg-topbar {
  position: relative;
  z-index: 2;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.eg-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 40px;
  width: min(1140px, calc(100% - 48px));
  min-height: 34px;
  margin: 0 auto;
  padding: 6px 0;
}

.eg-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none !important;
  white-space: nowrap;
}

.eg-topbar__item--phone {
  font-variant-numeric: tabular-nums;
}

.eg-site-header {
  position: relative;
  width: 100%;
  height: 68px;
  z-index: 1;
  background: transparent;
  margin: 0;
}

body.admin-bar .eg-site-header-wrap {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .eg-site-header-wrap {
    top: 46px;
  }
}

.eg-site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1140px, calc(100% - 48px));
  height: 68px;
  margin: 0 auto;
  z-index: 1;
}

.eg-site-header__logo {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  text-decoration: none !important;
  z-index: 2;
}

.eg-site-header__logo-img,
.eg-site-header__logo img {
  display: block;
  height: 40px !important;
  width: auto !important;
  max-width: 220px !important;
  max-height: 40px !important;
  object-fit: contain;
}

.eg-site-header__logo-text {
  color: var(--eg-heading);
  font-size: 16px;
  font-weight: 700;
}

.eg-site-header__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--eg-heading);
  cursor: pointer;
  z-index: 2;
}

.eg-site-header__toggle-bars {
  position: relative;
  display: block;
  width: 22px;
  height: 16px;
}

.eg-site-header__toggle-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition:
    top 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
}

.eg-site-header__toggle-bars span:nth-child(1) { top: 0; }
.eg-site-header__toggle-bars span:nth-child(2) { top: 7px; }
.eg-site-header__toggle-bars span:nth-child(3) { top: 14px; }

.eg-site-header.is-open .eg-site-header__toggle-bars span:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

.eg-site-header.is-open .eg-site-header__toggle-bars span:nth-child(2) {
  opacity: 0;
}

.eg-site-header.is-open .eg-site-header__toggle-bars span:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

.eg-site-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
}

.eg-site-header__menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eg-site-header__menu > li > a {
  display: inline-flex;
  padding: 6px 12px;
  color: var(--eg-nav) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: color 0.18s ease;
}

.eg-site-header__menu > li > a:hover,
.eg-site-header__menu > li > a:focus,
.eg-site-header__menu > li.current-menu-item > a,
.eg-site-header__menu > li.current_page_item > a,
.eg-site-header__menu > li.current-menu-parent > a,
.eg-site-header__menu > li.current-menu-ancestor > a,
.eg-site-header__menu > li.current_page_parent > a,
.eg-site-header__menu > li.current_page_ancestor > a {
  color: var(--eg-primary) !important;
}

.eg-site-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--eg-primary) 72%, transparent);
  background: var(--eg-primary);
  border-color: var(--eg-primary);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
}

.eg-site-header__cta:hover {
  background: color-mix(in srgb, var(--eg-primary) 82%, #000);
  border-color: color-mix(in srgb, var(--eg-primary) 82%, #000);
  color: #fff !important;
}

.eg-site-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
  flex-shrink: 0;
}

.eg-social {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.eg-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--eg-border);
  border-radius: 50%;
  color: #fff !important;
  background: transparent;
  text-decoration: none !important;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.eg-social__link svg {
  width: 15px;
  height: 15px;
  display: block;
}

.eg-social__link:hover,
.eg-social__link:focus-visible {
  color: var(--eg-primary) !important;
  border-color: var(--eg-primary);
  background: color-mix(in srgb, var(--eg-primary) 12%, transparent);
  transform: translateY(-2px);
}

.eg-social--mobile {
  display: none;
}

.eg-site-header__cta--mobile {
  display: none;
}

body.eg-nav-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .eg-topbar {
    font-size: 10px;
  }

  .eg-topbar__inner {
    width: calc(100% - 24px);
    gap: 8px 12px;
    min-height: 28px;
    flex-wrap: nowrap;
  }

  .eg-topbar__item {
    white-space: nowrap;
  }

  .eg-site-header-wrap {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .eg-site-header,
  .eg-site-header.is-open {
    height: 64px;
    max-height: 64px;
    overflow: visible;
  }

  .eg-site-header__inner {
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    width: calc(100% - 32px);
    overflow: visible;
  }

  .eg-site-header__logo-img,
  .eg-site-header__logo img {
    height: 34px !important;
    max-height: 34px !important;
  }

  .eg-site-header__actions {
    display: none;
  }

  .eg-site-header__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .eg-site-header__cta--desktop {
    display: none;
  }

  /* cuelga del header; el top bar queda arriba */
  .eg-site-header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 20px 0;
    background: var(--eg-header-fill);
    border-bottom: 1px solid var(--eg-border);
    box-shadow: 0 24px 48px color-mix(in srgb, #000 22%, transparent);
    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    z-index: 1001;
    transition:
      max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.28s ease,
      transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.28s ease,
      padding 0.36s ease;
  }

  .eg-site-header.is-open .eg-site-header__nav {
    max-height: min(78vh, 560px);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    padding: 12px 20px 22px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .eg-site-header__menu {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
  }

  .eg-site-header__menu > li {
    opacity: 0;
    transform: translateY(10px);
    transition:
      opacity 0.3s ease,
      transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .eg-site-header.is-open .eg-site-header__menu > li {
    opacity: 1;
    transform: translateY(0);
  }

  .eg-site-header.is-open .eg-site-header__menu > li:nth-child(1) { transition-delay: 0.04s; }
  .eg-site-header.is-open .eg-site-header__menu > li:nth-child(2) { transition-delay: 0.08s; }
  .eg-site-header.is-open .eg-site-header__menu > li:nth-child(3) { transition-delay: 0.12s; }
  .eg-site-header.is-open .eg-site-header__menu > li:nth-child(4) { transition-delay: 0.16s; }
  .eg-site-header.is-open .eg-site-header__menu > li:nth-child(5) { transition-delay: 0.2s; }
  .eg-site-header.is-open .eg-site-header__menu > li:nth-child(6) { transition-delay: 0.24s; }

  .eg-site-header__menu > li > a {
    width: 100%;
    padding: 14px 12px !important;
    border-radius: 12px;
    color: var(--eg-heading) !important;
    font-size: 17px !important;
    font-weight: 600 !important;
  }

  .eg-site-header__menu > li > a:hover,
  .eg-site-header__menu > li > a:focus,
  .eg-site-header__menu > li.current-menu-item > a,
  .eg-site-header__menu > li.current_page_item > a,
  .eg-site-header__menu > li.current-menu-parent > a,
  .eg-site-header__menu > li.current-menu-ancestor > a,
  .eg-site-header__menu > li.current_page_parent > a,
  .eg-site-header__menu > li.current_page_ancestor > a {
    color: var(--eg-primary) !important;
  }

  .eg-social--mobile {
    display: flex;
    margin: 10px 0 4px;
  }

  .eg-site-header__cta--mobile {
    display: inline-flex;
    margin-top: 8px;
    width: 100%;
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity 0.3s ease 0.12s,
      transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.12s,
      background 0.2s ease,
      border-color 0.2s ease;
  }

  .eg-site-header.is-open .eg-site-header__cta--mobile {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .eg-topbar {
    font-size: 9px;
  }

  .eg-topbar__inner {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    width: calc(100% - 16px);
    padding: 5px 0;
    gap: 6px;
  }

  .eg-topbar__item,
  .eg-topbar__item--phone {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eg-site-header__toggle-bars span,
  .eg-site-header__nav,
  .eg-site-header__menu > li,
  .eg-site-header__cta--mobile {
    transition: none !important;
  }

  .eg-site-header__nav {
    transform: none !important;
  }

  .eg-site-header__menu > li,
  .eg-site-header__cta--mobile {
    opacity: 1;
    transform: none;
  }
}
