/* MFOL Store: header, search panel, and phone menu */
.mfol-header {
  background: var(--hdr-bg, #fff);
  color: var(--hdr-text, #000);
  position: relative;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  z-index: 100;
}
.mfol-header.is-sticky {
  position: sticky;
  top: 0;
}
.admin-bar .mfol-header.is-sticky {
  top: 32px;
}
@media (max-width: 782px) {
  .admin-bar .mfol-header.is-sticky {
    top: 46px;
  }
}
@media (max-width: 600px) {
  .admin-bar .mfol-header.is-sticky {
    top: 0;
  }
}
.mfol-header.has-border {
  border-bottom: 2px solid var(--hdr-text, #000);
}
.mfol-header.is-sticky.is-scrolled {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

/* See-through over the first section until people scroll */
.mfol-header.is-transparent {
  left: 0;
  position: absolute;
  right: 0;
  top: var(--mfol-ann-h, 0px);
}
.admin-bar .mfol-header.is-transparent {
  top: calc(32px + var(--mfol-ann-h, 0px));
}
/* Once people scroll, a sticky see-through header moves up to the very top */
.mfol-header.is-transparent.is-sticky.is-scrolled {
  top: 0;
}
.admin-bar .mfol-header.is-transparent.is-sticky.is-scrolled {
  top: 32px;
}
.mfol-header.is-transparent.is-sticky {
  position: fixed;
}
.mfol-header.is-transparent:not(.is-scrolled) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--hdr-trans-text, #fff);
}

.mfol-header__inner {
  align-items: center;
  display: grid;
  gap: 16px 28px;
  margin: 0 auto;
  max-width: 1600px;
  min-height: calc(var(--hdr-height) + 2 * var(--hdr-space, 0px));
  padding: var(--hdr-space, 0px) var(--outer-padding);
}

/* Space above and below the logo (Store → Headers → Space Above and Below the Logo) */
.mfol-header--space-small {
  --hdr-space: 8px;
}
.mfol-header--space-medium {
  --hdr-space: 14px;
}
.mfol-header--space-large {
  --hdr-space: 22px;
}
@media (max-width: 991px) {
  .mfol-header--space-small {
    --hdr-space: 6px;
  }
  .mfol-header--space-medium {
    --hdr-space: 10px;
  }
  .mfol-header--space-large {
    --hdr-space: 16px;
  }
}
.mfol-header--h-compact {
  --hdr-height: 60px;
}
.mfol-header--h-regular {
  --hdr-height: 76px;
}
.mfol-header--h-tall {
  --hdr-height: 100px;
}

/* Logo */
.mfol-header__logo {
  color: inherit;
  display: block;
  grid-area: logo;
  line-height: 0;
  width: var(--hdr-logo-w, 140px);
}
.mfol-logo .mfol-logo__svg,
.mfol-logo .mfol-logo__img {
  display: block;
  height: auto;
  width: 100%;
}
.mfol-header .mfol-logo .mfol-logo__svg,
.mfol-header .mfol-logo .mfol-logo__img {
  max-height: calc(var(--hdr-height) - 16px);
  object-fit: contain;
  object-position: left center;
  width: 100%;
}

/* Layouts (desktop) */
.mfol-header__burger {
  display: none;
  grid-area: burger;
}
.mfol-header__nav--main {
  grid-area: main;
}
.mfol-header__nav--icons {
  grid-area: icons;
  justify-self: end;
}
@media (min-width: 992px) {
  .mfol-header--left .mfol-header__inner {
    grid-template-areas: "logo main icons";
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .mfol-header--left .mfol-header__nav--main {
    justify-self: end;
  }
  .mfol-header--split .mfol-header__inner {
    grid-template-areas: "logo main icons";
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .mfol-header--split .mfol-header__nav--main {
    justify-self: center;
  }
  .mfol-header--centered .mfol-header__inner {
    grid-template-areas: "main logo icons";
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .mfol-header--centered .mfol-header__logo {
    justify-self: center;
  }
  .mfol-header--centered .mfol-logo .mfol-logo__svg,
  .mfol-header--centered .mfol-logo .mfol-logo__img {
    object-position: center;
  }
}

/* Phones and tablets: menu button, centered logo, icons */
@media (max-width: 991px) {
  .mfol-header__inner {
    gap: 4px;
    grid-template-areas: "burger logo icons";
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .mfol-header .mfol-store-item {
    min-width: 40px;
    padding: 8px 8px !important;
  }
  .mfol-header__burger {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    height: 44px;
    justify-self: start;
    padding: 0;
    width: 44px;
  }
  .mfol-header__logo {
    justify-self: start;
    margin-left: 4px;
    width: min(var(--hdr-logo-w, 140px), 112px);
  }
  .mfol-header__nav--main {
    display: none;
  }
  .mfol-header .mfol-store-item__label {
    display: none;
  }
  .mfol-header .mfol-store-item--label .mfol-store-item__label {
    display: inline;
  }
}

/* Menus */
.mfol-header__menu {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Menu Text Size (Store → Headers → Layout & Menus) */
.mfol-header--menu-size-small {
  --hdr-menu-scale: 1;
}
.mfol-header--menu-size-medium {
  --hdr-menu-scale: 1.2;
}
.mfol-header--menu-size-large {
  --hdr-menu-scale: 1.4;
}
.mfol-header__menu--main {
  gap: 4px calc(26px * var(--hdr-menu-scale, 1));
}
.mfol-header__menu--icons {
  flex-wrap: nowrap;
  gap: 4px;
}
.mfol-header__menu > li {
  margin: 0;
  position: relative;
}
.mfol-header__menu a {
  color: inherit;
  display: inline-flex;
  padding: 10px 0;
  text-decoration: none;
}
.mfol-header--menu-mono .mfol-header__menu--main a {
  font-family: var(--f-mono);
  font-size: calc(0.8125rem * var(--hdr-menu-scale, 1));
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mfol-header--menu-mono-normal .mfol-header__menu--main a {
  font-family: var(--f-mono);
  font-size: calc(0.875rem * var(--hdr-menu-scale, 1));
}
.mfol-header--menu-body .mfol-header__menu--main a {
  font-family: var(--f-body);
  font-size: calc(1rem * var(--hdr-menu-scale, 1));
  font-weight: var(--f-body-weight-bold);
}
.mfol-header__menu--main > li > a:hover,
.mfol-header__menu--main > li.current-menu-item > a,
.mfol-header__menu--main > li.current-menu-ancestor > a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

/* Dropdowns */
.mfol-header__menu--main .menu-item-has-children > a::after {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  height: 6px;
  margin: 4px 0 0 8px;
  transform: rotate(45deg);
  width: 6px;
}
.mfol-header__menu .sub-menu {
  background: var(--color-white);
  border: 2px solid var(--color-black);
  border-radius: 10px;
  color: var(--color-black);
  left: -16px;
  list-style: none;
  margin: 0;
  min-width: 230px;
  opacity: 0;
  padding: 8px;
  position: absolute;
  top: 100%;
  transform: translateY(6px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  visibility: hidden;
  z-index: 10;
}
.mfol-header__menu .menu-item-has-children:hover > .sub-menu,
.mfol-header__menu .menu-item-has-children > a:focus + .sub-menu,
.mfol-header__menu .menu-item-has-children:focus-within > .sub-menu,
.mfol-header__menu .menu-item-has-children.is-open > .sub-menu {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}
.mfol-header__menu .sub-menu li {
  margin: 0;
}
.mfol-header__menu .sub-menu a {
  border-radius: 6px;
  display: block;
  padding: 10px 12px;
}
.mfol-header__menu .sub-menu a:hover {
  background: var(--color-gray);
}

/* Store items: Cart, Search, Account, Wishlist */
.mfol-store-item {
  align-items: center;
  border-radius: 6px;
  color: inherit;
  display: inline-flex;
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  gap: 8px;
  letter-spacing: 0.04em;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 10px !important;
  position: relative;
  text-decoration: none;
  text-transform: uppercase;
}
.mfol-store-item:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.mfol-store-item--icon {
  justify-content: center;
}
.mfol-store-item__icon {
  display: inline-flex;
  line-height: 0;
}
.mfol-store-item__icon svg {
  height: 22px;
  width: 22px;
}
.mfol-store-item__count {
  background: var(--color-orange);
  border: 2px solid var(--hdr-bg, #fff);
  border-radius: 20px;
  color: var(--color-black);
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  letter-spacing: 0;
  line-height: 1;
  min-width: 20px;
  padding: 3px 5px 2px;
  position: absolute;
  right: 0;
  text-align: center;
  top: 2px;
}
.mfol-store-item__count[hidden] {
  display: none;
}
.mfol-store-item--label .mfol-store-item__count,
.mfol-store-item--icon-label .mfol-store-item__count {
  position: static;
}

/* Search panel */
.mfol-search-panel {
  background: var(--color-white);
  border-bottom: 2px solid var(--color-black);
  border-top: 2px solid var(--color-black);
  color: var(--color-black);
  left: 0;
  position: absolute;
  right: 0;
  top: 100%;
}
.mfol-search-panel[hidden] {
  display: none;
}
.mfol-search-panel__form {
  align-items: center;
  display: flex;
  gap: 12px;
  margin: 0 auto;
  max-width: 980px;
  padding: 18px var(--outer-padding);
}
.mfol-search-panel__form input {
  background: transparent;
  border: 0;
  color: inherit;
  flex: 1;
  font-family: var(--f-body);
  font-size: clamp(1.125rem, 2.4vw, 1.5rem);
  font-weight: var(--f-body-weight-bold);
  min-width: 0;
  padding: 8px 0;
}
.mfol-search-panel__form input:focus {
  outline: none;
}
.mfol-search-panel__form:focus-within {
  box-shadow: inset 0 -3px 0 var(--color-blue);
}
.mfol-search-panel__submit {
  background: var(--color-orange);
  border: 2px solid var(--color-black);
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: 0.875rem;
  padding: 10px 16px 9px;
}
.mfol-search-panel__close {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

/* Phone menu */
.mfol-mobile-menu {
  inset: 0;
  position: fixed;
  z-index: 1000;
}
.mfol-mobile-menu[hidden] {
  display: none;
}
.mfol-mobile-menu__overlay {
  background: rgba(0, 0, 0, 0.45);
  inset: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 0.25s;
}
.mfol-mobile-menu__panel {
  background: var(--hdr-bg, #fff);
  color: var(--hdr-text, #000);
  display: flex;
  flex-direction: column;
  height: 100%;
  left: 0;
  overflow-y: auto;
  padding: 16px var(--outer-padding) 40px;
  position: absolute;
  top: 0;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  width: min(400px, 88vw);
}
.mfol-mobile-menu.is-open .mfol-mobile-menu__overlay {
  opacity: 1;
}
.mfol-mobile-menu.is-open .mfol-mobile-menu__panel {
  transform: translateX(0);
}
.mfol-mobile-menu__top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}
.mfol-mobile-menu__logo {
  color: inherit;
  display: block;
  line-height: 0;
  width: 120px;
}
.mfol-mobile-menu__close {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}
.mfol-mobile-menu__list,
.mfol-mobile-menu__list .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mfol-mobile-menu__list > li {
  border-bottom: 2px solid color-mix(in srgb, currentColor 18%, transparent);
  margin: 0;
}
.mfol-mobile-menu__list a {
  color: inherit;
  display: block;
  font-family: var(--f-trim);
  font-size: 2rem;
  line-height: 1;
  padding: 16px 0 12px;
  text-decoration: none;
  text-transform: uppercase;
}
.mfol-mobile-menu__list .sub-menu {
  padding: 0 0 12px 12px;
}
.mfol-mobile-menu__list .sub-menu a {
  font-family: var(--f-mono);
  font-size: 0.9375rem;
  padding: 8px 0;
  text-transform: none;
}
.mfol-mobile-menu__list .mfol-store-item {
  font-family: var(--f-mono);
  font-size: 1rem;
  padding: 14px 0 !important;
}
@media (prefers-reduced-motion: reduce) {
  .mfol-mobile-menu__panel,
  .mfol-mobile-menu__overlay,
  .mfol-header,
  .mfol-header__menu .sub-menu {
    transition: none;
  }
}

/* The smallest phones: a touch smaller so everything fits on one line */
@media (max-width: 374px) {
  .mfol-header__logo {
    width: min(var(--hdr-logo-w, 140px), 86px);
  }
  .mfol-header .mfol-store-item {
    min-width: 36px;
    padding: 8px 6px !important;
  }
  .mfol-header__burger {
    width: 38px;
  }
}

/* Small laptops and tablets turned sideways: tighten the menu so it fits */
@media (min-width: 992px) and (max-width: 1399px) {
  .mfol-header {
    --hdr-menu-scale-fit: 0.85;
  }
  .mfol-header__menu--main {
    gap: 4px calc(18px * var(--hdr-menu-scale, 1));
  }
  .mfol-header--menu-mono .mfol-header__menu--main > li > a {
    font-size: calc(0.8125rem * var(--hdr-menu-scale, 1) * var(--hdr-menu-scale-fit, 1));
  }
  .mfol-header--menu-mono-normal .mfol-header__menu--main > li > a {
    font-size: calc(0.875rem * var(--hdr-menu-scale, 1) * var(--hdr-menu-scale-fit, 1));
  }
  .mfol-header--menu-body .mfol-header__menu--main > li > a {
    font-size: calc(1rem * var(--hdr-menu-scale, 1) * var(--hdr-menu-scale-fit, 1));
  }
  .mfol-header__inner {
    column-gap: 20px;
  }
}

/* If the menu still doesn't fit, the script switches to the menu button (same as phones) */
.mfol-header.is-collapsed .mfol-header__inner {
  gap: 4px;
  grid-template-areas: "burger logo icons";
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.mfol-header.is-collapsed .mfol-header__burger {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-self: start;
  padding: 0;
  width: 44px;
}
.mfol-header.is-collapsed .mfol-header__logo {
  justify-self: start;
  margin-left: 4px;
}
.mfol-header.is-collapsed .mfol-header__nav--main {
  display: none;
}
/* While measuring, hide nothing and let the menu take its natural width */
.mfol-header.is-measuring .mfol-header__menu--main {
  flex-wrap: nowrap;
}
