/* Compact desktop header. */
html body #sow_chat.floating-wpp {
  z-index: 8 !important;
}

@media (min-width: 992px) {
  #header .header-top {
    margin: 30px 0 25px !important;
    padding-bottom: 10px !important;
  }

  #header .header-bg > .container {
    margin-bottom: 0 !important;
  }

  #header .header-top .header_logo {
    position: absolute !important;
    top: 50% !important;
    right: auto !important;
    left: 50% !important;
    width: 160px !important;
    margin: 0 !important;
    transform: translate(-50%, -50%);
  }

  #header .header-top .header_logo .logo {
    width: auto !important;
    max-height: 78px !important;
    margin: 0 auto !important;
  }

  #header .ets_mm_megamenu.hook-default {
    margin-top: 0 !important;
    padding: 0 15px !important;
  }

  #header .ets_mm_megamenu.hook-default .mm_menu_content_title {
    min-height: 50px !important;
  }
}

/* Keep all mobile controls on one row below the centred logo. */
@media (max-width: 991px) {
  #header .header-nav,
  #header .header-nav .mobile {
    overflow: visible;
  }

  #header .header-nav .mobile {
    position: relative;
  }

  #header .header-nav .mobile-controls {
    --mobile-control-size: 44px;
    display: grid;
    grid-template-columns: var(--mobile-control-size) auto auto minmax(0, 1fr) repeat(3, var(--mobile-control-size));
    grid-template-rows: 44px;
    align-items: center;
    gap: 4px;
    width: 100%;
    height: 44px;
    position: relative;
  }

  #header .header-nav .mobile-controls > * {
    grid-row: 1;
    float: none;
    margin: 0;
  }

  #header #mobile-megamenu-slot { grid-column: 1; z-index: 40; }
  #header #_mobile_language_selector { grid-column: 2; }
  #header .header-nav .mobile-controls > .flyer-menu { grid-column: 3; }
  #header .header-nav .mobile-controls > #search_widget { grid-column: 5; }
  #header .header-nav .mobile-controls > #_mobile_user_info { grid-column: 6; }
  #header .header-nav .mobile-controls > #_mobile_cart { grid-column: 7; }

  #header .header-nav .mobile-controls > .flyer-menu {
    position: relative;
    z-index: 31;
    bottom: auto;
    left: auto;
    margin: 0;
  }

  #header .header-nav .mobile-controls .flyer-menu__trigger,
  #header .header-nav .mobile-controls .header-language-toggle {
    height: 44px;
    min-height: 44px;
    padding: 0;
    line-height: 20px;
  }

  #header .header-nav .mobile-controls .header-language-toggle .material-icons,
  #header .header-nav .mobile-controls .flyer-menu__chevron {
    font-size: 18px;
    line-height: 18px;
  }

  #header .header-nav .mobile-controls > #search_widget,
  #header .header-nav .mobile-controls > #_mobile_user_info,
  #header .header-nav .mobile-controls > #_mobile_cart {
    width: var(--mobile-control-size);
    height: 44px;
    margin: 0;
    padding: 0;
  }

  #header .header-nav .mobile-controls .search_button,
  #header .header-nav .mobile-controls .tm_userinfotitle,
  #header #_mobile_cart .blockcart.cart-preview .carthome {
    width: var(--mobile-control-size);
    height: 44px;
    margin: 0;
    padding: 0;
    float: none;
    display: block;
    background-position: center;
  }

  #header .header-nav .mobile-controls .blockcart-header {
    position: relative;
    height: 44px;
  }

  #header .header-nav .mobile-controls .cart_custom {
    position: absolute;
    inset: 0;
  }

  #header .header-nav .mobile-controls .cart-products-counthome {
    top: 2px;
    right: 0;
    left: auto;
  }

  /* The header owns mobile positioning and stickiness for the entire row. */
  #header #mobile-megamenu-slot .ets_mm_megamenu {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: var(--mobile-control-size) !important;
    height: 44px;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent;
    box-shadow: none;
  }

  #header #mobile-megamenu-slot .ets_mm_megamenu_content,
  #header #mobile-megamenu-slot .ets_mm_megamenu_content > .container,
  #header #mobile-megamenu-slot .ets_mm_megamenu_content_content {
    width: 100%;
    max-width: none;
    height: 44px;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  #header #mobile-megamenu-slot .ybc-menu-toggle {
    width: var(--mobile-control-size) !important;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0;
    line-height: 0;
  }

  #header #mobile-megamenu-slot .ybc-menu-button-toggle_icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
  }

  #header #mobile-megamenu-slot .ybc-menu-toggle .icon-bar {
    position: static;
    top: auto;
    width: 18px;
    height: 2px;
    margin: 0;
    float: none;
    background-color: #313131;
  }

  #header .header-bg,
  #header .header-bg > .container,
  #header .header-top {
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* The floating drawer already provides a full-screen backdrop. The generic
     desktop mega-menu backdrop would overlap it and create a dark stripe. */
  body.hover_menu #header .ets_mm_megamenu::before {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }
}

@media (max-width: 420px) {
  #header .header-nav .mobile-controls {
    --mobile-control-size: 36px;
  }

  #header .header-nav .mobile-controls .flyer-menu__trigger > span:not(.material-icons) {
    font-size: 12px;
  }

  #header .header-nav .mobile-controls .flyer-menu__chevron {
    font-size: 18px;
  }
}

@media (max-width: 370px) {
  #header .header-nav .mobile-controls .flyer-menu__icon {
    display: none;
  }

  #header .header-nav .mobile-controls .flyer-menu__panel {
    left: -20px;
  }
}
