:root {
    --primary: #d9480f;
    --primary-dark: #b8380a;
    --bg: #f7f7f9;
    --card-bg: #ffffff;
    --border: #e5e5ea;
    --text: #1f2430;
    --text-muted: #6b7280;
    --success: #2f9e44;
    --danger: #e03131;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 5rem;
}

.order-header {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--primary); color: #fff; padding: 1rem;
    position: sticky; top: 0; z-index: 20;
}
.order-header h1 { font-size: 1.05rem; margin: 0; flex: 1; }
.order-header p { margin: 0; font-size: 0.85rem; opacity: 0.9; }
.back-link { color: #fff; text-decoration: none; font-size: 1.3rem; }

.cart-btn { margin-left: auto; color: #fff; text-decoration: none; position: relative; padding: 0.4rem 0.8rem; border: 1px solid rgba(255,255,255,.5); border-radius: 20px; font-size: 0.85rem; }
.cart-badge { background: #fff; color: var(--primary); border-radius: 50%; padding: 0 6px; font-weight: 700; font-size: 0.75rem; margin-left: 4px; }

.category-tabs { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.75rem 1rem; background: var(--card-bg); position: sticky; top: 60px; z-index: 15; border-bottom: 1px solid var(--border); }
.category-tab { flex-shrink: 0; padding: 0.4rem 0.9rem; border-radius: 20px; background: var(--bg); color: var(--text); text-decoration: none; font-size: 0.85rem; }
.category-tab.active { background: var(--primary); color: #fff; }

.menu-list { padding: 1rem; }
.category-section h2 { font-size: 1.05rem; margin: 1.2rem 0 0.6rem; }
.menu-grid { display: grid; gap: 0.8rem; }
.menu-item-card { display: flex; gap: 0.8rem; background: var(--card-bg); border-radius: 10px; padding: 0.7rem; border: 1px solid var(--border); }
.menu-item-img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.menu-item-info { flex: 1; min-width: 0; }
.menu-item-info h3 { margin: 0 0 0.2rem; font-size: 0.95rem; }
.menu-item-info p { margin: 0; font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.menu-item-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.price { font-weight: 700; color: var(--primary); }

.btn { display: inline-block; padding: 0.6rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; font-size: 0.9rem; text-decoration: none; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; margin-top: 0.75rem; }

.fab-waiter { position: fixed; bottom: 1.2rem; right: 1.2rem; background: var(--primary); color: #fff; border: none; border-radius: 30px; padding: 0.8rem 1.2rem; font-size: 0.9rem; box-shadow: 0 4px 12px rgba(0,0,0,.2); z-index: 30; cursor: pointer; }

/* --- Modal --- */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); align-items: flex-end; justify-content: center; z-index: 100; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 16px 16px 0 0; padding: 1.3rem; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.2rem; }

label { display: block; margin: 0.7rem 0 0.25rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
input[type=text], input[type=password], input[type=number], input[type=tel], textarea, select {
    width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: inherit;
}
.checkbox-label, .radio-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; color: var(--text); margin: 0.5rem 0; }
.checkbox-label input, .radio-label input { width: auto; }

.option-group-display { margin-top: 0.8rem; }
.option-group-display h4 { margin: 0 0 0.3rem; font-size: 0.88rem; }
.option-choice-label { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; font-weight: 400; }
.option-choice-label input { width: auto; }

.qty-control { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.4rem; }
.qty-control button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: #fff; font-size: 1rem; cursor: pointer; }

.empty-state { text-align: center; padding: 3rem 1.5rem; }

/* --- Cart --- */
.cart-page { padding: 1rem; }
.cart-item { display: flex; gap: 0.7rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem; margin-bottom: 0.7rem; }
.cart-item-img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h4 { margin: 0 0 0.2rem; font-size: 0.9rem; }
.option-line { font-size: 0.78rem; color: var(--text-muted); margin: 0; }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.cart-summary { position: sticky; bottom: 0; background: var(--card-bg); border-top: 1px solid var(--border); padding: 1rem; margin: 0 -1rem; }
.cart-total-row, .checkout-item-row { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.9rem; }
.total-row { font-weight: 700; border-top: 1px solid var(--border); margin-top: 0.4rem; padding-top: 0.6rem; }

/* --- Checkout --- */
.checkout-page { padding: 1rem; }

/* --- Status --- */
.status-page { padding: 1rem; }
.status-stepper { display: flex; flex-direction: column; gap: 0; margin: 1rem 0; }
.step { display: flex; align-items: center; gap: 0.7rem; padding: 0.4rem 0; opacity: 0.4; }
.step.done { opacity: 1; }
.step-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.step.done .step-dot { background: var(--success); }
.step-label { font-size: 0.9rem; }

.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: #1f2430; color: #fff; padding: 0.6rem 1.1rem; border-radius: 20px; font-size: 0.85rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 200; }
.toast.show { opacity: 1; }
