/*
 * Royal Servicess LLC
 * Customer Tablet Navigation T1
 *
 * Only 641px through 1120px.
 * Desktop and phone presentation remain unchanged.
 * No booking, authentication or JavaScript changes.
 */

@media (min-width: 641px) and (max-width: 1120px) {

    /* Header frame */

    .app-shell-header--customer {
        position: relative;
        z-index: 1100;
        overflow: visible !important;
    }

    .app-shell-header--customer
    .app-shell-header__inner {
        position: relative;
        display: grid;
        grid-template-columns:
            minmax(0, 1fr)
            98px
            44px;
        grid-template-rows: auto;
        align-items: center;
        gap: 12px !important;
        padding: 11px 0 !important;
        overflow: visible !important;
    }

    .app-shell-header--customer
    .app-shell-brand-group {
        grid-column: 1 !important;
        grid-row: 1 !important;
        min-width: 0;
        align-self: center;
    }

    /* Tablet hamburger button */

    .app-shell-header--customer
    .app-shell-menu-toggle {
        grid-area: auto !important;
        grid-column: 2 !important;
        grid-row: 1 !important;
        position: relative !important;
        z-index: 5;
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 9px !important;
        box-sizing: border-box;
        width: 98px !important;
        min-width: 98px !important;
        max-width: 98px !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 11px !important;
        border: 1px solid rgba(219, 183, 91, .25);
        border-radius: 12px;
        background: rgba(19, 19, 19, .85);
        color: #e8cf94;
        white-space: nowrap;
        cursor: pointer;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle__label {
        position: static !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        clip: auto !important;
        clip-path: none !important;
        opacity: 1 !important;
        font-size: 12px;
        font-weight: 750;
        line-height: 1;
        letter-spacing: .015em;
        white-space: nowrap !important;
        transform: none !important;
    }

    /* Bars stay inside their own 18px box */

    .app-shell-header--customer
    .app-shell-menu-toggle__lines {
        position: relative !important;
        display: block !important;
        flex: 0 0 18px !important;
        width: 18px !important;
        min-width: 18px !important;
        height: 18px !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle__lines span {
        position: absolute !important;
        left: 0 !important;
        display: block !important;
        width: 18px !important;
        height: 2px !important;
        margin: 0 !important;
        border-radius: 2px;
        background: currentColor !important;
        transform-origin: center;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle__lines span:nth-child(1) {
        top: 3px !important;
        transform: none !important;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle__lines span:nth-child(2) {
        top: 8px !important;
        width: 18px !important;
        opacity: 1;
        transform: none !important;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle__lines span:nth-child(3) {
        top: 13px !important;
        transform: none !important;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle[aria-expanded="true"]
    .app-shell-menu-toggle__lines span:nth-child(1) {
        transform: translateY(5px) rotate(45deg) !important;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle[aria-expanded="true"]
    .app-shell-menu-toggle__lines span:nth-child(2) {
        opacity: 0 !important;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle[aria-expanded="true"]
    .app-shell-menu-toggle__lines span:nth-child(3) {
        transform: translateY(-5px) rotate(-45deg) !important;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle[aria-expanded="true"] {
        border-color: rgba(228, 190, 93, .48);
        color: #f4d994;
        background: rgba(223, 181, 82, .08);
    }

    /* Independent account button */

    .app-shell-header--customer
    .app-shell-user {
        grid-area: auto !important;
        grid-column: 3 !important;
        grid-row: 1 !important;
        justify-self: end;
        align-self: center;
        z-index: 6;
        width: 44px;
        margin: 0 !important;
    }

    .app-shell-header--customer
    .app-shell-user > summary {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px;
        height: 44px !important;
        min-height: 44px !important;
        padding: 4px !important;
    }

    /* Compact right-aligned dropdown */

    .app-shell-header--customer
    .app-shell-nav {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        right: 0 !important;
        bottom: auto !important;
        left: auto !important;
        grid-area: auto !important;
        grid-column: auto !important;
        grid-row: auto !important;
        z-index: 30;
        display: grid !important;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        align-content: start;
        box-sizing: border-box;
        width: min(520px, calc(100vw - 32px)) !important;
        min-width: 0;
        max-width: 520px;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 5px 9px !important;
        border: 1px solid transparent !important;
        border-radius: 16px;
        background: #101112;
        box-shadow: none;
        opacity: 0 !important;
        visibility: hidden;
        overflow: hidden !important;
        pointer-events: none !important;
        transform: none !important;
    }

    .app-shell-header--customer.is-dashboard-menu-open
    .app-shell-nav {
        max-height: min(72vh, 540px) !important;
        margin: 0 !important;
        padding: 15px !important;
        border: 1px solid rgba(223, 185, 94, .24) !important;
        background:
            linear-gradient(
                155deg,
                rgba(24, 24, 23, .99),
                rgba(9, 10, 11, .99)
            ) !important;
        box-shadow:
            0 22px 54px rgba(0, 0, 0, .5);
        opacity: 1 !important;
        visibility: visible;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto !important;
    }

    .app-shell-header--customer
    .app-shell-nav::before {
        content: "RENTALS & ACCOUNT";
        display: block;
        grid-column: 1 / -1;
        padding: 4px 6px 9px;
        color: #dfc389;
        font-size: 10px;
        font-weight: 850;
        line-height: 1.4;
        letter-spacing: .12em;
    }

    /* Comfortable navigation cards */

    .app-shell-header--customer
    .app-shell-nav > a.app-shell-nav__link {
        position: static !important;
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        box-sizing: border-box;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 45px !important;
        margin: 0 !important;
        padding: 11px 13px !important;
        border: 1px solid rgba(255, 255, 255, .055);
        border-radius: 9px;
        background: rgba(255, 255, 255, .025);
        color: #e9e5dc !important;
        font-size: .79rem !important;
        font-weight: 650;
        line-height: 1.3;
        text-decoration: none;
        text-align: left;
        white-space: normal;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    .app-shell-header--customer
    .app-shell-nav > a.app-shell-nav__link:hover,
    .app-shell-header--customer
    .app-shell-nav > a.app-shell-nav__link:focus-visible,
    .app-shell-header--customer
    .app-shell-nav > a.app-shell-nav__link.is-active {
        border-color: rgba(220, 181, 81, .32);
        background: rgba(220, 181, 81, .085);
        color: #f8e3ae !important;
    }

    /* Gold CTA stays inside one grid cell */

    .app-shell-header--customer
    .app-shell-nav > a.app-shell-nav__reserve-cta {
        position: static !important;
        inset: auto !important;
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 45px !important;
        max-height: 52px;
        margin: 0 !important;
        padding: 10px 12px !important;
        border: 1px solid #e9c972 !important;
        border-radius: 9px;
        background:
            linear-gradient(
                125deg,
                #f0d993,
                #d4aa43
            ) !important;
        color: #181209 !important;
        font-size: .73rem !important;
        font-weight: 850 !important;
        text-align: center;
        transform: none !important;
    }

    .app-shell-header--customer
    .app-shell-nav > .app-shell-nav__mobile-section {
        display: block !important;
        grid-column: 1 / -1;
        width: 100%;
        margin: 7px 0 2px;
        padding: 12px 6px 6px;
        border-top: 1px solid rgba(220, 183, 91, .18);
        color: #dfc389;
    }

    .app-shell-header--customer
    .app-shell-nav > .app-shell-nav__mobile-signout-form {
        display: block !important;
        grid-column: 1 / -1;
        width: 100%;
        margin: 5px 0 0;
    }

    .app-shell-header--customer
    .app-shell-nav
    .app-shell-nav__mobile-signout {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        min-height: 43px;
        margin: 0;
        color: #e9cc8a;
        text-align: center;
    }
}

/* Narrow tablets: use a single readable column */

@media (min-width: 641px) and (max-width: 759px) {

    .app-shell-header--customer
    .app-shell-header__inner {
        grid-template-columns:
            minmax(0, 1fr)
            90px
            44px;
        gap: 8px !important;
    }

    .app-shell-header--customer
    .app-shell-menu-toggle {
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
    }

    .app-shell-header--customer
    .app-shell-nav {
        width: min(420px, calc(100vw - 28px)) !important;
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 641px) and (max-width: 1120px)
and (prefers-reduced-motion: reduce) {

    .app-shell-header--customer
    .app-shell-menu-toggle,
    .app-shell-header--customer
    .app-shell-nav {
        transition: none !important;
    }
}


/*
 * TABLET ACTION ALIGNMENT T2
 * Put Reserve Now next to Sign Out at the
 * end of the tablet customer menu.
 *
 * Other header breakpoints remain untouched.
 */

@media (min-width: 641px) and (max-width: 1120px) {

    .app-shell-header--customer
    .app-shell-nav > a.app-shell-nav__reserve-cta {
        order: 90;
        grid-column: 1 !important;
        grid-row: auto !important;
        align-self: stretch;
        width: 100% !important;
        min-height: 46px !important;
        margin: 8px 0 0 !important;
        padding: 10px 12px !important;
    }

    .app-shell-header--customer
    .app-shell-nav > form.app-shell-nav__mobile-signout-form {
        order: 91;
        grid-column: 2 !important;
        grid-row: auto !important;
        align-self: stretch;
        width: 100% !important;
        margin: 8px 0 0 !important;
        padding: 0 !important;
    }

    .app-shell-header--customer
    .app-shell-nav
    .app-shell-nav__mobile-signout {
        display: flex !important;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 100% !important;
        min-height: 46px !important;
        margin: 0 !important;
        padding: 10px 12px !important;
        border-radius: 9px;
        text-align: center;
    }
}

@media (min-width: 641px) and (max-width: 759px) {

    .app-shell-header--customer
    .app-shell-nav > a.app-shell-nav__reserve-cta,
    .app-shell-header--customer
    .app-shell-nav > form.app-shell-nav__mobile-signout-form {
        grid-column: 1 / -1 !important;
    }
}
