/* ═══════════════════════════════════════════════════════════════
   Restaurant Mode — Mobile-First Styles (v2 Redesign)
   ═══════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }

body.restaurant-app {
    font-family: var(--app-font);
    background: var(--app-page-bg, #fafafa);
    padding-top: 60px;
    padding-bottom: 68px;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

/* ── Header ── */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: 60px; background: var(--app-header-bg, #fff);
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    z-index: 1030;
    display: flex; align-items: center;
}

.header-icon-btn {
    background: none;
    border: none;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--app-header-text, #333);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.header-icon-btn:active { background: #f0f0f0; }

.mode-badge {
    display: inline-flex; align-items: center;
    background: color-mix(in srgb, var(--app-primary), white 88%);
    color: var(--app-primary);
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 600;
    max-width: 200px; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis;
}

/* ── Bottom Navigation ── */
.app-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 68px; background: var(--app-nav-bg, #fff);
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
    display: flex; z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-decoration: none; color: var(--app-nav-inactive, #aaa);
    font-size: 0.68rem; gap: 3px;
    transition: color .2s;
    position: relative;
}
.bottom-nav-item i { font-size: 1.2rem; transition: transform .2s; }
.bottom-nav-item.active { color: var(--app-nav-active, var(--app-primary)); }
.bottom-nav-item.active::before {
    content: '';
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 32px; height: 3px;
    background: var(--app-nav-active, var(--app-primary));
    border-radius: 0 0 3px 3px;
}
.bottom-nav-item .nav-badge {
    position: absolute; top: 4px; right: calc(50% - 18px);
    background: var(--app-danger); color: #fff;
    font-size: 0.6rem; min-width: 18px; height: 18px;
    border-radius: 9px; display: flex;
    align-items: center; justify-content: center;
    font-weight: 700; border: 2px solid #fff;
}

/* ── App Content ── */
.app-content { min-height: calc(100vh - 128px); }

/* ── Choice Screen ── */
.choice-screen {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: calc(100vh - 128px);
    padding: 24px;
    text-align: center;
    position: relative;
}
.choice-screen-bgimg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; z-index: 0;
}
.choice-screen-content {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    align-items: center; width: 100%;
}
.choice-screen-bg h4 { color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.choice-screen-bg p { text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.choice-screen-bg .choice-btn {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.choice-btn {
    width: 100%; max-width: 320px;
    padding: 28px 24px; margin: 10px 0;
    border: none; border-radius: 18px;
    background: var(--app-card-bg, #fff); text-decoration: none;
    display: flex; align-items: center;
    gap: 16px; transition: all .2s;
    color: #333;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.choice-btn:hover, .choice-btn:active {
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    background: color-mix(in srgb, var(--app-primary), white 95%);
    color: var(--app-primary);
    transform: scale(1.02);
}
.choice-btn .choice-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: color-mix(in srgb, var(--app-primary), white 85%);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--app-primary); flex-shrink: 0;
}
.choice-btn .choice-text { text-align: start; }
.choice-btn .choice-text h5 { margin: 0; font-weight: 700; font-size: 1.1rem; }
.choice-btn .choice-text p { margin: 0; font-size: 0.82rem; color: #888; }

/* ── Branch Cards ── */
.branch-card {
    background: var(--app-card-bg, #fff); border-radius: 16px;
    padding: 16px; margin-bottom: 12px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    transition: box-shadow .2s, transform .15s;
    text-decoration: none; color: inherit; display: block;
}
.branch-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); color: inherit; }
.branch-card .branch-name { font-weight: 700; font-size: 1.05rem; }
.branch-card .branch-meta { font-size: 0.82rem; color: #777; }
.branch-card .branch-badge {
    display: inline-block; padding: 2px 10px;
    border-radius: 10px; font-size: 0.72rem; font-weight: 600;
}
.branch-badge.open { background: #e8f5e9; color: #2e7d32; }
.branch-badge.closed { background: #fce4ec; color: #c62828; }

/* ── Menu ── */
.category-tabs {
    display: flex; gap: 8px;
    overflow-x: auto; padding: 12px 16px;
    background: var(--app-card-bg, #fff);
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky; top: 60px; z-index: 10;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
    white-space: nowrap; padding: 8px 18px;
    border-radius: 24px; font-size: 0.82rem;
    font-weight: 600; border: 1.5px solid #e0e0e0;
    background: var(--app-card-bg, #fff); color: #555;
    text-decoration: none; transition: all .2s;
    flex-shrink: 0;
}
.cat-tab.active, .cat-tab:hover {
    background: var(--app-primary); color: var(--app-btn-text, #fff);
    border-color: var(--app-primary);
}
.cat-tab .tab-count {
    display: inline-block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 2px;
}
.cat-tab.active .tab-count { opacity: 0.85; }

.menu-grid { padding: 12px 16px; }
.menu-item-card {
    background: var(--app-card-bg, #fff); border-radius: 14px;
    overflow: hidden; margin-bottom: 12px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    display: flex; gap: 0;
    text-decoration: none; color: inherit;
    transition: box-shadow .2s, transform .15s;
    cursor: pointer;
    position: relative;
}
.menu-item-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); color: inherit; }
.menu-item-img {
    width: 110px; height: 110px; object-fit: cover; flex-shrink: 0;
    background: #f0f0f0;
}
.menu-item-info { padding: 12px 14px 12px 14px; flex: 1; min-width: 0; }
.menu-item-info h6 { font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }
.menu-item-info .item-desc {
    font-size: 0.78rem; color: #888;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.menu-item-info .item-price {
    font-weight: 700; color: var(--app-primary);
    font-size: 0.95rem; margin-top: 6px;
}
.out-of-stock { opacity: 0.5; pointer-events: none; }

.quick-add-btn {
    position: absolute;
    bottom: 10px; right: 10px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--app-primary);
    color: var(--app-btn-text, #fff);
    border: none;
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    z-index: 2;
    line-height: 1;
}
.quick-add-btn:active { transform: scale(0.85); }
.quick-add-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.25); transform: scale(1.08); }
.rtl .quick-add-btn { right: auto; left: 10px; }

/* ── Item Detail Modal (Bottom Sheet) ── */
.item-modal .modal-dialog {
    margin: 0;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-width: 100%;
    transform: translateY(0);
}
.item-modal .modal-content {
    border-radius: 24px 24px 0 0;
    border: none;
    box-shadow: 0 -4px 30px rgba(0,0,0,.15);
    max-height: 92vh;
    overflow-y: auto;
}
.item-modal .modal-body { padding: 0; }
.item-modal-img { width: 100%; height: 240px; object-fit: cover; }
.item-modal-content { padding: 24px 20px; }
.item-modal-content > h5 { font-size: 1.2rem; }
.modifier-group { margin-bottom: 20px; }
.modifier-group h6 {
    font-weight: 700; font-size: 0.9rem; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.modifier-group h6 .text-danger { font-size: 0.75rem; }
.modifier-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid #f5f5f5;
}
.modifier-option label { font-size: 0.88rem; cursor: pointer; flex: 1; }
.modifier-price { font-size: 0.82rem; color: #888; margin-left: 8px; white-space: nowrap; }
.modifier-option .form-check-input {
    width: 22px; height: 22px;
    border: 2px solid #ccc;
    cursor: pointer;
}
.modifier-option .form-check-input:checked {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}
.qty-control {
    display: flex; align-items: center; gap: 20px;
    justify-content: center; margin: 24px 0;
}
.qty-control button {
    width: 44px; height: 44px; border-radius: 50%;
    border: 2px solid var(--app-primary); background: #fff;
    font-size: 1.3rem; display: flex;
    align-items: center; justify-content: center;
    cursor: pointer; transition: all .15s;
    color: var(--app-primary);
}
.qty-control button:active { transform: scale(0.88); background: color-mix(in srgb, var(--app-primary), white 90%); }
.qty-control .qty-value { font-size: 1.4rem; font-weight: 700; min-width: 36px; text-align: center; }

/* ── Floating Basket Bar ── */
.basket-float {
    position: fixed; bottom: 78px; left: 16px; right: 16px;
    background: var(--app-primary); color: var(--app-btn-text, #fff);
    border-radius: 16px; padding: 14px 20px;
    display: flex; justify-content: space-between;
    align-items: center; z-index: 1020;
    box-shadow: 0 4px 24px rgba(0,0,0,.22);
    text-decoration: none; transition: transform .2s;
}
.basket-float:hover { transform: translateY(-2px); color: var(--app-btn-text, #fff); }
.basket-float .bf-count {
    background: rgba(255,255,255,.25);
    padding: 2px 10px; border-radius: 10px;
    font-size: 0.82rem; font-weight: 700;
}
.basket-float .bf-total { font-weight: 700; font-size: 1.05rem; }

/* ── Basket Page ── */
.basket-item {
    background: var(--app-card-bg, #fff); border-radius: 14px;
    padding: 14px; margin-bottom: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    display: flex; gap: 12px; align-items: flex-start;
}
.basket-item .bi-img {
    width: 52px; height: 52px;
    border-radius: 10px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}
.basket-item .bi-img-placeholder {
    width: 52px; height: 52px;
    border-radius: 10px;
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    color: #ccc; font-size: 1.2rem;
    flex-shrink: 0;
}
.basket-item .bi-body { flex: 1; min-width: 0; }
.basket-item .bi-name { font-weight: 700; font-size: 0.92rem; }
.basket-item .bi-mods { font-size: 0.78rem; color: #888; }
.basket-item .bi-price { font-weight: 700; color: var(--app-primary); }
.basket-item .bi-qty-btn {
    width: 36px; height: 36px; padding: 0;
    border-radius: 50%;
    border: 1.5px solid #ddd;
    background: #fff;
    font-size: 1.1rem;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .15s;
    color: #333;
}
.basket-item .bi-qty-btn:active { transform: scale(0.88); }

/* ── Summary Card ── */
.summary-card {
    background: var(--app-card-bg, #fff); border-radius: 16px;
    padding: 18px; margin-top: 12px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.summary-row {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: 0.88rem;
}
.summary-row.total { font-weight: 700; font-size: 1.05rem; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 6px; }

/* ── Action Buttons ── */
.btn-app {
    width: 100%; padding: 16px;
    border-radius: 14px; font-weight: 700;
    font-size: 1rem; border: none;
    transition: all .2s;
    min-height: 52px;
}
.btn-app-primary {
    background: var(--app-primary); color: var(--app-btn-text, #fff);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--app-primary), transparent 60%);
}
.btn-app-primary:hover { background: var(--app-primary-dark); color: var(--app-btn-text, #fff); }
.btn-app-outline {
    background: #fff; color: var(--app-primary);
    border: 2px solid var(--app-primary);
}
.btn-app-lg {
    padding: 18px; font-size: 1.05rem; min-height: 56px;
}

/* ── Order Tracking Timeline ── */
.timeline { padding: 0 0 0 36px; position: relative; }
.timeline::before {
    content: ''; position: absolute; left: 15px; top: 0; bottom: 0;
    width: 2px; background: #e8e8e8;
}
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .tl-icon {
    position: absolute; left: -36px; top: 0;
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; background: #f0f0f0; color: #bbb;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    z-index: 1;
}
.timeline-item.done .tl-icon {
    background: var(--app-success); color: #fff;
}
.timeline-item.active .tl-icon {
    background: var(--app-primary); color: #fff;
    animation: tlPulse 2s infinite;
}
@keyframes tlPulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--app-primary), transparent 30%); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.timeline-item h6 { font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; }
.timeline-item small { font-size: 0.75rem; color: #999; }

/* ── Order History Card ── */
.order-card {
    background: #fff; border-radius: 16px;
    padding: 16px; margin-bottom: 12px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    text-decoration: none; color: inherit; display: block;
    border-left: 4px solid transparent;
    transition: box-shadow .2s, transform .15s;
}
.order-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); color: inherit; }
.order-card.accent-pending { border-left-color: #e65100; }
.order-card.accent-approved, .order-card.accent-confirmed { border-left-color: #1565c0; }
.order-card.accent-preparing { border-left-color: #283593; }
.order-card.accent-ready { border-left-color: #6a1b9a; }
.order-card.accent-outfordelivery { border-left-color: #00695c; }
.order-card.accent-readyforpickup { border-left-color: #ad1457; }
.order-card.accent-delivered { border-left-color: #2e7d32; }
.order-card.accent-cancelled, .order-card.accent-rejected { border-left-color: #c62828; }

.order-status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    border-radius: 10px; font-size: 0.72rem; font-weight: 600;
}
.order-status-badge i { font-size: 0.65rem; }
.status-pending { background: #fff3e0; color: #e65100; }
.status-confirmed, .status-approved { background: #e3f2fd; color: #1565c0; }
.status-processing, .status-preparing { background: #e8eaf6; color: #283593; }
.status-ready { background: #f3e5f5; color: #6a1b9a; }
.status-outfordelivery { background: #e0f7fa; color: #00695c; }
.status-readyforpickup { background: #fce4ec; color: #ad1457; }
.status-delivered { background: #e8f5e9; color: #1b5e20; }
.status-cancelled, .status-rejected { background: #fce4ec; color: #c62828; }

/* ── Checkout Progress ── */
.checkout-progress {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin-bottom: 24px; padding: 0 20px;
}
.checkout-progress .cp-step {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; font-weight: 600; color: #bbb;
}
.checkout-progress .cp-step.active { color: var(--app-primary); }
.checkout-progress .cp-step .cp-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: #e8e8e8; color: #999;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
}
.checkout-progress .cp-step.active .cp-num {
    background: var(--app-primary); color: #fff;
}
.checkout-progress .cp-line {
    flex: 0 0 40px; height: 2px; background: #e8e8e8; margin: 0 8px;
}

.checkout-input-group {
    position: relative; margin-bottom: 12px;
}
.checkout-input-group .ci-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #bbb; font-size: 0.9rem; z-index: 2;
}
.rtl .checkout-input-group .ci-icon { left: auto; right: 14px; }
.checkout-input-group .form-control {
    padding-left: 40px;
    border-radius: 12px; border: 1.5px solid #e0e0e0;
    font-size: 0.92rem; min-height: 48px;
}
.rtl .checkout-input-group .form-control { padding-left: 16px; padding-right: 40px; }
.checkout-input-group .form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary), transparent 85%);
}

/* ── Auth Pages ── */
.auth-page {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: calc(100vh - 128px); padding: 24px;
}
.auth-card {
    width: 100%; max-width: 400px; background: #fff;
    border-radius: 24px; padding: 0;
    box-shadow: 0 4px 30px rgba(0,0,0,.08);
    overflow: hidden;
}
.auth-card-header {
    background: linear-gradient(135deg, var(--app-primary), color-mix(in srgb, var(--app-primary), black 18%));
    padding: 32px 24px 28px;
    text-align: center;
    color: #fff;
}
.auth-card-header .auth-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 14px;
    backdrop-filter: blur(4px);
}
.auth-card-header h4 {
    font-weight: 700; margin: 0 0 4px;
    font-size: 1.25rem;
}
.auth-card-header p {
    margin: 0; font-size: 0.82rem;
    opacity: 0.85;
}
.auth-card-body {
    padding: 28px 24px 24px;
}
.auth-card h4 { font-weight: 700; margin-bottom: 24px; text-align: center; }
.auth-input-group {
    position: relative; margin-bottom: 14px;
}
.auth-input-group .ai-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #bbb; font-size: 0.9rem; z-index: 2;
    pointer-events: none;
}
.rtl .auth-input-group .ai-icon { left: auto; right: 14px; }
.auth-input-group .form-control {
    padding-left: 42px;
    border-radius: 12px; border: 1.5px solid #e8e8e8;
    font-size: 0.92rem; min-height: 48px;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.rtl .auth-input-group .form-control { padding-left: 16px; padding-right: 42px; }
.auth-input-group .form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary), transparent 85%);
    background: #fff;
}
.auth-card .form-control {
    border-radius: 12px; padding: 12px 16px;
    border: 1.5px solid #e0e0e0; font-size: 0.92rem;
}
.auth-card .form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary), transparent 80%);
}
.auth-divider {
    display: flex; align-items: center;
    gap: 12px; margin: 20px 0;
    color: #bbb; font-size: 0.78rem;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px; background: #eee;
}
.auth-link {
    color: var(--app-primary); font-weight: 600;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

/* ── Profile Page ── */
.profile-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--app-primary), white 75%), color-mix(in srgb, var(--app-primary), white 88%));
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--app-primary), transparent 70%);
}
.profile-avatar i { font-size: 2rem; color: var(--app-primary); }
.profile-menu-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; margin-bottom: 8px;
    background: #fff; border-radius: 14px;
    text-decoration: none; color: inherit;
    box-shadow: 0 1px 6px rgba(0,0,0,.04);
    transition: box-shadow .2s, transform .15s;
}
.profile-menu-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    color: inherit;
}
.profile-menu-item:active { transform: scale(0.98); }
.profile-menu-item .pmi-left {
    display: flex; align-items: center; gap: 14px;
}
.profile-menu-item .pmi-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
}
.profile-menu-item .pmi-text { font-weight: 600; font-size: 0.92rem; }
.profile-menu-item .pmi-arrow { color: #ccc; font-size: 0.8rem; }

/* ── Empty State ── */
.empty-state {
    text-align: center; padding: 60px 24px;
    color: #999;
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: .4; }
.empty-state h5 { font-weight: 600; color: #666; }
.empty-state p { font-size: 0.88rem; }

/* ── Floating Cart Button (legacy support) ── */
.floating-cart-btn {
    position: fixed;
    bottom: 84px;
    right: 16px;
    z-index: 1025;
}
.rtl .floating-cart-btn { right: auto; left: 16px; }
.fcb-link {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--app-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    text-decoration: none;
    position: relative;
    transition: transform .15s;
}
.fcb-link:hover { color: #fff; transform: scale(1.08); }
.fcb-link:active { transform: scale(0.95); }
.fcb-badge {
    position: absolute;
    top: -2px; right: -2px;
    background: var(--app-danger);
    color: #fff;
    font-size: 0.65rem;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid #fff;
}

/* ── Home Banner Carousel ── */
.rest-carousel {
    position: relative;
    overflow: hidden;
    margin: 8px 14px 14px;
    border-radius: 18px;
    background: #e8e8e8;
}
.rest-carousel-track {
    display: flex;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}
.rtl .rest-carousel-track { flex-direction: row-reverse; }
.rest-carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
}
.rest-banner-link { display: block; }
.rest-banner-img {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    display: block;
    border-radius: 18px;
    max-height: 220px;
}
.rest-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}
.rest-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    cursor: pointer;
    transition: all .25s;
}
.rest-dot.active {
    width: 22px;
    border-radius: 4px;
    background: var(--app-primary);
}

/* ── Home Category Grid ── */
.rest-home-section {
    padding: 0 14px 16px;
}
.rest-category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.rest-category-card {
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #f0f0f0;
    aspect-ratio: 1 / 1;
    transition: transform .15s;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.rest-category-card:active { transform: scale(0.96); }
.rest-category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rest-category-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    color: #bbb;
    font-size: 2.5rem;
}
.rest-category-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 12px 14px;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
}
.rest-category-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* ── Search Overlay ── */
.search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 2000;
    display: none;
    flex-direction: column;
}
.search-overlay.open { display: flex; }
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    padding-top: env(safe-area-inset-top, 10px);
}
.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: #f5f5f5;
    padding: 12px 16px;
    border-radius: 14px;
    font-family: var(--app-font);
}
.search-bar .search-close {
    background: none; border: none;
    font-size: 1.2rem; color: #666;
    cursor: pointer; padding: 8px;
}
.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    -webkit-overflow-scrolling: touch;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}
.search-result-item img {
    width: 52px; height: 52px;
    border-radius: 12px;
    object-fit: cover;
    background: #f0f0f0;
}
.search-result-item .sri-info { flex: 1; min-width: 0; }
.search-result-item .sri-name { font-weight: 600; font-size: .9rem; }
.search-result-item .sri-price { color: var(--app-primary); font-weight: 700; font-size: .85rem; }
.search-empty {
    text-align: center;
    padding: 60px 24px;
    color: #999;
}

/* ── Side Drawer ── */
.side-drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
    z-index: 2010;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.side-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.side-drawer {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 280px;
    background: #fff;
    z-index: 2020;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
}
.rtl .side-drawer { left: auto; right: 0; transform: translateX(100%); }
.side-drawer.open { transform: translateX(0); }
.side-drawer-header {
    padding: 28px 20px 18px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.side-drawer-header img { max-height: 56px; object-fit: contain; }
.side-drawer-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}
.side-drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    font-size: .92rem;
    font-weight: 500;
    transition: background .15s;
}
.side-drawer-item:hover, .side-drawer-item:active { background: #f8f8f8; color: #333; }
.side-drawer-item i { width: 22px; text-align: center; color: #888; font-size: 1.05rem; }
.side-drawer-divider { height: 1px; background: #f0f0f0; margin: 6px 0; }

/* ── Native App Polish ── */
body.restaurant-app {
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;
}
body.restaurant-app input,
body.restaurant-app textarea,
body.restaurant-app [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

/* ── Skeleton Loading ── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton-banner { width: 100%; aspect-ratio: 16 / 8; border-radius: 16px; }
.skeleton-card { aspect-ratio: 1; border-radius: 14px; }

/* ── Page Transitions ── */
.app-content {
    animation: fadeSlideIn .3s ease-out;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Touch Polish ── */
.choice-btn:active,
.branch-card:active,
.order-card:active,
.menu-item-card:active {
    transform: scale(0.97);
    transition: transform .1s;
}
.btn-app:active {
    transform: scale(0.96);
}

/* ── iOS Bounce Prevention ── */
html.restaurant-html {
    overflow: hidden;
    height: 100%;
}
body.restaurant-app {
    overflow-y: auto;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}

/* ── GPS Overlay ── */
.gps-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,.97);
    z-index: 2050;
    display: none;
    align-items: center;
    justify-content: center;
}
.gps-overlay.active { display: flex; }
.gps-overlay-content {
    text-align: center;
    padding: 32px 24px;
    max-width: 340px;
}

/* ── Animations ── */
@keyframes cartBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.cart-bounce i { animation: cartBounce .5s ease-out; }

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.15); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}
.confirm-check { animation: checkPop .6s cubic-bezier(.17,.67,.35,1.2) forwards; }
.confirm-check-particles {
    position: relative;
    display: inline-block;
}
.confirm-check-particles::before,
.confirm-check-particles::after {
    content: '';
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    animation: particleBurst .8s ease-out forwards;
    opacity: 0;
}
.confirm-check-particles::before {
    background: var(--app-primary);
    top: 10px; left: -8px;
    animation-delay: .2s;
}
.confirm-check-particles::after {
    background: var(--app-success);
    top: 5px; right: -6px;
    animation-delay: .35s;
}
@keyframes particleBurst {
    0% { transform: translate(0,0) scale(0); opacity: 1; }
    100% { transform: translate(-20px, -30px) scale(1.5); opacity: 0; }
}

/* ── Address Cards (Checkout) ── */
.address-cards-row {
    display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px;
    scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.address-cards-row::-webkit-scrollbar { height: 4px; }
.address-cards-row::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.address-card {
    flex: 0 0 170px; min-height: 110px; padding: 14px 12px;
    background: var(--app-card-bg, #fff);
    border: 2px solid #e8e8e8; border-radius: 14px;
    cursor: pointer; transition: all .2s ease; position: relative;
    display: flex; flex-direction: column; gap: 4px;
}
.address-card:hover { border-color: color-mix(in srgb, var(--app-primary), transparent 50%); }
.address-card.active {
    border-color: var(--app-primary);
    box-shadow: 0 2px 12px color-mix(in srgb, var(--app-primary), transparent 75%);
    background: color-mix(in srgb, var(--app-primary), transparent 95%);
}
.address-card .addr-icon {
    width: 32px; height: 32px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; margin-bottom: 4px;
    background: color-mix(in srgb, var(--app-primary), transparent 90%);
    color: var(--app-primary);
}
.address-card .addr-label-tag {
    font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
    color: var(--app-primary); margin-bottom: 2px;
}
.address-card .addr-text {
    font-size: .78rem; color: #555; line-height: 1.3;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.address-card .addr-badge {
    position: absolute; top: 8px; right: 8px; font-size: .6rem; font-weight: 700;
    padding: 2px 6px; border-radius: 6px; text-transform: uppercase; letter-spacing: .3px;
}
.rtl .address-card .addr-badge { right: auto; left: 8px; }
.address-card .addr-badge.badge-default { background: var(--app-primary); color: #fff; }
.address-card .addr-badge.badge-recent { background: #e3f2fd; color: #1565c0; }

.add-address-card {
    flex: 0 0 120px; min-height: 110px; padding: 14px 12px;
    border: 2px dashed #d0d0d0; border-radius: 14px;
    cursor: pointer; transition: all .2s ease;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; color: #888; background: transparent;
}
.add-address-card:hover {
    border-color: var(--app-primary); color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary), transparent 95%);
}
.add-address-card .plus-circle {
    width: 36px; height: 36px; border-radius: 50%;
    border: 2px dashed currentColor;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 300;
}
.add-address-card span { font-size: .75rem; font-weight: 600; text-align: center; }

/* ── Add Address Modal ── */
#addAddressModal .modal-content { border-radius: 20px; border: none; overflow: hidden; }
#addAddressModal .modal-header {
    border-bottom: none; padding: 18px 20px 8px;
}
#addAddressModal .modal-header .modal-title { font-weight: 700; font-size: 1.05rem; }
#addAddressModal .modal-body { padding: 8px 20px 20px; }

#modalMap { height: 220px; border-radius: 12px; z-index: 0; margin-bottom: 12px; }

.label-selector { display: flex; gap: 8px; margin-bottom: 14px; }
.label-selector .label-btn {
    flex: 1; padding: 8px 6px; border: 2px solid #e0e0e0; border-radius: 12px;
    background: #fff; cursor: pointer; text-align: center;
    font-size: .8rem; font-weight: 600; color: #666;
    transition: all .2s ease; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.label-selector .label-btn i { font-size: 1rem; }
.label-selector .label-btn.active {
    border-color: var(--app-primary); color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary), transparent 92%);
}

.modal-search-bar {
    display: flex; gap: 8px; margin-bottom: 12px;
}
.modal-search-bar input {
    flex: 1; border-radius: 12px; border: 1.5px solid #e0e0e0;
    padding: 10px 14px; font-size: .88rem;
}
.modal-search-bar input:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary), transparent 85%);
    outline: none;
}
.modal-search-bar button {
    border-radius: 12px; border: none; padding: 10px 16px;
    background: var(--app-primary); color: #fff; font-size: .88rem; cursor: pointer;
}
.modal-search-bar button:hover { opacity: .9; }

.modal-form-group { margin-bottom: 12px; }
.modal-form-group label { font-size: .78rem; font-weight: 600; color: #666; margin-bottom: 4px; display: block; }
.modal-form-group input, .modal-form-group textarea {
    width: 100%; border-radius: 12px; border: 1.5px solid #e0e0e0;
    padding: 10px 14px; font-size: .88rem;
}
.modal-form-group input:focus, .modal-form-group textarea:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary), transparent 85%);
    outline: none;
}

/* ── Delivery Preview ── */
.delivery-preview {
    background: var(--app-card-bg, #fff); border-radius: 14px;
    padding: 14px; border: 1.5px solid #eee;
}
.delivery-preview .preview-map { height: 140px; border-radius: 10px; margin-bottom: 10px; }
.delivery-preview .preview-info { font-size: .85rem; color: #444; }
.delivery-preview .preview-info i { color: var(--app-primary); width: 18px; text-align: center; margin-right: 6px; }
.rtl .delivery-preview .preview-info i { margin-right: 0; margin-left: 6px; }
.delivery-preview .preview-info div { margin-bottom: 4px; display: flex; align-items: center; }

/* ── Utilities ── */
.section-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; }
.page-padding { padding: 16px; }
