/* ============================================================
   Path: src/RichRich.Web/wwwroot/css/pos.css
   Session: J-162 (TABLE-SERVICE-1)  ⚠️ MODIFIED — previously POS-DISCOUNT-3
   LastModified: 2026-09-30
   Module: M12 POS (Frontend) — full-screen POS shell styling
   ============================================================
   📝 J-162: شريط النوع أزرارٌ فعليّة · وسما «في المطبخ» و«لم يُرسَل» ·
     تذييلٌ بثلاثة أزرار · أزرار التذييل المعطّلة.
     والنسخة الخاملة Components/Pages/Pos/pos.css حُذفت فعلاً.
   ⚠️ MODIFIED FILE — Original from POS-Redesign
   📝 Changes (POS-DISCOUNT-3):
     - أنماط زرّ الخصم المُفعَّل + سطر الخصم في الملخّص.
     - 🔴 توحيد النسختين: كانت نسخةٌ ثانية خاملة في
       Components/Pages/Pos/pos.css تلقّت تعديلات POS-Redesign-Fix
       (products-col) التي **لم تصل** للملف المُقدَّم — دُمجت هنا
       وحُذفت النسخة الخاملة (النمط الثامن: ميزةٌ يخفيها ملفٌّ خاطئ).
   ============================================================
   نظام تصميم شاشة نقطة البيع منقول من التمبليت المرجعي
   (pos_system_fixed.html): قشرة بملء الشاشة + لوحة طلب داكنة +
   لوحة منتجات بيضاء + فئات ملوّنة + ثيمات (official/luxury/fresh/fast).

   ملاحظات:
   - كل القواعد مقيّدة تحت .pos-shell حتى لا تتسرّب لبقية التطبيق
     (الملف محمّل عالمياً في App.razor).
   - بيئة الإمارات: الضريبة 5% والعملة AED تُعرَضان في الـ markup لا هنا.
   - radius=0 (حواف حادّة) كما في التمبليت.
   ============================================================ */

/* === Design tokens (scoped) === */
.pos-shell {
    --pos-primary: #1f6b3a;
    --pos-primary-dark: #154d29;
    --pos-accent: #FF8C42;
    --pos-accent-dark: #e67a35;
    --pos-secondary: #2b6cb0;
    --pos-surface-dark: #1f2933;
    --pos-surface-darker: #141a21;
    --pos-text-on-dark: #f3f4f6;
    --pos-text-muted: #9ca3af;
    --pos-success: #28a745;
    --pos-danger: #dc3545;
}

/* === Themes (apply class on .pos-shell) === */
.pos-shell.theme-official { --pos-primary: #00306e; --pos-primary-dark: #002255; --pos-accent: #3bbdb1; --pos-secondary: #0a7cd3; --pos-surface-dark: #1a2332; --pos-surface-darker: #0f1520; }
.pos-shell.theme-luxury   { --pos-primary: #2C2C2C; --pos-primary-dark: #1A1A1A; --pos-accent: #c5a55a; --pos-secondary: #A08840; --pos-surface-dark: #1a1a1a; --pos-surface-darker: #0f0f0f; }
.pos-shell.theme-fresh    { --pos-primary: #1f6b3a; --pos-primary-dark: #154d29; --pos-accent: #FF8C42; --pos-secondary: #2b6cb0; --pos-surface-dark: #1f2933; --pos-surface-darker: #141a21; }
.pos-shell.theme-fast     { --pos-primary: #D32F2F; --pos-primary-dark: #B71C1C; --pos-accent: #FF9800; --pos-secondary: #D32F2F; --pos-surface-dark: #1f1f1f; --pos-surface-darker: #121212; }

/* === Sharp corners on POS controls === */
.pos-shell .pos-btn,
.pos-shell .prod-card,
.pos-shell .pay-actions .btn-pay,
.pos-shell .footer-actions .btn,
.pos-shell .search-box,
.pos-shell .pill,
.pos-shell .qty-box,
.pos-shell .toolbar-btn,
.pos-shell .cat-tile,
.pos-shell .toolbar-spacer { border-radius: 0 !important; }

/* === Layout === */
.pos-shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--pos-surface-darker);
    color: var(--pos-text-on-dark);
    font-family: 'Tajawal', sans-serif;
}
.pos-shell .pos-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    flex-grow: 1;
    overflow: hidden;
    min-height: 0;
}

/* === Order Pane (dark) === */
.pos-shell .order-pane { background: var(--pos-surface-dark); display: flex; flex-direction: column; border-inline-end: 1px solid rgba(255,255,255,0.05); height: 100%; overflow: hidden; }
.pos-shell .order-head { background: var(--pos-primary); padding: 1rem; display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: #fff; flex-shrink: 0; }
.pos-shell .order-meta-bar { background: var(--pos-surface-darker); padding: 0.5rem 1rem; display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--pos-text-muted); flex-shrink: 0; }
.pos-shell .order-meta-bar .unpaid { color: var(--pos-accent); font-weight: 700; }

.pos-shell .type-toggle { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; flex-shrink: 0; }
.pos-shell .pill { flex: 1; padding: 0.55rem; text-align: center; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.4rem; color: #fff; border: none; }
.pos-shell .pill.takeaway { background: var(--pos-accent); }
.pos-shell .pill.dine { background: var(--pos-primary); opacity: 0.6; }
.pos-shell .pill.active { opacity: 1; border: 1px solid #fff; }
.pos-shell button.pill { font: inherit; font-weight: 800; }

.pos-shell .order-lines { flex-grow: 1; overflow-y: auto; padding: 0.5rem 1rem; min-height: 0; }
.pos-shell .order-lines-empty { text-align: center; padding: 2rem 1rem; color: var(--pos-text-muted); }
.pos-shell .order-lines-empty i { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.pos-shell .o-line { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.pos-shell .o-line .qty-box { width: 32px; height: 32px; background: var(--pos-primary); color: #fff; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.pos-shell .o-line .o-info { flex-grow: 1; min-width: 0; }
.pos-shell .o-line .name { font-weight: 700; }
.pos-shell .o-line .price { color: var(--pos-text-muted); font-size: 0.85rem; }
.pos-shell .o-line .o-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.2rem; }
.pos-shell .o-line .o-tag { font-size: 0.65rem; padding: 0.05rem 0.35rem; background: rgba(255,255,255,0.1); color: var(--pos-text-on-dark); font-weight: 700; }
.pos-shell .o-line .o-tag.kitchen { background: rgba(40,167,69,0.3); }
.pos-shell .o-line .o-tag.unsent { background: rgba(255,140,66,0.35); }
.pos-shell .o-line .o-amount { font-weight: 800; white-space: nowrap; }
.pos-shell .o-line .o-acts { display: flex; gap: 0.35rem; }
.pos-shell .o-line .o-act { background: rgba(255,255,255,0.08); border: none; color: var(--pos-text-on-dark); width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; }
.pos-shell .o-line .o-act.remove { color: var(--pos-danger); }
.pos-shell .o-line .o-act:hover { background: rgba(255,255,255,0.18); }

.pos-shell .discount-section { padding: 0.75rem 1rem; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.pos-shell .discount-btn { width: 100%; background: transparent; border: 1px dashed rgba(255,255,255,0.2); color: var(--pos-text-on-dark); padding: 0.5rem; font-weight: 600; cursor: pointer; }
/* 🆕 POS-DISCOUNT-3: الزرّ صار يعمل — تفاعل لمسيّ + حالة التعطيل (سلّة فارغة). */
.pos-shell .discount-btn:hover:not(:disabled) { border-color: var(--pos-accent); color: var(--pos-accent); }
.pos-shell .discount-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* سطر الخصم في الملخّص: أخضر النجاح — مبلغٌ لصالح العميل. */
.pos-shell .summary-row.discount { color: var(--pos-success); }
.pos-shell .summary-row.discount small { color: var(--pos-text-muted); font-weight: 400; }
.pos-shell .summary-row.discount .o-act.remove { width: 1.6rem; height: 1.6rem; font-size: 0.7rem; }
.pos-shell .summary-section { padding: 0.75rem 1rem; flex-shrink: 0; }
.pos-shell .summary-row { display: flex; justify-content: space-between; margin-bottom: 0.4rem; font-size: 0.9rem; }
.pos-shell .summary-row.total { font-size: 1.2rem; font-weight: 800; padding-top: 0.5rem; border-top: 1px dashed rgba(255,255,255,0.2); margin-top: 0.5rem; }
.pos-shell .amount { color: var(--pos-accent); font-weight: 700; }

.pos-shell .pay-actions { padding: 0.5rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; flex-shrink: 0; }
.pos-shell .btn-pay { width: 100%; padding: 0.85rem; border: none; font-weight: 700; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; color: #fff; }
.pos-shell .btn-pay.primary { background: var(--pos-primary); }
.pos-shell .btn-pay.accent { background: var(--pos-accent); }
.pos-shell .btn-pay:disabled { opacity: 0.5; cursor: not-allowed; }

.pos-shell .footer-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; padding: 0.5rem 1rem; background: var(--pos-surface-darker); flex-shrink: 0; }
.pos-shell .footer-actions .btn { background: rgba(255,255,255,0.1); border: none; color: var(--pos-text-on-dark); padding: 0.6rem 0.5rem; font-weight: 700; font-size: 0.8rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.pos-shell .footer-actions .btn:hover { background: rgba(255,255,255,0.2); }
.pos-shell .footer-actions .btn.danger { color: var(--pos-danger); }
.pos-shell .footer-actions.three { grid-template-columns: repeat(3, 1fr); }
.pos-shell .footer-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* === Products column: pane (grows) + bottom-bar (under products only) === */
.pos-shell .products-col { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.pos-shell .products-col .products-pane { flex: 1 1 auto; }

/* === Products Pane (white) === */
.pos-shell .products-pane { background: #f5f6f8; display: flex; flex-direction: column; padding: 0.75rem; gap: 0.75rem; height: 100%; overflow: hidden; min-height: 0; }

/* Toolbar */
.pos-shell .products-toolbar-wrapper { background-color: #fff; display: flex; align-items: stretch; flex-shrink: 0; direction: inherit; gap: 0; border: 1px solid #e5e7eb; }
.pos-shell .products-toolbar-wrapper > * { direction: inherit; }
.pos-shell .toolbar-buttons-row { display: flex; align-items: stretch; flex: 1; }
.pos-shell .search-box { flex-shrink: 0; width: 300px; background: #fff; display: flex; align-items: center; padding: 0 1rem; border-inline-start: 1px solid #e5e7eb; }
.pos-shell .search-box input { border: none; outline: none; background: transparent; padding: 0.75rem 0.5rem; flex-grow: 1; font-family: inherit; font-size: 0.95rem; width: 100%; color: #333; }
.pos-shell .search-box i { color: #9ca3af; }
.pos-shell .toolbar-spacer { flex: 1; background: #fff; min-width: 10px; }
.pos-shell .toolbar-btn { background: #fff; border: none; border-inline-end: 1px solid #f0f0f0; padding: 0.6rem 0.9rem; font-weight: 700; font-size: 0.85rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; color: #333; position: relative; min-width: 70px; transition: background 0.15s; height: 100%; }
.pos-shell .toolbar-btn:hover { background: #f3f4f6; }
.pos-shell .toolbar-btn i { font-size: 1.2rem; color: var(--pos-primary); }
.pos-shell .toolbar-btn span { font-size: 0.7rem; color: #555; }

.pos-shell .toolbar-dropdown-wrapper { position: relative; z-index: 9999; }
.pos-shell .pos-dropdown { position: absolute; top: 100%; inset-inline-start: 0; background: #fff; min-width: 180px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); z-index: 10000; display: none; border: 1px solid #e5e7eb; padding: 0.5rem 0; }
.pos-shell .pos-dropdown.show { display: block; }
.pos-shell .pos-dropdown-item { padding: 0.7rem 1rem; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: #111; transition: background 0.2s; }
.pos-shell .pos-dropdown-item:hover { background-color: #f8f9fa; }
.pos-shell .pos-dropdown-item.active { background-color: var(--pos-primary); color: #fff; }
.pos-shell .pos-dropdown-header { padding: 0.5rem 1rem; font-size: 0.75rem; color: #6c757d; font-weight: 700; }
.pos-shell .color-dot { width: 14px; height: 14px; display: inline-block; border: 1px solid rgba(0,0,0,0.1); }

/* Categories row */
.pos-shell .cat-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; flex-shrink: 0; }
.pos-shell .cat-tile { padding: 0.7rem 0.5rem; color: #fff; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; cursor: pointer; text-align: center; font-size: 0.85rem; transition: filter 0.15s, transform 0.15s; border: none; }
.pos-shell .cat-tile:hover { filter: brightness(1.1); transform: translateY(-1px); }
.pos-shell .cat-tile.active { outline: 2px solid #fff; outline-offset: -2px; }
.pos-shell .cat-tile i { font-size: 1.3rem; }
.pos-shell .cat-tile .cat-label { font-size: 0.85rem; font-weight: 800; line-height: 1.2; }
.pos-shell .cat-tile.c1 { background: #d63831; }
.pos-shell .cat-tile.c2 { background: #e8760a; }
.pos-shell .cat-tile.c3 { background: #2b7a44; }
.pos-shell .cat-tile.c4 { background: #3bbdb1; }
.pos-shell .cat-tile.c5 { background: #2b6cb0; }
.pos-shell .cat-tile.c6 { background: #7b5ea7; }

/* Product grid (white cards) */
.pos-shell .prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; overflow-y: auto; flex-grow: 1; align-content: start; padding-bottom: 0.5rem; min-height: 0; }
@media (min-width: 1200px) { .pos-shell .prod-grid { grid-template-columns: repeat(6, 1fr); } }
.pos-shell .prod-empty { grid-column: 1 / -1; text-align: center; padding: 3rem; color: #999; }
.pos-shell .prod-empty i { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.pos-shell .prod-card { background: #fff; overflow: visible; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; position: relative; display: flex; flex-direction: column; border: 1px solid #e8e8e8; box-shadow: 0 1px 4px rgba(0,0,0,0.07); height: auto; text-align: center; padding: 0; }
.pos-shell .prod-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.13); }
.pos-shell .prod-card .img-wrap { width: 100%; aspect-ratio: 4 / 3; position: relative; overflow: hidden; display: block; line-height: 0; background: #f0f0f0; flex-shrink: 0; }
.pos-shell .prod-card .img-wrap img { position: absolute; top: 0; inset-inline-start: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.pos-shell .prod-card:hover .img-wrap img { transform: scale(1.05); }
.pos-shell .prod-card .img-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #c2c2c2; font-size: 2.2rem; }
.pos-shell .prod-card .name { padding: 0.5rem 0.5rem 0.6rem; font-size: 0.82rem; font-weight: 700; color: #222; background: #fff; text-align: center; line-height: 1.3; }
.pos-shell .prod-card .price-tag { padding: 0.1rem 0.5rem 0.45rem; font-size: 0.82rem; font-weight: 800; color: var(--pos-primary); background: #fff; text-align: center; }
.pos-shell .prod-card .price-badge { position: absolute; top: 0.4rem; inset-inline-end: 0.4rem; background: var(--pos-accent); color: #fff; padding: 0.18rem 0.45rem; font-size: 0.78rem; font-weight: 800; z-index: 2; line-height: 1.4; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.pos-shell .prod-card .badge-dot { position: absolute; top: 0.4rem; inset-inline-start: 0.4rem; display: flex; gap: 0.2rem; z-index: 2; }
.pos-shell .prod-card .badge-dot i { background: rgba(0,0,0,0.55); color: #fff; width: 20px; height: 20px; display: grid; place-items: center; font-size: 0.7rem; border-radius: 50%; }

.pos-shell .prod-loading { grid-column: 1 / -1; display: grid; place-items: center; padding: 3rem; }

/* === Bottom action bar (full-width footer of the shell) === */
.pos-shell .bottom-bar { display: flex; gap: 0; background: var(--pos-surface-dark); border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; padding: 0; }
.pos-shell .action-btn { flex: 1; background: rgba(255,255,255,0.06); border: none; color: var(--pos-text-on-dark); padding: 0.5rem 0.25rem; font-weight: 700; font-size: 0.75rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; border-inline-start: 1px solid rgba(255,255,255,0.06); border-radius: 0; }
.pos-shell .action-btn:first-child { border-inline-start: none; }
.pos-shell .action-btn:hover:not(:disabled) { background: rgba(255,255,255,0.15); }
.pos-shell .action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pos-shell .action-btn.primary { background: var(--pos-secondary); }
.pos-shell .action-btn.success { background: var(--pos-primary); }
.pos-shell .action-btn i { font-size: 1.05rem; }

/* === Responsive === */
@media (max-width: 1100px) {
    .pos-shell .toolbar-btn span { display: none; }
    .pos-shell .toolbar-btn { min-width: 50px; padding: 0.6rem; }
}
@media (max-width: 900px) {
    .pos-shell .pos-body { grid-template-columns: 1fr; height: 100%; }
    .pos-shell .products-col { height: 100%; min-height: 0; }
    .pos-shell .products-pane { height: 100%; min-height: 0; }
    .pos-shell .order-pane { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: 100%; max-width: 320px; z-index: 1000; transform: translateX(-100%); transition: transform 0.3s; }
    .pos-shell .order-pane.open { transform: translateX(0); }
    .pos-shell .pos-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; display: none; }
    .pos-shell .pos-overlay.show { display: block; }
    .pos-shell .mobile-order-btn { display: flex !important; }
    .pos-shell .cat-row { grid-template-columns: repeat(3, 1fr); }
    .pos-shell .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .pos-shell .products-toolbar-wrapper { flex-direction: column; height: auto; gap: 0; }
    .pos-shell .search-box { order: 1; width: 100%; border-inline-start: none; border-bottom: 1px solid #e5e7eb; padding: 0 0.75rem; height: 44px; flex-shrink: 0; }
    .pos-shell .toolbar-buttons-row { order: 2; display: flex; flex-direction: row; width: 100%; }
    .pos-shell .toolbar-spacer { display: none; }
    .pos-shell .toolbar-btn { flex: 1; min-width: 0; height: 42px; padding: 0.4rem 0.3rem; }
}
@media (max-width: 600px) {
    .pos-shell .action-btn { padding: 0.5rem 0.15rem; font-size: 0.68rem; }
    .pos-shell .action-btn span { font-size: 0.62rem; }
    .pos-shell .products-pane { padding: 0.5rem; gap: 0.5rem; }
    .pos-shell .cat-row { grid-template-columns: repeat(3, 1fr); gap: 0.3rem; }
    .pos-shell .cat-tile { padding: 0.5rem 0.3rem; font-size: 0.75rem; }
    .pos-shell .cat-tile i { font-size: 1rem; }
    .pos-shell .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
}

/* Hide mobile-only order button on desktop by default */
.pos-shell .mobile-order-btn { display: none; }
