/* "Your order": slides up like a kitchen ticket on a phone, sits beside the menu on a computer.
   This file also loads on pages without tokens.css, so every color has a fallback. */

#cartSideNav.order-panel {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 88dvh;
    padding: 0;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    background: var(--paper, #FFFFFF);
    box-shadow: 0 -8px 32px rgba(20, 23, 61, .28);
    color: var(--ink, #14173D);
    font-family: var(--body, inherit);
    transition: none;
}

#cartSideNav.sidenav-cart-open {
    display: flex;
    flex-direction: column;
    animation: order-panel-up .24s ease-out;
}

#cartSideNav.sidenav-cart-close { display: none; }
#cartSideNav:focus { outline: 0; }

.order-panel__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(20, 23, 61, .6);
}

#cartSideNav.sidenav-cart-open ~ .order-panel__backdrop { display: block; }
body.order-panel-open { overflow: hidden; }

@keyframes order-panel-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes order-panel-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.order-panel__head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 8px 12px 20px;
    border-bottom: 1px solid var(--line, rgba(20, 23, 61, .18));
}

.order-panel__title {
    margin: 0;
    color: inherit;
    font: 800 1.5rem/1.1 var(--display, inherit);
    letter-spacing: -.02em;
}

.order-panel__close {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

#cartSideNav .order-panel__items {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* One dish */
.order-line {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--line, rgba(20, 23, 61, .18));
}

.order-line:last-child { border-bottom: 0; }

.order-line__image {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--surface, #FFF6D6);
    object-fit: cover;
}

.order-line__name {
    margin: 0;
    color: inherit;
    font: 700 1rem/1.25 var(--display, inherit);
    white-space: pre-line; /* Extras come on their own lines. */
}

.order-line__each {
    margin: 2px 0 0;
    color: var(--muted, #565A7A);
    font-size: .875rem;
    line-height: 1.3;
}

.order-line__total {
    font: 700 1rem/1.25 var(--display, inherit);
    white-space: nowrap;
}

.order-line__stepper {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    border: 1.5px solid var(--line, rgba(20, 23, 61, .18));
    border-radius: 999px;
}

.order-line__stepper button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: .8125rem;
    cursor: pointer;
}

.order-line__stepper span {
    min-width: 24px;
    font-weight: 700;
    text-align: center;
}

/* Total and next step */
.order-panel__foot {
    flex: none;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    border-top: 2px dashed var(--line, rgba(20, 23, 61, .18));
}

.order-panel__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.order-panel__total strong { font: 800 1.375rem/1.1 var(--display, inherit); }

#cartSideNav .order-panel__primary {
    display: grid;
    place-items: center;
    min-height: 52px;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--saffron, #FFC22E);
    color: #14173D;
    font: 700 1.0625rem/1.2 var(--display, inherit);
    text-align: center;
    text-decoration: none;
}

.order-panel__secondary {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-top: 6px;
    padding: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.order-panel__foot:has(.order-panel__empty) {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    border-top: 0;
}

.order-panel__empty { padding: 16px 0 4px; text-align: center; }
.order-panel__empty p { margin: 0; color: var(--muted, #565A7A); }
.order-panel__empty .order-panel__empty-title {
    margin-bottom: 4px;
    color: inherit;
    font: 700 1.125rem/1.25 var(--display, inherit);
}

.order-panel__close:focus-visible,
.order-line__stepper button:focus-visible,
.order-panel__primary:focus-visible,
.order-panel__secondary:focus-visible {
    outline: 3px solid var(--navy, #14173D);
    outline-offset: 2px;
}

[data-theme='dark'] .order-panel__close:focus-visible,
[data-theme='dark'] .order-line__stepper button:focus-visible,
[data-theme='dark'] .order-panel__primary:focus-visible,
[data-theme='dark'] .order-panel__secondary:focus-visible { outline-color: var(--saffron, #FFC22E); }

@media (min-width: 768px) {
    #cartSideNav.order-panel {
        top: 0;
        left: auto;
        width: 430px;
        max-height: none;
        border-radius: 0;
        box-shadow: -8px 0 32px rgba(20, 23, 61, .28);
    }

    #cartSideNav.sidenav-cart-open { animation-name: order-panel-in; }
}

@media (prefers-reduced-motion: reduce) {
    #cartSideNav.sidenav-cart-open { animation: none; }
}
