/* Add to Experience Builder's custom CSS. Keep headerColumn on the header. */
commerce-layout-site .header:has(.headerColumn) {
  --dxp-s-header-background-color: #f8f8f8;
  background-color: #f8f8f8;
}

commerce-layout-site
  .header:has(.headerColumn)
  c-header-menu-n-o-s-c-k
  .headerMenu
  .menu {
  background-color: #f2f5f9  !important;
}

.headerColumn {
  display: block;
  position: relative;
  z-index: 100;
  width: 100%;
  padding: 0 !important;
  overflow: visible;
  background: #f8f8f8;
  color: #202020;
}

.headerColumn,
.headerColumn * {
  box-sizing: border-box;
}

.headerColumn > .columns-content {
  width: 100%;
  max-width: none !important;
  margin: 0 auto;
  padding: 5px 24px 5px 60px !important;
  overflow: visible;
}

.headerColumn > .columns-content > .columns {
  display: grid !important;
  grid-template-columns: minmax(120px, 1fr) minmax(280px, 440px) minmax(
      226px,
      1fr
    );
  align-items: center;
  gap: 24px;
  min-height: 50px;
  height: auto !important;
  overflow: visible;
}

.headerColumn > .columns-content > .columns > dxp_layout-column-spacer {
  display: none;
}

.headerColumn > .columns-content > .columns > dxp_layout-column {
  display: block;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 0;
  overflow: visible;
}

.headerColumn > .columns-content > .columns > dxp_layout-column:nth-of-type(2) {
  width: 100% !important;
}

.headerColumn .column-content,
.headerColumn webruntime-component-container,
.headerColumn webruntime-visibility-container,
.headerColumn dxp_data_provider-data-proxy,
.headerColumn commerce_data_provider-navigation-menu-data-provider {
  overflow: visible;
}

.headerColumn
  > .columns-content
  > .columns
  > dxp_layout-column
  > .column-content {
  display: flex;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-width: 0;
  min-height: 50px;
  padding: 0 !important;
}

.headerColumn
  > .columns-content
  > .columns
  > dxp_layout-column:nth-of-type(2)
  > .column-content
  > webruntime-visibility-container {
  width: 100%;
  min-width: 0;
}

.headerColumn
  > .columns-content
  > .columns
  > dxp_layout-column:last-of-type
  > .column-content {
  justify-content: flex-end !important;
  gap: 24px !important;
}

.headerColumn .component-wrapper-spacer,
.headerColumn .wishlist-shortcut-wrapper,
.headerColumn .cb-outputRichText-container {
  margin: 0;
  padding: 0;
}

.headerColumn .cb-outputRichText-container a {
  vertical-align: middle;
}

.headerColumn community_builder-html-editor {
  margin: 0;
  padding: 0;
}

.headerColumn .cb-outputRichText-container img {
  display: block;
  width: 120px !important;
  max-width: 100%;
  height: auto !important;
  max-height: 42px;
  object-fit: contain;
}

.headerColumn .searchHeader,
.headerColumn .searchHeader b2b_search_suggestions-combobox,
.headerColumn .searchHeader b2b_search_suggestions-input,
.headerColumn .searchHeader .suggestions-combobox-container {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  height: auto;
}

.headerColumn .searchHeader {
  background: transparent !important;
}

.headerColumn .searchHeader .input-container {
  display: flex;
  align-items: stretch;
  width: 100% !important;
  max-width: 100% !important;
  height: 50px !important;
  border: 1px solid #dedede;
  border-radius: 5px;
  background: #fff;
}

.headerColumn .searchHeader .input-container:focus-within {
  outline: 2px solid #0079f3;
  outline-offset: 2px;
}

.headerColumn .searchHeader .input-wrapper {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  border: 0 !important;
  border-radius: 5px 0 0 5px !important;
  background: transparent !important;
  box-shadow: none !important;
}

.headerColumn .searchHeader .search-input-with-button {
  width: 100%;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 0 !important;
  border-radius: 5px 0 0 5px !important;
  outline: none;
  box-shadow: none;
  background: transparent !important;
  color: #202020;
  font:
    400 16px/1.4 Arial,
    sans-serif;
}

.headerColumn .searchHeader .search-input-with-button::placeholder {
  color: #929292;
  opacity: 1;
}

.headerColumn .searchHeader .input-search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 5px 5px 0 !important;
  box-shadow: none;
  background: transparent !important;
  color: #777;
}

.headerColumn .searchHeader .search-icon {
  width: 20px;
  height: 20px;
  fill: currentColor !important;
}

.headerColumn commerce-wishlist-shortcut a,
.headerColumn .buttonIcon,
.headerColumn .multiCart lightning-button-menu > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 32px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  background: transparent;
  color: #202020;
}

.headerColumn .defaultIcon {
  color: #202020 !important;
}

.headerColumn commerce-wishlist-shortcut svg,
.headerColumn .notifIcon,
.headerColumn .multiCart svg[data-key="cart"] {
  width: 22px !important;
  height: 22px !important;
  color: #202020;
  fill: currentColor;
}

.headerColumn .multiCart .cart-list-wrapper {
  background-image: none;
}

.headerColumn .multiCart .cart-list-wrapper::before {
  display: none;
}

.headerColumn .multiCart lightning-primitive-icon:has(svg[data-key="down"]) {
  display: none;
}

.headerColumn .userMenu,
.headerColumn .userMenu commerce_my_account-user-profile-menu {
  display: block;
  position: relative;
  overflow: visible;
}

.headerColumn .userMenu .slds-dropdown-trigger {
  position: relative;
  overflow: visible;
}

.headerColumn .userMenu .menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 58px;
  height: 32px;
  min-height: 0;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #202020;
  border-radius: 18px;
  background: #fff;
  color: #202020;
}

.headerColumn .userMenu .menu-button::after {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  margin-top: -3px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

.headerColumn .userMenu .slds-icon_container::after {
  content: none;
}

.headerColumn .userMenu .menu-button[aria-expanded="true"]::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

.headerColumn .userMenu .icon-color,
.headerColumn .userMenu .menu-button svg {
  color: #202020;
  fill: currentColor;
}

.headerColumn .userMenu .menu-button svg {
  width: 16px !important;
  height: 16px !important;
}

.headerColumn commerce-wishlist-shortcut svg,
.headerColumn .notifIcon,
.headerColumn .multiCart svg[data-key="cart"],
.headerColumn .userMenu .menu-button svg,
.headerColumn .searchHeader .search-icon {
  transition: transform 180ms ease;
  transform-origin: center;
}

@media (hover: hover) {
  .headerColumn commerce-wishlist-shortcut a:hover svg,
  .headerColumn .buttonIcon:hover .notifIcon,
  .headerColumn
    .multiCart
    lightning-button-menu
    > button:hover
    svg[data-key="cart"],
  .headerColumn .userMenu .menu-button:hover svg,
  .headerColumn .searchHeader .input-search-button:hover .search-icon {
    transform: scale(1.15);
  }

  .headerColumn commerce-wishlist-shortcut a:hover,
  .headerColumn .buttonIcon:hover,
  .headerColumn .multiCart lightning-button-menu > button:hover,
  .headerColumn .userMenu .menu-button:hover,
  .headerColumn .searchHeader .input-search-button:hover {
    border-color: transparent !important;
    box-shadow: none !important;
  }
}

.headerColumn .multiCart .cart-list-wrapper::after {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .headerColumn commerce-wishlist-shortcut svg,
  .headerColumn .notifIcon,
  .headerColumn .multiCart svg[data-key="cart"],
  .headerColumn .userMenu .menu-button svg,
  .headerColumn .searchHeader .search-icon {
    transition: none;
  }
}

/* Keep the open menu outside the header, and scroll it on short viewports. */
.headerColumn .userMenu .slds-dropdown {
  position: absolute;
  z-index: 101;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  bottom: auto;
  left: auto;
  width: 220px;
  min-width: 200px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  margin: 0;
  padding: 6px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #dedede;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 14%);
  background: #fff;
  transform: none;
}

.headerColumn .userMenu .slds-dropdown__list {
  max-height: none;
  overflow: visible;
}

/* Salesforce sets the penultimate menu row to 100vw; keep every row in the panel. */
.headerColumn .userMenu ul.slds-dropdown__list > li.slds-dropdown__item {
  width: 100%;
  max-width: 100%;
}

.headerColumn .userMenu .slds-dropdown__item > a {
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
  padding: 10px 16px;
  color: #202020;
  white-space: normal;
}

.headerColumn .userMenu .menu-nubbin {
  display: none;
}

.headerColumn a:focus-visible,
.headerColumn button:focus-visible,
.headerColumn .userMenu .menu-button:focus-visible {
  outline: 2px solid #0079f3 !important;
  outline-offset: 3px;
}

@media (max-width: 1023px) {
  .headerColumn > .columns-content {
    padding-right: 24px !important;
    padding-left: 24px !important;
  }

  .headerColumn > .columns-content > .columns {
    grid-template-columns: minmax(120px, 1fr) minmax(220px, 1.4fr) auto;
    gap: 20px;
  }

  .headerColumn
    > .columns-content
    > .columns
    > dxp_layout-column:last-of-type
    > .column-content {
    gap: 16px !important;
  }
}

@media (max-width: 767px) {
  .headerColumn > .columns-content {
    padding: 8px 16px !important;
  }

  .headerColumn > .columns-content > .columns {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
  }

  .headerColumn
    > .columns-content
    > .columns
    > dxp_layout-column:nth-of-type(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .headerColumn > .columns-content > .columns > dxp_layout-column:last-of-type {
    grid-column: 2;
    grid-row: 1;
  }
}
