#top.ml-desktop-top,
.ml-desktop-menu,
#header .header-contacts {
    display: none;
}

#header.header-main {
    max-height: none;
    z-index: 1002;
}

#header .header-main-inner {
    display: grid;
    grid-template-columns: minmax(44px, 1fr) auto 48px;
    grid-template-areas: "logo nav cart" "search search search";
    align-items: center;
    gap: 6px 8px;
    position: relative;
    padding: 7px 12px 8px;
}

#header .header-main-inner::before,
#header .header-main-inner::after {
    display: none;
}

#header #logo {
    grid-area: logo;
    justify-self: start;
    align-self: center;
    min-width: 0;
    max-width: 100%;
    padding: 0;
}

#header #logo a {
    display: block;
}

#header #logo img {
    width: 48px;
    height: 48px;
    max-width: 100%;
    object-fit: contain;
}

#header #logo h1 {
    font-size: 15px;
    margin: 0;
    overflow-wrap: anywhere;
}

#header .header-search {
    grid-area: search;
    min-width: 0;
}

#header #search .input-lg,
#header #search .btn-lg {
    height: 44px;
    font-size: 16px;
}

#header #search {
    margin: 0;
}

#header #search .btn-lg {
    min-width: 44px;
    padding: 0 12px;
}

.ml-mobile-nav {
    grid-area: nav;
    display: flex;
    gap: 6px;
    align-items: center;
}

.ml-mobile-nav summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 44px;
    padding: 0 9px;
    list-style: none;
    white-space: nowrap;
    border: 1px solid #c9d8e6;
    border-radius: 9px;
    background: #fff;
    color: #014782;
    font-family: Manrope, Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.ml-mobile-nav summary::-webkit-details-marker {
    display: none;
}

.ml-mobile-nav .ml-mobile-nav__catalog {
    border-color: #014782;
    background: #014782;
    color: #fff;
}

.ml-mobile-nav details[open] > summary {
    border-color: #b72164;
    background: #b72164;
    color: #fff;
}

.ml-mobile-nav summary:focus-visible,
#header #cart > button:focus-visible {
    outline: 2px solid #b72164;
    outline-offset: 2px;
}

.ml-mobile-nav__panel,
#header #cart > .dropdown-menu {
    position: absolute;
    inset: calc(100% - 1px) 12px auto;
    width: auto;
    min-width: 0;
    max-height: min(66vh, 560px);
    overflow: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #d9e3ed;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(1, 71, 130, .16);
    z-index: 2;
}

.ml-mobile-nav__categories,
.ml-mobile-nav__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
}

.ml-mobile-nav__categories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ml-mobile-nav__links {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #d9e3ed;
}

.ml-mobile-nav__panel a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 6px;
    color: #014782;
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ml-mobile-nav__categories a {
    padding-inline: 10px;
    border-radius: 8px;
    background: #f1f6fa;
}

.ml-mobile-nav__phones {
    margin: 0;
    padding: 0;
    border: 0;
}

.ml-mobile-nav__phones a {
    justify-content: center;
    white-space: nowrap;
    font-size: clamp(12px, 3.5vw, 14px);
}

.ml-mobile-nav__panel a.ml-mobile-nav__max {
    justify-content: center;
    margin-top: 4px;
    border-radius: 8px;
    background: #b72164;
    color: #fff;
}

.ml-mobile-nav__panel a.ml-mobile-nav__email {
    justify-content: center;
}

.ml-mobile-nav__panel--contacts p {
    margin: 4px 6px 0;
    color: #536473;
    font-size: 13px;
}

#header .header-cart {
    grid-area: cart;
    width: 48px;
    min-width: 0;
}

#header #cart {
    position: static;
}

#header #cart > .dropdown-backdrop {
    pointer-events: none;
}

#header #cart > button {
    position: relative;
    min-height: 44px;
    padding: 0;
    border-color: #c9d8e6;
    border-radius: 9px;
    font-size: 0;
}

#header #cart > button::before {
    content: "\f07a";
    color: #014782;
    font: normal normal normal 19px/1 FontAwesome;
}

#header #cart > button > .fa-shopping-cart {
    display: none;
}

#header #cart-total {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

#header #cart > button[data-cart-count]::after {
    content: attr(data-cart-count);
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 15px;
    padding: 0 3px;
    border-radius: 9px;
    background: #b72164;
    color: #fff;
    font: 700 10px/15px Arial, sans-serif;
}

#header #cart .dropdown-menu > li > div {
    min-width: 0;
    padding: 0;
}

#header #cart .dropdown-menu table {
    overflow-wrap: anywhere;
}

#header #cart .dropdown-menu .img-thumbnail {
    width: 30px;
    max-width: none;
    padding: 0;
}

#header #cart .dropdown-menu .btn-danger {
    min-width: 36px;
    min-height: 36px;
}

#header #cart .dropdown-menu p > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

/* Keep the legacy filter handles clear of the second header row. */
body:has(#header .ml-mobile-nav) .bf-responsive.bf-active :is(.bf-check-position, .bf-btn-show, .bf-btn-reset) {
    top: 124px !important;
}
