/* CM Klara navigation v13 — safe mobile search + persistent top back control. */

@media (max-width: 1024px) {
    /* Persistent action row directly below the brand header. */
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-wrap {
        position: relative !important;
        z-index: 14 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        min-height: 58px !important;
        padding: 8px 16px !important;
        background: #fff !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__back-proxy {
        display: none !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        min-height: 34px !important;
        padding: 5px 9px !important;
        margin: 0 !important;
        border: 1px solid #dedfe2 !important;
        border-radius: 7px !important;
        background: #fff !important;
        color: #be1e2d !important;
        box-shadow: 0 1px 2px rgba(20,24,30,.035) !important;
        font-family: "Open Sans", Arial, sans-serif !important;
        font-size: 12.5px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__back-proxy.is-visible {
        display: inline-flex !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__back-proxy::before {
        content: "←" !important;
        font-size: 13px !important;
        line-height: 1 !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__back-proxy:hover,
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__back-proxy:focus-visible {
        border-color: #c7c9cd !important;
        background: #f7f7f8 !important;
        color: #a81724 !important;
        outline: 2px solid rgba(190,30,45,.10) !important;
        outline-offset: 1px !important;
    }

    /* Keep original buttons only as the drill-down state target for JS. */
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__level > button.cmk-nav-mobile__back {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        min-width: 1px !important;
        min-height: 1px !important;
        margin: -1px !important;
        padding: 0 !important;
        overflow: hidden !important;
        clip: rect(0 0 0 0) !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Compact search stays clearly intentional on the right side of the same row. */
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form {
        margin-left: auto !important;
        flex: 0 0 auto !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form:not(.is-expanded) {
        width: 118px !important;
        min-width: 118px !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form:not(.is-expanded) .cmk-nav-mobile__search-label {
        color: #404041 !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form:not(.is-expanded) button[type="submit"],
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form:not(.is-expanded) button[type="button"] {
        border-radius: 50% !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form.is-expanded {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__back-proxy.is-visible + .cmk-nav-mobile__search-form.is-expanded {
        min-width: 0 !important;
    }
}
