/* CM Klara – sticky navigation + mobile offcanvas. */

.cmk-nav {
    position: sticky;
    top: 0;
    z-index: 99980;
}

body.admin-bar .cmk-nav { top: 32px; }

.cmk-nav__desktop {
    box-shadow: 0 3px 12px rgba(24, 28, 35, .04);
}

@media (max-width: 1024px) {
    body.admin-bar .cmk-nav { top: 46px; }

    .cmk-nav-mobile {
        position: relative;
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        align-items: center;
        min-height: 68px;
        padding: 8px 14px;
        background: #fff;
        border-bottom: 1px solid #eceef0;
        box-shadow: 0 5px 18px rgba(28,32,40,.08);
    }

    .cmk-nav-mobile__toggle,
    .cmk-nav-mobile__search-toggle {
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 12px;
        background: #f5f6f7;
        color: #172033;
        cursor: pointer;
    }

    .cmk-nav-mobile__toggle {
        font-size: 0;
    }

    .cmk-nav-mobile__toggle > span[aria-hidden="true"] {
        display: none;
    }

    .cmk-nav-mobile__toggle::before {
        content: "";
        width: 21px;
        height: 14px;
        border-top: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        box-shadow: inset 0 5px 0 -3px currentColor, inset 0 -5px 0 -3px currentColor;
    }

    .cmk-nav-mobile__search-toggle {
        justify-self: end;
        padding: 12px;
    }

    .cmk-nav-mobile__header-brand {
        justify-self: center;
    }

    .cmk-nav-mobile__brand {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        min-width: 0;
        color: #20242b;
        text-decoration: none;
    }

    .cmk-nav-mobile__brand-image {
        display: block;
        width: auto;
        max-width: 178px;
        height: 44px;
        object-fit: contain;
    }

    .cmk-nav-mobile__brand-mark {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 3px solid #d71920;
        border-radius: 50%;
        color: #d71920;
        font-size: 28px;
        font-weight: 700;
        line-height: 1;
        flex: 0 0 auto;
    }

    .cmk-nav-mobile__brand-copy {
        display: flex;
        flex-direction: column;
        line-height: 1;
    }

    .cmk-nav-mobile__brand-copy strong {
        font-size: 24px;
        letter-spacing: .07em;
    }

    .cmk-nav-mobile__brand-copy small {
        margin-top: 4px;
        font-size: 8px;
        letter-spacing: .24em;
        text-transform: uppercase;
        color: #737984;
    }

    .cmk-nav-mobile__backdrop {
        position: fixed;
        inset: 0;
        z-index: 99997;
        display: block;
        border: 0;
        background: rgba(17,22,29,.52);
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity .24s ease, visibility .24s ease;
    }

    .cmk-nav-mobile__backdrop.is-open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .cmk-nav-mobile__panel {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 99999;
        width: min(88vw, 430px);
        display: flex;
        flex-direction: column;
        visibility: hidden;
        opacity: 0;
        background: #fff;
        box-shadow: 18px 0 50px rgba(17,22,29,.18);
        transform: translateX(-104%);
        transition: transform .28s cubic-bezier(.22,.61,.36,1), opacity .22s ease, visibility .22s ease;
    }

    body.admin-bar .cmk-nav-mobile__panel {
        top: 46px;
    }

    .cmk-nav-mobile__panel.is-open {
        visibility: visible;
        opacity: 1;
        transform: translateX(0);
    }

    .cmk-nav-mobile__topbar {
        min-height: 72px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 18px;
        border-bottom: 1px solid #eceef0;
    }

    .cmk-nav-mobile__topbar .cmk-nav-mobile__brand {
        max-width: calc(100% - 52px);
    }

    .cmk-nav-mobile__close {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        border: 0;
        border-radius: 12px;
        background: #f5f6f7;
        color: #172033;
        font: inherit;
        font-size: 30px;
        line-height: 1;
        cursor: pointer;
    }

    .cmk-nav-mobile__search-wrap {
        padding: 12px 18px 8px;
    }

    .cmk-nav-mobile__search-form {
        display: flex;
        align-items: center;
        min-height: 46px;
        padding: 4px 5px 4px 14px;
        border: 1px solid #e1e4e8;
        border-radius: 14px;
        background: #f6f7f8;
        transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
    }

    .cmk-nav-mobile__search-form:focus-within {
        border-color: rgba(215,25,32,.5);
        background: #fff;
        box-shadow: 0 0 0 3px rgba(215,25,32,.07);
    }

    .cmk-nav-mobile__search-icon {
        width: 19px;
        height: 19px;
        flex: 0 0 19px;
        color: #263145;
    }

    .cmk-nav-mobile__search-form input {
        min-width: 0;
        flex: 1 1 auto;
        height: 38px;
        border: 0;
        outline: 0;
        background: transparent;
        padding: 0 10px;
        color: #404041;
        font: inherit;
        font-size: 14px;
        -webkit-appearance: none;
    }

    .cmk-nav-mobile__search-form input::-webkit-search-cancel-button {
        -webkit-appearance: none;
    }

    .cmk-nav-mobile__search-form button {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 10px;
        background: #d71920;
        color: #fff;
        padding: 10px;
        cursor: pointer;
    }

    .cmk-nav-mobile__viewport {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .cmk-nav-mobile__level {
        position: absolute;
        inset: 0;
        display: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 4px 14px 22px;
        background: #fff;
    }

    .cmk-nav-mobile__level.is-active {
        display: block;
    }

    .cmk-nav-mobile__level > ul > li {
        margin: 0;
        border-bottom: 1px solid #eceef0;
    }

    .cmk-nav-mobile__back {
        width: 100%;
        min-height: 48px;
        margin-bottom: 6px;
        padding: 10px 8px;
        border: 0;
        border-bottom: 1px solid #e2e4e7;
        background: transparent;
        color: #404041;
        text-align: left;
        font: inherit;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
    }

    .cmk-nav-mobile__parent-link {
        display: block;
        margin: 0 0 8px;
        padding: 11px 12px;
        border-radius: 10px;
        background: #fff2f3;
        color: #d71920;
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
    }

    .cmk-nav-mobile a,
    .cmk-nav-mobile__forward {
        width: 100%;
        min-height: 52px;
        display: grid;
        grid-template-columns: 26px minmax(0, 1fr) auto;
        align-items: center;
        gap: 11px;
        padding: 10px 8px;
        border: 0;
        background: #fff;
        color: #263145;
        text-decoration: none;
        font: inherit;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.35;
        text-align: left;
        cursor: pointer;
    }

    .cmk-nav-mobile__row-icon {
        width: 21px;
        height: 21px;
        display: inline-flex;
        color: #27354a;
    }

    .cmk-nav-mobile li.is-current > a,
    .cmk-nav-mobile__forward.is-expanded,
    .cmk-nav-mobile a:hover,
    .cmk-nav-mobile a:focus-visible,
    .cmk-nav-mobile__forward:hover,
    .cmk-nav-mobile__forward:focus-visible {
        color: #d71920;
        background: #fff7f7;
    }

    .cmk-nav-mobile__forward.is-expanded {
        border-left: 3px solid #d71920;
        padding-left: 5px;
        font-weight: 700;
    }

    .cmk-nav-mobile__forward.is-expanded .cmk-nav-mobile__row-icon {
        color: #d71920;
    }

    .cmk-nav-mobile__accordion {
        display: grid;
        grid-template-rows: 0fr;
        overflow: hidden;
        opacity: 0;
        transition: grid-template-rows .24s ease, opacity .18s ease;
    }

    .cmk-nav-mobile__accordion.is-open {
        grid-template-rows: 1fr;
        opacity: 1;
    }

    .cmk-nav-mobile__accordion > * {
        min-height: 0;
    }

    .cmk-nav-mobile__accordion-list {
        padding: 0 0 6px 28px !important;
    }

    .cmk-nav-mobile__accordion-list > li {
        border-bottom: 0 !important;
    }

    .cmk-nav-mobile__accordion-list a,
    .cmk-nav-mobile__accordion-list .cmk-nav-mobile__forward {
        min-height: 46px;
        padding-top: 7px;
        padding-bottom: 7px;
        font-size: 13px;
    }

    .cmk-nav-mobile__accordion-list .cmk-nav-mobile__row-icon {
        width: 19px;
        height: 19px;
    }

    .cmk-nav-mobile__footer {
        flex: 0 0 auto;
        padding: 12px 18px 18px;
        border-top: 1px solid #eceef0;
        background: #fff;
    }

    .cmk-nav-mobile__registration {
        min-height: 50px !important;
        display: grid !important;
        grid-template-columns: 24px minmax(0,1fr) auto !important;
        gap: 10px !important;
        padding: 11px 14px !important;
        border-radius: 10px !important;
        background: #d71920 !important;
        color: #fff !important;
        font-size: 14px !important;
        font-weight: 700 !important;
    }

    .cmk-nav-mobile__registration-icon {
        width: 21px;
        height: 21px;
    }

    .cmk-nav-mobile__contacts {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 14px;
        margin-top: 13px;
    }

    .cmk-nav-mobile__contacts a {
        width: auto !important;
        min-height: 0 !important;
        display: inline-flex !important;
        grid-template-columns: none !important;
        gap: 6px !important;
        padding: 0 !important;
        background: transparent !important;
        color: #566070 !important;
        font-size: 11px !important;
    }

    .cmk-nav-mobile__contacts a > span {
        width: 14px;
        height: 14px;
        color: #d71920;
    }
}

@media (max-width: 430px) {
    .cmk-nav-mobile {
        grid-template-columns: 44px minmax(0,1fr) 44px;
        padding-inline: 10px;
    }

    .cmk-nav-mobile__brand-image {
        max-width: 150px;
        height: 40px;
    }

    .cmk-nav-mobile__brand-copy strong {
        font-size: 20px;
    }

    .cmk-nav-mobile__panel {
        width: min(92vw, 410px);
    }

    .cmk-nav-mobile__contacts {
        display: grid;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cmk-nav-mobile__panel,
    .cmk-nav-mobile__backdrop,
    .cmk-nav-mobile__accordion {
        transition-duration: .01ms !important;
    }
}
