/* =========================================================
   MY RIDE — PREMIUM HEADER + MOBILE NAV
   ========================================================= */

.mr-header {
    position: relative;
    z-index: 10000;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid rgba(20,20,20,.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.mr-header__inner {
    display: flex;
    align-items: center;
    min-height: 82px;
}

.mr-logo {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    color: #111;
    text-decoration: none;
}

.mr-logo__main {
    display: block;
    font-size: 21px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -.045em;
}

.mr-logo__sub {
    display: block;
    margin-top: 5px;
    font-size: 7px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: .28em;
    text-transform: uppercase;
    opacity: .58;
}

/* Desktop primary nav */
.mr-desktop-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: auto;
}

.mr-desktop-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    color: #44413c;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: color .2s ease;
}

.mr-desktop-nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 1.5px;
    background: #111;
    transform: translateX(-50%);
    transition: width .22s ease;
}

.mr-desktop-nav a:hover,
.mr-desktop-nav a.is-active {
    color: #111;
}

.mr-desktop-nav a:hover::after,
.mr-desktop-nav a.is-active::after {
    width: 18px;
}

/* Desktop action cluster */
.mr-header__actions {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: 25px;
    flex-shrink: 0;
}

.mr-header__action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #45423d;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .22s ease, border-color .22s ease, color .22s ease, transform .22s ease;
}

.mr-header__action svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.mr-header__action:hover,
.mr-header__action.is-active {
    background: #f3f1eb;
    border-color: #e6e2d9;
    color: #111;
}

.mr-header__action:hover {
    transform: translateY(-1px);
}

.mr-header__action.is-active {
    box-shadow: inset 0 0 0 1px rgba(17,17,17,.025);
}

/* Saved count badge */
.mr-saved-count,
.mr-mobile-saved-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.mr-saved-count[hidden],
.mr-mobile-saved-count[hidden] {
    display: none;
}

/* Browse CTA */
.mr-header__booking {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    margin-left: 3px;
    padding: 0 17px;
    border-radius: 13px;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 7px 20px rgba(0,0,0,.10);
    transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}

.mr-header__booking:hover {
    background: #292929;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,.14);
}

/* Mobile-only elements */
.mr-mobile-header-actions,
.mr-mobile-bottom-nav,
.mr-mobile-menu-button,
.mr-mobile-menu {
    display: none !important;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 767px) {

    .mr-header__inner {
        min-height: 68px;
    }

    .mr-logo__main {
        font-size: 18px;
    }

    .mr-logo__sub {
        margin-top: 4px;
        font-size: 6px;
    }

    .mr-desktop-nav,
    .mr-header__actions {
        display: none;
    }

    .mr-mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 7px;
        margin-left: auto;
        margin-right: 8px;
    }

    .mr-mobile-header-action {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 39px;
        height: 39px;
        border: 1px solid #e4e0d8;
        border-radius: 12px;
        background: #f7f5f0;
        color: #171717;
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(0,0,0,.035);
        transition: transform .2s ease, background .2s ease, border-color .2s ease;
    }

    .mr-mobile-header-action svg {
        width: 19px;
        height: 19px;
    }

    .mr-mobile-header-action:active {
        transform: scale(.95);
        background: #ece9e1;
    }

    .mr-mobile-menu-button {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        flex-direction: column;
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        gap: 5px;
        padding: 0 9px;
        margin: 0;
        border: 1px solid #e1ddd5;
        border-radius: 12px;
        background: #111;
        color: #fff;
        cursor: pointer;
        box-shadow: 0 6px 16px rgba(0,0,0,.12);
    }

    .mr-mobile-menu-button span {
        display: block;
        height: 1.6px;
        border-radius: 999px;
        background: currentColor;
        transition: width .22s ease, transform .22s ease, opacity .22s ease;
    }

    .mr-mobile-menu-button span:nth-child(1),
    .mr-mobile-menu-button span:nth-child(3) { width: 19px; }
    .mr-mobile-menu-button span:nth-child(2) { width: 13px; }

    .mr-mobile-menu-button[aria-expanded="true"] span:nth-child(1) {
        width: 19px;
        transform: translateY(6.6px) rotate(45deg);
    }
    .mr-mobile-menu-button[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
        width: 0;
    }
    .mr-mobile-menu-button[aria-expanded="true"] span:nth-child(3) {
        width: 19px;
        transform: translateY(-6.6px) rotate(-45deg);
    }

    /* Mobile slide/fade menu */
    .mr-mobile-menu {
        position: fixed !important;
        top: 68px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 70px !important;
        display: none !important;
        overflow-y: auto;
        background: #f7f6f2 !important;
        border-top: 1px solid #e4e0d8;
        z-index: 10000 !important;
        box-sizing: border-box;
        isolation: isolate;
        opacity: 1 !important;
        animation: mrMenuIn .22s ease both;
    }

    .mr-mobile-menu.is-open {
        display: block !important;
    }

    @keyframes mrMenuIn {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .mr-mobile-menu__inner {
        width: 100%;
        padding: 22px 18px 28px;
        box-sizing: border-box;
    }

    .mr-mobile-menu__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 18px;
        border-bottom: 1px solid #dfdcd5;
    }

    .mr-mobile-menu__label {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .18em;
        color: #7b776f;
    }

    .mr-mobile-menu__close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 1px solid #d8d4cc;
        border-radius: 11px;
        background: #fff;
        color: #111;
        cursor: pointer;
        transition: background .2s ease, color .2s ease, transform .2s ease;
    }

    .mr-mobile-menu__close:active {
        transform: scale(.95);
    }

    .mr-mobile-menu__close svg {
        width: 17px;
        height: 17px;
    }

    .mr-mobile-menu__nav {
        display: flex;
        flex-direction: column;
        margin-top: 8px;
    }

    .mr-mobile-menu__nav a {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 58px;
        margin-bottom: 6px;
        padding: 0 14px;
        border: 1px solid transparent;
        border-radius: 13px;
        color: #222;
        text-decoration: none;
        font-size: 20px;
        font-weight: 500;
        letter-spacing: -.035em;
        transition:
            color .2s ease,
            background .2s ease,
            border-color .2s ease,
            transform .2s ease;
    }

    .mr-mobile-menu__nav a::before {
        display: none;
    }

    .mr-mobile-menu__nav a.is-active {
        font-weight: 650;
        background: #ebe9e2;
        border-color: #ddd9d0;
        color: #111;
        box-shadow: inset 0 0 0 1px rgba(17,17,17,.02);
    }

    .mr-mobile-menu__nav a svg {
        width: 21px;
        height: 21px;
        flex: 0 0 auto;
        opacity: 1;
        color: currentColor;
        transition: transform .2s ease;
    }

    .mr-mobile-menu__nav a:hover {
        color: #111;
        background: #f0eee8;
        border-color: #e2ded5;
    }

    .mr-mobile-menu__nav a:hover svg,
    .mr-mobile-menu__nav a.is-active svg {
        opacity: 1;
        transform: translateX(2px);
    }

    .mr-mobile-menu__label-wrap {
        display: inline-flex;
        align-items: center;
        gap: 7px;
    }

    .mr-mobile-menu-saved-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 17px;
        height: 17px;
        padding: 0 5px;
        border-radius: 999px;
        background: #111;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        line-height: 1;
    }

    .mr-mobile-menu-saved-count[hidden] {
        display: none;
    }

    .mr-mobile-menu__cta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 54px;
        margin-top: 22px;
        padding: 0 18px;
        box-sizing: border-box;
        border-radius: 13px;
        background: #111;
        color: #fff !important;
        text-decoration: none;
        font-size: 13px;
        font-weight: 700;
        box-shadow: 0 10px 24px rgba(0,0,0,.13);
    }

    .mr-mobile-menu__cta svg {
        width: 17px;
        height: 17px;
    }

    /* Premium fixed bottom navigation */
    .mr-mobile-bottom-nav {
        position: fixed !important;
        top: auto !important;
        left: 10px !important;
        right: 10px !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        z-index: 9999 !important;
        display: grid !important;
        grid-template-columns: repeat(6, 1fr);
        height: 64px;
        padding: 5px;
        box-sizing: border-box;
        border: 1px solid #dedbd3;
        border-radius: 18px;
        background: rgba(255,255,255,.94);
        box-shadow: 0 12px 35px rgba(0,0,0,.12);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .mr-mobile-bottom-nav__item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        border-radius: 13px;
        color: #77736c;
        text-decoration: none;
        font-size: 9px;
        font-weight: 600;
        line-height: 1;
        transition: color .2s ease, background .2s ease, transform .2s ease;
    }

    .mr-mobile-bottom-nav__item svg {
        display: block;
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        transition: transform .2s ease;
    }

    .mr-mobile-bottom-nav__item:hover {
        color: #111;
    }

    .mr-mobile-bottom-nav__item.is-active {
        background: #f0eee8;
        color: #111;
    }

    .mr-mobile-bottom-nav__item.is-active svg {
        transform: translateY(-1px);
    }

    .mr-mobile-saved-count {
        position: absolute;
        top: 5px;
        right: 16%;
        min-width: 14px;
        height: 14px;
        padding: 0 4px;
        font-size: 8px;
        border: 2px solid #fff;
    }

    
}

/* Small phones */
@media (max-width: 380px) {
    .mr-mobile-bottom-nav {
        top: auto !important;
        left: 7px !important;
        right: 7px !important;
        bottom: calc(6px + env(safe-area-inset-bottom)) !important;
        height: 61px;
        border-radius: 16px;
    }

    .mr-mobile-bottom-nav__item {
        font-size: 8px;
        gap: 2px;
        border-radius: 11px;
    }

    .mr-mobile-bottom-nav__item svg {
        width: 18px;
        height: 18px;
    }

    .mr-mobile-header-actions {
        gap: 5px;
        margin-right: 5px;
    }

    .mr-mobile-header-action {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .mr-mobile-menu-button {
        width: 39px;
        height: 39px;
        border-radius: 10px;
    }

   
}

/* =========================================================
   FINAL MOBILE HEADER VISIBILITY FIX
   Keep the mobile search, profile and hamburger visible.
   ========================================================= */
@media (max-width: 767px) {
    .mr-header__inner {
        position: relative;
        overflow: visible !important;
    }

    .mr-mobile-header-actions {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto !important;
    }

    .mr-mobile-header-action {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto !important;
    }

    .mr-mobile-menu-button {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto !important;
    }

    .mr-logo {
        flex: 0 0 auto;
    }
}


/* =========================================================
   MY RIDE — FINAL MOBILE MENU FIX
   Explicit viewport height
   ========================================================= */

@media (max-width: 767px) {

    .mr-mobile-menu {
        position: fixed !important;

        top: 68px !important;
        left: 0 !important;
        right: 0 !important;

        width: 100% !important;

        height: calc(100vh - 138px) !important;
        max-height: calc(100vh - 138px) !important;
        min-height: 0 !important;

        bottom: auto !important;

        display: none !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        box-sizing: border-box !important;

        z-index: 10000 !important;

        background: #f7f6f2 !important;
    }

    .mr-mobile-menu.is-open {
        display: block !important;

        height: calc(100vh - 138px) !important;
        max-height: calc(100vh - 138px) !important;
    }

    .mr-mobile-menu__inner {
        display: block !important;

        width: 100% !important;
        min-height: 100% !important;

        padding: 22px 18px 28px !important;

        box-sizing: border-box !important;
    }

}

/* =========================================================
   FINAL MOBILE DRAWER — OPAQUE PREMIUM PANEL
   ========================================================= */
@media (max-width: 767px) {
    .mr-mobile-menu,
    .mr-mobile-menu.is-open {
        background: #f7f6f2 !important;
        opacity: 1 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .mr-mobile-menu__inner {
        background: #f7f6f2 !important;
    }
}
/* =========================================================
   SAVED COUNT — MOBILE DRAWER
   Position badge above the bookmark icon
   ========================================================= */

@media (max-width: 767px) {

    .mr-mobile-menu__nav a[href*="/saved-cars/"] {
        position: relative;
    }

    .mr-mobile-menu__nav a[href*="/saved-cars/"] .mr-saved-count,
    .mr-mobile-menu__nav a[href*="/saved-cars/"] .mr-mobile-saved-count,
    .mr-mobile-menu__nav a[href*="/saved-cars/"] [data-saved-count] {
        position: absolute !important;

        right: 0px !important;
        top: calc(50% - 17px) !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        min-width: 15px !important;
        width: auto !important;
        height: 15px !important;

        padding: 0 4px !important;

        border: 2px solid #f7f6f2 !important;
        border-radius: 999px !important;

        background: #111 !important;
        color: #fff !important;

        font-size: 7px !important;
        font-weight: 700 !important;
        line-height: 1 !important;

        z-index: 3 !important;
    }

}

/* =========================================================
   MOBILE BOTTOM NAV — SUBTLE BOLD POLISH
   ========================================================= */

@media screen and (max-width: 767px) {

    /* Navigation labels only */
    .mr-mobile-bottom-nav__item > span:not(.mr-mobile-saved-count) {
        color: #4f4c46 !important;
        font-weight: 700 !important;
    }

    /* Navigation icons */
    .mr-mobile-bottom-nav__item > svg {
        color: #4f4c46 !important;
        stroke-width: 2.2px !important;
    }

    .mr-mobile-bottom-nav__item > svg path {
        stroke-width: 2.2px !important;
    }

    /* Keep active item slightly stronger */
    .mr-mobile-bottom-nav__item.is-active > span:not(.mr-mobile-saved-count) {
        color: #111111 !important;
        font-weight: 700 !important;
    }

    .mr-mobile-bottom-nav__item.is-active > svg {
        color: #111111 !important;
        stroke-width: 2.2px !important;
    }

    .mr-mobile-bottom-nav__item.is-active > svg path {
        stroke-width: 2.2px !important;
    }
}