/* ═══════════════════════════════════════════════════════════════════════
   food-card.css — بطاقةُ الطعام، لكلّ مضيفيها (js/shared/food-card.js)
   ═══════════════════════════════════════════════════════════════════════

   📄 `docs/menu-ux/SPEC-chat-food-card.md` §2–§8، والمقاساتُ كما رُسمت في
      `mockup-chat-card.html`: صحونٌ على لوحة قائمة. كلُّ قاعدةٍ هنا `fc-*`،
      ولا مُحدِّدَ صفحة: تحمّلها صفحةُ النزيل ولوحةُ الفندق ولوحةُ المنصّة
      فتُرسم البطاقةُ نفسُها في الثلاث — المعاينةُ لا «شكلَ معاينةٍ» لها.

   🎨 ألوانٌ مصمتة فقط (SPEC §8): لا تدرّجات، ولا `backdrop-filter`، ولا Inter.
      والخطّ Tajawal — ما يشحنه تطبيقُ النزيل.
   ═══════════════════════════════════════════════════════════════════════ */

.fc {
    --fc-ground: #080f14;
    --fc-card: #0c171d;
    --fc-paper: #0f1d24;
    --fc-line: #1c2a31;
    --fc-line-2: #2a3a42;
    --fc-em: #5ec9a0;
    --fc-em-ink: #06231a;
    --fc-em-deep: #0f2a22;
    --fc-em-edge: #2c6b56;
    --fc-em-text: #8fe3c1;
    --fc-amber: #f59e0b;
    --fc-amber-deep: #2a1f08;
    --fc-amber-edge: #5a3f0c;
    --fc-amber-text: #fcd28a;
    --fc-t1: #ffffff;
    --fc-t2: #b9c3c7;
    --fc-t3: #7f8c92;
    --fc-r-card: 16px;
    --fc-r-ctl: 12px;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    background: var(--fc-card);
    border: 1px solid var(--fc-line-2);
    border-radius: var(--fc-r-card);
    color: var(--fc-t1);
    font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-align: start;
}
.fc *, .fc *::before, .fc *::after { box-sizing: border-box; }
/* `:where` يصفّر خصوصيّة القاعدة: `.fc button` كانت تغلب `.fc-ghost { font-size }`
   وأخواتها فيُرسم كلُّ زرٍّ بحجم خطّ مضيفه لا بحجمه المرسوم. */
:where(.fc) button { font: inherit; color: inherit; cursor: pointer; }
.fc button[aria-disabled="true"] { cursor: default; }
.fc button:disabled { cursor: not-allowed; opacity: .5; }
.fc button:focus-visible, button.fc:focus-visible { outline: 2px solid var(--fc-em); outline-offset: 2px; }

.fc-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fc-ic-sm { width: 16px; height: 16px; }
/* السهمُ يُقلب في LTR وحدها — باتّجاه العنصر المحسوب (`:dir`)، لا بأيّ سلفٍ يحمل
   `dir="ltr"`: صفحةُ النزيل فيها أسلافٌ LTR داخل واجهةٍ عربيّة. */
.fc-ic-fwd:dir(ltr) { transform: scaleX(-1); }

/* ═══ الصحن — الفكرةُ الواحدة ═══════════════════════════════════════════
   صورةُ الطبق في دائرة، أو حرفُه الأوّل على درجةٍ ثابتة. الحلقةُ (٢px بلون
   البطاقة) حافّةُ الصحن، وهي ما يفصل الصحونَ المتراكبة. */
.fc-plate {
    --size: 36px;
    position: relative; flex: none;
    width: var(--size); height: var(--size);
    display: grid; place-items: center;
    border-radius: 50%;
    background: #1a2429;
    box-shadow: 0 0 0 2px var(--fc-card), 0 0 0 3px var(--fc-line-2);
}
.fc-plate > img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.fc-plate.is-mono { background: var(--fc-plate-bg); color: var(--fc-plate-fg); }
.fc-plate.is-mono > .fc-mono { font-size: calc(var(--size) * 0.46); font-weight: 800; line-height: 1; transform: translateY(1px); }
.fc-plate.is-sm { --size: 28px; }
.fc-plate.is-xs { --size: 22px; }
.fc-plate.is-rim { background: transparent; box-shadow: inset 0 0 0 2px var(--fc-line-2); }
.fc-plate.is-warn { color: var(--fc-amber); font-weight: 800; box-shadow: inset 0 0 0 2px var(--fc-amber-edge); }
.fc-plate-qty {
    position: absolute; inset-block-start: -5px; inset-inline-start: -5px;
    min-width: 19px; height: 19px; padding: 0 5px;
    display: grid; place-items: center;
    border-radius: 10px; border: 2px solid var(--fc-card);
    background: var(--fc-em); color: var(--fc-em-ink);
    font-size: 11px; font-weight: 800; line-height: 1; font-style: normal;
}
.fc-stack { flex: none; display: flex; align-items: center; padding-inline-start: 3px; }
.fc-stack .fc-plate + .fc-plate { margin-inline-start: -10px; }
.fc.is-loading .fc-plate.is-rim { animation: fc-breathe 1.4s infinite ease-in-out; }
.fc.is-loading .fc-plate.is-rim:nth-child(2) { animation-delay: .18s; }
.fc.is-loading .fc-plate.is-rim:nth-child(3) { animation-delay: .36s; }
@keyframes fc-breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fc.is-loading .fc-plate.is-rim { animation: none; opacity: .7; } }
/* المغلق: الصحونُ رماديّة — «ليس الآن» تُرى قبل أن تُقرأ. */
.fc.is-closed .fc-plate > img, .fc.is-closed .fc-plate.is-mono { filter: grayscale(1); opacity: .55; }

/* ═══ البطاقة ═════════════════════════════════════════════════════════ */
.fc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fc-name { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 15px; line-height: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-meta { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--fc-t2); white-space: nowrap; overflow: hidden; }
.fc-state { display: inline-flex; align-items: center; gap: 5px; color: var(--fc-em-text); font-weight: 700; }
.fc-dot { width: 7px; height: 7px; border-radius: 4px; background: var(--fc-em); flex: none; }
.fc-state.is-closed { color: var(--fc-amber-text); }
.fc-state.is-closed .fc-dot { background: var(--fc-amber); }
.fc-sep { color: var(--fc-t3); }
.fc-em { color: var(--fc-em-text); font-weight: 700; }

/* مطويّة — زرٌّ واحد بـ64: صحونٌ · اسم · حبّة */
.fc-collapsed { display: flex; align-items: center; gap: 8px; height: 64px; padding: 9px 12px; }
button.fc-collapsed:hover { border-color: var(--fc-em-edge); }
.fc-collapsed.is-static { cursor: default; }
.fc-pill { flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--fc-em); color: var(--fc-em-ink); font-size: 13px; font-weight: 800; }
.fc-pill.is-outline { background: transparent; border: 1px solid var(--fc-line-2); color: var(--fc-t2); }

/* مفتوحة — لوحةُ قائمة */
.fc-expanded { padding: 6px 12px 8px; }
.fc-head { display: flex; align-items: center; gap: 8px; }
.fc-toggle { flex: 1; min-width: 0; min-height: 48px; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 0; border: 0; background: transparent; text-align: start; }
.fc-caret { color: var(--fc-t3); transform: rotate(180deg); }
.fc-all { flex: none; min-height: 44px; display: inline-flex; align-items: center; gap: 2px; padding: 0 10px 0 8px; border: 1px solid var(--fc-em-edge); border-radius: 999px; background: var(--fc-em-deep); color: var(--fc-em-text); font-size: 13px; font-weight: 800; }
.fc-list { list-style: none; margin: 2px 0 0; padding: 4px 0 0; border-top: 1px dashed var(--fc-line-2); }
.fc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 0; }
.fc-open { flex: 1; min-width: 0; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 4px 3px 4px 0; border: 0; background: transparent; text-align: start; }
.fc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* الاسمُ ···· السعر — السطرُ المطبوع. السعرُ لا يتنازل؛ الاسمُ يلتفّ إلى سطرٍ ثانٍ
   (لا يُقصّ — على 320 أبقى السطرُ الواحد 67px وأضاع «مشوي»)، والنقاطُ تجري من
   آخر سطره إلى السعر. */
.fc-line { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.fc-dish { flex: 0 1 auto; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 700; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fc-lead { flex: 1 1 10px; min-width: 10px; height: 0; margin-bottom: 6px; border-bottom: 2px dotted var(--fc-line-2); }
.fc-price { flex: none; color: var(--fc-em); font-size: 14px; font-weight: 800; white-space: nowrap; }
.fc-under { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 12px; line-height: 17px; font-weight: 600; }
.fc-flag { color: var(--fc-amber-text); white-space: nowrap; }
.fc-diet { color: var(--fc-t3); white-space: nowrap; }
.fc-add { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--fc-em-edge); border-radius: 50%; background: var(--fc-em-deep); color: var(--fc-em); }
.fc-add:hover { border-color: var(--fc-em); }
.fc-status { flex: 1 0 100%; margin: 0 0 6px; padding-inline-start: 46px; font-size: 12px; line-height: 17px; font-weight: 700; color: var(--fc-amber-text); }
.fc-status[hidden] { display: none; }
/* طبقٌ خرج من القائمة: اسمُه باقٍ، حافّةُ صحنٍ متقطّعة، بلا سعرٍ ولا «+». */
.fc-row.is-gone .fc-plate { background: transparent; box-shadow: none; outline: 2px dashed var(--fc-line-2); outline-offset: -2px; }
.fc-row.is-gone .fc-plate > .fc-mono { opacity: .4; }
.fc-row.is-gone .fc-dish { color: var(--fc-t2); }

/* في السلّة — صينيّةٌ في أسفل اللوحة */
.fc-tray { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px -12px -8px; padding: 8px 12px; border-top: 1px solid var(--fc-em-edge); border-radius: 0 0 15px 15px; background: var(--fc-em-deep); }
.fc-tray-sum { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; line-height: 16px; color: var(--fc-t2); white-space: nowrap; }
.fc-tray-text { display: flex; flex-direction: column; }
.fc-tray-total { font-size: 15px; line-height: 20px; color: var(--fc-em-text); font-weight: 800; }
.fc-tray-sum .fc-plate { box-shadow: 0 0 0 2px var(--fc-em-deep); }
.fc-primary { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--fc-r-ctl); background: var(--fc-em); color: var(--fc-em-ink) !important; font-size: 14px; font-weight: 800; }
.fc-primary:hover:not(:disabled) { background: #74d6b0; }
.fc-wide { width: 100%; margin-top: 8px; }
.fc-ghost { flex: none; min-height: 44px; padding: 0 12px; border: 1px solid var(--fc-line-2); border-radius: var(--fc-r-ctl); background: transparent; color: var(--fc-t1); font-size: 13px; font-weight: 700; }

/* الأقسام (categories / no_match) */
.fc-say { margin: 4px 0 0; padding-top: 8px; border-top: 1px dashed var(--fc-line-2); font-size: 13px; line-height: 1.7; color: var(--fc-t2); }
.fc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fc-chip { min-height: 44px; padding: 0 14px; border: 1px solid var(--fc-line-2); border-radius: 999px; background: transparent; color: var(--fc-t2); font-size: 13px; font-weight: 700; }
.fc-chip:hover { border-color: var(--fc-em-edge); color: var(--fc-t1); }

/* المراجعة — إيصالٌ بحافّةٍ مقطوعة */
.fc-receipt { background: transparent; border: 0; border-radius: 0; }
.fc-paper { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 6px; background: var(--fc-paper); border: 1px solid var(--fc-line-2); border-bottom: 0; border-radius: var(--fc-r-card) var(--fc-r-card) 0 0; }
.fc-tear { display: block; width: 100%; height: 8px; fill: var(--fc-paper); }
.fc-rhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.fc-rtitles { display: flex; flex-direction: column; min-width: 0; }
.fc-over { font-size: 11.5px; font-weight: 700; color: var(--fc-t3); }
.fc-room { flex: none; padding: 3px 9px; border: 1px dashed var(--fc-em-edge); border-radius: 8px; color: var(--fc-em-text); font-size: 12px; font-weight: 800; transform: rotate(-3deg); }
.fc-lines { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px dashed var(--fc-line-2); display: flex; flex-direction: column; gap: 8px; }
.fc-lines small { display: block; padding-inline-start: 22px; font-size: 12px; line-height: 17px; color: var(--fc-t3); }
.fc-lines small.fc-warn { color: var(--fc-amber-text); font-weight: 700; }
.fc-q { color: var(--fc-t3); font-weight: 800; }
.fc-lines .fc-lead { margin-bottom: 6px; }
.fc-amt { flex: none; font-size: 14px; font-weight: 800; white-space: nowrap; }
.fc-amt s { color: var(--fc-t3); font-weight: 500; }
.fc-lines li.is-changed .fc-amt { color: var(--fc-amber-text); }
.fc-lines li.is-broken .fc-dish { color: var(--fc-t2); }
.fc-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--fc-line-2); font-size: 13px; color: var(--fc-t2); }
.fc-total b { font-size: 20px; font-weight: 800; color: var(--fc-em); white-space: nowrap; }
.fc-send { width: 100%; min-height: 48px; font-size: 15px; }
.fc-link { min-height: 44px; border: 0; background: transparent; color: var(--fc-t2); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--fc-line-2); }
.fc-notice { margin: 0; padding: 8px 10px; border: 1px solid var(--fc-amber-edge); border-radius: 10px; background: var(--fc-amber-deep); color: var(--fc-amber-text); font-size: 12.5px; line-height: 1.7; }
/* 💳 جملةُ الدفع تحت المجموع — معلومةٌ تُقرأ لا تحذير: لونٌ هادئ بلا إطار. */
.fc-pay { margin: -4px 0 0; font-size: 12.5px; line-height: 1.6; font-weight: 650; color: var(--fc-t2); }
.fc-rstatus { margin: 0; font-size: 12.5px; line-height: 1.6; font-weight: 700; color: var(--fc-amber-text); }
.fc-rstatus:empty { display: none; }

/* خطأ */
.fc-error { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 9px 12px; }
.fc-error .fc-meta { white-space: normal; }

/* 🗂️ لوحةُ التبويب — نفسُ الصفوف في بطاقةٍ واحدةٍ بطول القائمة */
.fc-board { padding: 2px 12px 4px; }
.fc-board > .fc-list { margin: 0; padding: 0; border-top: 0; }
.fc-board > .fc-list > .fc-row + .fc-row { border-top: 1px solid var(--fc-line); }
.fc-board.is-closed .fc-plate > img, .fc-board.is-closed .fc-plate.is-mono { filter: grayscale(1); opacity: .55; }
