/* CM Klara navigation v7 — branded controls, balanced desktop sticky and tuned search motion. */

@media (min-width: 1025px) {
    /* Keep the desktop navigation visually centred, also after sticky activation. */
    .cmk-nav.cmk-nav--fixed .cmk-nav__root {
        width: fit-content !important;
        max-width: calc(100% - 190px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Sticky already carries the Klara brand, so Home is redundant there. */
    .cmk-nav.cmk-nav--fixed .cmk-nav__root-item.is-home-item {
        display: none !important;
    }

    /* Desktop search uses the same visual language as the compact mobile control. */
    .cmk-nav .cmk-nav__root-item.is-search {
        width: 108px !important;
        flex-basis: 108px !important;
        transition:
            width .28s cubic-bezier(.22,.61,.36,1),
            flex-basis .28s cubic-bezier(.22,.61,.36,1) !important;
    }

    .cmk-nav .cmk-nav__root-item.is-search-open {
        width: 350px !important;
        flex-basis: 350px !important;
    }

    .cmk-nav .cmk-nav__root-item.is-search > a.cmk-nav__root-link {
        gap: 8px !important;
        padding: 0 8px !important;
        border: 0 !important;
        border-radius: 22px !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #404041 !important;
        transition:
            color .14s ease,
            opacity .14s ease,
            transform .28s cubic-bezier(.22,.61,.36,1),
            visibility .14s ease !important;
    }

    .cmk-nav .cmk-nav__root-item.is-search > a.cmk-nav__root-link:hover,
    .cmk-nav .cmk-nav__root-item.is-search > a.cmk-nav__root-link:focus-visible {
        background: #fff6f7 !important;
        color: #be1e2d !important;
    }

    .cmk-nav .cmk-nav__root-item.is-search .cmk-nav__search-trigger-icon {
        order: 2 !important;
        width: 34px !important;
        height: 34px !important;
        flex: 0 0 34px !important;
        padding: 8px !important;
        border-radius: 50% !important;
        background: #d71920 !important;
        color: #fff !important;
        box-shadow: 0 3px 9px rgba(190,30,45,.16) !important;
    }

    .cmk-nav .cmk-nav__root-item.is-search .cmk-nav__root-label {
        order: 1 !important;
        font-weight: 600 !important;
    }

    .cmk-nav .cmk-nav__root-item.is-search .cmk-nav__search-form {
        border-radius: 14px !important;
        transform: translateX(18px) scale(.98) !important;
        transition:
            opacity .16s ease .02s,
            transform .28s cubic-bezier(.22,.61,.36,1),
            visibility .16s ease,
            border-color .14s ease,
            box-shadow .14s ease !important;
    }

    .cmk-nav .cmk-nav__root-item.is-search-open .cmk-nav__search-form {
        transform: translateX(0) scale(1) !important;
    }

    .cmk-nav .cmk-nav__search-form .cmk-nav__search-submit {
        border-radius: 10px !important;
        background: #d71920 !important;
        transition:
            background-color .14s ease,
            box-shadow .14s ease,
            transform .14s ease !important;
    }
}

@media (min-width: 1025px) and (max-width: 1180px) {
    .cmk-nav.cmk-nav--fixed .cmk-nav__root {
        width: fit-content !important;
        max-width: calc(100% - 100px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .cmk-nav .cmk-nav__root-item.is-search-open {
        width: 305px !important;
        flex-basis: 305px !important;
    }
}

@media (max-width: 1024px) {
    /* Brand-consistent mobile header controls; suppress browser blue tap highlight. */
    .cmk-nav-mobile__toggle,
    .cmk-nav-mobile__search-toggle,
    body > .cmk-nav-mobile__panel button,
    body > .cmk-nav-mobile__panel a {
        -webkit-tap-highlight-color: transparent !important;
    }

    .cmk-nav-mobile__toggle,
    .cmk-nav-mobile__search-toggle {
        border: 1px solid rgba(190,30,45,.10) !important;
        background: #fff6f7 !important;
        color: #be1e2d !important;
        box-shadow: none !important;
    }

    .cmk-nav-mobile__toggle:active,
    .cmk-nav-mobile__search-toggle:active {
        background: #ffecef !important;
        color: #a81724 !important;
    }

    .cmk-nav-mobile__toggle:focus,
    .cmk-nav-mobile__search-toggle:focus {
        outline: none !important;
    }

    .cmk-nav-mobile__toggle:focus-visible,
    .cmk-nav-mobile__search-toggle:focus-visible {
        outline: 2px solid rgba(190,30,45,.35) !important;
        outline-offset: 2px !important;
    }

    /* Mobile v6 became too fast. Restore a deliberate but still responsive motion. */
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form {
        transition:
            width .23s cubic-bezier(.22,.61,.36,1),
            background-color .16s ease,
            border-radius .20s ease,
            border-color .16s ease,
            box-shadow .16s ease !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-label {
        transition:
            opacity .14s ease,
            transform .17s ease,
            width .17s ease !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form button[type="submit"] {
        transition:
            border-radius .21s ease,
            width .21s ease,
            height .21s ease,
            box-shadow .15s ease !important;
    }

    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-icon,
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form input[type="search"] {
        transition-duration: .16s !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cmk-nav .cmk-nav__root-item.is-search,
    .cmk-nav .cmk-nav__root-item.is-search > a.cmk-nav__root-link,
    .cmk-nav .cmk-nav__root-item.is-search .cmk-nav__search-form,
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form,
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-label,
    body > .cmk-nav-mobile__panel .cmk-nav-mobile__search-form button[type="submit"] {
        transition-duration: .01ms !important;
    }
}
