/* Project overrides layered on top of the purchased theme (style.min.css).
   Keep everything project-specific here so the theme files stay untouched. */

:root {
  --adp-green: #29594B;
  --adp-green-dark: #19352D;
  --adp-lime: #CFFF45;
  --adp-border: #DCE4E0;
}

/* The header row is a flexbox, and the logo SVG asks for 300px — which is why
   a crowded bar used to squeeze it down to a smear (or push the buttons off
   screen). Capping it leaves room for the nav; the pill never shrinks. */
.theme-main-menu .logo img {
  max-width: 150px;
}

.theme-main-menu .right-widget {
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Header: merged "Ingresar / Registrarme" control
   One pill instead of two separate buttons, so the top bar keeps its room for
   the nav and the search field.
--------------------------------------------------------------------------- */
.theme-main-menu .auth-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--adp-green);
  border-radius: 30px;
  background: #fff;
}

.theme-main-menu .auth-switch a {
  display: inline-block;
  font-family: "Satoshi", sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 34px;
  white-space: nowrap;
  border-radius: 30px;
  padding: 0 18px;
  transition: all 0.2s ease-in-out 0s;
}

.theme-main-menu .auth-switch__login {
  color: var(--adp-green-dark);
  /* Signed in, this half holds the username — cap it before it crowds the nav. */
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-main-menu .auth-switch__login:hover,
.theme-main-menu .auth-switch__login:focus-visible {
  background: rgba(41, 89, 75, 0.08);
  color: var(--adp-green-dark);
}

.theme-main-menu .auth-switch__signup {
  background: var(--adp-green);
  color: #fff;
}

.theme-main-menu .auth-switch__signup:hover,
.theme-main-menu .auth-switch__signup:focus-visible {
  background: var(--adp-lime);
  color: var(--adp-green-dark);
}

.theme-main-menu .header-plain-link {
  font-weight: 500;
  color: var(--adp-green-dark);
}

.theme-main-menu .header-plain-link:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Header: search field
--------------------------------------------------------------------------- */
.navbar-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: 260px;
  max-width: 100%;
  height: 46px;
  padding: 0 5px 0 16px;
  border: 1px solid var(--adp-border);
  border-radius: 30px;
  background: #F6F8F7;
  transition: all 0.2s ease-in-out 0s;
}

.navbar-search:hover {
  border-color: #B9C7C1;
}

/* Width stays fixed on focus — growing it would shove the whole nav sideways. */
.navbar-search:focus-within {
  background: #fff;
  border-color: var(--adp-green);
  box-shadow: 0 6px 20px rgba(25, 53, 45, 0.12);
}

.navbar-search__icon {
  flex: 0 0 auto;
  margin-right: 10px;
  font-size: 16px;
  line-height: 1;
  color: #7C8D87;
  transition: color 0.2s ease-in-out 0s;
}

.navbar-search:focus-within .navbar-search__icon {
  color: var(--adp-green);
}

.navbar-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: "Satoshi", sans-serif;
  font-size: 15px;
  color: var(--adp-green-dark);
}

.navbar-search__input::placeholder {
  color: #98A6A1;
}

/* Safari/Chrome draw their own clear button on type=search; the pill has its
   own submit button, so drop it. */
.navbar-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.navbar-search__submit {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--adp-green);
  color: #fff;
  font-size: 18px;
  transition: all 0.2s ease-in-out 0s;
}

.navbar-search__submit:hover {
  background: var(--adp-lime);
  color: var(--adp-green-dark);
}

/* Autocomplete panel */
.navbar-search__suggestions.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 300px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--adp-border);
  border-radius: 16px;
}

.navbar-search__suggestions .dropdown-item {
  border-radius: 10px;
  line-height: 1.4;
  font-size: 15px;
  white-space: normal;
  /* Product names arrive already cased; the theme's capitalize would turn
     "Ver todos los resultados" into title case. */
  text-transform: none;
}

.navbar-search__suggestions .dropdown-item:hover,
.navbar-search__suggestions .dropdown-item:focus {
  background: #F1F5F3;
}

/* On desktop the theme keeps every .navbar .dropdown-menu hidden until its
   parent .dropdown is hovered — which also swallowed the autocomplete panel,
   since it is opened from script with .show and has no .dropdown parent. */
.navbar-search__suggestions.dropdown-menu.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------------------
   Between 992px and 1399px the whole bar — logo, six nav items, search and the
   account pill — has to fit one line, so buy back some room.
--------------------------------------------------------------------------- */
@media (min-width: 992px) and (max-width: 1399px) {
  .navbar-search {
    width: 200px;
  }

  .theme-main-menu .nav-item .nav-link {
    margin: 0 12px;
  }
}

/* Tightest desktop band: a signed-in visitor also carries "Mi cuenta" and the
   account pill, which is what used to push the row off screen. */
@media (min-width: 992px) and (max-width: 1199px) {
  .navbar-search {
    width: 170px;
  }

  .theme-main-menu .nav-item .nav-link {
    margin: 0 8px;
    font-size: 16px;
  }
}

/* ---------------------------------------------------------------------------
   Small screens: the search field lives inside the collapsed nav, and the auth
   pill sits next to the burger — both need to shrink.
--------------------------------------------------------------------------- */
@media (max-width: 991px) {
  /* Match the 12px inset the drawer's nav links use. */
  .nav-item-search {
    padding: 14px 12px 5px;
  }

  .navbar-search,
  .navbar-search:focus-within {
    width: 100%;
  }

  /* The collapsed nav is a 320px drawer — a wider panel would be cut off. */
  .navbar-search__suggestions.dropdown-menu {
    min-width: 0;
  }
}

/* The pill shares the top bar with the logo and the burger on phones. */
@media (max-width: 575px) {
  .theme-main-menu .auth-switch a {
    font-size: 13px;
    padding: 0 10px;
    line-height: 32px;
  }
}
