/* ═════════════════════════════════════════════════
   Kava Café — Customer-facing Menu Styles
   الألوان الأساسية مستمدة من اللوجو
   ═════════════════════════════════════════════════ */
/*
 * Phase 8.18 — Palette unified with landing.css so the same brand colours
 * apply across kavacafe.net + order.kavacafe.net. Don't redefine variables
 * already declared in landing.css — only the menu-specific ones.
 */
:root {
    --k-teal:         #00929C;
    --k-teal-dark:    #006E78;
    --k-teal-light:   #4DB8BF;
    --k-burgundy:     #6B1F2C;
    --k-burgundy-dark:#4D1620;
    --k-gold:         #D4A648;
    --k-beige:        #EDE5D9;
    --k-beige-soft:   #f6f0e7;
    --k-cream:        #FAF7F2;
    --k-text:         #2C2521;
    --k-text-muted:   #777777;
    --k-card:         #ffffff;
    --k-border:       #e5dcc9;
    --k-success:      #198754;
    --k-danger:       #dc3545;
    --k-shadow:       0 4px 14px rgba(107,31,44,0.08);
    --k-shadow-strong:0 8px 24px rgba(107,31,44,0.15);
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--k-cream);
    color: var(--k-text);
    margin: 0;
    min-height: 100vh;
}
/* Phase 8.20.x — DO NOT collapse padding on body.
   landing.css reserves the top with `body { padding-top: 64px }` so the
   fixed `.kava-header` doesn't overlap content. If we set `padding: 0`
   on the shared rule above, the shorthand silently overrides that — which
   was the bug a customer reported (invoice number row hidden behind the
   header on /Customer/OrderDetails, /Menu/Cart, /Menu/Checkout, etc).
   Set the bottom-only padding here and let landing.css own the top. */
body {
    /* Phase 8.18 — account for iPhone notch + Android nav bar.
       env(safe-area-inset-bottom) returns 0 on browsers/devices without notch. */
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

a { text-decoration: none; color: inherit; }

/* ═════════ Header ═════════ */
.menu-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--k-teal) 0%, var(--k-teal-dark) 100%);
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.brand-link { display: flex; align-items: center; text-decoration: none; }
.brand-logo {
    height: 48px; width: auto;
    background: white;
    border-radius: 10px;
    padding: 3px 5px;
}
.brand-info { padding: 0 8px; }
.brand-name { font-size: 1.05rem; font-weight: 800; line-height: 1.1; color: white; }
.brand-tagline {
    font-size: 0.62rem;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 2px;
}
.cart-btn {
    position: relative;
    color: white;
    font-size: 1.5rem;
    padding: 8px 12px;
    border-radius: 50%;
    transition: background 0.15s;
}
.cart-btn:active { background: rgba(255,255,255,0.15); }
.cart-badge {
    position: absolute;
    top: -2px; left: -4px;
    background: var(--k-burgundy);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 20px; height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center; justify-content: center;
    padding: 0 6px;
    border: 2px solid white;
}

/* ═════════ Main ═════════ */
.menu-main { padding: 12px 0; min-height: calc(100vh - 150px); }

/* ═════════ Hero (الرسالة الترحيبية) ═════════ */
.hero-card {
    background: linear-gradient(135deg, var(--k-beige) 0%, var(--k-beige-soft) 100%);
    border-radius: 16px;
    padding: 18px 20px;
    margin: 10px 12px 16px;
    box-shadow: var(--k-shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--k-border);
}
.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/images/kava-logo.png') no-repeat center right -40px;
    background-size: 140px;
    opacity: 0.08;
    pointer-events: none;
}
.hero-title {
    font-size: 1.1rem; font-weight: 800;
    color: var(--k-burgundy);
    margin: 0 0 4px 0;
}
.hero-subtitle {
    font-size: 0.82rem;
    color: var(--k-text-muted);
    margin: 0;
}
.hero-info {
    display: flex; gap: 10px; margin-top: 10px;
    flex-wrap: wrap;
}
.hero-info-pill {
    background: white;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--k-teal-dark);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--k-teal-light);
}
.hero-info-pill i { color: var(--k-teal); }

/* ═════════ Phase 8.20.x — AI suggestions inside product modal ═════════
   "اللي طلبوا ده طلبوا كمان..." chips. MarketBasketService returns the
   top-N affinity matches; this section renders them as horizontal-scroll
   chips that the customer can quick-add without closing the current modal. */
.pm-suggestions {
    margin: 8px 0 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(0,146,156,0.06), rgba(212,166,72,0.06));
    border: 1px solid rgba(0,146,156,0.18);
    border-radius: 12px;
}
.pm-suggestions-header {
    display: flex; align-items: center; gap: 6px;
    font-weight: 800; font-size: 0.88rem;
    color: var(--k-burgundy);
    margin-bottom: 8px;
}
.pm-suggestions-header i { color: var(--k-gold, #D4A648); font-size: 1.05rem; }
.pm-suggestions-chips {
    display: flex; gap: 8px; overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.pm-suggestions-chips::-webkit-scrollbar { display: none; }
.pm-suggest-chip {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 8px;
    background: white;
    border: 1px solid var(--k-border);
    border-radius: 999px;
    padding: 4px 12px 4px 4px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--k-text);
    transition: transform .12s, border-color .12s, box-shadow .12s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    max-width: 220px;
}
.pm-suggest-chip:hover { border-color: var(--k-teal); transform: translateY(-1px); }
.pm-suggest-chip:active { transform: scale(0.97); }
.pm-suggest-chip img, .pm-suggest-chip > i {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--k-beige);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; color: var(--k-teal);
    flex-shrink: 0;
}
.pm-suggest-chip-info { display: flex; flex-direction: column; min-width: 0; }
.pm-suggest-chip-name {
    font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 130px;
}
.pm-suggest-chip-price {
    font-size: 0.72rem;
    color: var(--k-text-muted);
    margin-top: 1px;
}
.pm-suggest-chip-plus {
    background: var(--k-teal);
    color: white;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}

/* ═════════ Phase 8.20.x — Category section grouping ═════════
   Products grouped under their category name. The chip strip above
   (.categories-scroll) can `<a href="#cat-{id}">` smooth-scroll to
   each section. Each section keeps a normal .products-grid inside so
   the existing card / sale-price styles still apply unchanged. */
.category-section {
    margin: 12px 0 18px;
    /* scroll-margin-top: leave a buffer when smooth-scrolling so the
       heading lands BELOW the sticky chip strip and fixed header. */
    scroll-margin-top: 140px;
}
.category-section-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--k-burgundy);
    padding: 6px 14px 4px;
    margin: 0 0 6px 0;
}
.category-section-title::before {
    content: '';
    display: inline-block;
    width: 4px; height: 16px;
    background: var(--k-teal);
    border-radius: 2px;
    margin-inline-end: 4px;
}
.category-section-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--k-text-muted);
    background: var(--k-beige);
    padding: 1px 8px;
    border-radius: 999px;
}

/* ═════════ Phase 8.20.x — Loyalty hint ═════════
   "حابب تطلبه تاني؟" — surfaces a returning customer's most-ordered
   products as quick re-order chips. Lives between the hero and the
   search bar so it's the first thing they see. */
.loyalty-hint {
    margin: 8px 12px 4px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(0,146,156,0.08), rgba(212,166,72,0.08));
    border: 1px solid rgba(0,146,156,0.2);
    border-radius: 14px;
}
.loyalty-hint-header {
    display: flex; align-items: center; gap: 6px;
    font-weight: 800; font-size: 0.92rem;
    color: var(--k-burgundy);
    margin-bottom: 8px;
}
.loyalty-hint-header i { color: var(--k-gold, #D4A648); font-size: 1.1rem; }
.loyalty-hint-chips {
    display: flex; gap: 8px; overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.loyalty-hint-chips::-webkit-scrollbar { display: none; }
.loyalty-chip {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 6px;
    background: white;
    border: 1px solid var(--k-border);
    border-radius: 999px;
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--k-text);
    transition: transform .12s, box-shadow .12s, border-color .12s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.loyalty-chip:hover { border-color: var(--k-teal); transform: translateY(-1px); }
.loyalty-chip:active { transform: scale(0.97); }
.loyalty-chip img, .loyalty-chip > i {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--k-beige);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--k-teal);
}
.loyalty-chip-name {
    max-width: 140px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.loyalty-chip-add {
    background: var(--k-teal);
    color: white;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.95rem;
    line-height: 1;
}

/* ═════════ Phase 8.20.x — Instant product search ═════════
   Lives above the category chips. Always visible on /Menu and never
   covers any existing UI: the wrap simply pushes the categories scroll
   down by ~60px on mobile / ~70px on desktop. */
.menu-search-wrap {
    padding: 6px 14px 4px;
}
.menu-search-inner {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e7e3df;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.menu-search-inner:focus-within {
    border-color: var(--k-teal);
    box-shadow: 0 0 0 3px rgba(0,146,156,0.15);
}
.menu-search-icon {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--k-text-muted);
    font-size: 1.05rem;
    pointer-events: none;
}
.menu-search-input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 12px 14px 12px 44px;
    font-size: 0.95rem;
    font-family: inherit;
    color: inherit;
    outline: none;
    /* RTL: icon ends up on the right, so flip the padding the other way */
    padding-inline-start: 44px;
    padding-inline-end: 44px;
}
/* Strip the native clear "x" that appears on type=search in Chrome — we
   render our own .menu-search-clear that toggles via JS. */
.menu-search-input::-webkit-search-cancel-button,
.menu-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.menu-search-clear {
    position: absolute;
    inset-inline-end: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: var(--k-text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
}
.menu-search-clear:hover { color: var(--k-burgundy); }
.menu-search-hint {
    margin-top: 6px;
    padding: 0 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--k-text-muted);
}
.menu-search-hint a {
    color: var(--k-teal);
    font-weight: 700;
    text-decoration: none;
}
.menu-search-hint a:hover { text-decoration: underline; }

/* ═════════ Categories (فلترة أفقية) ═════════
   Phase 8.20.x — sticky: the chips now stick under the fixed header as
   the customer scrolls, so they can re-tap a category without scrolling
   back to the top. `top` matches the body.padding-top values from
   landing.css so the chip strip lands flush against the header bottom. */
.categories-scroll {
    position: sticky;
    top: 72px;                 /* desktop: matches body padding-top in landing.css */
    z-index: 50;               /* under .kava-header (z-index 1000) but over everything else */
    background: var(--k-cream);
    padding: 8px 12px;
    overflow-x: auto;
    display: flex;
    gap: 8px;
    white-space: nowrap;
    scrollbar-width: none;
    /* Soft fade at the bottom of the sticky strip so cards scrolling
       under it don't slam against the chips visually. */
    box-shadow: 0 6px 8px -8px rgba(0,0,0,0.15);
}
@media (max-width: 600px) { .categories-scroll { top: 68px; } }
@media (max-width: 360px) { .categories-scroll { top: 60px; } }
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
    flex-shrink: 0;
    background: white;
    border: 1.5px solid var(--k-border);
    color: var(--k-text);
    padding: 8px 16px;
    border-radius: 22px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.15s;
    cursor: pointer;
}
.cat-chip.active {
    background: var(--k-teal);
    border-color: var(--k-teal);
    color: white;
    box-shadow: 0 3px 10px rgba(0,146,156,0.3);
}
.cat-chip:active { transform: scale(0.96); }
.cat-chip .count {
    font-size: 0.68rem;
    opacity: 0.7;
    margin-right: 4px;
}

/* ═════════ Product Cards (شبكة المنتجات) ═════════ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 4px 12px;
}
@media (min-width: 520px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px){ .products-grid { grid-template-columns: repeat(5, 1fr); } }

.product-card {
    background: var(--k-card);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--k-shadow);
    display: flex; flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    border: 1px solid var(--k-border);
}
.product-card:active { transform: scale(0.97); }
.product-image {
    aspect-ratio: 1 / 1;
    background: var(--k-beige);
    position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.product-image-placeholder {
    font-size: 2.5rem;
    color: var(--k-teal-light);
    opacity: 0.6;
}
.product-body {
    padding: 10px 12px 12px;
    display: flex; flex-direction: column;
    flex: 1;
}
.product-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--k-text);
    margin: 0 0 2px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
}
.product-desc {
    font-size: 0.72rem;
    color: var(--k-text-muted);
    margin: 0 0 6px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: auto;
    gap: 6px;
}
.product-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--k-burgundy);
}
.product-price .currency {
    font-size: 0.7rem; opacity: 0.75; font-weight: 600;
}
.add-btn {
    background: var(--k-teal);
    border: none;
    color: white;
    /* Phase 8.20.x — bumped 34→44 to meet WCAG 2.5.5 touch target minimum
       (44×44 CSS px). Was failing on small phones where users mis-tapped. */
    width: 44px; height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,146,156,0.3);
    transition: all 0.15s;
    cursor: pointer;
    font-size: 1.35rem;
}
.add-btn:active {
    transform: scale(0.9);
    background: var(--k-teal-dark);
}

/* Phase 7.18.15 — منتجات مش متاحة للديلفري (متاحة في الكافيه فقط) */
.product-card.not-deliverable {
    opacity: 0.65;
    cursor: not-allowed;
    filter: grayscale(0.4);
    position: relative;
}
.product-card.not-deliverable .product-image {
    position: relative;
}
.not-deliverable-badge {
    position: absolute;
    bottom: 6px;
    inset-inline-start: 6px;
    background: rgba(147, 82, 76, 0.92);  /* burgundy */
    color: white;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 2;
}
.not-deliverable-badge i { font-size: 0.75rem; }
/* ═════════════════════════════════════════════════════════
   Phase 8.20.x — Talabat-style card overlays
   The owner sent a Talabat screenshot: he wants a floating + button
   pinned to the bottom-corner of the product image instead of the
   inline + button next to the price in the footer. Sale items show a
   strikethrough on the original price + a yellow underline under the
   discounted price. A `-XX%` promo badge sits in the opposite corner.
   ═══════════════════════════════════════════════════════════ */
.add-btn-floating {
    position: absolute;
    /* Bottom-end corner of the image. inset-inline-end flips correctly
       in RTL (Arabic) — chip lands on the visually-right in EN, the
       visually-left in AR, matching how Talabat itself does it. */
    bottom: 8px;
    inset-inline-end: 8px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid white;
    background: white;
    color: var(--k-teal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: transform .12s, background .12s, color .12s;
}
.add-btn-floating:hover  { background: var(--k-teal); color: white; }
.add-btn-floating:active { transform: scale(0.9); }

/* Hide the legacy inline add button now that the floating one is the
   primary affordance. Keep the markup for assistive tech fallback. */
.add-btn-inline {
    display: none !important;
}

/* Promo badge sits in the opposite corner of the floating + */
.promo-badge {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    z-index: 3;
    background: var(--k-burgundy);
    color: white;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    letter-spacing: 0.2px;
}

/* Sale price layout: discounted price (with yellow underline) above the
   crossed-out original. Stacks vertically in the footer. */
.product-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1.15;
}
.product-price.on-sale {
    /* Yellow accent under the active sale price — matches Talabat's
       visual "this is the deal" cue. Underline thickness scaled to font. */
    background-image: linear-gradient(transparent 70%, var(--k-gold, #D4A648) 70%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding: 0 2px;
}
.product-price-original {
    font-size: 0.78rem;
    color: var(--k-text-muted);
    text-decoration: line-through;
    margin-top: 2px;
    font-weight: 600;
}
.product-price-original .currency {
    font-size: 0.65rem;
    opacity: 0.75;
}

/* RTL: the strikethrough rendering looks fine in both directions —
   text-decoration travels with the text. No flip needed. */

.add-btn.add-btn-disabled {
    background: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
    font-size: 1rem;
}

/* ═════════ Bottom Nav ═════════ */
.menu-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 90;
}
.bnav-item {
    color: var(--k-text-muted);
    display: flex; flex-direction: column;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    position: relative;
    transition: color 0.15s;
}
.bnav-item i { font-size: 1.3rem; margin-bottom: 2px; }
.bnav-item.active { color: var(--k-teal); }
.bnav-badge {
    position: absolute;
    top: 2px; left: 12px;
    background: var(--k-burgundy);
    color: white;
    font-size: 0.6rem;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center; justify-content: center;
    padding: 0 4px;
    font-weight: 800;
}

/* ═════════ Toast ═════════ */
.toast-container {
    position: fixed;
    top: 80px; right: 0; left: 0;
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    z-index: 1000;
    pointer-events: none;
}
.toast-msg {
    background: var(--k-burgundy);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: var(--k-shadow-strong);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s forwards;
}
.toast-msg.success { background: var(--k-success); }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateY(-20px); }
}

/* ═════════ Cart ═════════ */
.cart-items { padding: 4px 12px; }
.cart-item {
    background: var(--k-card);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    box-shadow: var(--k-shadow);
    border: 1px solid var(--k-border);
}
.cart-item-img {
    width: 72px; height: 72px;
    border-radius: 10px;
    background: var(--k-beige);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--k-teal-light);
    font-size: 1.8rem;
    overflow: hidden;
}
.cart-item-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.cart-item-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: 0.92rem; color: var(--k-text); margin: 0 0 4px 0; }
.cart-item-note {
    font-size: 0.72rem;
    color: var(--k-text-muted);
    background: var(--k-beige-soft);
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    align-self: flex-start;
}
.cart-item-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: auto;
}
.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--k-beige);
    border-radius: 18px;
    padding: 2px 4px;
}
.qty-btn {
    background: white;
    border: 1px solid var(--k-border);
    color: var(--k-teal);
    width: 28px; height: 28px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s;
}
.qty-btn:active { background: var(--k-teal); color: white; }
.qty-val { font-weight: 800; min-width: 22px; text-align: center; }
.cart-item-price {
    font-weight: 800; color: var(--k-burgundy);
    font-size: 1rem;
}

/* ═════════ Cart Summary ═════════ */
.cart-summary {
    background: var(--k-card);
    margin: 16px 12px;
    padding: 16px 18px;
    border-radius: 14px;
    box-shadow: var(--k-shadow);
    border: 1px solid var(--k-border);
}
.summary-row {
    display: flex; justify-content: space-between;
    padding: 5px 0;
    font-size: 0.9rem;
    color: var(--k-text-muted);
}
.summary-row.total {
    border-top: 2px dashed var(--k-border);
    margin-top: 8px; padding-top: 12px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--k-burgundy);
}
.summary-row .val { font-weight: 700; color: var(--k-text); }

.coupon-row {
    display: flex; gap: 8px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--k-border);
}
.coupon-row input {
    flex: 1;
    border: 1.5px solid var(--k-border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-family: inherit;
}
.coupon-row input:focus { border-color: var(--k-teal); outline: none; }
.coupon-row button {
    background: var(--k-teal);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ═════════ CTAs ═════════ */
.cta-btn {
    display: block;
    width: calc(100% - 24px);
    margin: 10px 12px;
    background: linear-gradient(135deg, var(--k-teal), var(--k-teal-dark));
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(0,146,156,0.3);
    transition: all 0.15s;
    text-align: center;
    cursor: pointer;
}
.cta-btn:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(0,146,156,0.4); }
.cta-btn:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }

.cta-btn.secondary {
    background: white;
    color: var(--k-teal-dark);
    border: 2px solid var(--k-teal);
    box-shadow: none;
}

/* ═════════ Empty State ═════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--k-text-muted);
}
.empty-state i {
    font-size: 4rem;
    color: var(--k-teal-light);
    opacity: 0.5;
    margin-bottom: 16px;
}
.empty-state h3 { font-weight: 800; color: var(--k-burgundy); margin-bottom: 4px; }

/* ═════════ Checkout Form ═════════ */
.form-section {
    background: var(--k-card);
    border-radius: 14px;
    padding: 16px 18px;
    margin: 10px 12px;
    box-shadow: var(--k-shadow);
    border: 1px solid var(--k-border);
}
.form-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--k-burgundy);
    margin: 0 0 12px 0;
    display: flex; align-items: center; gap: 8px;
}
.form-section-title i { color: var(--k-teal); }
.form-field {
    display: flex; flex-direction: column;
    margin-bottom: 12px;
}
.form-field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--k-text);
    margin-bottom: 4px;
}
.form-field input, .form-field select, .form-field textarea {
    border: 1.5px solid var(--k-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: inherit;
    /* Phase 8.20.x — 16px exact: prevents iOS Safari from auto-zooming
       when the user taps a form field (iOS zooms whenever font-size < 16px).
       The zoom was disorienting and left half the keyboard offscreen. */
    font-size: 16px;
    background: white;
    transition: border-color 0.15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    border-color: var(--k-teal); outline: none;
    box-shadow: 0 0 0 3px rgba(0,146,156,0.1);
}
/* Phase 8.20.x — Zone search input sits immediately above the zones <select>.
   Slightly smaller padding + magnifier icon set as background so it doesn't
   visually compete with the select underneath. */
.form-field .zone-search-input {
    margin-bottom: 6px;
    padding-inline-start: 38px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16' fill='%23999'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/></svg>");
    background-repeat: no-repeat;
    background-position: 12px center;
}
html[dir="rtl"] .form-field .zone-search-input {
    padding-inline-start: 38px;
    background-position: calc(100% - 12px) center;
}

.payment-options {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.payment-option {
    border: 2px solid var(--k-border);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    background: white;
    font-weight: 700;
    color: var(--k-text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.payment-option i { font-size: 1.8rem; display: block; margin-bottom: 4px; color: var(--k-teal-light); }
.payment-option.active {
    border-color: var(--k-teal);
    background: linear-gradient(135deg, rgba(0,146,156,0.05), rgba(0,146,156,0.1));
    color: var(--k-teal-dark);
}
.payment-option.active i { color: var(--k-teal); }
.payment-option:active { transform: scale(0.97); }

/* ═════════ Order Confirmation ═════════ */
.success-icon {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--k-success), #13aa52);
    display: flex; align-items: center; justify-content: center;
    margin: 20px auto;
    font-size: 3rem;
    color: white;
    box-shadow: 0 8px 24px rgba(25,135,84,0.3);
    animation: bounce 0.6s ease;
}
@keyframes bounce {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}
.order-token {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--k-burgundy);
    background: var(--k-beige-soft);
    padding: 8px 16px;
    border-radius: 10px;
    display: inline-block;
    letter-spacing: 2px;
    border: 2px dashed var(--k-burgundy);
}

/* ═════════ Modifier / Note Modal ═════════ */
.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.modal-backdrop-custom.show { display: flex; animation: fadeIn 0.2s; }
.modal-sheet {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ═════════ Utility ═════════ */
.text-burgundy { color: var(--k-burgundy); }
.text-teal { color: var(--k-teal); }
.bg-beige { background: var(--k-beige-soft); }

/* ═════════════════════════════════════════════════
   📱 Tablet (768px - 991px)
   تصميم محصور في عمود واحد عريض
   ═════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 991px) {
    body { max-width: 700px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.08); background: white; }
    .menu-bottom-nav { max-width: 700px; left: 50%; transform: translateX(-50%); }
}

/* ═════════════════════════════════════════════════
   🖥️ Desktop (≥992px) — Layout بـ 3 أعمدة
   - يسار: Categories Sidebar (sticky)
   - وسط: Hero + Products Grid
   - يمين: Cart Sidebar (sticky)
   ═════════════════════════════════════════════════ */
@media (min-width: 992px) {

    /* الـ body بيوسع للشاشة كاملة */
    body {
        background: var(--k-cream);
        padding-bottom: 0;
    }

    /* الـ Header يبقى بـ container أوسع */
    .menu-header > .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }
    .menu-header { padding: 14px 0; }
    .brand-info { padding: 0 16px; }
    .brand-name { font-size: 1.3rem; }
    .brand-tagline { font-size: 0.7rem; }

    /* إخفاء الـ Bottom Nav (مش لازم في الديسكتوب) */
    .menu-bottom-nav { display: none !important; }

    /* الـ Main يصبح Grid بـ 3 أعمدة */
    .menu-main {
        max-width: 1400px;
        margin: 0 auto;
        padding: 24px 20px;
        display: grid;
        grid-template-columns: 240px 1fr 320px;
        gap: 20px;
        align-items: start;
    }

    /* ═════════ Categories Sidebar (يسار) ═════════ */
    .desktop-categories {
        position: sticky;
        top: 90px;
        background: white;
        border-radius: 14px;
        padding: 16px;
        box-shadow: var(--k-shadow);
        max-height: calc(100vh - 110px);
        overflow-y: auto;
    }
    .desktop-categories h3 {
        font-size: 0.85rem;
        color: var(--k-text-muted);
        font-weight: 700;
        margin: 0 0 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--k-border);
    }
    .desktop-cat-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        margin-bottom: 4px;
        border-radius: 10px;
        color: var(--k-text);
        font-weight: 600;
        font-size: 0.9rem;
        transition: all 0.15s;
        cursor: pointer;
    }
    .desktop-cat-link:hover {
        background: var(--k-beige-soft);
        color: var(--k-teal-dark);
    }
    .desktop-cat-link.active {
        background: var(--k-teal);
        color: white;
        box-shadow: 0 2px 8px rgba(0,146,156,0.25);
    }
    .desktop-cat-link .count {
        background: rgba(255,255,255,0.2);
        color: inherit;
        opacity: 0.9;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 0.75rem;
        font-weight: 700;
    }
    .desktop-cat-link.active .count { background: rgba(255,255,255,0.25); }

    /* إخفاء الـ horizontal categories (للموبايل) — لأنها بقت موجودة في الـ sidebar */
    .categories-scroll { display: none !important; }

    /* ═════════ Main Content (وسط) ═════════ */
    .desktop-main-col { min-width: 0; }   /* يمنع overflow */

    /* الـ Hero بياخد الـ width الكامل */
    .hero-card {
        margin: 0 0 20px;
        padding: 24px 28px;
    }
    .hero-title { font-size: 1.5rem; }
    .hero-subtitle { font-size: 1rem; }

    /* Products Grid: 3-4 أعمدة */
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        padding: 0;
        gap: 16px;
    }
    .product-card { transition: transform 0.18s, box-shadow 0.18s; }
    .product-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--k-shadow-strong);
        border-color: var(--k-teal-light);
    }

    /* ═════════ Cart Sidebar (يمين) ═════════ */
    .desktop-cart-sidebar {
        position: sticky;
        top: 90px;
        background: white;
        border-radius: 14px;
        padding: 18px;
        box-shadow: var(--k-shadow);
        max-height: calc(100vh - 110px);
        overflow-y: auto;
    }
    .desktop-cart-sidebar h3 {
        font-size: 1rem;
        font-weight: 800;
        color: var(--k-burgundy);
        margin: 0 0 12px;
        padding-bottom: 10px;
        border-bottom: 2px solid var(--k-beige);
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .desktop-cart-empty {
        text-align: center;
        padding: 30px 10px;
        color: var(--k-text-muted);
    }
    .desktop-cart-empty i {
        font-size: 2.5rem;
        opacity: 0.4;
        display: block;
        margin-bottom: 8px;
    }
    .desktop-cart-empty .small {
        font-size: 0.82rem;
    }

    .dc-item {
        display: flex;
        gap: 10px;
        padding: 10px 0;
        border-bottom: 1px solid var(--k-border);
    }
    .dc-item:last-child { border-bottom: none; }
    .dc-item-img {
        width: 48px; height: 48px;
        border-radius: 8px;
        background: var(--k-beige);
        flex-shrink: 0;
        display: flex; align-items: center; justify-content: center;
        overflow: hidden;
    }
    .dc-item-img img { width: 100%; height: 100%; object-fit: cover; }
    .dc-item-img i { color: var(--k-text-muted); font-size: 1.2rem; }
    .dc-item-body { flex: 1; min-width: 0; }
    .dc-item-name {
        font-weight: 700;
        font-size: 0.88rem;
        color: var(--k-text);
        margin-bottom: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dc-item-mods {
        font-size: 0.72rem;
        color: var(--k-teal-dark);
        margin-bottom: 2px;
    }
    .dc-item-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .dc-qty-controls {
        display: flex; align-items: center; gap: 4px;
    }
    .dc-qty-btn {
        width: 24px; height: 24px;
        border: 1px solid var(--k-border);
        background: white;
        border-radius: 6px;
        color: var(--k-teal-dark);
        font-weight: 700;
        font-size: 0.85rem;
        cursor: pointer;
    }
    .dc-qty-btn:hover { background: var(--k-beige-soft); }
    .dc-qty-val {
        min-width: 22px; text-align: center;
        font-weight: 700; font-size: 0.85rem;
    }
    .dc-item-price {
        font-weight: 700;
        color: var(--k-burgundy);
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .dc-totals {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 2px dashed var(--k-border);
    }
    .dc-total-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 4px;
        font-size: 0.85rem;
        color: var(--k-text-muted);
    }
    .dc-total-row.final {
        margin-top: 8px;
        font-size: 1rem;
        font-weight: 800;
        color: var(--k-burgundy);
    }
    .dc-checkout-btn {
        display: block;
        width: 100%;
        margin-top: 14px;
        padding: 12px;
        background: linear-gradient(135deg, var(--k-teal), var(--k-teal-dark));
        color: white;
        border: none;
        border-radius: 10px;
        font-weight: 800;
        font-size: 0.95rem;
        text-align: center;
        text-decoration: none;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0,146,156,0.3);
        transition: transform 0.15s, box-shadow 0.15s;
    }
    .dc-checkout-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(0,146,156,0.4);
        color: white;
    }
    .dc-checkout-btn i { margin-left: 6px; }

    /* PWA install banner لا يلزم على ديسكتوب */
    .install-banner { display: none !important; }

    /* الـ Cart page نفسها لو فتحها مباشرة على ديسكتوب */
    .menu-main:has(> .single-page) {
        display: block;
        max-width: 800px;
    }
}

/* ═════════════════════════════════════════════════
   🖥️ Wide Desktop (≥1280px) — مزيد من العرض
   ═════════════════════════════════════════════════ */
@media (min-width: 1280px) {
    .products-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ═════════════════════════════════════════════════
   صفحات بدون sidebars (Cart, Track, Checkout, Profile,
   Login, Rate, ...) — عمود واحد متمركز على الديسكتوب
   ═════════════════════════════════════════════════ */
@media (min-width: 992px) {
    .menu-main.no-sidebar {
        display: block !important;
        max-width: 720px;
        margin: 0 auto;
        padding: 24px 16px;
    }
    /* في الصفحات دي، نخفي sidebars المنيو حتى لو موجودة */
    .menu-main.no-sidebar .desktop-categories,
    .menu-main.no-sidebar .desktop-cart-sidebar { display: none !important; }
}

/* تأكيد: الـ form-section في صفحات الأوردر (Cart, Track, etc.) متمركزة */
@media (min-width: 992px) {
    .menu-main.no-sidebar .form-section,
    .menu-main.no-sidebar .hero-card,
    .menu-main.no-sidebar .empty-state,
    .menu-main.no-sidebar .cart-list,
    .menu-main.no-sidebar > div {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* الـ desktop sidebars: hide على الموبايل/التابلت */
.desktop-categories,
.desktop-cart-sidebar { display: none; }

@media (min-width: 992px) {
    .desktop-categories,
    .desktop-cart-sidebar { display: block; }
}
