/*
 * Новая адаптивная шапка Lodka24.
 * Все классы изолированы префиксами header-new / header-nav-new / header-cart-new.
 */

.header-new {
    position: relative;
    z-index: 20;
    background: #fff;
}

.header-new__middle {
    padding: 25px 0;
    background: #fff;
}

.header-new__row {
    display: grid;
    grid-template-columns: 240px minmax(280px, 1fr) 220px 170px;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.header-new__logo-link {
    display: flex;
    align-items: center;
    width: 100%;
    height: 80px;
    text-decoration: none;
}

.header-new__logo-link img {
    display: block;
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
}

.header-new__search-desktop,
.header-new__contacts {
    min-width: 0;
}

.header-new__contacts .h-phones {
    width: 100%;
}

.header-new__action,
.header-new__phone-mobile,
.header-new__mobile-search,
.header-nav-new__head {
    display: none;
}

.header-new__bottom {
    background: #0776d5;
}

.header-nav-new__list {
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
}

.header-nav-new__item {
    position: relative;
    display: flex;
    align-items: stretch;
}

.header-nav-new__item::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: rgba(0, 0, 0, .1);
    content: "";
}

.header-nav-new__item:first-child::before {
    display: none;
}

.header-nav-new__link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 14px 25px;
    color: #fff;
    font-size: 17px;
    line-height: 20px;
    text-decoration: none;
    text-transform: uppercase;
}

.header-nav-new__item--parent > .header-nav-new__link {
    padding-right: 42px;
}

.header-nav-new__item:hover > .header-nav-new__link,
.header-nav-new__item.is-active > .header-nav-new__link {
    color: #fff;
    background: #05457b;
}

.header-nav-new__submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 48px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.header-nav-new__submenu-toggle::after {
    position: absolute;
    top: 17px;
    left: 14px;
    width: 9px;
    height: 9px;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
    content: "";
    transform: rotate(45deg);
}

.header-nav-new__submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    width: 260px;
    margin: 0;
    padding: 0;
    background: #fff;
    box-shadow: 0 9px 10px rgba(150, 150, 150, .3);
}

.header-nav-new__item--parent:hover > .header-nav-new__submenu {
    display: block;
}

.header-nav-new__submenu-link {
    display: block;
    padding: 9px 12px;
    color: #202020;
    font-size: 14px;
    line-height: 18px;
    text-decoration: none;
}

.header-nav-new__submenu-item:hover > .header-nav-new__submenu-link,
.header-nav-new__submenu-item.is-active > .header-nav-new__submenu-link {
    color: #fff;
    background: #0776d5;
}

.header-cart-new {
    min-width: 0;
}

.header-cart-new__link {
    display: flex;
    align-items: center;
    color: #202020;
    text-decoration: none;
}

.header-cart-new__icon {
    position: relative;
    display: flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: #fff;
    background: #0776d5;
    transition: background-color .2s ease;
}

.header-cart-new__link:hover .header-cart-new__icon {
    background: #3ca5ff;
}

.header-cart-new__icon .fa {
    font-size: 24px;
}

.header-cart-new__count {
    display: none;
}

.header-cart-new__description {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-left: 10px;
    font-family: Arial, sans-serif;
}

.header-cart-new__caption {
    color: #909090;
    font-size: 12px;
    line-height: 14px;
}

.header-cart-new__amount {
    color: #0776d5;
    font-size: 16px;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
}

.header-cart-new__price {
    color: #202020;
    font-size: 12px;
    line-height: 14px;
}

.header-new__overlay {
    display: none;
}

@media (max-width: 1190px) and (min-width: 981px) {
    .header-new__row {
        grid-template-columns: 210px minmax(240px, 1fr) 205px 150px;
        gap: 18px;
    }

    .header-nav-new__link {
        padding-right: 15px;
        padding-left: 15px;
        font-size: 14px;
    }

    .header-nav-new__item--parent > .header-nav-new__link {
        padding-right: 36px;
    }
}

@media (max-width: 980px) {
    body.header-menu-open {
        overflow: hidden;
    }

    .header-new .h-top {
        display: none;
    }

    .header-new__middle {
        padding: 0;
        background: #0776d5;
    }

    .header-new__middle .container.wide {
        padding-right: 10px;
        padding-left: 10px;
    }

    .header-new__row {
        display: grid;
        grid-template-columns: 42px minmax(100px, 1fr) 42px 42px 42px;
        gap: 6px;
        min-height: 58px;
    }

    .header-new__action {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 0;
        border-radius: 3px;
        color: #fff;
        background: transparent;
        text-decoration: none;
        cursor: pointer;
    }

    .header-new__action:hover,
    .header-new__action:focus,
    .header-new__action.is-active {
        color: #fff;
        background: #05457b;
    }

    .header-new__action .fa {
        font-size: 23px;
    }

    .header-new__burger {
        flex-direction: column;
        gap: 5px;
    }

    .header-new__burger span {
        display: block;
        width: 25px;
        height: 2px;
        background: #fff;
    }

    .header-new__logo {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
    }

    .header-new__logo-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: min(150px, 100%);
        height: 44px;
        padding: 4px 8px;
        border-radius: 3px;
        background: #fff;
    }

    .header-new__logo-link img {
        max-width: 100%;
        max-height: 36px;
    }

    .header-new__search-desktop,
    .header-new__contacts {
        display: none;
    }

    .header-new__phone-mobile {
        display: block;
        width: 42px;
        height: 42px;
    }

    .header-new__phone-mobile:empty {
        display: none;
    }

    .header-new__search-toggle {
        display: flex;
    }

    .header-cart-new {
        width: 42px;
        height: 42px;
    }

    .header-cart-new__link {
        width: 42px;
        height: 42px;
    }

    .header-cart-new__icon {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        border-radius: 3px;
        background: transparent;
    }

    .header-cart-new__link:hover .header-cart-new__icon {
        background: #05457b;
    }

    .header-cart-new__icon .fa {
        font-size: 23px;
    }

    .header-cart-new__count {
        display: block;
        position: absolute;
        top: 1px;
        right: 0;
        min-width: 17px;
        height: 17px;
        padding: 1px 3px;
        border: 1px solid #fff;
        border-radius: 9px;
        color: #0776d5;
        background: #fff;
        font-size: 11px;
        font-weight: 700;
        line-height: 13px;
        text-align: center;
    }

    .header-cart-new__description {
        display: none;
    }

    .header-new__mobile-search {
        display: block;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        background: #fff;
        box-shadow: 0 5px 12px rgba(0, 0, 0, .12);
        transition: max-height .25s ease, opacity .2s ease, padding .25s ease;
    }

    .header-new__mobile-search.is-open {
        max-height: 90px;
        padding: 10px 0;
        opacity: 1;
    }

    .header-new__mobile-search .w-search .input__default {
        height: 44px;
        font-size: 15px;
    }

    .header-new__mobile-search .w-search .search__btn {
        width: 42px;
        height: 42px;
    }

    .header-new__mobile-search .w-search .fa {
        top: 12px;
        right: 13px;
    }

    .header-new__bottom {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 102;
        width: min(340px, 88vw);
        overflow-y: auto;
        background: #fff;
        box-shadow: 5px 0 20px rgba(0, 0, 0, .18);
        transform: translateX(-105%);
        transition: transform .25s ease;
    }

    .header-new__bottom.is-open {
        transform: translateX(0);
    }

    .header-new__bottom .container.wide {
        width: 100%;
        padding: 0;
    }

    .header-nav-new__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 58px;
        padding: 0 16px 0 20px;
        color: #fff;
        background: #0776d5;
        font-size: 20px;
        font-weight: 700;
    }

    .header-nav-new__close {
        position: relative;
        width: 36px;
        height: 36px;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .header-nav-new__close::before,
    .header-nav-new__close::after {
        position: absolute;
        top: 17px;
        left: 6px;
        width: 25px;
        height: 2px;
        background: #fff;
        content: "";
    }

    .header-nav-new__close::before {
        transform: rotate(45deg);
    }

    .header-nav-new__close::after {
        transform: rotate(-45deg);
    }

    .header-nav-new__list {
        display: block;
    }

    .header-nav-new__item {
        display: block;
        border-bottom: 1px solid #ececec;
    }

    .header-nav-new__item::before {
        display: none;
    }

    .header-nav-new__link {
        display: block;
        min-height: 0;
        padding: 14px 52px 14px 20px;
        color: #202020;
        background: #fff;
        font-size: 15px;
        line-height: 20px;
        text-transform: uppercase;
    }

    .header-nav-new__item:hover > .header-nav-new__link,
    .header-nav-new__item.is-active > .header-nav-new__link {
        color: #fff;
        background: #0776d5;
    }

    .header-nav-new__submenu-toggle {
        display: block;
        width: 48px;
        height: 48px;
        background: #f5f5f5;
    }

    .header-nav-new__submenu-toggle::before,
    .header-nav-new__submenu-toggle::after {
        position: absolute;
        top: 23px;
        left: 17px;
        width: 14px;
        height: 2px;
        border: 0;
        background: #202020;
        content: "";
        transform: none;
    }

    .header-nav-new__submenu-toggle::after {
        transform: rotate(90deg);
        transition: transform .2s ease;
    }

    .header-nav-new__item.is-submenu-open > .header-nav-new__submenu-toggle::after {
        transform: rotate(0deg);
    }

    .header-nav-new__item.is-active > .header-nav-new__submenu-toggle {
        background: #05457b;
    }

    .header-nav-new__item.is-active > .header-nav-new__submenu-toggle::before,
    .header-nav-new__item.is-active > .header-nav-new__submenu-toggle::after {
        background: #fff;
    }

    .header-nav-new__submenu,
    .header-nav-new__item--parent:hover > .header-nav-new__submenu {
        display: none;
        position: static;
        width: 100%;
        box-shadow: none;
        background: #f4f4f4;
    }

    .header-nav-new__item.is-submenu-open > .header-nav-new__submenu {
        display: block;
    }

    .header-nav-new__submenu-link {
        padding: 11px 20px 11px 32px;
        border-top: 1px solid #e7e7e7;
        color: #202020;
        background: #f4f4f4;
        font-size: 14px;
    }

    .header-nav-new__submenu-item:hover > .header-nav-new__submenu-link,
    .header-nav-new__submenu-item.is-active > .header-nav-new__submenu-link {
        color: #fff;
        background: #404040;
    }

    .header-new__overlay {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 101;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(0, 0, 0, .55);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .header-new__overlay.is-open {
        display: block;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

@media (max-width: 420px) {
    .header-new__middle .container.wide {
        padding-right: 6px;
        padding-left: 6px;
    }

    .header-new__row {
        grid-template-columns: 38px minmax(82px, 1fr) 38px 38px 38px;
        gap: 3px;
    }

    .header-new__action,
    .header-new__phone-mobile,
    .header-cart-new,
    .header-cart-new__link,
    .header-cart-new__icon {
        width: 38px;
        height: 40px;
    }

    .header-new__logo-link {
        height: 40px;
        padding-right: 5px;
        padding-left: 5px;
    }

    .header-new__logo-link img {
        max-height: 32px;
    }
}

/* Sticky mobile header: hides on scroll down and returns on scroll up.
 * Важно: не используем transform на .header-new, иначе position: fixed у
 * выезжающего меню начинает рассчитываться относительно шапки, а не viewport.
 */
@media (max-width: 980px) {
    .header-new {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 1000;
        transform: none;
        transition: top .25s ease;
        will-change: top;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .header-new.is-scroll-hidden {
        top: -70px;
        transform: none;
    }

    .header-new.is-scroll-locked {
        top: 0;
        transform: none;
    }

    .header-new__bottom {
        z-index: 1102;
    }

    .header-new__overlay {
        z-index: 1101;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-new {
        transition: none;
    }
}
