/*
 * Global site header cascade layer.
 *
 * This is the single source of truth for the redesigned commercial header,
 * desktop navigation and responsive header states. It is loaded after the
 * legacy theme and module styles on every storefront page.
 */
body {
  --hb-layout-max: 1480px;
  --hb-header-red: var(--color-primary, #eb4640);
  --hb-header-dark: #101820;
  --hb-header-border: #e8e8e8;
}

/* The wider commercial content grid remains exclusive to the homepage. */
body#index {
  --width-container: var(--hb-layout-max);
}

body #header {
  /* Legacy custom.css declares a sticky header with !important. */
  position: relative !important;
  top: auto;
  z-index: 99;
  color: #252525;
  background: #fff;
  box-shadow: 0 3px 14px rgb(0 0 0 / 7%);
}

body#index .section-container-min,
body .hb-commerce-topbar .section-container-min,
body #header .section-container-min,
body #header .ets_mm_megamenu_content .container {
  box-sizing: border-box;
  width: min(calc(100% - 40px), var(--hb-layout-max));
  max-width: var(--hb-layout-max);
  margin-right: auto;
  margin-left: auto;
}

/* Long editorial copy stays readable inside the wider commercial layout. */
body#index #custom-text #full-description {
  width: min(100%, var(--width-container-min-2));
  margin-right: auto;
  margin-left: auto;
}

/* Utility strip */
body .hb-commerce-topbar {
  min-height: 34px;
  color: #fff;
  background: var(--hb-header-dark);
  font-size: 12px;
}

body .hb-commerce-topbar__inner {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

body .hb-commerce-topbar__inner span,
body .hb-commerce-topbar__inner a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  line-height: 1.25;
  white-space: nowrap;
}

body .hb-commerce-topbar__inner svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body .hb-commerce-topbar__inner a {
  color: var(--hb-header-red);
  font-weight: 700;
}

/* Main row */
body #header .header-top {
  padding: 16px 0 14px;
}

body #header .header__flex {
  min-height: 58px;
  gap: clamp(18px, 2vw, 34px);
}

body #header #logo-menu {
  flex: 0 0 205px;
  align-items: center;
}

body #header .logo {
  display: block;
  width: 205px;
  height: 50px;
  object-fit: contain;
  object-position: left center;
}

body #header .hb-logo-desktop {
  display: block;
}

body #header .hb-logo-mobile {
  display: none;
}

body #search-desktop {
  flex: 1 1 660px;
  max-width: 760px;
  margin: 0;
}

body .searchbar-desktop {
  position: relative;
  box-sizing: border-box;
  height: 50px;
  padding: 0 62px 0 18px;
  border: 1px solid #dcdfe3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 3%);
}

body .searchbar-desktop > svg {
  position: absolute;
  top: -1px;
  right: -1px;
  box-sizing: border-box;
  width: 52px;
  height: 50px;
  padding: 15px;
  border-radius: 0 8px 8px 0;
  background: var(--hb-header-red);
}

body .searchbar-desktop > svg * {
  stroke: #fff;
}

body .searchbar-desktop span {
  overflow: hidden;
  color: #747474;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body #header #icons {
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

body #header #icons .block-icon,
body #header #icons .hb-blog-link,
body #header #icons .language-selector button {
  box-sizing: border-box;
  display: flex;
  min-width: 50px;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
}

body #header #icons .language-selector button,
body #header #icons > .hb-blog-link,
body #header #icons #_desktop_user_info .user-info,
body #header #icons .blockcart .header {
  border: 1px solid var(--hb-header-border);
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 3%);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

body #header .hb-blog-link {
  height: 50px;
  padding: 0 13px;
  color: #292929;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

body #header .hb-blog-link:hover {
  border-color: #f2b4b1;
  color: var(--hb-header-red);
  background: #fff6f5;
  box-shadow: 0 3px 10px rgb(235 70 64 / 10%);
}

body #header .hb-blog-link:hover svg path {
  stroke: var(--hb-header-red);
}

body #header #icons svg {
  max-width: 21px;
  max-height: 21px;
}

body #header #icons #_desktop_user_info .userinfo_header {
  width: auto;
  height: 48px;
  padding: 0 13px;
  border-radius: 7px;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}

body #header #icons #_desktop_user_info .user-info {
  width: auto;
  height: 50px;
  padding: 0;
  border-radius: 8px;
}

body #header #icons #_desktop_user_info .user-info:hover {
  border-color: #f2b4b1;
  color: var(--hb-header-red);
  background: #fff6f5;
  box-shadow: 0 3px 10px rgb(235 70 64 / 10%);
}

body #header #icons #_desktop_user_info .user-info.block-icon:hover {
  color: var(--hb-header-red);
  background: #fff6f5;
}

body #header #icons #_desktop_user_info .user-info:hover svg path {
  stroke: var(--hb-header-red);
}

body #header .hb-account-label {
  color: #292929;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

body #header #icons #_desktop_user_info .user-info:hover .hb-account-label {
  color: var(--hb-header-red);
}

body #header #icons .blockcart .header {
  display: flex;
  min-width: 112px;
  height: 50px;
  padding: 0 12px;
  justify-content: flex-start;
}

body #header #icons .blockcart .header:hover {
  border-color: #f2b4b1;
  color: inherit;
  background: #fff6f5;
  box-shadow: 0 3px 10px rgb(235 70 64 / 10%);
}

body #header #icons .blockcart .header:hover svg path {
  stroke: var(--hb-header-red);
}

body #header .hb-cart-summary {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

body #header .hb-cart-summary strong {
  color: #202020;
  font-size: 14px;
  font-weight: 700;
}

body #header .hb-cart-summary small {
  margin-top: 3px;
  color: #444;
  font-size: 13px;
  white-space: nowrap;
}

body #header #icons .blockcart .header:hover .hb-cart-summary strong,
body #header #icons .blockcart .header:hover .hb-cart-summary small {
  color: var(--hb-header-red);
}

body #header #icons .blockcart .cart-products-count {
  top: -6px;
  right: auto;
  left: 18px;
  width: 17px;
  height: 17px;
  color: #fff;
  background: var(--hb-header-red);
}

body #header #icons .language-selector button {
  height: 50px;
  padding: 0 13px;
}

body #header #icons .language-selector button:hover,
body #header #icons .language-selector button[aria-expanded="true"] {
  border-color: #f2b4b1;
  color: var(--hb-header-red);
  background: #fff6f5;
  box-shadow: 0 3px 10px rgb(235 70 64 / 10%);
}

/* Navigation row */
body #header .header-bottom {
  border-top: 1px solid var(--hb-header-border);
  border-bottom: 1px solid var(--hb-header-border);
  background: #fff;
}

body #header .ets_mm_megamenu_content {
  background: #fff;
}

body #header .ets_mm_megamenu_content .mm_menus_ul {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  min-height: 58px;
  align-items: center;
  gap: 2px;
  padding: 0;
}

body #header .ets_mm_megamenu_content .mm_menus_li {
  margin: 0;
}

body #header .ets_mm_megamenu_content .mm_menus_ul > .mm_menus_li:not(.hb-primary-category) {
  display: none;
}

body #header .ets_mm_megamenu_content .mm_menus_li > .ets_mm_url {
  box-sizing: border-box;
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 0 13px;
  border-radius: 6px;
  color: #252525;
  font-size: 12px;
  font-weight: 600;
  transition: color .15s ease, background-color .15s ease;
}

body #header .ets_mm_megamenu_content .mm_menus_li > .ets_mm_url:hover {
  color: var(--hb-header-red);
  background: #fff3f2;
}

body #header .ets_mm_megamenu_content .hb-primary-category {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
}

body #header .ets_mm_megamenu_content .hb-primary-category > .ets_mm_url {
  width: 100%;
  min-height: 54px;
  justify-content: center;
  padding: 8px 6px;
  text-align: center;
  white-space: normal;
}

body #header .ets_mm_megamenu_content .hb-primary-category > .ets_mm_url .mm_menu_content_title {
  font-size: clamp(12px, .8vw, 14px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.01em;
}

body #header .ets_mm_megamenu_content .hb-primary-submenu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 1px);
  left: 50%;
  box-sizing: border-box;
  display: block;
  padding: 18px 20px 20px;
  overflow: visible;
  border: 1px solid var(--hb-header-border);
  border-top: 3px solid var(--hb-header-red);
  border-radius: 0 0 10px 10px;
  background: #fff;
  box-shadow: 0 16px 35px rgb(0 0 0 / 14%);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

body #header .ets_mm_megamenu_content .hb-primary-category:hover > .hb-primary-submenu,
body #header .ets_mm_megamenu_content .hb-primary-category:focus-within > .hb-primary-submenu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

body #header .hb-primary-submenu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hb-header-border);
}

body #header .hb-primary-submenu__header strong {
  color: #252525;
  font-size: 18px;
  line-height: 1.2;
}

body #header .hb-primary-submenu__content {
  display: block;
}

body #header .hb-primary-submenu__content > .mm_columns_li {
  flex: 1 1 100%;
  width: 100%;
}

body #header .hb-primary-submenu__content .mm_blocks_ul {
  display: block;
  margin: 0;
  padding: 0;
}

body #header .hb-primary-submenu__content .mm_blocks_li {
  width: 100%;
  min-width: 0;
}

body #header .hb-primary-submenu__content .ets_mm_categories,
body #header .hb-primary-submenu__content .ets_mm_categories ul {
  width: 100%;
  margin: 0;
  padding: 0;
  columns: 1;
}

/*
 * Structured desktop submenus.
 * Column count follows the amount of second- and third-level content.
 */
body #header .hb-primary-category--cols-3 > .hb-primary-submenu {
  width: min(900px, calc(100vw - 360px));
}

body #header .hb-primary-category--cols-2 > .hb-primary-submenu {
  width: min(650px, calc(100vw - 80px));
}

body #header .hb-primary-category--refrigeration > .hb-primary-submenu {
  width: min(980px, calc(100vw - 40px));
}

body #header .hb-primary-category--structured.hb-primary-category--align-left > .hb-primary-submenu {
  right: auto;
  left: 0;
  transform: translate(0, 8px);
}

body #header .hb-primary-category--structured.hb-primary-category--align-left:hover > .hb-primary-submenu,
body #header .hb-primary-category--structured.hb-primary-category--align-left:focus-within > .hb-primary-submenu {
  transform: translate(0, 0);
}

body #header .hb-primary-category--structured.hb-primary-category--align-right > .hb-primary-submenu {
  right: 0;
  left: auto;
  transform: translate(0, 8px);
}

body #header .hb-primary-category--structured.hb-primary-category--align-right:hover > .hb-primary-submenu,
body #header .hb-primary-category--structured.hb-primary-category--align-right:focus-within > .hb-primary-submenu {
  transform: translate(0, 0);
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories {
  display: grid;
  align-items: start;
  gap: 14px 26px;
}

body #header .hb-primary-category--cols-3 .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body #header .hb-primary-category--cols-2 .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li {
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 0;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > a {
  position: relative;
  display: block;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0 0 4px;
  border-bottom: 1px solid #eceef0;
  border-radius: 0;
  color: #25282b;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: .015em;
  text-transform: uppercase;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > a:hover {
  color: var(--hb-header-red);
  background: transparent;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories:empty {
  display: none;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories > li {
  position: relative;
  margin: 0;
  padding: 0;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories > li > a {
  position: relative;
  display: block;
  padding: 3px 7px 3px 16px;
  border-radius: 5px;
  color: #555a60;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.3;
  text-transform: none;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories > li > a::before {
  position: absolute;
  top: 10px;
  left: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c8ccd0;
  content: "";
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories > li > a:hover {
  color: var(--hb-header-red);
  background: #fff3f2;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories > li > a:hover::before {
  background: var(--hb-header-red);
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories > li > .ets_mm_categories {
  display: block;
  width: auto;
  margin: 2px 0 2px 16px;
  padding: 0 0 0 7px;
  border-left: 1px solid #e2e5e8;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories > li > .ets_mm_categories:empty {
  display: none;
}

body #header .hb-primary-category--structured .hb-primary-submenu__content .ets_mm_block_content > .ets_mm_categories > li > .ets_mm_categories > li > .ets_mm_categories a {
  height: auto;
  min-height: 0;
  padding: 3px 5px;
  color: #6d7278;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
  text-transform: none;
}

/*
 * Navigation breakpoint contract:
 * - below 1200px: modal navigation opened by #menu-icon
 * - from 1200px: horizontal desktop navigation
 * Keep both limits adjacent so no intermediate width can lose both menus.
 */
@media (min-width: 1200px) {
  body #header .header-bottom {
    display: block;
  }

  body #header #menu-icon {
    /* Overrides the legacy max-width:1200 rule at the exact breakpoint. */
    display: none !important;
  }
}

@media (max-width: 1199px) {
  body #header .header-bottom {
    display: none;
  }

  body #header #menu-icon {
    box-sizing: border-box;
    display: flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--hb-header-red);
    cursor: pointer;
  }

  body .hb-commerce-topbar__inner span:first-child,
  body .hb-commerce-topbar__inner span:nth-child(4) {
    display: none;
  }

  body #header #logo-menu {
    flex-basis: 175px;
  }

  body #header .logo {
    width: 175px;
  }

  body #header .hb-account-label {
    display: none;
  }

}

@media (min-width: 992px) and (max-width: 1199px) {
  body #header #logo-menu {
    flex: 0 0 235px;
    gap: 12px;
  }

  body #header #logo-menu > a {
    flex: 0 0 175px;
    width: 175px;
  }
}

@media (max-width: 991px) {
  body#index .section-container-min,
  body .hb-commerce-topbar .section-container-min,
  body #header .section-container-min {
    width: min(calc(100% - 28px), var(--hb-layout-max));
  }

  body .hb-commerce-topbar {
    display: none;
  }

  body #header .header-top {
    padding: 10px 0 12px;
  }

  body #header .header__flex {
    min-height: 50px;
    gap: 12px;
  }

  body #header #logo-menu {
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 12px;
  }

  body #header #logo-menu > a {
    display: block;
    flex: 0 0 clamp(130px, 22vw, 180px);
    width: clamp(130px, 22vw, 180px);
    min-width: 130px;
  }

  body #header .logo {
    width: 100%;
    height: 44px;
    visibility: visible;
    opacity: 1;
  }

  body #header .hb-logo-desktop {
    display: none;
  }

  body #header .hb-logo-mobile {
    display: block;
  }

  body #header #icons {
    flex: 0 0 auto;
    gap: 8px;
  }

  body #header #icons > a.block-icon {
    display: none;
  }

  body #header .searchbar-large {
    height: 48px;
    margin-top: 10px;
    padding-right: 56px;
  }

  body #header .searchbar-large > svg {
    width: 50px;
    height: 48px;
    padding: 14px;
  }

}

@media (max-width: 767px) {
  body #header .header__flex {
    gap: 8px;
  }

  body #header #logo-menu {
    gap: 9px;
  }

  body #header #logo-menu > a {
    flex-basis: clamp(112px, 30vw, 145px);
    width: clamp(112px, 30vw, 145px);
    min-width: 112px;
  }

  body #header #icons .language-selector button,
  body #header #icons .hb-blog-link,
  body #header #icons #_desktop_user_info .user-info,
  body #header #icons #_desktop_user_info .userinfo_header,
  body #header #icons .blockcart .header {
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
  }

  body #header #icons .hb-blog-link {
    padding: 0;
  }

  body #header #icons .hb-blog-link span {
    display: none;
  }

  body #header #icons .language-selector button {
    /* Legacy mobile language control also fixes width with !important. */
    width: 46px !important;
    padding: 0 7px;
    color: #292929;
    border-color: var(--hb-header-border);
    background: #fff;
  }

  body #header #icons .language-selector .language-flag {
    display: none;
  }

  body #header #icons .language-selector .language-code {
    display: inline-flex;
    color: #292929;
    font-size: 13px;
    line-height: 1;
    visibility: visible;
    opacity: 1;
  }

  body #header #icons .language-selector button:hover .language-code,
  body #header #icons .language-selector button[aria-expanded="true"] .language-code {
    color: var(--hb-header-red);
  }

  body #header .hb-cart-summary {
    display: none;
  }

  body #header #icons .blockcart .cart-products-count {
    top: -5px;
    left: 25px;
  }
}

@media (max-width: 543px) {
  body#index .section-container-min,
  body .hb-commerce-topbar .section-container-min,
  body #header .section-container-min {
    width: min(calc(100% - 20px), var(--hb-layout-max));
  }

  body #header #logo-menu > a {
    flex-basis: clamp(96px, 30vw, 118px);
    width: clamp(96px, 30vw, 118px);
    min-width: 96px;
  }

  body #menu-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  body #header #icons #_desktop_user_info .user-info,
  body #header #icons #_desktop_user_info .userinfo_header,
  body #header #icons .language-selector button,
  body #header #icons .hb-blog-link,
  body #header #icons .blockcart .header {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  body #header #icons .language-selector button {
    width: 42px !important;
  }

  body #header #icons .blockcart .cart-products-count {
    left: 22px;
  }

  body .searchbar-desktop {
    height: 44px;
    padding-right: 52px;
  }

  body .searchbar-desktop > svg {
    width: 46px;
    height: 44px;
    padding: 13px;
  }
}

@media (max-width: 359px) {
  body #header .header__flex {
    gap: 5px;
  }

  body #header #logo-menu {
    gap: 6px;
  }

  body #header #logo-menu > a {
    flex-basis: 70px;
    width: 70px;
    min-width: 70px;
  }

  body #header #icons {
    gap: 5px;
  }

  body #header #icons #_desktop_user_info .user-info,
  body #header #icons #_desktop_user_info .userinfo_header,
  body #header #icons .language-selector button,
  body #header #icons .hb-blog-link,
  body #header #icons .blockcart .header {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  body #header #icons .language-selector button {
    width: 40px !important;
  }
}
