/* Header compartido Smart Fit: se usa en index, páginas públicas y panel. */
:root {
  --autohide-header-height: 99px;
  --sf-header-yellow: #ffad12;
  --sf-header-yellow-2: #fbb900;
  --sf-header-black: #141415;
  --sf-header-line: rgba(20, 20, 21, 0.12);
  --sf-header-font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.has-autohide-header {
  padding-top: var(--autohide-header-height, 99px);
}

body.sf-menu-open {
  overflow: hidden;
}

.new-home-v4-header:not([data-smartfit-shared-header]),
#header-menu-modal:not([data-smartfit-shared-header]),
body > .hpub,
body > .hpub-menu,
body > .topbar {
  display: none !important;
}

.new-home-v4-header {
  font-family: var(--sf-header-font);
}

.new-home-v4-header.autohide {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 11000;
  background: #fff !important;
  transform: translate3d(0, -110%, 0);
  transition: transform 280ms ease, box-shadow 280ms ease;
  will-change: transform;
}

.new-home-v4-header.autohide.shown {
  background: #fff !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transform: translate3d(0, 0, 0);
}

.new-home-v4-header__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--autohide-header-height, 99px);
  padding: 0 clamp(20px, 4.4vw, 90px);
  background: #fff !important;
}

.new-home-v4-header__brand,
.new-home-v4-header__brand a {
  display: flex;
  align-items: center;
}

.new-home-v4-header__brand {
  width: 190px;
  height: 69px;
  flex: 0 0 auto;
}

.new-home-v4-header__brand a {
  width: 100%;
  height: 100%;
}

.smartfit-shared-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

@media (max-width: 1441px) {
  .new-home-v4-header__brand {
    width: 150px;
  }
}

.new-home-v4-header__nav,
.new-home-v4-header__menu {
  display: flex;
  align-items: center;
}

.new-home-v4-header__menu {
  gap: clamp(12px, 1.4vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.new-home-v4-btn,
.new-home-v4-header__menu-item,
.smart-ui-button {
  font-family: var(--sf-header-font);
  text-decoration: none;
}

.new-home-v4-header__menu-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--sf-header-black);
  font-size: clamp(15px, 1vw, 18px);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.new-home-v4-header__menu-item:hover {
  color: var(--sf-header-yellow);
}

.new-home-v4-header__menu-item-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
}

.new-home-v4-header__menu .smart-ui-button--primary,
#header-menu-modal .new-home-v4-nav__content > .smart-ui-button {
  position: relative;
  overflow: visible;
  animation: smartfitCtaPulse 1.8s ease-out infinite;
}

.smart-ui-button--primary,
.new-home-v4-header__menu .smart-ui-button--primary,
#header-menu-modal .new-home-v4-nav__content > .smart-ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  background: var(--sf-header-yellow);
  color: #111 !important;
  font-size: clamp(15px, 1vw, 18px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

@keyframes smartfitCtaPulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 143, 255, 0.55); }
  70% { box-shadow: 0 0 0 11px rgba(76, 143, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 143, 255, 0); }
}

.new-home-v4-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
}

.new-home-v4-menu-button svg {
  display: block;
}

#dark-mode,
#light-mode {
  display: none !important;
}

.new-home-v4-header__country-item {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 !important;
}

.new-home-v4-header__country-item .new-home-v4-nav__countries {
  position: relative;
  margin: 0;
}

.new-home-v4-nav__country-selected {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 104px;
  height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
}

.new-home-v4-header .new-home-v4-nav__country-selected {
  min-width: 104px !important;
  height: 44px !important;
}

.new-home-v4-nav__country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.new-home-v4-header .new-home-v4-nav__country-flag {
  width: 32px !important;
  height: 32px !important;
  transform: none !important;
}

.new-home-v4-nav__country-flag-ar { background-image: url("/assets/flags/ar.svg"); }
.new-home-v4-nav__country-flag-br { background-image: url("/assets/flags/br.svg"); }
.new-home-v4-nav__country-flag-cl { background-image: url("/assets/flags/cl.svg"); }
.new-home-v4-nav__country-flag-co { background-image: url("/assets/flags/co.svg"); }
.new-home-v4-nav__country-flag-cr { background-image: url("/assets/flags/cr.svg"); }
.new-home-v4-nav__country-flag-mx { background-image: url("/assets/flags/mx.svg"); }

.new-home-v4-nav__country-selected > .country-name {
  flex-grow: 0;
  padding: 0 8px 0 0;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.new-home-v4-nav__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 10px;
  transition: transform 180ms ease;
}

.new-home-v4-nav__countries.opened .new-home-v4-nav__arrow {
  transform: rotate(180deg);
}

.new-home-v4-header__country-item .new-home-v4-nav__countries-wrapper {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 10020;
  width: min(360px, calc(100vw - 32px));
  max-height: 70vh;
  overflow: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--sf-header-line);
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
}

.new-home-v4-nav__countries-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.new-home-v4-nav__countries-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  color: #111;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.new-home-v4-nav__countries-list li a:hover {
  background: #fff7df;
}

#header-menu-modal[aria-hidden="true"] {
  display: none;
}

#header-menu-modal[aria-hidden="false"] {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 20000;
  font-family: var(--sf-header-font);
}

#header-menu-modal .smart-ui-modal__overlay {
  position: fixed;
  inset: 0 !important;
  z-index: 20000 !important;
  background: rgba(0, 0, 0, 0.36);
}

#header-menu-modal .smart-ui-modal__container {
  position: absolute;
  top: 0 !important;
  left: auto !important;
  right: 0;
  bottom: 0 !important;
  z-index: 20001 !important;
  width: min(360px, 32vw);
  min-width: 320px;
  max-width: 100vw;
  overflow-y: auto;
  background: #fff;
  color: #111;
  box-shadow: -18px 0 44px rgba(0, 0, 0, 0.16);
  will-change: transform;
}

#header-menu-modal .smart-ui-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px 18px;
  gap: 0;
}

#header-menu-modal .smart-ui-modal__title {
  display: none;
}

#header-menu-modal .smart-ui-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  cursor: pointer;
}

#header-menu-modal .smart-ui-modal__close svg {
  width: 32px;
  height: 32px;
  pointer-events: none;
}

#header-menu-modal .smartfit-lang-switcher {
  position: relative;
  margin: 0 auto 0 0;
  color: #000;
}

#header-menu-modal .smartfit-lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  font-family: var(--sf-header-font);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

#header-menu-modal .smartfit-lang-switcher__globe {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
}

#header-menu-modal .smartfit-lang-switcher__caret {
  width: 23px;
  height: 14px;
  flex: 0 0 auto;
  transition: transform 180ms ease;
}

#header-menu-modal .smartfit-lang-switcher.is-open .smartfit-lang-switcher__caret {
  transform: rotate(180deg);
}

#header-menu-modal .smartfit-lang-switcher__menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 2;
  min-width: 160px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--sf-header-line);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

#header-menu-modal .smartfit-lang-switcher.is-open .smartfit-lang-switcher__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#header-menu-modal .smartfit-lang-switcher__menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #141415;
  font-family: var(--sf-header-font);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: default;
}

#header-menu-modal .smartfit-lang-switcher__menu button:hover {
  background: #fff7df;
}

#header-menu-modal .smart-ui-modal__content {
  padding: 0 18px 20px;
}

#header-menu-modal .new-home-v4-nav__content {
  display: block;
  overflow-x: visible;
  padding-top: 0;
}

#header-menu-modal .new-home-v4-nav__content > .smart-ui-button {
  width: auto;
  max-width: 100% !important;
  min-height: 48px;
  margin: 0 0 12px auto !important;
  padding: 0 30px;
  outline: none !important;
  animation: none !important;
  box-shadow: none !important;
  font-size: clamp(15px, 1vw, 18px);
}

#header-menu-modal .new-home-v4-nav__menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0 0 10px !important;
  padding: 0;
  list-style: none;
}

#header-menu-modal .new-home-v4-nav__menu li {
  margin: 0;
  padding: 0;
}

#header-menu-modal .new-home-v4-nav__menu li a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-height: 44px;
  margin: 0 !important;
  padding: 2px 4px !important;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #141415 !important;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
  text-decoration: none;
  box-shadow: none;
  transition: background-color 180ms ease, color 180ms ease;
}

#header-menu-modal .new-home-v4-nav__menu li a:hover {
  background: #fff7df;
  color: #141415 !important;
}

#header-menu-modal .new-home-v4-nav__menu li a:focus-visible {
  outline: 2px solid var(--sf-header-yellow);
  outline-offset: 2px;
}

#header-menu-modal .sf-public-nav-item__label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
}

#header-menu-modal .sf-public-nav-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #141415;
}

#header-menu-modal .sf-public-nav-item__icon svg {
  display: block;
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#header-menu-modal .sf-public-nav-item.is-active {
  font-weight: 900;
}

#header-menu-modal .sf-public-nav-item.is-active .sf-public-nav-item__icon {
  background: var(--sf-header-yellow);
}

#header-menu-modal .new-home-v4-nav__footer-menu,
#header-menu-modal .smartfit-nav-selectors:empty {
  display: none !important;
}

#header-menu-modal .smartfit-nav-selectors {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 20px;
  margin: 8px 0 0;
}

@media (max-width: 1024px) {
  .new-home-v4-header__menu > li:not(:last-child):not(.new-home-v4-header__country-item) {
    display: none;
  }

  #header-menu-modal .smart-ui-modal__container {
    width: min(350px, 76vw);
    min-width: 0;
  }
}

@media (max-width: 767.98px) {
  :root {
    --autohide-header-height: 89px;
  }

  .new-home-v4-header__content {
    min-height: var(--autohide-header-height, 89px);
    padding: 0 22px;
  }

  .smartfit-shared-logo {
    width: 100%;
  }

  .new-home-v4-header__brand {
    width: 97px;
  }

  .new-home-v4-header__country-item {
    display: flex;
  }

  .new-home-v4-nav__country-selected {
    min-width: 100px;
    height: 42px;
    gap: 5px;
    padding: 0 2px;
  }

  .new-home-v4-header .new-home-v4-nav__country-selected {
    min-width: 100px !important;
    height: 42px !important;
  }

  .new-home-v4-nav__country-selected > .country-name {
    padding-right: 2px;
    font-size: 13px;
  }

  .new-home-v4-nav__country-flag {
    width: 30px;
    height: 30px;
  }

  .new-home-v4-header .new-home-v4-nav__country-flag {
    width: 30px !important;
    height: 30px !important;
  }

  .new-home-v4-header__country-item .new-home-v4-nav__countries-wrapper {
    position: fixed;
    top: calc(var(--autohide-header-height, 89px) + 8px);
    right: 16px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - var(--autohide-header-height, 89px) - 24px);
  }

  #header-menu-modal .smart-ui-modal__container {
    width: min(320px, 88vw);
  }

  #header-menu-modal .smart-ui-modal__header {
    min-height: 64px;
    padding: 10px 14px;
  }

  #header-menu-modal .smart-ui-modal__content {
    padding: 0 12px 18px;
  }

  #header-menu-modal .smartfit-lang-switcher__btn {
    font-size: 20px;
  }

  #header-menu-modal .new-home-v4-nav__menu li a {
    min-height: 48px;
    gap: 10px;
    padding: 5px 7px !important;
    font-size: 16px;
  }

  #header-menu-modal .sf-public-nav-item__icon {
    flex-basis: 35px;
    width: 35px;
    height: 35px;
  }

  #header-menu-modal .sf-public-nav-item__icon svg {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 460px) {
  .new-home-v4-header__content {
    padding-right: 14px;
    padding-left: 14px;
  }

  .new-home-v4-header__menu {
    gap: 6px;
  }

  #header-menu-modal .smart-ui-modal__container {
    width: min(320px, 88vw);
  }
}

@media (max-width: 359.98px) {
  .new-home-v4-nav__countries-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .new-home-v4-header.autohide,
  #header-menu-modal .smartfit-lang-switcher__menu {
    transition: none;
  }

  .new-home-v4-header__menu .smart-ui-button--primary,
  #header-menu-modal .new-home-v4-nav__content > .smart-ui-button {
    animation: none;
  }
}
