/* ============================================================================
   QR / mini cart  —  .m-qcart
   ----------------------------------------------------------------------------
   The cart drawer a guest sees after scanning a table sticker.

   Two things drive every decision here:

   • It is read on a phone, one-handed, at a dinner table. Controls sit within
     thumb reach at the BOTTOM, targets are >= 44px, and the summary and pay
     button are pinned so the total never scrolls out of sight.
   • The guest must be able to check their order at a glance before paying, so
     each line shows the item, its add-ons, the unit price, the quantity and
     the line total — no arithmetic left to the reader.

   Colours come from the DB theme tokens, with the shade end of the brand
   gradient derived from the brand itself: the stored shade can be left over
   from another palette, which used to render green brands green-to-brown.

   All spacing uses logical properties (inline-start/end) so RTL is automatic.
   ========================================================================== */

.m-qcart {
    --qc-brand:      var(--m-brand, var(--theme-brand, #B8541A));
    --qc-brand-dark: var(--theme-brand-dark, #8B3F12);
    --qc-brand-rgb:  var(--theme-brand-rgb, 184, 84, 26);
    --qc-ink:        var(--m-text, var(--theme-text, #241A13));
    --qc-ink-soft:   var(--m-text-soft, var(--theme-text-soft, #5C4938));
    --qc-ink-mute:   var(--m-text-mute, var(--theme-text-muted, #8C7A66));
    --qc-surface:    #FFFFFF;
    --qc-surface-2:  #F8F4ED;
    --qc-line:       rgba(36, 26, 19, .09);
    --qc-line-2:     rgba(36, 26, 19, .16);
    --qc-danger:     var(--theme-danger, #C73E3E);
    --qc-r-sm: 12px;
    --qc-r-md: 16px;
    --qc-r-pill: 999px;
    --qc-ease: cubic-bezier(.22, .61, .36, 1);

    display: flex;
    flex-direction: column;
    min-height: 100%;
    font-family: var(--m-font-body, 'Tajawal', 'Inter', system-ui, sans-serif);
    color: var(--qc-ink);
}
@supports (color: color-mix(in srgb, red 50%, black)) {
    .m-qcart { --qc-brand-dark: color-mix(in srgb, var(--qc-brand) 74%, #000); }
}

/* ---------- Header ---------- */
.m-qcart .m-qcart__head {
    position: sticky;
    inset-block-start: -1px;
    z-index: 3;
    background: var(--qc-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--qc-line);
    flex: none;
}
.m-qcart__head-txt { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.m-qcart .m-qcart__head h5 {
    margin: 0 !important;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--qc-ink) !important;
    font-family: inherit !important;
    text-transform: none;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.m-qcart__head h5 i { color: var(--qc-brand); font-size: .92em; }
.m-qcart .m-qcart__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: var(--qc-r-pill);
    background: rgba(var(--qc-brand-rgb), .12);
    color: var(--qc-brand);
    font-size: .74rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.m-qcart .m-qcart__table {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--qc-r-pill);
    background: rgba(var(--qc-brand-rgb), .10);
    color: var(--qc-brand);
    font-size: .76rem;
    font-weight: 800;
}
.m-qcart__table i { font-size: .78em; }

/* The close control is a real button-sized target, not a 12px glyph. */
.m-qcart .close_cart {
    flex: none;
    width: 38px; height: 38px;
    background: var(--qc-surface-2);
    border: 1px solid var(--qc-line);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--qc-ink-soft);
    cursor: pointer;
    transition: background .2s var(--qc-ease), color .2s, border-color .2s;
}
.m-qcart .close_cart:hover,
.m-qcart .close_cart:focus-visible {
    background: var(--qc-brand); color: #fff; border-color: var(--qc-brand);
    outline: none;
}

/* ---------- Item list ---------- */
.m-qcart .m-qcart__list {
    list-style: none;
    margin: 0;
    padding: 0;
    /* The panel itself scrolls; the list only takes the room it needs so a
       short cart does not leave a void above a bottom-pinned summary. */
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Short lists sit at the top rather than stretching to fill the sheet. */
    align-content: flex-start;
}
.m-qcart__list::-webkit-scrollbar { width: 5px; }
.m-qcart__list::-webkit-scrollbar-thumb { background: var(--qc-line-2); border-radius: 999px; }

/* Each line is its own card: a one-item cart still looks composed instead of
   one lonely row floating in a tall empty sheet. */
.m-qcart .m-qcart__item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: none;
    padding: 12px;
    border: 1px solid var(--qc-line);
    border-radius: var(--qc-r-md);
    background: var(--qc-surface-2);
    position: relative;
    animation: m-qcart-in .28s var(--qc-ease) both;
}
.m-qcart__item.is-busy { opacity: .5; pointer-events: none; }
.m-qcart .m-qcart__item.is-going {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease;
}
@keyframes m-qcart-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.m-qcart .m-qcart__thumb {
    width: 60px; height: 60px;
    border-radius: 14px !important;
    overflow: hidden;
    background: #EFE7DA;
    border: 1px solid var(--qc-line);
    display: flex; align-items: center; justify-content: center;
}
.m-qcart__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* No photo => a plate glyph, never a broken-image icon with the alt text
   spilling out of the frame. */
.m-qcart__thumb i { font-size: 20px; color: rgba(var(--qc-brand-rgb), .38); }

.m-qcart__body { display: contents; }

/* The dish name.

   This was a `-webkit-box` with `-webkit-line-clamp: 2`, which is the usual
   way to clamp two lines — but the element is a grid item (its wrapper is
   `display: contents`), and a `-webkit-box` grid item is not laid out in its
   track: Chrome shrink-wrapped it, dropped it under the remove button and
   painted no text at all. Every line in the cart showed a price, a stepper
   and no dish. A plain block sits in its cell, and a two-line max-height
   clamps it just as well.

   `!important` because style.css reaches this same element through
   `.wsus__menu_cart_area ul li .menu_cart_text .title` — four classes deep,
   which outweighs anything sensible written here — and it is the rule that
   asks for `-webkit-box`. */
.m-qcart .m-qcart__name {
    font-size: .93rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--qc-ink) !important;
    text-decoration: none;
    display: block !important;
    max-height: 2.7em;          /* 2 × line-height */
    overflow: hidden;
    align-self: center;
    /* Same legacy rule also puts `transition: all linear .3s` on this element.
       The drawer reveals itself by flipping `visibility` on its container, and
       with `all` in the transition the title takes that change as its own to
       animate — and can be left sitting on `hidden` while every other part of
       the row is already painted. It transitions colour on hover, nothing
       else. */
    visibility: visible !important;
    transition: color .2s var(--qc-ease) !important;
}
.m-qcart__name:hover { color: var(--qc-brand) !important; }

.m-qcart .m-qcart__del {
    align-self: start;
    flex: none;
    width: 28px; height: 28px;
    border: 1px solid var(--qc-line);
    background: var(--qc-surface);
    border-radius: 50%;
    color: var(--qc-ink-mute);
    font-size: .74rem;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s var(--qc-ease), color .2s, border-color .2s;
}
.m-qcart .m-qcart__del:hover,
.m-qcart .m-qcart__del:focus-visible {
    background: rgba(199, 62, 62, .10); color: var(--qc-danger);
    border-color: rgba(199, 62, 62, .35); outline: none;
}

/* Unit price + size + add-ons all live on the meta row. */
.m-qcart .m-qcart__meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    min-width: 0;
}
.m-qcart .m-qcart__unit {
    font-size: .76rem;
    color: var(--qc-ink-mute);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    display: inline-flex; align-items: center; gap: 3px;
}
.m-qcart .m-qcart__size {
    font-size: .72rem;
    color: var(--qc-ink-mute);
    padding: 2px 8px;
    border-radius: var(--qc-r-pill);
    background: var(--qc-surface);
    border: 1px solid var(--qc-line);
}
.m-qcart .m-qcart__chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: var(--qc-r-pill);
    background: var(--qc-surface);
    border: 1px solid var(--qc-line);
    font-size: .7rem;
    color: var(--qc-ink-soft);
    line-height: 1.7;
}
.m-qcart__chip i { font-size: .55rem; color: var(--qc-brand); }
.m-qcart__chip b { font-weight: 800; color: var(--qc-ink); }

/* ---------- Quantity stepper ---------- */
.m-qcart .m-qcart__qty {
    justify-self: start;
    display: inline-flex; align-items: center;
    background: var(--qc-surface);
    border: 1px solid var(--qc-line);
    border-radius: var(--qc-r-pill);
    padding: 2px;
}
.m-qcart .m-qcart__qty-btn {
    width: 30px; height: 30px;
    border: 0; background: transparent;
    border-radius: 50%;
    color: var(--qc-ink-soft);
    font-size: .68rem;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s var(--qc-ease), color .2s;
}
.m-qcart .m-qcart__qty-btn:hover:not(:disabled),
.m-qcart .m-qcart__qty-btn:focus-visible:not(:disabled) {
    background: var(--qc-brand); color: #fff; outline: none;
}
.m-qcart__qty-btn:disabled { opacity: .3; cursor: not-allowed; }
.m-qcart .m-qcart__qty-val {
    min-width: 28px; text-align: center;
    font-weight: 800; font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

.m-qcart .m-qcart__line {
    align-self: center;
    justify-self: end;
    font-size: 1rem;
    font-weight: 800;
    color: var(--qc-brand);
    font-variant-numeric: tabular-nums;
    display: inline-flex; align-items: center; gap: 3px;
    white-space: nowrap;
}

/* ---------- Add-more row ---------- */
.m-qcart .m-qcart__more {
    flex: none;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 8px;
    padding: 11px 14px;
    border-radius: var(--qc-r-md);
    border: 1px dashed var(--qc-line-2);
    background: transparent;
    color: var(--qc-ink-soft) !important;
    font-size: .82rem; font-weight: 700;
    text-decoration: none !important;
    transition: background .2s var(--qc-ease), color .2s, border-color .2s;
}
.m-qcart .m-qcart__more:hover,
.m-qcart .m-qcart__more:focus-visible {
    background: rgba(var(--qc-brand-rgb), .07);
    color: var(--qc-brand) !important;
    border-color: rgba(var(--qc-brand-rgb), .35);
    outline: none;
}
.m-qcart__more i { color: var(--qc-brand); }

/* ---------- Summary + actions (pinned) ---------- */
.m-qcart .m-qcart__foot {
    flex: none;
    position: sticky;
    inset-block-end: 0;
    z-index: 3;
    margin-top: auto;
    padding-top: 14px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--qc-line);
    background: var(--qc-surface);
}
.m-qcart__sums { margin-bottom: 12px; }
.m-qcart .m-qcart__sum {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    font-size: .84rem;
    color: var(--qc-ink-soft);
}
.m-qcart .m-qcart__sum span:last-child,
.m-qcart .m-qcart__sum strong {
    font-variant-numeric: tabular-nums;
    display: inline-flex; align-items: center; gap: 3px;
    white-space: nowrap;
}
/* The grand total is the number the guest is agreeing to pay, so it is the
   loudest thing in the footer — the sub-total used to compete with it. */
.m-qcart .m-qcart__sum--grand {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--qc-line-2);
    font-size: .92rem;
    font-weight: 800;
    color: var(--qc-ink);
}
.m-qcart .m-qcart__sum--grand strong {
    font-size: 1.24rem;
    font-weight: 800;
    color: var(--qc-brand);
}

/* ---------- Calls to action ---------- */
.m-qcart .m-qcart__cta {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 0;
    font-size: .95rem; font-weight: 800;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform .2s var(--qc-ease), filter .2s, background .2s, color .2s;
}
.m-qcart__cta + .m-qcart__cta { margin-top: 8px; }
.m-qcart .m-qcart__cta--pay {
    background: linear-gradient(135deg, var(--qc-brand), var(--qc-brand-dark));
    color: #fff !important;
    box-shadow: 0 14px 28px -14px rgba(var(--qc-brand-rgb), .95);
}
.m-qcart__cta--pay:hover { transform: translateY(-2px); filter: brightness(1.06); color: #fff !important; }
.m-qcart__cta--pay:active { transform: translateY(0) scale(.99); }
.m-qcart .m-qcart__cta--pay b {
    display: inline-flex; align-items: center; gap: 3px;
    padding-inline-start: 12px;
    border-inline-start: 1px solid rgba(255, 255, 255, .32);
    font-variant-numeric: tabular-nums;
}
.m-qcart__cta--pay .Saudi_Riyal { filter: brightness(0) invert(1); opacity: .95; }
/* Secondary route (cash, pay later, view cart) reads as an alternative,
   not as a second equally-weighted primary button. */
.m-qcart .m-qcart__cta--ghost {
    background: var(--qc-surface);
    border: 1.5px solid var(--qc-line-2);
    color: var(--qc-ink-soft) !important;
    min-height: 46px;
    font-size: .88rem;
    box-shadow: none;
}
.m-qcart .m-qcart__cta--ghost:hover,
.m-qcart .m-qcart__cta--ghost:focus-visible {
    border-color: var(--qc-brand);
    color: var(--qc-brand) !important;
    background: rgba(var(--qc-brand-rgb), .06);
    outline: none;
}
.m-qcart__cta:focus-visible { outline: 2px solid var(--qc-brand); outline-offset: 2px; }
html[dir="rtl"] .m-qcart__cta-dir { transform: scaleX(-1); }

/* ---------- Empty state ---------- */
.m-qcart .m-qcart__empty {
    flex: 1 1 auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 30px 18px;
}
.m-qcart .m-qcart__empty-icon {
    width: 76px; height: 76px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--qc-brand-rgb), .09);
    color: var(--qc-brand);
    font-size: 30px;
    margin-bottom: 6px;
}
.m-qcart__empty h6 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--qc-ink); }
.m-qcart__empty p { margin: 0; font-size: .84rem; color: var(--qc-ink-mute); max-width: 30ch; }
.m-qcart .m-qcart__empty-btn {
    margin-top: 14px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px;
    border-radius: var(--qc-r-pill);
    background: linear-gradient(135deg, var(--qc-brand), var(--qc-brand-dark));
    color: #fff !important;
    font-size: .88rem; font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 12px 24px -12px rgba(var(--qc-brand-rgb), .9);
}
.m-qcart__empty-btn:hover { filter: brightness(1.06); color: #fff !important; }

/* ---------- Narrow phones ---------- */
@media (max-width: 380px) {
    .m-qcart__item { grid-template-columns: 52px minmax(0, 1fr) auto; column-gap: 10px; padding: 10px; }
    .m-qcart__thumb { width: 52px; height: 52px; }
    .m-qcart__name { font-size: .88rem; }
    .m-qcart__cta { font-size: .88rem; padding: 13px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .m-qcart__item { animation: none; }
    .m-qcart__cta, .m-qcart__del, .m-qcart__qty-btn { transition: none; }
}

/* ---------------------------------------------------------------------------
   Legacy neutralisers
   modern-2026.css styles the old drawer markup (.mini_cart_list li,
   .menu_cart_img, .menu_cart_text) and those class names are still on the
   elements for the legacy scripts. Their box model is undone here so the grid
   above is the only thing deciding layout.
   --------------------------------------------------------------------------- */
.m-qcart .mini_cart_list li { gap: 0; padding: 12px; border-bottom: 0; }
.m-qcart .menu_cart_img { width: 60px; height: 60px; flex-shrink: 0; border-radius: 14px !important; }
.m-qcart .menu_cart_text { flex: none; min-width: 0; }
.m-qcart .menu_cart_text .title {
    font-size: .93rem !important;
    font-weight: 800 !important;
    color: var(--qc-ink) !important;
    margin: 0 !important;
}
.m-qcart .menu_cart_text .price { margin: 0 !important; }
.m-qcart .Saudi_Riyal { width: .68em !important; height: auto !important; vertical-align: -.02em; }
.m-qcart .m-qcart__sum--grand strong .Saudi_Riyal { width: .60em !important; }

/* A lone grand-total row sat directly under the footer's own rule, stacking a
   solid and a dashed separator two pixels apart. */
.m-qcart .m-qcart__sums > .m-qcart__sum--grand:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.m-qcart .m-qcart__sum--grand > span:first-child {
    font-weight: 800;
    color: var(--qc-ink);
}

/* fa-arrow-left already points the way a guest moves forward in RTL; flipping
   it turned the checkout arrow back on itself. */
html[dir="rtl"] .m-qcart .m-qcart__cta-dir { transform: none; }

/* Reassurance strip: fills the space a short cart leaves above the pinned
   summary with something a guest at a table actually wants confirmed. */
.m-qcart .m-qcart__assure {
    flex: none;
    display: flex; align-items: flex-start; gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--qc-r-md);
    background: rgba(var(--qc-brand-rgb), .06);
    border: 1px solid rgba(var(--qc-brand-rgb), .14);
}
.m-qcart .m-qcart__assure-icon {
    flex: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--qc-brand-rgb), .12);
    color: var(--qc-brand);
    font-size: 13px;
}
.m-qcart .m-qcart__assure-txt { min-width: 0; }
.m-qcart .m-qcart__assure-txt b {
    display: block;
    font-size: .82rem; font-weight: 800; color: var(--qc-ink);
    margin-bottom: 2px;
}
.m-qcart .m-qcart__assure-txt span {
    display: block;
    font-size: .76rem; line-height: 1.5; color: var(--qc-ink-mute);
}

/* Group the reassurance strip with the summary at the bottom of a tall panel:
   items read at the top, everything to act on sits together in thumb reach. */
.m-qcart .m-qcart__assure { margin-top: auto; margin-bottom: 4px; }
.m-qcart .m-qcart__foot { margin-top: 10px; }

/* The site's floating widgets (WhatsApp, dark-mode toggle) sit above the cart
   overlay, so they used to hover over the summary and the pay button. */
.show_mini_cart ~ .nx-wa-float,
.show_mini_cart ~ .nx-theme-toggle,
body:has(.wsus__menu_cart_area.show_mini_cart) .nx-wa-float,
body:has(.wsus__menu_cart_area.show_mini_cart) .nx-theme-toggle,
body:has(.wsus__menu_cart_area.show_mini_cart) .qr-myorders-fab {
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

/* ---------- Item rows ---------- */
/* Row 1 identifies the item, row 2 carries the controls. Splitting them is
   what stops the stepper and the total from sliding under the photo on a
   narrow drawer. */
.m-qcart .m-qcart__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}
.m-qcart .m-qcart__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
}
.m-qcart .m-qcart__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--qc-line);
}
.m-qcart .m-qcart__thumb { align-self: center; }
.m-qcart .m-qcart__del { align-self: flex-start; margin-top: 1px; }
.m-qcart .m-qcart__line { justify-self: auto; }
