/* Shared header */

.ms-header {
  background: var(--ms-color-page);
  padding: 30px 0 22px;
  position: relative;
  z-index: 20;
}

.ms-header__inner {
  width: min(100% - 48px, var(--ms-wide-container));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 220px minmax(420px, 1fr) 360px;
  align-items: start;
  gap: 28px;
}

.ms-header__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

/* .ms-logo {
  display: inline-flex;
  width: 72px;
  min-height: 54px;
  align-items: flex-start;
  justify-content: flex-start;
} */

.ms-header__brand img,
.ms-header__brand .custom-logo {
  width: 138px;
  height: auto;
  object-fit: contain;
}

.ms-brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ms-primary-nav {
  padding-top: 43px;
}

.ms-primary-menu {
  display: flex;
  justify-content: center;
  gap: clamp(30px, 4.2vw, 66px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ms-primary-menu li {
  margin: 0;
}

.ms-primary-menu a {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ms-primary-nav .ms-category-sidebar {
  display: none;
}

.ms-header__tools {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 13px;
  padding-top: 2px;
}

.ms-header__top-tools,
.ms-header__bottom-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
}

.ms-language-switcher {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.ms-language-switcher a {
  font-weight: 400;
}

.ms-b2b-link {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  font-size: 13px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ms-search {
  width: 292px;
  max-width: 100%;
}

.ms-search form,
.woocommerce-product-search,
.search-form {
  display: flex;
  width: 100%;
  margin: 0;
}

.ms-search input[type="search"],
.ms-search .search-field {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 0;
  background: var(--ms-color-input);
  padding: 0 12px;
  color: var(--ms-color-text);
  outline: 0;
}

.ms-search input[type="search"]::placeholder,
.ms-search .search-field::placeholder {
  color: rgba(31, 41, 48, 0.72);
}

.ms-search button,
.ms-search input[type="submit"],
.ms-search .search-submit {
  flex: 0 0 52px;
  width: 52px;
  height: 38px;
  min-height: 38px;
  border: 0;
  background: var(--ms-color-cream);
  color: var(--ms-color-text);
  position: relative;
  padding: 0;
  overflow: hidden;
}

.ms-search button::before,
.ms-search .search-submit::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 999px;
  left: 17px;
  top: 10px;
}

.ms-search button::after,
.ms-search .search-submit::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
  left: 30px;
  top: 25px;
}

.ms-cart-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding-inline: 2px;
}

.ms-cart-icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
}

.ms-cart-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-top: 0;
}

.ms-cart-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 12px;
  height: 9px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.ms-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 18px;
  font-size: 12px;
  line-height: 1;
}

.ms-menu-toggle {
  display: none;
}

/* Front page: header overlays the hero image */
.home .ms-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
}

@media (max-width: 760px) {
  main .ms-category-sidebar {
    display: none;
  }

  .ms-primary-nav {
    background-color: var(--ms-color-cream);
    padding: 1rem !important;
  }

  .ms-primary-nav ul.ms-primary-menu {
    padding-top: 1rem;
  }

  .ms-primary-nav .ms-category-sidebar {
    display: block;
    font-family: var(--ms-font-body);
    margin-top: 1rem;
    padding: 0 !important;
  }

  .ms-primary-nav .ms-category-sidebar h2 {
    font-family: var(--ms-font-body);
    margin-bottom: 0.5rem;
    font-size: 15px !important;
    line-height: 1.5 !important;
    letter-spacing: 0.02em !important;
  }

  .ms-primary-nav .ms-category-sidebar ul {
    padding-top: 0;
    padding-left: 10px;
  }

  .ms-primary-nav .ms-category-sidebar ul li {
    padding-right: 4px;
  }

  .ms-primary-nav .ms-category-sidebar__parent,
  .ms-primary-nav
    .ms-category-sidebar__item:not(.has-children)
    > .ms-category-sidebar__link {
    width: calc(100% + 25px);
    margin-inline: -25px 0;
  }

  .ms-primary-nav .ms-category-sidebar__parent > .ms-category-sidebar__link,
  .ms-primary-nav
    .ms-category-sidebar__item:not(.has-children)
    > .ms-category-sidebar__link {
    padding-left: 25px;
  }

  .ms-primary-nav .ms-category-sidebar__parent > .ms-category-sidebar__toggle {
    flex-basis: 38px;
    padding-inline: 8px;
  }
}
@media (min-width: 761px) and (max-width: 899px) {
  .ms-is-front-page .ms-header__brand img {
    height: auto;
    max-width: 125px !important;
  }
}

@media (min-width: 1420px) {
  .ms-header {
    margin-inline: -40px;
  }
}
