/* menu-template.css — الأنماط الثابتة لصفحة المنيو (تم فصلها من menu.php لتحسين التنظيم والأداء وتفعيل الكاش) */
* { margin:0; padding:0; box-sizing:border-box; }
input, select, textarea, button { font-size: 16px; }
/* Touch scroll fix: never block the page touch events.
   Zoom is disabled by viewport only; scrolling remains native. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; height: auto; min-height: 100%; overflow-y: auto; }
body {
  font-family: var(--font-ar);
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
body.lang-en { font-family: var(--font-en); direction: ltr; }
body.lang-en * { text-align: left; }

/* Animated background */
.bg-pattern {
  position: fixed; inset: 0; z-index: -1;
  background: 
    radial-gradient(ellipse at 20% 20%, color-mix(in srgb, var(--primary) 8%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, color-mix(in srgb, var(--primary) 5%, transparent) 0%, transparent 50%),
    var(--page-bg);
}

/* Header */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; gap: 16px;
}
.logo-wrap { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.logo-placeholder {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--button-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; border: 2px solid var(--gold);
}
.logo-text { display: flex; flex-direction: column; }
.logo-name {
  font-size: 1.1rem; font-weight: 800;
  background: var(--primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.logo-tagline { font-size: 0.65rem; color: var(--text-muted); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s; text-decoration: none;
}
.btn-icon:hover { background: var(--gold); border-color: var(--primary); color: var(--button-text); transform: scale(1.05); }
.lang-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
  background: var(--button-bg);
  border: none; color: var(--button-text); cursor: pointer; transition: all 0.25s;
  letter-spacing: 0.5px;
}
.lang-btn:hover { transform: scale(1.05); box-shadow: 0 4px 15px color-mix(in srgb, var(--primary) 35%, transparent); }
.cart-btn {
  position: relative;
  background: var(--button-bg);
  border: none; color: var(--button-text); border-radius: 22px;
  padding: 8px 16px; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all 0.25s;
}
.cart-btn:hover { transform: scale(1.05); box-shadow: 0 4px 20px color-mix(in srgb, var(--primary) 40%, transparent); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--badge-bg); color: var(--badge-text); font-size: 0.65rem; font-weight: 800;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.cart-count.visible { display: flex; animation: pop 0.3s ease; }
@keyframes pop { 0%{transform:scale(0)}60%{transform:scale(1.3)}100%{transform:scale(1)} }

/* Hero/Banner Slider */
.banner-slider {
  position: relative; overflow: hidden;
  max-height: 480px; min-height: 240px;
}
.banner-track { display: flex; direction: ltr; transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94); }
.banner-slide {
  min-width: 100%; position: relative; direction: rtl;
  max-height: 480px; overflow: hidden;
}
.banner-slide img {
  width: 100%; height: 100%; object-fit: cover;
  max-height: 480px;
}
.banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.7));
  display: flex; align-items: flex-end; padding: 30px;
}
.banner-text h2 { font-size: clamp(1.4rem, 4vw, 2.5rem); font-weight: 900; color: var(--badge-text); text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.banner-text p { color: rgba(255,255,255,0.85); margin-top: 6px; font-size: 0.95rem; }
.slider-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.slider-dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5);
  cursor: pointer; transition: all 0.3s;
}
.slider-dot.active { background: var(--gold); transform: scale(1.3); }

/* No banner hero */
.hero {
  text-align: center; padding: 60px 20px 40px;
  background: linear-gradient(160deg, var(--darker) 0%, var(--dark) 100%);
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 900;
  background: var(--primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1.2; margin-bottom: 12px;
}
.hero p { color: var(--text-muted); font-size: 1.05rem; max-width: 500px; margin: 0 auto; }

/* Search + Filter */
.search-section {
  max-width: 1400px; margin: 0 auto;
  padding: 24px 20px 0;
}
.search-wrap {
  position: relative; max-width: 560px; margin: 0 auto 20px;
}
.search-input {
  width: 100%; padding: 14px 50px 14px 20px;
  background: var(--input-bg); border: 1.5px solid var(--border);
  border-radius: 50px; color: var(--text); font-family: var(--font-ar);
  font-size: 0.95rem; transition: all 0.3s; outline: none;
}
.search-input:focus { border-color: var(--primary); background: var(--surface-hover); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.search-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  right: 18px; color: var(--text-muted); font-size: 16px; pointer-events: none;
}
body.lang-en .search-icon { right: auto; left: 18px; }
body.lang-en .search-input { padding: 14px 20px 14px 50px; }

/* Category Tabs */
.cat-tabs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; flex-wrap: nowrap; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; padding: 9px 20px; border-radius: 50px;
  background: var(--category-bg); border: 1.5px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 0.85rem;
  font-family: var(--font-ar); font-weight: 600; transition: all 0.25s;
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.cat-tab:hover { border-color: var(--primary); color: var(--text); }
.cat-tab.active {
  background: var(--button-bg);
  border-color: var(--primary); color: var(--button-text); font-weight: 700;
}
.cat-icon { font-size: 1.1rem; }

/* Products Grid */
.menu_products-section { max-width: 1400px; margin: 0 auto; padding: 24px 20px 100px; }
.section-title {
  font-size: 1.3rem; font-weight: 800; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
}
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}
.menu_products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
  cursor: pointer;
  position: relative;
  animation: fadeUp 0.5s ease backwards;
  backdrop-filter: blur(10px);
}
.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--primary) 25%, transparent);
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(20px); }
  to { opacity:1; transform:translateY(0); }
}
.product-img-wrap { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.product-img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-img { transform: scale(1.08); }
.product-img-placeholder {
  width: 100%; height: 100%; 
  background: linear-gradient(135deg, var(--surface), var(--surface-hover));
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}
.product-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--badge-bg);
  color: var(--badge-text); font-size: 0.7rem; font-weight: 800;
  padding: 4px 10px; border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
body.lang-en .product-badge { right: auto; left: 12px; }
.unavailable-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.unavailable-tag {
  background: var(--badge-bg); color: var(--badge-text); padding: 6px 16px;
  border-radius: 20px; font-weight: 700; font-size: 0.85rem;
}
.product-info { padding: 16px; }
.product-name {
  font-size: 1rem; font-weight: 700; margin-bottom: 6px;
  color: var(--text); line-height: 1.3;
}
.product-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price-wrap { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.product-price {
  font-size: 1.05rem; font-weight: 800;
  color: var(--price-color);
}
.product-price-old {
  font-size: 0.8rem; color: var(--text-muted);
  text-decoration: line-through;
}
.btn-add {
  flex-shrink: 0; padding: 8px 16px; border-radius: 22px;
  background: var(--button-bg);
  border: none; color: var(--button-text); font-weight: 700; font-size: 0.8rem;
  cursor: pointer; font-family: var(--font-ar);
  transition: all 0.25s; display: flex; align-items: center; gap: 5px;
}
.btn-add:hover { transform: scale(1.05); box-shadow: 0 4px 15px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-add:active { transform: scale(0.97); }

/* No results */
.no-results {
  text-align: center; padding: 60px 20px; grid-column: 1/-1;
  color: var(--text-muted);
}
.no-results .icon { font-size: 4rem; margin-bottom: 16px; }

/* Cart Panel */
.cart-panel {
  position: fixed; top: 0; right: -420px; width: 420px; max-width: 100vw;
  height: 100vh; background: var(--cart-bg);
  border-left: 1px solid var(--border);
  z-index: 280; transition: right 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
}
body.lang-en .cart-panel { right: auto; left: -420px; transition: left 0.4s cubic-bezier(0.25,0.46,0.45,0.94); border-left: none; border-right: 1px solid var(--border); }
.cart-panel.open { right: 0; }
body.lang-en .cart-panel.open { left: 0; }
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 270; opacity: 0; pointer-events: none;
  transition: opacity 0.3s; backdrop-filter: blur(4px);
}
.cart-overlay.active { opacity: 1; pointer-events: all; }
.cart-header {
  padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-header h3 { font-size: 1.1rem; font-weight: 800; }
.cart-close { background: var(--surface); border: none; color: var(--text); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 16px; transition: all 0.2s; }
.cart-close:hover { background: rgba(229,62,62,0.2); color: #e53e3e; }
.cart-items { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--category-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }
.cart-item-img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
.cart-item-price { font-size: 0.85rem; color: var(--price-color); font-weight: 600; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-btn { width: 34px; height: 34px; min-width: 34px; min-height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 16px; font-weight: 800; transition: all 0.2s; touch-action: manipulation; position: relative; z-index: 2; }
.qty-btn:hover { background: var(--gold); color: var(--button-text); border-color: var(--primary); }
.qty-val { font-size: 0.9rem; font-weight: 700; min-width: 20px; text-align: center; }
.cart-item-delete { background: rgba(229,62,62,0.10); border: 1px solid rgba(229,62,62,0.25); border-radius: 50%; color: #e53e3e; cursor: pointer; font-size: 14px; width: 34px; height: 34px; min-width: 34px; min-height: 34px; padding: 0; margin-right: auto; transition: transform 0.2s; touch-action: manipulation; position: relative; z-index: 2; }
body.lang-en .cart-item-delete { margin-right: 0; margin-left: auto; }
.cart-item-delete:hover { transform: scale(1.2); }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.cart-empty .icon { font-size: 3rem; margin-bottom: 12px; }
.cart-footer {
  padding: 16px; border-top: 1px solid var(--border);
  background: var(--category-bg);
}
.cart-notes { width: 100%; margin-bottom: 12px; padding: 10px 14px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: var(--font-ar); font-size: 0.85rem; resize: none; outline: none; }
.cart-notes:focus { border-color: var(--primary); }
.table-input { width: 100%; margin-bottom: 8px; padding: 10px 14px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: var(--font-ar); font-size: 0.85rem; outline: none; }
.table-input:focus { border-color: var(--primary); }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cart-total-label { font-size: 0.9rem; color: var(--text-muted); }
.cart-total-price { font-size: 1.2rem; font-weight: 800; color: var(--price-color); }
.btn-order {
  width: 100%; padding: 14px; border-radius: 12px;
  background: var(--button-bg);
  border: none; color: var(--button-text); font-size: 1rem; font-weight: 800;
  cursor: pointer; font-family: var(--font-ar);
  transition: all 0.3s; letter-spacing: 0.5px;
}
.btn-order:hover { box-shadow: 0 6px 25px color-mix(in srgb, var(--primary) 40%, transparent); transform: translateY(-2px); }
.btn-order:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.checkout-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.70);backdrop-filter:blur(8px);z-index:310;display:none;align-items:center;justify-content:center;padding:18px}
.checkout-modal-box{width:min(94vw,480px);max-height:90vh;overflow-y:auto;background:var(--card-bg);border:1px solid var(--border);border-radius:24px;box-shadow:0 22px 70px rgba(0,0,0,.38);animation:fadeUp .28s ease;color:var(--text)}
.checkout-modal-header{padding:18px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--header-bg);position:sticky;top:0;z-index:1}
.checkout-modal-title{font-weight:900;font-size:1rem;display:flex;align-items:center;gap:8px}
.checkout-modal-close{width:36px;height:36px;border-radius:50%;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;font-size:1rem}
.checkout-modal-body{padding:18px 20px}
.checkout-choice-grid{display:flex;flex-direction:column;gap:12px;margin-bottom:14px}
.checkout-choice{width:100%;border:1.5px solid var(--border);background:var(--category-bg);color:var(--text);border-radius:16px;padding:16px;text-align:right;font-family:var(--font-ar);cursor:pointer;display:flex;align-items:center;gap:12px;transition:.22s}
.checkout-choice:hover{border-color:var(--primary);transform:translateY(-2px);box-shadow:0 8px 24px rgba(0,0,0,.10)}
.checkout-choice-icon{width:44px;height:44px;border-radius:14px;background:var(--button-bg);color:var(--button-text);display:flex;align-items:center;justify-content:center;font-size:1.15rem;flex-shrink:0}
.checkout-choice-title{font-weight:900;font-size:.95rem}
.checkout-choice-sub{font-size:.78rem;color:var(--text-muted);margin-top:3px}
.checkout-form-section{display:none}
.checkout-input{width:100%;margin-bottom:10px;padding:12px 14px;background:var(--input-bg);border:1.5px solid var(--border);border-radius:12px;color:var(--text);font-family:var(--font-ar);font-size:.92rem;outline:none}
.checkout-input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 18%,transparent)}
.checkout-summary{margin-bottom:14px;padding:12px;background:var(--category-bg);border:1px solid var(--border);border-radius:14px;max-height:180px;overflow-y:auto}
.checkout-summary-line{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px solid color-mix(in srgb,var(--border) 65%,transparent);font-size:.84rem}
.checkout-summary-line:last-child{border-bottom:none}
.checkout-total-box{display:flex;flex-direction:column;gap:6px;margin:12px 0;padding:12px 14px;background:var(--category-bg);border:1px solid var(--border);border-radius:14px}
.checkout-total-row{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:.88rem}
.checkout-total-row.final{font-weight:900;font-size:1.05rem;color:var(--price-color);border-top:1px solid var(--border);padding-top:8px;margin-top:2px}
.checkout-back{margin-bottom:12px;background:transparent;border:none;color:var(--primary);font-family:var(--font-ar);font-weight:800;cursor:pointer}

/* Order success */
.order-success {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.order-success.show { opacity: 1; pointer-events: all; }
.success-box {
  background: var(--cart-bg); border: 1px solid var(--border);
  border-radius: 24px; padding: 40px; text-align: center;
  max-width: 400px; width: 90%;
  transform: scale(0.8); transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.order-success.show .success-box { transform: scale(1); }
.success-icon { font-size: 5rem; margin-bottom: 16px; }
.success-box h3 { font-size: 1.5rem; font-weight: 800; color: var(--price-color); margin-bottom: 8px; }
.success-box p { color: var(--text-muted); margin-bottom: 20px; }
.order-number { font-size: 1.1rem; font-weight: 800; background: var(--surface); padding: 12px 20px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 20px; }


/* Restaurant Info Footer */
.info-footer {
  margin: -70px auto 110px; max-width: 1400px; padding: 0 20px;
}
.info-footer-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px;
  padding: 20px; display: grid; grid-template-columns: 1.4fr repeat(3, auto); gap: 14px; align-items: center;
  box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.info-footer-title { font-size: 1.05rem; font-weight: 900; color: var(--price-color); margin-bottom: 4px; }
.info-footer-text { color: var(--text-muted); font-size: .88rem; }
.info-footer-link { display:flex; align-items:center; gap:8px; color:var(--text); background:var(--surface); border:1px solid var(--border); padding:10px 12px; border-radius:12px; text-decoration:none; font-size:.85rem; white-space:nowrap; }
.info-footer-link i { color: var(--price-color); }
@media (max-width: 768px) {
  .info-footer { margin: -82px auto 125px; padding: 0 14px; }
  .info-footer-card { grid-template-columns: 1fr; text-align: center; gap: 10px; }
  .info-footer-link { justify-content: center; white-space: normal; }
}

/* Bottom nav for mobile */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bottom-nav-bg); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 90;
}
.bottom-nav-inner { display: flex; justify-content: space-around; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-muted); cursor: pointer; font-size: 0.65rem; padding: 4px 12px; border-radius: 8px; transition: all 0.2s; text-decoration: none; position: relative; min-width: 58px; }
.nav-item.active, .nav-item:hover { color: var(--price-color); }
.nav-item i { font-size: 1.2rem; }
.nav-icon-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.bottom-cart-count {
  position: absolute; top: -9px; right: -12px;
  background: var(--badge-bg); color: var(--badge-text); font-size: 0.62rem; font-weight: 900;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--bottom-nav-bg); box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.bottom-cart-count.visible { display: flex; animation: pop 0.3s ease; }

/* WiFi badge */
.wifi-badge {
  position: fixed; bottom: 80px; left: 16px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 14px;
  font-size: 0.75rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
  backdrop-filter: blur(10px); z-index: 85;
  display: none;
}
.wifi-badge.visible { display: flex; }

/* Scroll top */
.scroll-top {
  position: fixed; bottom: 80px; right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--button-bg);
  border: none; color: var(--button-text); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(20px);
  transition: all 0.3s; z-index: 80;
  box-shadow: 0 4px 15px color-mix(in srgb, var(--primary) 35%, transparent);
}
.scroll-top.show { opacity: 1; transform: translateY(0); }

/* Toast */
.toast {
  position: fixed; top: 80px; right: 16px; z-index: 250;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; font-weight: 600;
  transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  backdrop-filter: blur(10px); max-width: 320px;
  box-shadow: var(--shadow);
}
body.lang-en .toast { right: auto; left: 16px; transform: translateX(-120%); }
.toast.show { transform: translateX(0); }
.toast.success { border-color: #38a169; }
.toast.error { border-color: #e53e3e; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px;
}
@keyframes shimmer { from{background-position:200% 0} to{background-position:-200% 0} }

/* Featured strip */
.featured-strip { padding: 24px 20px 0; max-width: 1400px; margin: 0 auto; }
.featured-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.featured-scroll::-webkit-scrollbar { display: none; }
.featured-mini {
  flex-shrink: 0; width: 150px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; cursor: pointer;
  transition: all 0.3s; text-align: center;
}
.featured-mini:hover { border-color: var(--primary); transform: translateY(-3px); }
.featured-mini img { width: 100%; height: 100px; object-fit: cover; }
.featured-mini-placeholder { width: 100%; height: 100px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; background: var(--surface); }
.featured-mini-info { padding: 8px 10px; }
.featured-mini-name { font-size: 0.78rem; font-weight: 700; margin-bottom: 4px; }
.featured-mini-price { font-size: 0.75rem; color: var(--price-color); font-weight: 600; }

@media (max-width: 768px) {
  .bottom-nav { display: block; }
  .menu_products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .menu_products-section { padding-bottom: 120px; }
  .header-inner { padding: 10px 0; }
  .logo-tagline { display: none; }
}
@media (max-width: 480px) {
  .menu_products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cart-panel { width: min(100vw, 420px); right: -100vw; }
  body.lang-en .cart-panel { left: -100vw; }
  .banner-slider { min-height: 180px; }
  .banner-slide, .banner-slide img { height: 220px; }
  .product-info { padding: 10px; }
  .product-name { font-size: 0.88rem; }
  .product-desc { display: none; }
}


/* Mobile performance patch: lighter rendering on phones */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .header, .cart-panel, .cart-overlay, .image-modal, .bottom-nav, .wa-modal-overlay, #waFloatBtn, .scroll-top {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .product-card, .featured-mini, .banner-section, .cart-item {
    animation: none !important;
    transition: transform .15s ease, opacity .15s ease !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.22) !important;
  }
  .product-card { contain: none !important; }
  .product-card:hover, .product-card:active { transform: none !important; }
  .product-img { transition: none !important; }
  .product-card:hover .product-img { transform: none !important; }
  .menu_products-grid { gap: 12px !important; }
  .product-body { padding: 12px !important; }
  .banner-track { transition: transform .28s ease !important; }
  .skeleton { animation: none !important; }
  html, body, .menu_products-section, .product-card, .banner-section, .search-section { touch-action: auto !important; }
  .cat-tabs, .featured-scroll { touch-action: auto !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* Strong mobile speed + no zoom patch */
@media (max-width: 768px) {
  html { scroll-behavior: auto; }
  body { overscroll-behavior-y: auto; }
  .bg-pattern::before, .bg-pattern::after { display:none !important; }
  .product-card, .featured-mini, .cat-tab, .banner-slider, .info-footer-card {
    will-change: auto !important;
    filter: none !important;
  }
  .product-img-wrap { background: rgba(255,255,255,.035); }
  .product-img, .featured-mini img { transform:none !important; object-fit:cover; }
  .menu_products-grid { align-items: stretch; }
}


/* Emergency mobile touch/scroll override */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
  html, body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  body {
    position: relative !important;
    overscroll-behavior-y: auto !important;
  }
  .bg-pattern {
    pointer-events: none !important;
  }
  .menu_products-section, .menu_products-grid, .product-card, .product-info,
  .banner-slider, .banner-track, .banner-slide, .search-section,
  .featured-strip, .info-footer {
    touch-action: auto !important;
    pointer-events: auto;
  }
  .cat-tabs, .featured-scroll {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .cart-overlay:not(.active), .order-success:not(.show) {
    pointer-events: none !important;
  }
  .wa-modal-overlay:not([style*="display: flex"]) {
    pointer-events: none !important;
  }
}


/* Scroll-root mobile layout + stable bottom navigation.
   On Android browsers, fixed bars jump when the browser toolbar hides/shows.
   We keep the browser page itself fixed and scroll only .app-scroll on phones,
   so the bottom menu stays visually stable at the screen bottom. */
.app-scroll { min-height: 100vh; }

@media (max-width: 768px) {
  :root { --bottom-nav-height: 72px; }

  html, body {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body {
    position: fixed !important;
    inset: 0 !important;
    touch-action: auto !important;
  }

  .app-scroll {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    padding-bottom: calc(var(--bottom-nav-height) + 34px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--page-bg) !important;
  }

  .app-scroll .header {
    position: sticky !important;
    top: 0 !important;
  }

  .bottom-nav {
    display: block !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    min-height: var(--bottom-nav-height) !important;
    height: auto !important;
    padding: 7px 0 calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--bottom-nav-bg) !important;
    border-top: 1px solid var(--border) !important;
    box-shadow: 0 -10px 28px rgba(0,0,0,.35) !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    translate: none !important;
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
    z-index: 220 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .bottom-nav-inner {
    height: 58px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
  }

  .bottom-nav, .bottom-nav *, .nav-item, .nav-item *, .bottom-cart-count.visible {
    transition: none !important;
    animation: none !important;
  }

  .nav-item {
    min-width: 58px !important;
    padding: 5px 8px !important;
    transform: none !important;
  }

  .nav-item i { font-size: 1.28rem !important; }
  .nav-item span:not(.bottom-cart-count) { line-height: 1.15 !important; }

  .menu_products-section {
    padding-bottom: calc(var(--bottom-nav-height) + 70px) !important;
  }

  .info-footer {
    margin-bottom: calc(var(--bottom-nav-height) + 32px) !important;
  }

  .scroll-top, #waFloatBtn, .wifi-badge {
    transition: opacity .15s linear !important;
  }

  .bottom-nav, .bottom-nav *, .cart-panel, .cart-panel *, .wa-modal-overlay, .wa-modal-overlay *, .order-success, .order-success * {
    touch-action: auto !important;
  }

  .cart-items {
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Keep the cart checkout button above the mobile bottom bar. */
  .cart-overlay.active {
    z-index: 270 !important;
  }

  .cart-panel.open {
    z-index: 280 !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  .cart-footer {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* القالب الأساسي يبقى كما هو بدون أي تغيير */

/* القالب الحديث: ستايل نظيف وبطاقات أكبر وحواف ناعمة */
body.menu-template-modern {
  --page-bg:#f6f8fb;
  --card-bg:#ffffff;
  --header-bg:rgba(255,255,255,.96);
  --bottom-nav-bg:rgba(255,255,255,.96);
  --surface:#ffffff;
  --category-bg:#ffffff;
  --border:#e5e7eb;
  --text:#111827;
  --text-muted:#6b7280;
  --button-bg:linear-gradient(135deg,var(--primary),color-mix(in srgb,var(--primary) 70%,#2563eb));
  --radius:26px;
  --radius-sm:18px;
}
body.menu-template-modern .bg-pattern{opacity:.55}
body.menu-template-modern .header{box-shadow:0 10px 28px rgba(15,23,42,.06)}
body.menu-template-modern .product-card{border-radius:26px;border:1px solid #edf0f4;box-shadow:0 18px 45px rgba(15,23,42,.08);overflow:hidden}
body.menu-template-modern .product-card:hover{transform:translateY(-3px)}
body.menu-template-modern .cat-tab{border-radius:999px}
body.menu-template-modern .banner-slider{border-radius:0 0 34px 34px;overflow:hidden}

/* القالب الكلاسيك: طابع فاخر هادئ بدون تغيير القالب الأساسي */
body.menu-template-classic {
  --page-bg:#fffaf0;
  --card-bg:#fffdf7;
  --header-bg:#fff8e7;
  --bottom-nav-bg:#fff8e7;
  --surface:#fffdf7;
  --category-bg:#fff6df;
  --border:#ead9b8;
  --text:#3f2a16;
  --text-muted:#7b6148;
  --button-bg:linear-gradient(135deg,#8b5e34,#c79a4b);
  --primary:#8b1e1e;
  --gold:#b88733;
  --radius:16px;
  --radius-sm:10px;
}
body.menu-template-classic .header{border-bottom:2px solid #ead9b8}
body.menu-template-classic .logo-img,body.menu-template-classic .logo-placeholder{border-radius:14px}
body.menu-template-classic .product-card{border:1px solid #ead9b8;border-radius:16px;box-shadow:0 12px 26px rgba(63,42,22,.08)}
body.menu-template-classic .product-name{font-family:Georgia, 'Times New Roman', serif}
body.menu-template-classic .cat-tab{border-radius:12px;border-color:#e2cda5}
body.menu-template-classic .banner-overlay{background:linear-gradient(to bottom,transparent 25%,rgba(63,42,22,.72));}
.closed-orders-box{margin:12px 18px;padding:14px 16px;border-radius:16px;background:#fff1f2;color:#991b1b;border:1px solid #fecdd3;font-weight:800;text-align:center}
.coupon-row{display:flex;gap:8px;margin:10px 0}.coupon-row input{flex:1}
