/* AW Menu - Front */

.aw-menu-wrap {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.aw-menu {
  width: 100%;
}

.aw-menu__bar {
  display: flex;
  align-items: center;
  /* Mobile: toggle must be on the LEFT */
  justify-content: flex-start;
  gap: 14px;
}

/* Toggle (mobile) */
.aw-menu__toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 10px;
  cursor: pointer;
}

.aw-menu__toggle-bars {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  position: relative;
}

.aw-menu__toggle-bars::before,
.aw-menu__toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: currentColor;
}

.aw-menu__toggle-bars::before { top: -7px; }
.aw-menu__toggle-bars::after { top: 7px; }

/* List */
.aw-menu__list {
  list-style: none !important;
  margin: 0;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.aw-menu__item { margin: 0; }

.aw-menu .aw-menu__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;

  /* Blue gradient underline effect */
  color: #0055A4;
  background-image: linear-gradient(90deg, #0055A4, #00AEEF) !important;
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  padding-bottom: 4px;
  transition: background-size 220ms ease, color 220ms ease;
}

.aw-menu .aw-menu__link:hover,
.aw-menu .aw-menu__link:focus-visible {
  background-size: 100% 2px;
  color: #0055A4;
}

.aw-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.aw-menu__icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

/*
  Desktop layout:
  - Force logo to stay on the LEFT on desktop
  - Keep AW Menu AFTER the logo
*/
@media (min-width: 768px) {
  .header-bottom__row.aw-menu-enabled {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
  }

  .header-bottom__row.aw-menu-enabled > .logo {
    order: 1;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .header-bottom__row.aw-menu-enabled > .aw-menu-wrap {
    order: 2;
  }

  /* Keep menu items aligned near the logo */
  .aw-menu__bar {
    justify-content: flex-start;
  }

  /* Prevent the menu from breaking above/below the logo */
  .aw-menu__list {
    flex-wrap: nowrap;
  }
}

/* Mobile only:
   - keep logo / search / account / cart on the first line
   - move AW menu under the logo, left aligned
   - open the menu as a real grid in the flow (no overlay)
*/
@media (max-width: 767.98px) {
  .header-bottom__row.aw-menu-enabled {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .header-bottom__row.aw-menu-enabled > .logo { order: 1; }
  .header-bottom__row.aw-menu-enabled > .search__mobile { order: 2; }
  .header-bottom__row.aw-menu-enabled > #_mobile_user_info { order: 3; }
  .header-bottom__row.aw-menu-enabled > #_mobile_cart { order: 4; }

  .header-bottom__row.aw-menu-enabled > .aw-menu-wrap {
    order: 5;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 8px;
    margin-bottom: 14px;
    justify-content: flex-start;
  }

  .header-bottom__row.aw-menu-enabled > .aw-menu-wrap .aw-menu {
    width: 100%;
  }

  .header-bottom__row.aw-menu-enabled > .aw-menu-wrap .aw-menu__bar {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .aw-menu__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .aw-menu__list {
    display: none;
    width: 100%;
    padding-top: 0;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .aw-menu.aw-menu--open .aw-menu__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .aw-menu__item {
    width: 100%;
  }

  .aw-menu .aw-menu__link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding: 12px 12px;
    white-space: normal;
    border: 1px solid rgba(0, 85, 164, 0.10);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    background-image: none !important;
  }

  .aw-menu .aw-menu__link:hover,
  .aw-menu .aw-menu__link:focus-visible {
    background-size: 0 0;
    color: #0055A4;
  }

  .aw-menu__text {
    line-height: 1.25;
    font-size: 14px;
  }
}

@media (max-width: 479.98px) {
  .aw-menu.aw-menu--open .aw-menu__list {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Safety overrides (layout + colors)
   - Ensure menu aligns vertically with the logo on desktop
   - Keep menu links blue by default
   ========================= */
.aw-menu__link{color:#0055A4 !important;}
.aw-menu__link .aw-menu__text{color:inherit;}

@media (min-width: 768px){
  /* the header row is often align-items-stretch in the theme; ensure AW menu centers */
  .header-bottom__row .aw-menu-wrap{
    align-self:center;
    display:flex;
    align-items:center;
    margin-left:20px;
  }
  .header-bottom__row .aw-menu-wrap .aw-menu,
  .header-bottom__row .aw-menu-wrap .aw-menu__bar{height:100%;}
  .aw-menu__icon{display:inline-flex; align-items:center; justify-content:center;}
  .aw-menu__icon svg{display:block;}
  .aw-menu__text{line-height:1.2;}
}
