/* RD Site mobile sliding navigation. Desktop navigation stays unchanged. */
.mobile-nav {
    display: none;
}

.site-header__messengers {
    display: none;
}

.site-header__contact {
    display: contents;
}

@media (min-width: 901px) {
    .site-header__contact {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
    }

    .site-header__messengers {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
    }

    .site-header__messenger-link {
        flex: 0 0 22px;
        width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 5px;
        overflow: hidden;
        text-decoration: none;
    }

    .site-header__messenger-link--max {
        background: transparent;
    }

    .site-header__messenger-image {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 5px;
    }

    .site-header__messenger-link--telegram {
        background: #49a9d8;
        color: #fff;
    }

    .site-header__messenger-icon {
        display: block;
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 900px) {
    .site-header__burger {
        display: flex;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        padding: 11px;
        margin: 0;
        border: 0;
        background: transparent;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }


    .site-header .site-container {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .site-header .site-header__logo {
        flex: 0 0 auto;
        margin-right: auto;
    }

    .site-header__phone {
        display: inline-flex;
        flex: 0 1 auto;
        margin: 0;
        white-space: nowrap;
    }

    .site-header__actions {
        margin-left: 0;
    }

    .site-header__burger span {
        display: block;
        width: 22px;
        height: 1.5px;
        background: var(--ink);
    }

    .mobile-nav {
        position: fixed;
        inset: 0;
        z-index: 500;
        display: block;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        overflow: hidden;
        border: 0;
        background: transparent;
        visibility: hidden;
        pointer-events: none;
        overscroll-behavior: contain;
        transition: visibility 0s linear .28s;
    }

    .mobile-nav.is-open {
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .mobile-nav__backdrop {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        padding: 0;
        background: rgba(23, 23, 15, .38);
        opacity: 0;
        cursor: pointer;
        transition: opacity .28s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav.is-open .mobile-nav__backdrop {
        opacity: 1;
    }

    .mobile-nav__drawer {
        position: absolute;
        inset: 0 auto 0 0;
        width: min(88vw, 380px);
        height: 100%;
        overflow: hidden;
        background: var(--bg);
        box-shadow: 18px 0 40px rgba(23, 23, 15, .14);
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4, 0, .2, 1);
        will-change: transform;
    }

    .mobile-nav.is-open .mobile-nav__drawer {
        transform: translateX(0);
    }

    .mobile-nav__viewport {
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: var(--bg);
    }

    .mobile-nav__panel {
        position: absolute;
        inset: 0;
        padding: 0;
        z-index: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        height: 100%;
        background: var(--bg);
        transform: translateX(100%);
        transition: transform .26s cubic-bezier(.4, 0, .2, 1);
        will-change: transform;
        pointer-events: none;
    }

    .mobile-nav__panel.is-active {
        z-index: 3;
        transform: translateX(0);
        pointer-events: auto;
    }

    .mobile-nav__panel.is-before {
        z-index: 2;
        transform: translateX(-100%);
        pointer-events: none;
    }

    .mobile-nav__head {
        flex: 0 0 58px;
        min-height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 16px 0 20px;
        border-bottom: 1px solid var(--line);
        background: var(--bg);
    }

    .mobile-nav__title {
        min-width: 0;
        font-family: Manrope, sans-serif;
        font-size: 17px;
        font-weight: 500;
        line-height: 1.2;
    }

    .mobile-nav__back {
        min-width: 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--ink);
        font: inherit;
        font-size: 15px;
        font-weight: 500;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav__back > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav__back-icon {
        position: relative;
        flex: 0 0 10px;
        width: 10px;
        height: 10px;
        border-left: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;
        transform: rotate(45deg);
    }

    .mobile-nav__close {
        position: relative;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        margin-right: -8px;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav__close span {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 1.5px;
        background: var(--ink);
    }

    .mobile-nav__close span:first-child {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .mobile-nav__close span:last-child {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .mobile-nav__body {
        min-height: 0;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #c9c8c1 transparent;
    }

    .mobile-nav__body::-webkit-scrollbar {
        width: 5px;
    }

    .mobile-nav__body::-webkit-scrollbar-track {
        background: transparent;
    }

    .mobile-nav__body::-webkit-scrollbar-thumb {
        background: #c9c8c1;
        border-radius: 999px;
    }

    .mobile-nav__list {
        flex: 0 0 auto;
        width: 100%;
    }

    .mobile-nav__item {
        position: relative;
        display: flex;
        align-items: stretch;
        width: 100%;
        min-height: 54px;
        border-bottom: 1px solid var(--line);
        background: var(--bg);
    }

    .mobile-nav .mobile-nav__item > .mobile-nav__link,
    .mobile-nav .mobile-nav__item > .mobile-nav__label {
        min-width: 0;
        min-height: 54px;
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        margin: 0;
        padding: 14px 20px;
        border: 0;
        color: var(--ink);
        font-size: 15px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .mobile-nav .mobile-nav__item > .mobile-nav__link.is-active {
        color: var(--accent);
    }

    .mobile-nav .mobile-nav__item--has-children > .mobile-nav__link,
    .mobile-nav .mobile-nav__item--has-children > .mobile-nav__label {
        padding-right: 12px;
    }

    .mobile-nav__next {
        position: relative;
        flex: 0 0 54px;
        width: 54px;
        min-height: 54px;
        margin: 0;
        padding: 0;
        border: 0;
        border-left: 1px solid var(--line);
        background: transparent;
        color: var(--ink);
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav__next span {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 9px;
        height: 9px;
        border-top: 1.5px solid currentColor;
        border-right: 1.5px solid currentColor;
        transform: translate(-65%, -50%) rotate(45deg);
    }

    .mobile-nav__next:active,
    .mobile-nav__back:active,
    .mobile-nav__close:active {
        background: var(--bg-tint);
    }

    .mobile-nav__socials {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 20px 18px;
        border: 0;
        background: var(--bg);
    }

    .mobile-nav .mobile-nav__social-link {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 10px;
        overflow: hidden;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .mobile-nav__social-link--max {
        background: transparent;
    }

    .mobile-nav__social-image {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 10px;
    }

    .mobile-nav__social-link--telegram {
        background: #49a9d8;
        color: #fff;
    }

    .mobile-nav__social-icon {
        display: block;
        width: 30px;
        height: 30px;
    }

    body.is-mobile-menu-open {
        overflow: hidden;
    }
}

@media (max-width: 560px) {
    .site-header .site-container {
        gap: 7px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .site-header .site-header__logo {
        font-size: 18px;
    }

    .site-header__phone {
        display: inline-flex;
    }

    .site-header__actions {
        gap: 6px;
    }

    .site-header__account,
    .site-header__cart {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .site-header__burger {
        flex-basis: 38px;
        width: 38px;
        height: 40px;
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (max-width: 420px) {
    .site-header .site-container {
        gap: 5px;
        padding-left: 8px;
        padding-right: 8px;
    }


    .site-header__actions {
        gap: 4px;
    }

    .mobile-nav__drawer {
        width: min(92vw, 380px);
    }
}

@media (min-width: 901px) {
    .mobile-nav {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-nav,
    .mobile-nav__backdrop,
    .mobile-nav__drawer,
    .mobile-nav__panel {
        transition: none;
    }
}
