/* ===========================
   Reset & base
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --accent: #f9a825;
  --bg: #fff8f0;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --text-light: #999;
  --border: #eaeaea;
  --border-strong: #dcdcdc;
  --shadow-sm: 0 2px 6px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.15);
  --radius: 14px;
  --radius-lg: 22px;
  --success: #10b981;
  --danger: #ef4444;
}

html, body { height: 100%; }
body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ===========================
   Header
   =========================== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 800; font-size: 1.05rem; }
.brand-tag { font-size: .78rem; color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-link {
  padding: 8px 14px; border-radius: 999px; font-weight: 500;
  color: var(--text); transition: background .2s;
}
.header-link:hover { background: #f4f4f4; }

.cart-btn {
  position: relative;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: 0; cursor: pointer;
  border-radius: 999px; padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; box-shadow: var(--shadow-sm);
  transition: transform .12s;
}
.cart-btn:hover { transform: translateY(-1px); }
.cart-icon { font-size: 1rem; }
.cart-count {
  background: #fff; color: var(--primary-dark);
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; font-weight: 800; font-size: .78rem;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ===========================
   Hero
   =========================== */
.hero {
  background: linear-gradient(135deg, #fff5e6 0%, #ffe4ec 100%);
  padding: 40px 0 30px;
}
.hero-inner {
  display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 32px;
}
.hero-text h1 { font-size: 2.3rem; font-weight: 800; margin-bottom: 12px; }
.hero-text p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 20px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-badges .badge {
  background: rgba(255,255,255,.7); padding: 6px 12px;
  border-radius: 999px; font-size: .85rem; border: 1px solid var(--border);
}
.hero-visual {
  font-size: 12rem; text-align: center; opacity: .9;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,.15));
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 20px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; cursor: pointer;
  border: 0; transition: transform .12s, box-shadow .12s, background .12s;
}
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: var(--shadow-sm);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.ghost {
  background: rgba(255,255,255,.85); color: var(--primary-dark);
  border: 1px solid var(--border-strong);
}
.btn.ghost:hover { background: #fff; }
.btn.big { padding: 12px 24px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ===========================
   Filters
   =========================== */
.filters-wrap { padding: 24px 0 10px; background: var(--bg); position: sticky; top: 71px; z-index: 30; }
.filters-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.filters-header h2 { font-size: 1.5rem; font-weight: 800; }
.search-wrap { flex: 1; max-width: 320px; }
#search {
  width: 100%; padding: 10px 16px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  font-family: inherit; font-size: .95rem; background: #fff;
  outline: none; transition: border-color .2s;
}
#search:focus { border-color: var(--primary); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; background: #fff; border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
  font-family: inherit; font-size: .9rem; font-weight: 500;
  transition: all .18s; white-space: nowrap;
}
.chip:hover { border-color: var(--primary); }
.chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: transparent;
}

.quick-filters { display: flex; gap: 10px; padding-bottom: 12px; }
.chip-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: #fff; border: 1px solid var(--border-strong);
  border-radius: 999px; cursor: pointer; font-size: .88rem;
  user-select: none;
}
.chip-toggle input { display: none; }
.chip-toggle:has(input:checked) {
  background: var(--primary); color: #fff; border-color: transparent;
}

/* ===========================
   Menu grid
   =========================== */
.menu-main { padding: 20px 0 60px; }
.category-block { margin-bottom: 40px; }
.category-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.category-icon { font-size: 1.6rem; }
.category-title { font-size: 1.35rem; font-weight: 800; }

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.item-card {
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  border: 1px solid var(--border);
  transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.item-card.unavailable { opacity: .55; }

.item-image {
  position: relative; aspect-ratio: 4 / 3;
  background: #f4ede0 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ddd"><text x="50%25" y="55%25" font-size="10" text-anchor="middle">🍕</text></svg>') center/40% no-repeat;
  overflow: hidden;
}
.item-image img { width: 100%; height: 100%; object-fit: cover; }
.item-image .placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: #ccc;
}

.item-tags {
  position: absolute; top: 10px; left: 10px;
  display: flex; gap: 6px; flex-direction: row-reverse;
}
.item-tag {
  background: rgba(255,255,255,.95); backdrop-filter: blur(4px);
  color: var(--text); font-size: .72rem; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.item-tag.veg { color: #059669; }
.item-tag.spicy { color: #dc2626; }
.item-tag.off { background: rgba(0,0,0,.65); color: #fff; }

.item-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.item-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.item-desc {
  font-size: .82rem; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 12px; min-height: 2.5em;
}
.item-price-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.item-price {
  color: var(--primary-dark); font-weight: 800; font-size: 1.05rem;
}
.item-price small { font-size: .72rem; color: var(--text-muted); font-weight: 500; margin-right: 4px; }
.item-add {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: 0; width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; font-size: 1.2rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
}
.item-add:hover { transform: scale(1.08); }

.empty {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
  font-size: 1.05rem;
}

/* ===========================
   Modal
   =========================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fade .18s ease;
}
.modal-panel {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 520px; max-height: 92vh; overflow: hidden;
  position: relative; display: flex; flex-direction: column;
  animation: pop .22s ease;
}
.modal-panel.small { max-width: 460px; }
.modal-close {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(255,255,255,.9); border: 0; width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; font-size: 1.1rem; color: var(--text);
  box-shadow: var(--shadow-sm); font-weight: 700;
}
.modal-img { aspect-ratio: 16/10; background: #f5efe4; overflow: hidden; }
.modal-img img { width: 100%; height: 100%; object-fit: cover; }
.modal-img .placeholder { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 5rem; color: #ccc; }
.modal-body { padding: 18px 22px 22px; overflow-y: auto; }
.modal-tags { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.modal-body h3 { font-size: 1.4rem; margin-bottom: 6px; font-weight: 800; }
.modal-desc { color: var(--text-muted); margin-bottom: 14px; font-size: .92rem; }

.sizes-title { font-weight: 700; margin-bottom: 8px; font-size: .95rem; }
.sizes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin-bottom: 16px; }
.size-option {
  padding: 10px 12px; border: 1.5px solid var(--border-strong);
  border-radius: 12px; cursor: pointer; text-align: center;
  transition: all .15s; background: #fff;
}
.size-option .label { font-weight: 700; font-size: .95rem; }
.size-option .price { color: var(--text-muted); font-size: .82rem; margin-top: 2px; }
.size-option:hover { border-color: var(--primary); }
.size-option.selected {
  border-color: var(--primary); background: #fff2f3;
}
.size-option.selected .price { color: var(--primary-dark); font-weight: 700; }

.modal-qty { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; }
.qty-ctrl { display: flex; align-items: center; gap: 12px; }
.qty-ctrl button {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: #fff;
  cursor: pointer; font-size: 1.2rem; font-weight: 700;
}
.qty-ctrl button:hover { border-color: var(--primary); color: var(--primary); }
#qty-value { font-weight: 700; min-width: 24px; text-align: center; }

.modal-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.modal-total { font-size: 1.15rem; font-weight: 800; color: var(--primary-dark); }

/* ===========================
   Cart drawer
   =========================== */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55;
  animation: fade .18s ease;
}
.drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 100%; max-width: 420px; background: var(--surface);
  display: flex; flex-direction: column; animation: slide-in-l .22s ease;
}
.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.drawer-header h3 { font-size: 1.15rem; font-weight: 800; }
.drawer-header .modal-close { position: static; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-body:empty::after {
  content: "السلة فارغة. أضف أصناف من المنيو!"; display: block;
  text-align: center; color: var(--text-muted); padding: 40px 0;
}
.drawer-footer {
  border-top: 1px solid var(--border); padding: 16px 20px;
  background: #fafafa;
}
.cart-totals { margin-bottom: 12px; font-size: .95rem; }
.cart-totals .row { display: flex; justify-content: space-between; padding: 3px 0; }
.cart-totals .total { font-weight: 800; font-size: 1.1rem; padding-top: 8px; border-top: 1px dashed var(--border-strong); margin-top: 6px; color: var(--primary-dark); }

.cart-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-img { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: #f5efe4; flex-shrink: 0; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: .95rem; }
.cart-item-meta { font-size: .78rem; color: var(--text-muted); }
.cart-item-total { font-weight: 700; color: var(--primary-dark); font-size: .95rem; }
.cart-item-remove {
  background: none; border: 0; color: var(--danger);
  cursor: pointer; font-size: 1.1rem; padding: 4px;
}

/* ===========================
   Order form
   =========================== */
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: .88rem; font-weight: 500; color: var(--text-muted);
}
.form input, .form textarea {
  padding: 10px 14px; border: 1.5px solid var(--border-strong);
  border-radius: 12px; font-family: inherit; font-size: .95rem;
  color: var(--text); background: #fff; outline: none;
  transition: border-color .18s;
}
.form input:focus, .form textarea:focus { border-color: var(--primary); }
.form textarea { resize: vertical; min-height: 60px; }

.order-summary {
  background: #fafafa; border-radius: 12px; padding: 12px 14px;
  font-size: .9rem; margin: 6px 0; border: 1px solid var(--border);
}
.order-summary .row { display: flex; justify-content: space-between; padding: 3px 0; }
.order-summary .row.total { font-weight: 800; color: var(--primary-dark); border-top: 1px dashed var(--border-strong); padding-top: 8px; margin-top: 4px; }

.success {
  background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
  padding: 20px; border-radius: 12px; text-align: center;
  margin-top: 16px; font-weight: 500;
}

/* ===========================
   Toast
   =========================== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111; color: #fff; padding: 12px 22px;
  border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 100;
  font-size: .92rem; font-weight: 500;
  animation: pop .2s ease;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: #1a1a1a; color: #e5e5e5; padding: 34px 0;
  margin-top: 40px;
}
.footer-inner {
  display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 20px; align-items: center;
}
.footer-title { font-size: 1.15rem; font-weight: 800; }
.footer-tag { color: #999; font-size: .85rem; }
.footer-info { color: #ccc; font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.footer-copy { color: #888; font-size: .82rem; }

/* ===========================
   Animations
   =========================== */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slide-in-l {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 780px) {
  .hero-inner { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .hero-visual { font-size: 8rem; }
  .hero-text h1 { font-size: 1.7rem; }
  .hero-cta { justify-content: center; }
  .filters-wrap { top: 63px; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 480px) {
  .header-link { display: none; }
  .brand-tag { display: none; }
  .brand-name { font-size: .95rem; }
  .header-inner { padding: 10px 16px; }
  .hero { padding: 24px 0 16px; }
  .hero-text h1 { font-size: 1.5rem; }
  .items-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .item-name { font-size: .9rem; }
  .item-price { font-size: .95rem; }
  .item-desc { font-size: .76rem; -webkit-line-clamp: 2; }
  .modal-panel { max-height: 88vh; }
  .drawer-panel { max-width: 100%; }
  .cart-btn { padding: 6px 10px; font-size: .85rem; }
  .category-title { font-size: 1.15rem; }
  .filters-wrap { top: 55px; }
}
