/* =============================================
   وصلك — Waslak | Main Stylesheet
   Inspired by Thuisbezorgd.nl
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #FF5722;
  --primary-dark:  #E64A19;
  --primary-light: #FF7043;
  --primary-pale:  #FFF0EA;
  --dark:          #1A1A1A;
  --gray-dark:     #3D3D3D;
  --gray:          #767676;
  --gray-light:    #B0B0B0;
  --border:        #E8E0D8;
  --bg:            #F7F2EE;
  --white:         #FFFFFF;
  --green:         #2E7D32;
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.16);
  --radius-sm:     8px;
  --radius-md:     16px;
  --radius-lg:     24px;
  --radius-full:   999px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--dark);
  font-size: 15px;
  line-height: 1.6;
  direction: rtl;
}

/* ===== UTILITY ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-full);
  font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; border: none; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: white; color: var(--dark); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.text-primary { color: var(--primary); }
.text-gray { color: var(--gray); }
.fw-900 { font-weight: 900; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.flex { display: flex; } .items-center { align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700;
}
.badge-green { background: #E8F5E9; color: var(--green); }
.badge-orange { background: var(--primary-pale); color: var(--primary); }
.badge-gray { background: #F0F0F0; color: var(--gray); }


/* ===== TOPBAR — في الـ header.php مباشرة ===== */

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
  padding: 64px 0 80px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,87,34,0.15) 0%, transparent 60%);
}
.hero-content { position: relative; z-index: 1; max-width: 620px; }
.hero-label {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,87,34,0.15); border: 1px solid rgba(255,87,34,0.3);
  color: var(--primary-light); padding: 6px 16px;
  border-radius: var(--radius-full); font-size: 0.85rem; font-weight: 700;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 900; color: white;
  line-height: 1.2; margin-bottom: 16px;
}
.hero h1 em { color: var(--primary); font-style: normal; }
.hero p { color: #A0A0A0; font-size: 1.05rem; margin-bottom: 32px; }

.hero-search {
  display: flex; background: white;
  border-radius: var(--radius-full); overflow: hidden;
  box-shadow: var(--shadow-lg); max-width: 560px;
}
.hero-search input {
  flex: 1; border: none; outline: none;
  padding: 16px 24px; font-family: 'Cairo', sans-serif;
  font-size: 1rem; color: var(--dark);
}
.hero-search button {
  background: var(--primary); color: white; border: none;
  padding: 16px 28px; font-family: 'Cairo', sans-serif;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: background 0.2s; white-space: nowrap;
}
.hero-search button:hover { background: var(--primary-dark); }

.hero-stats {
  display: flex; gap: 32px; margin-top: 28px;
}
.stat { }
.stat-num { font-size: 1.5rem; font-weight: 900; color: white; }
.stat-label { font-size: 0.78rem; color: #888; margin-top: 2px; }

/* ===== CATEGORIES BAR ===== */
.cats-bar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 0; position: sticky; top: 68px; z-index: 400;
}
.cats-scroll {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 12px 0; scrollbar-width: none;
}
.cats-scroll::-webkit-scrollbar { display: none; }
.cat-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 20px; border-radius: var(--radius-md);
  background: none; border: 2px solid transparent;
  font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 0.82rem;
  color: var(--gray); cursor: pointer; transition: all 0.2s; white-space: nowrap;
  min-width: 80px;
}
.cat-btn .cat-emoji { font-size: 1.5rem; }
.cat-btn:hover { background: var(--primary-pale); color: var(--primary); }
.cat-btn.active {
  background: var(--primary-pale); color: var(--primary);
  border-color: var(--primary);
}

/* ===== SECTION ===== */
.section { padding: 40px 0; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-size: 1.4rem; font-weight: 900; }
.section-sub { color: var(--gray); font-size: 0.9rem; margin-top: 4px; }
.see-all { color: var(--primary); font-weight: 700; font-size: 0.9rem; text-decoration: none; }
.see-all:hover { text-decoration: underline; }

/* ===== RESTAURANT CARDS ===== */
.restaurants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.rest-card {
  background: white; border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s;
  text-decoration: none; color: inherit; display: block;
}
.rest-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.rest-cover {
  width: 100%; height: 160px; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 4.5rem;
  overflow: hidden;
}
.rest-cover img { width: 100%; height: 100%; object-fit: cover; }
.rest-cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
}
.rest-badges {
  position: absolute; top: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.rest-body { padding: 16px 18px 20px; }
.rest-name { font-size: 1.1rem; font-weight: 800; margin-bottom: 6px; }
.rest-meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 12px; color: var(--gray); font-size: 0.82rem; margin-bottom: 12px;
}
.rest-meta-item { display: flex; align-items: center; gap: 4px; }
.rest-meta-item.rating { color: var(--dark); font-weight: 700; }
.rest-meta-item.rating span { color: #F5A623; }
.rest-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.rest-tag {
  background: var(--bg); color: var(--gray-dark);
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
}
.free-delivery { color: var(--green) !important; font-weight: 700; }

/* ===== RESTAURANT PAGE ===== */
.rest-hero {
  background: var(--dark); color: white;
  padding: 32px 0;
}
.rest-hero-inner {
  display: flex; align-items: flex-start; gap: 24px;
}
.rest-logo-big {
  width: 100px; height: 100px; border-radius: var(--radius-md);
  background: var(--bg); display: flex; align-items: center;
  justify-content: center; font-size: 3.5rem; flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.1);
}
.rest-details h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 8px; }
.rest-details .meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.9rem; color: #aaa; }
.rest-details .meta .rating { color: white; font-weight: 700; }

.rest-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; margin-top: 32px; }

/* Menu */
.menu-section { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.menu-cat-header {
  background: var(--bg); padding: 14px 20px;
  font-weight: 800; font-size: 1rem; color: var(--dark);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 120px;
}
.menu-item {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: #FAFAFA; }
.menu-item-emoji { font-size: 2.2rem; flex-shrink: 0; }
.menu-item-info { flex: 1; }
.menu-item-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 3px; }
.menu-item-desc { color: var(--gray); font-size: 0.82rem; line-height: 1.5; }
.menu-item-price { font-weight: 800; color: var(--dark); font-size: 1rem; white-space: nowrap; margin-left: 12px; }
.add-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: white; border: none;
  font-size: 1.4rem; font-weight: 300; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.add-btn:hover { background: var(--primary-dark); transform: scale(1.1); }
.qty-control {
  display: flex; align-items: center; gap: 8px;
}
.qty-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--primary); background: none;
  color: var(--primary); font-size: 1.1rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.qty-btn:hover { background: var(--primary); color: white; }
.qty-num { font-weight: 800; font-size: 1rem; min-width: 20px; text-align: center; }

/* Cart Sidebar */
.cart-sidebar {
  position: sticky; top: 100px; height: fit-content;
  background: white; border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
}
.cart-header {
  padding: 18px 20px; background: var(--dark); color: white;
  font-size: 1rem; font-weight: 800;
  display: flex; justify-content: space-between; align-items: center;
}
.cart-body { padding: 0; }
.cart-empty { padding: 40px 20px; text-align: center; color: var(--gray); }
.cart-empty .icon { font-size: 3rem; margin-bottom: 12px; }
.cart-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  gap: 12px;
}
.cart-item-name { font-weight: 600; font-size: 0.9rem; flex: 1; }
.cart-item-qty { color: var(--gray); font-size: 0.8rem; }
.cart-item-price { font-weight: 800; font-size: 0.9rem; white-space: nowrap; }
.cart-item-remove {
  background: none; border: none; color: var(--gray-light);
  cursor: pointer; font-size: 1rem; padding: 2px;
}
.cart-item-remove:hover { color: #e53935; }
.cart-footer { padding: 16px 20px; }
.cart-totals { margin-bottom: 16px; }
.cart-row {
  display: flex; justify-content: space-between;
  font-size: 0.88rem; color: var(--gray); margin-bottom: 8px;
}
.cart-row.total {
  font-size: 1.05rem; font-weight: 900; color: var(--dark);
  padding-top: 12px; margin-top: 4px;
  border-top: 2px solid var(--border); margin-bottom: 0;
}
.checkout-btn {
  width: 100%; padding: 16px; background: var(--primary);
  color: white; border: none; border-radius: var(--radius-full);
  font-family: 'Cairo', sans-serif; font-weight: 800; font-size: 1rem;
  cursor: pointer; transition: all 0.2s;
}
.checkout-btn:hover { background: var(--primary-dark); }
.checkout-btn:disabled { background: #ccc; cursor: not-allowed; }
.min-order-note {
  font-size: 0.78rem; color: var(--gray); text-align: center;
  margin-top: 8px;
}

/* ===== CHECKOUT ===== */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.form-card {
  background: white; border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 24px;
  margin-bottom: 16px;
  /* منع التجاوز */
  min-width: 0; overflow: hidden;
}
.form-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); font-family: 'Cairo', sans-serif;
  font-size: 0.92rem; color: var(--dark); outline: none;
  transition: border-color 0.2s; background: var(--bg);
  box-sizing: border-box; /* مهم — يمنع التجاوز */
}
.form-input:focus { border-color: var(--primary); background: white; }
.form-input.error { border-color: #e53935; }
.form-error { color: #e53935; font-size: 0.78rem; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Payment Options */
.payment-options { display: flex; flex-direction: column; gap: 12px; }
.payment-opt {
  display: flex; align-items: center; gap: 14px;
  border: 2px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; cursor: pointer; transition: all 0.2s;
  background: var(--bg);
}
.payment-opt:hover, .payment-opt.selected {
  border-color: var(--primary); background: var(--primary-pale);
}
.payment-opt input[type=radio] { display: none; }
.payment-radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.payment-opt.selected .payment-radio {
  border-color: var(--primary); background: var(--primary);
}
.payment-opt.selected .payment-radio::after {
  content: ''; width: 8px; height: 8px;
  background: white; border-radius: 50%;
}
.payment-icon-big { font-size: 2rem; }
.payment-details { flex: 1; }
.payment-name { font-weight: 800; font-size: 0.95rem; }
.payment-desc { font-size: 0.8rem; color: var(--gray); margin-top: 2px; }
.payment-badge { font-size: 0.7rem; }

/* Order Summary Sticky */
.order-summary-card {
  background: white; border-radius: var(--radius-lg);
  border: 1px solid var(--border); position: sticky; top: 100px;
  overflow: hidden;
}
.order-summary-header {
  background: var(--dark); color: white;
  padding: 16px 20px; font-weight: 800;
}
.order-summary-body { padding: 20px; }
.order-rest-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 16px; color: var(--gray); }
.summary-item {
  display: flex; justify-content: space-between;
  font-size: 0.88rem; margin-bottom: 10px;
}
.summary-item .name { flex: 1; color: var(--dark); }
.summary-item .qty { color: var(--primary); font-weight: 700; margin: 0 8px; }
.summary-item .price { font-weight: 700; }
.summary-divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.summary-total {
  display: flex; justify-content: space-between;
  font-size: 1.1rem; font-weight: 900; margin-bottom: 16px;
}
.place-order-btn {
  width: 100%; padding: 16px; background: var(--primary);
  color: white; border: none; border-radius: var(--radius-full);
  font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 1.05rem;
  cursor: pointer; transition: all 0.2s;
}
.place-order-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ===== ORDER SUCCESS ===== */
.success-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 60px 0; }
.success-card {
  background: white; border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 48px;
  max-width: 560px; width: 100%; text-align: center;
  box-shadow: var(--shadow-lg);
}
.success-icon { font-size: 5rem; margin-bottom: 16px; }
.success-card h2 { font-size: 1.8rem; font-weight: 900; margin-bottom: 8px; }
.success-card p { color: var(--gray); margin-bottom: 24px; }
.order-num-big {
  background: var(--bg); border-radius: var(--radius-md);
  padding: 16px; font-size: 1.4rem; font-weight: 900;
  color: var(--primary); margin-bottom: 24px; letter-spacing: 2px;
}
.tracking-steps { text-align: right; margin: 24px 0; }
.track-step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.track-step:last-child { border-bottom: none; }
.track-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
}
.track-dot.done { background: var(--primary); }
.track-dot.active { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-pale); }
.track-label { font-weight: 600; font-size: 0.9rem; }
.track-time { font-size: 0.8rem; color: var(--gray); }

/* ===== ADMIN ===== */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--dark); color: white; padding: 24px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-logo { padding: 0 24px 24px; font-size: 1.4rem; font-weight: 900; color: var(--primary); }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px; color: #aaa; text-decoration: none;
  font-weight: 600; font-size: 0.9rem; transition: all 0.2s;
  border-right: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
  color: white; background: rgba(255,255,255,0.05);
  border-right-color: var(--primary);
}
.admin-main { padding: 32px; background: var(--bg); }
.admin-header { margin-bottom: 28px; }
.admin-header h1 { font-size: 1.6rem; font-weight: 900; }
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: white; border-radius: var(--radius-md);
  border: 1px solid var(--border); padding: 20px;
}
.stat-card-num { font-size: 2rem; font-weight: 900; color: var(--primary); }
.stat-card-label { color: var(--gray); font-size: 0.85rem; margin-top: 4px; }

.data-table {
  background: white; border-radius: var(--radius-md);
  border: 1px solid var(--border); overflow: hidden;
}
.data-table table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--bg); padding: 12px 16px; font-weight: 800;
  font-size: 0.85rem; text-align: right; border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.88rem; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFAFA; }

/* Status Badges */
.status { padding: 4px 12px; border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 700; }
.status-pending    { background: #FFF3E0; color: #E65100; }
.status-confirmed  { background: #E3F2FD; color: #1565C0; }
.status-preparing  { background: #F3E5F5; color: #6A1B9A; }
.status-on_the_way { background: #E0F7FA; color: #00695C; }
.status-delivered  { background: #E8F5E9; color: #2E7D32; }
.status-cancelled  { background: #FFEBEE; color: #C62828; }

/* ===== FOOTER ===== */
footer {
  background: var(--dark); color: #888;
  padding: 48px 0 24px; margin-top: 60px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px; margin-bottom: 40px;
}
.footer-logo { font-size: 1.8rem; font-weight: 900; color: var(--primary); margin-bottom: 12px; }
.footer-logo span { color: white; }
.footer-desc { font-size: 0.88rem; line-height: 1.8; }
.footer-col h4 { color: white; font-weight: 800; font-size: 0.95rem; margin-bottom: 16px; }
.footer-col a {
  display: block; color: #888; text-decoration: none;
  font-size: 0.88rem; margin-bottom: 10px; transition: color 0.2s;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid #333; padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem;
}

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; }
.toast {
  background: var(--dark); color: white; padding: 14px 24px;
  border-radius: var(--radius-full); font-weight: 700; font-size: 0.9rem;
  box-shadow: var(--shadow-lg); white-space: nowrap;
  animation: toastIn 0.3s ease;
}
.toast.success { background: #2E7D32; }
.toast.error { background: #C62828; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =============================================
   NAVBAR MOBILE COMPONENTS
   ============================================= */

/* زر بحث الموبايل */
.mobile-search-btn {
  display: none;
  background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--radius-full); width: 38px; height: 38px;
  font-size: 1rem; cursor: pointer; align-items: center;
  justify-content: center; flex-shrink: 0;
  transition: border-color 0.2s;
}
.mobile-search-btn:hover { border-color: var(--primary); }

/* شريط بحث الموبايل */
.mobile-search-bar {
  border-top: 1px solid var(--border);
  padding: 10px 0;

/* =============================================
   NAVBAR MOBILE COMPONENTS (NEW)
   ============================================= */

/* زر أيقونة عام */
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gray); transition: all 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* أزرار يمين الـ navbar */
.nav-right {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}

/* User menu */
.user-wrap { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--radius-full); padding: 6px 12px 6px 8px;
  font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 0.85rem;
  cursor: pointer; color: var(--dark); transition: border-color 0.2s;
  white-space: nowrap; max-width: 160px;
}
.user-btn:hover { border-color: var(--primary); }
.u-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 900; flex-shrink: 0;
}
.u-name  { overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.u-arrow { font-size: 0.6rem; color: var(--gray); }
.u-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 175px; background: white;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); z-index: 600; overflow: hidden;
}
.u-dropdown.open { display: block; }
.u-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; text-decoration: none; color: var(--dark);
  font-weight: 600; font-size: 0.86rem; transition: background 0.15s;
}
.u-item:hover { background: var(--bg); }
.u-sep    { border: none; border-top: 1px solid var(--border); }
.u-logout { color: #e53935 !important; }

/* Cart button */
.cart-btn {
  background: var(--primary); color: white; border: none;
  border-radius: var(--radius-full); padding: 8px 14px;
  font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 0.85rem;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: background 0.2s; flex-shrink: 0; white-space: nowrap;
}
.cart-btn:hover { background: var(--primary-dark); }
.cart-icon  { font-size: 1rem; }
.cart-badge {
  background: white; color: var(--primary); width: 20px; height: 20px;
  border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-size: 0.7rem; font-weight: 900;
}

/* Mobile search bar */
.mob-search-bar {
  display: none; border-top: 1px solid var(--border);
  background: white; padding: 8px 0;
}
.mob-search-bar.open { display: block; }
.mob-search-bar input {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: var(--radius-full);
  font-family: 'Cairo', sans-serif; font-size: 0.9rem; outline: none; background: var(--bg);
}
.mob-search-bar input:focus { border-color: var(--primary); }

/* Search drop */
.search-drop {
  display: none; position: fixed; top: 62px; right: 0; left: 0;
  max-width: 520px; margin: 0 auto; background: white;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); z-index: 700; overflow: hidden;
}

/* توافق مع كود قديم */
.user-dropdown { display:none; }
.user-dropdown.open { display:block; }
.search-dropdown-wrap { display:none; }
.mobile-search-btn { display:none; }
.nav-actions { display:flex; align-items:center; gap:6px; flex-shrink:0; }

/* helpers */
.desk-only { }
.mob-only  { display: none !important; }

/* =============================================
   RESPONSIVE — TABLET ≤900px
   ============================================= */
@media (max-width: 900px) {
  .rest-layout, .checkout-grid { grid-template-columns: 1fr; }
  .cart-sidebar { position: relative; top: 0; }
  .footer-grid  { grid-template-columns: 1fr 1fr; }
  .hero-stats   { gap: 14px; }
}

/* =============================================
   RESPONSIVE — MOBILE ≤640px
   ============================================= */
@media (max-width: 640px) {

  /* منع overflow — الأهم */
  html, body    { overflow-x: hidden; }
  .container    { padding: 0 14px; }

  /* Topbar */
  .topbar { font-size: 0.7rem; padding: 5px 14px; }

  /* ── Navbar ── */
  .navbar-inner { height: 52px; gap: 5px; }
  .logo         { font-size: 1.38rem; }

  /* إخفاء عناصر الـ desktop */
  .nav-search { display: none !important; }
  .nb-desk    { display: none !important; }
  .nb-mob     { display: flex !important; }

  /* user btn: أيقونة فقط */
  .nb-user-btn {
    padding: 4px; width: 34px; height: 34px;
    border-radius: 50%; justify-content: center;
  }
  .nb-uname { display: none !important; }
  .nb-user-drop { left: auto; right: 0; }

  /* سلة */
  .nb-cart     { padding: 7px 11px; font-size: 0.8rem; gap: 4px; }
  .nav-cart    { padding: 7px 11px; font-size: 0.8rem; }

  /* Category bar */
  .cats-bar  { top: 52px; }
  .cat-btn   { padding: 7px 10px; min-width: 58px; font-size: 0.73rem; }
  .cat-emoji { font-size: 1.12rem; }

  /* Hero */
  .hero         { padding: 26px 0 36px; }
  .hero h1      { font-size: 1.48rem; line-height: 1.27; }
  .hero p       { font-size: 0.85rem; margin-bottom: 16px; }
  .hero-label   { font-size: 0.73rem; padding: 4px 11px; margin-bottom: 10px; }
  .hero-search  { max-width: 100%; }
  .hero-search input  { padding: 11px 13px; font-size: 0.85rem; }
  .hero-search button { padding: 11px 13px; font-size: 0.82rem; }
  .hero-stats   { gap: 8px; margin-top: 16px; flex-wrap: wrap; }
  .stat-num     { font-size: 1.02rem; }
  .stat-label   { font-size: 0.67rem; }

  /* Restaurants */
  .restaurants-grid { grid-template-columns: 1fr; gap: 12px; }
  .rest-cover       { height: 128px; font-size: 3.4rem; }

  /* Sections */
  .section       { padding: 20px 0; }
  .section-title { font-size: 1.08rem; }

  /* Restaurant page */
  .rest-hero        { padding: 14px 0; }
  .rest-hero-inner  { flex-direction: column; gap: 10px; }
  .rest-logo-big    { width: 58px; height: 58px; font-size: 2.2rem; }
  .rest-details h1  { font-size: 1.12rem; }
  .rest-page-body   { grid-template-columns: 1fr; padding: 12px 0 78px; }
  .menu-cat-nav     { top: 52px; }
  .item-img   { width: 64px; height: 64px; font-size: 1.85rem; }
  .item-name  { font-size: 0.85rem; }
  .item-price { font-size: 0.85rem; }
  .cart-col   { display: none; }

  /* Checkout */
  .checkout-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow: hidden;
  }
  .checkout-grid > * { min-width: 0; max-width: 100%; }
  .form-row  { grid-template-columns: 1fr; }
  .form-card { padding: 14px !important; margin-bottom: 12px !important; overflow: hidden; }
  .form-card * { max-width: 100%; box-sizing: border-box; }
  .place-order-btn { padding: 12px; font-size: 0.89rem; }
  .order-summary-card { position: relative !important; top: 0 !important; }
  input[type=range] { width: 100% !important; max-width: 100% !important; }

  /* Account */
  .profile-layout        { grid-template-columns: 1fr; padding: 12px 0 58px; gap: 10px; }
  .profile-sidebar       { position: relative; top: 0; }
  .profile-avatar-section{ padding: 14px; }
  .profile-nav           { display: flex; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .profile-nav::-webkit-scrollbar { display: none; }
  .profile-nav-item      { padding: 9px 12px; white-space: nowrap; flex-shrink: 0; border-right: none !important; border-bottom: 3px solid transparent; font-size: 0.79rem; }
  .profile-nav-item.active { border-bottom-color: var(--primary); }

  /* Auth */
  .auth-page  { grid-template-columns: 1fr; }
  .auth-left  { display: none; }
  .auth-right { padding: 16px 14px 14px; min-height: 100vh; align-items: flex-start; padding-top: 28px; }
  .auth-card  { padding: 18px 14px; box-shadow: none; }

  /* Footer */
  .footer-grid   { grid-template-columns: 1fr; gap: 16px; }
  footer         { padding: 22px 0 12px; margin-top: 20px; }
  .footer-bottom { flex-direction: column; gap: 4px; text-align: center; }

  /* Success */
  .success-card  { padding: 20px 14px; }
  .success-icon  { font-size: 2.5rem; }
  .order-num-big { font-size: 0.98rem; padding: 10px; }

  /* Toast */
  .toast-container { bottom: 68px; left: 12px; right: 12px; transform: none; width: auto; }
  .toast           { text-align: center; white-space: normal; width: 100%; }

  /* Admin */
  .admin-layout  { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

