@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* ========== CSS Variables ========== */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #34d399;
  --primary-glow: rgba(16, 185, 129, 0.25);

  --bg-deep: #060d0b;
  --bg-dark: #0a1512;
  --bg-surface: #0f1f1a;
  --bg-elevated: #152820;
  --bg-card: #1a3028;
  --bg-card-hover: #1f3830;

  --border-subtle: rgba(16, 185, 129, 0.1);
  --border-glow: rgba(16, 185, 129, 0.35);

  --text-primary: #f0fdf9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.2);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; }

/* ========== Utilities ========== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* ========== Glassmorphism Card ========== */
.glass {
  background: rgba(26, 48, 40, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-glow);
  color: var(--primary-light);
}
.btn-outline:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }

/* ========== Inputs ========== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.input, select.input, textarea.input {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  padding: 11px 14px;
  transition: all var(--transition);
  width: 100%;
  outline: none;
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-card);
}
select.input option {
  background: var(--bg-card);
  color: var(--text-primary);
}
textarea.input { resize: vertical; min-height: 90px; }

/* ========== Cards ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

/* ========== Badge ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}
.badge-success { background: rgba(16,185,129,0.15); color: var(--primary-light); border: 1px solid rgba(16,185,129,0.3); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--accent-amber); border: 1px solid rgba(245,158,11,0.3); }
.badge-danger  { background: rgba(239,68,68,0.15);  color: var(--accent-red);   border: 1px solid rgba(239,68,68,0.3); }
.badge-info    { background: rgba(59,130,246,0.15);  color: #93c5fd;             border: 1px solid rgba(59,130,246,0.3); }

/* ========== Spinner ========== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Toast Notification ========== */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease forwards;
  pointer-events: all;
  min-width: 280px;
  font-size: 14px;
  font-weight: 600;
}
.toast.success { border-color: rgba(16,185,129,0.5); color: var(--primary-light); }
.toast.error   { border-color: rgba(239,68,68,0.5);  color: #fca5a5; }
.toast.info    { border-color: rgba(59,130,246,0.5);  color: #93c5fd; }
.toast.hide    { animation: slideUp 0.3s ease forwards; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp   { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 13, 11, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}
.modal-close {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--accent-red); border-color: rgba(239,68,68,0.4); }

/* ========== Header ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 13, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 12px var(--primary-glow);
}
.logo-text {
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search Bar */
.search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  padding: 10px 44px 10px 16px;
  transition: all var(--transition);
  outline: none;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.search-input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Cart button */
.cart-btn {
  position: relative;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-primary);
  font-size: 20px;
}
.cart-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  box-shadow: 0 0 16px var(--primary-glow);
}
.cart-count {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--primary);
  color: #000;
  font-weight: 900;
  font-size: 11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-deep);
}

/* ========== Hero Section ========== */
.hero {
  padding: 48px 0 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(16,185,129,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.hero-subtitle {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
  margin-inline: auto;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
}
.stat-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary-light);
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== Categories Filter ========== */
.categories-section {
  padding: 16px 0 24px;
}
.categories-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.cat-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ========== Products Grid ========== */
.products-section {
  padding: 0 0 60px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.product-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow), var(--shadow-md);
}
.product-emoji-box {
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  position: relative;
  overflow: hidden;
}
.product-emoji-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(16,185,129,0.08), transparent 70%);
}
.product-body { padding: 14px; }
.product-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}
.product-store {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-light);
}
.product-price span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}
.add-to-cart-btn {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow: 0 2px 10px var(--primary-glow);
}
.add-to-cart-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 18px rgba(16,185,129,0.5);
}
.out-of-stock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 13, 11, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
}
.out-of-stock-label {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
}

/* ========== Cart Drawer ========== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 13, 11, 0.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.cart-overlay.active { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 380px;
  max-width: 100vw;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  z-index: 501;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}
.cart-overlay.active .cart-drawer { transform: translateX(0); }

.cart-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.cart-title { font-size: 18px; font-weight: 800; }

.cart-items { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.cart-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all var(--transition);
}
.cart-item-emoji { font-size: 30px; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.cart-item-store { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 26px;
  height: 26px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-value { font-weight: 700; font-size: 14px; min-width: 20px; text-align: center; }
.cart-item-price { font-weight: 800; color: var(--primary-light); font-size: 15px; flex-shrink: 0; }
.remove-item-btn {
  width: 26px;
  height: 26px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 6px;
  color: #fca5a5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.remove-item-btn:hover { background: rgba(239,68,68,0.2); }

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.cart-total-label { font-size: 16px; color: var(--text-secondary); }
.cart-total-amount { font-size: 24px; font-weight: 900; color: var(--primary-light); }
.cart-total-currency { font-size: 14px; color: var(--text-muted); }

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
}
.cart-empty-icon { font-size: 56px; opacity: 0.5; }
.cart-empty-text { font-size: 15px; font-weight: 600; }

/* ========== Checkout Modal ========== */
.checkout-modal { max-width: 560px; }

.payment-method-group { display: flex; gap: 10px; margin-top: 4px; }
.payment-option {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  background: var(--bg-card);
}
.payment-option:hover { border-color: var(--border-glow); }
.payment-option.active {
  border-color: var(--primary);
  background: rgba(16,185,129,0.08);
}
.payment-icon { font-size: 24px; margin-bottom: 4px; }
.payment-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.payment-option.active .payment-label { color: var(--primary-light); }

.bank-info-box {
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
  display: none;
}
.bank-info-box.visible { display: block; }
.bank-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.bank-info-label { font-size: 13px; color: var(--text-muted); }
.bank-info-value { font-size: 14px; font-weight: 700; color: var(--primary-light); }

.order-summary-box {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
}
.order-summary-title { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.order-summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.order-total-row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; padding-top: 8px; border-top: 1px solid var(--border-subtle); margin-top: 4px; }
.order-total-row .amount { color: var(--primary-light); }

.whatsapp-btn {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
}
.whatsapp-btn:hover { box-shadow: 0 6px 24px rgba(37, 211, 102, 0.55); transform: translateY(-2px); }

/* ========== Empty State ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 14px;
}
.empty-icon { font-size: 64px; opacity: 0.4; }
.empty-title { font-size: 20px; font-weight: 700; color: var(--text-secondary); }
.empty-text { font-size: 14px; color: var(--text-muted); }

/* ========== Loading State ========== */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-lg);
}
.skeleton-card { height: 220px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ========== Footer ========== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ========== Merchant Dashboard ========== */
.merchant-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active {
  background: rgba(16,185,129,0.12);
  color: var(--primary-light);
  border-color: rgba(16,185,129,0.25);
}
.nav-icon { font-size: 18px; flex-shrink: 0; }
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-subtle);
}

.main-content {
  background: var(--bg-dark);
  padding: 28px;
  overflow-y: auto;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.page-title { font-size: 26px; font-weight: 900; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-glow); transform: translateY(-2px); }
.stat-card-icon { font-size: 28px; margin-bottom: 12px; }
.stat-card-value { font-size: 28px; font-weight: 900; color: var(--primary-light); }
.stat-card-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Merchant Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: right;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg-card); }
.data-table .product-emoji-cell { font-size: 24px; }

/* Orders */
.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all var(--transition);
}
.order-card:hover { border-color: var(--border-glow); }
.order-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.order-id { font-size: 12px; color: var(--text-muted); font-family: monospace; }
.order-date { font-size: 12px; color: var(--text-muted); }
.order-customer { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.order-contact { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.order-items-mini { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.order-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.order-total { font-size: 18px; font-weight: 800; color: var(--primary-light); }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Auth form styles */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}
.auth-container::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.auth-tab.active {
  background: var(--primary);
  color: #000;
  box-shadow: 0 2px 10px var(--primary-glow);
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.divider { border: none; border-top: 1px solid var(--border-subtle); margin: 4px 0; }

/* Panel pages */
.panel-section {
  display: none;
}
.panel-section.active {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; }
  .search-bar { order: 3; width: 100%; max-width: 100%; }
  .hero { padding: 28px 0 20px; }
  .merchant-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; right: -280px; width: 260px; z-index: 200; transition: right 0.3s ease; height: 100vh; }
  .sidebar.open { right: 0; }
  .main-content { padding: 16px; }
  .cart-drawer { width: 100vw; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .modal { padding: 20px; }
  .auth-card { padding: 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
