/* ==========================================================================
   حلال ماركت — إعادة التصميم (redesign.css)
   - يُحمَّل بعد main.css / cart.css / recent-orders.css في صفحات الموقع العامة فقط
   - نفس لوحة الألوان الأصلية (أزرق #3b82f6 / #2563eb + رمادي سليت + تدرج بنفسجي)
   - لا يؤثر على لوحة التحكم (admin) لأنها لا تحمّل هذا الملف
   ========================================================================== */

:root {
  /* نفس ألوان النظام الأصلي — لم يتغير أي لون أساسي */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --background: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;

  /* درجات مشتقة من نفس الألوان */
  --primary-soft: #eff6ff;
  --primary-line: #bfdbfe;
  --primary-ring: rgba(59, 130, 246, 0.22);
  --accent-from: #667eea;
  --accent-to: #764ba2;

  /* مقاييس */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 20px -6px rgba(15, 23, 42, 0.12), 0 2px 6px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, 0.25);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- أساسيات ---------- */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
  border-radius: 8px;
}

::selection { background: var(--primary-line); color: var(--text); }

.ico {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid transparent;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s var(--ease), color 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -6px rgba(37, 99, 235, 0.55);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn:disabled {
  opacity: 1;
  background: #e2e8f0;
  color: #94a3b8;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* ---------- الهيدر ---------- */
.header {
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  transition: box-shadow 0.25s;
}

.header.scrolled { box-shadow: var(--shadow-md); }

.header-content {
  padding: 10px 24px;
  gap: 8px;
}

.logo { order: 1; gap: 10px; }

.logo img {
  height: 40px;
  width: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--primary-soft);
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.2px;
}

.nav-menu {
  order: 2;
  margin-inline-start: 28px;
  margin-inline-end: auto;
  gap: 4px;
}

.nav-menu a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-light);
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.nav-menu a:hover { background: var(--primary-soft); color: var(--primary-dark); }

.nav-menu a.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nav-menu .btn-secondary {
  margin-inline-start: 8px;
  color: var(--text-light);
}

.nav-menu .btn-secondary:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.cart-icon { position: relative; }

.cart-badge {
  position: static;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  font-size: 12px;
  line-height: 1;
}

.cart-icon.disabled { opacity: 0.55; }

.header-actions {
  order: 3;
  gap: 4px;
}

.navbar-search-btn,
.mobile-cart-btn,
.mobile-history-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 10px;
  color: var(--text-light);
  font-size: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-cart-btn,
.mobile-history-btn { display: none; }

.navbar-search-btn:hover,
.mobile-cart-btn:hover,
.mobile-history-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.mobile-cart-badge {
  top: 3px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  width: auto;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-sizing: content-box;
  font-size: 10px;
}

.header-actions #enablePushBtn {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  font-weight: 700;
}

.header-actions #enablePushBtn:hover:not(:disabled) { background: #dbeafe; }

/* ---------- نافذة البحث ---------- */
.search-overlay {
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.search-overlay-content {
  padding: 18px 24px 20px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.search-overlay-inner .search-input-nav {
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--background);
  font-size: 16px;
}

.search-overlay-inner .search-input-nav:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.search-overlay-close {
  width: 44px;
  height: 44px;
  font-size: 20px;
  border-radius: 12px;
}

.search-overlay-results {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-overlay-results:empty { display: none; }

.search-result-image,
.search-result-image.img-lazy { background: #f1f5f9; object-fit: contain; }

.search-add-cart-btn,
.search-qty-btn,
.search-qty-input { border-radius: 8px; }

.search-add-cart-btn {
  box-shadow: none;
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 24px 96px;
  background:
    radial-gradient(900px 380px at 90% -20%, rgba(255, 255, 255, 0.22), transparent 60%),
    radial-gradient(700px 320px at 0% 120%, rgba(255, 255, 255, 0.14), transparent 60%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  max-width: 760px;
  padding: 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 14px;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.hero p.hero-lead {
  font-size: clamp(16px, 2.2vw, 19px);
  max-width: 560px;
  margin: 0 auto 24px;
  opacity: 0.92;
}

.hero p.hero-branch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  padding: 8px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  opacity: 1;
}

.hero p.hero-branch:empty { display: none; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn-hero {
  padding: 13px 28px;
  border-radius: 12px;
  font-size: 16px;
  text-decoration: none;
}

.btn-hero-solid {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.45);
}

.btn-hero-solid:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(15, 23, 42, 0.5); }

.btn-hero-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-hero-ghost:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-2px); }

/* ---------- عناوين الأقسام ---------- */
.categories {
  padding: 64px 24px 72px;
  position: relative;
}

.section-title {
  position: relative;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 40px;
  padding-bottom: 16px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 48px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.categories .section-title { margin-bottom: 12px; }

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 16px;
  margin: 0 auto 40px;
  max-width: 520px;
}

/* ---------- كروت الأقسام ---------- */
.category-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.category-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}

.category-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-line);
  box-shadow: var(--shadow-md);
}

.category-image {
  height: 190px;
  padding: 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s var(--ease);
}

.category-card:hover .category-image { transform: scale(1.03); }

.category-card { overflow: hidden; }

.category-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  padding: 20px;
}

.category-content h3 {
  font-size: 19px;
  font-weight: 800;
  margin: 0;
}

.category-content p {
  margin: 0 0 12px;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-content .btn {
  margin-top: auto;
  width: 100%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--primary-line);
  box-shadow: none;
}

.category-card:hover .category-content .btn {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* هيكل التحميل */
.category-skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  animation: none;
  overflow: hidden;
}

.category-skeleton-image,
.category-skeleton-title,
.category-skeleton-text,
.category-skeleton-button {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.category-skeleton-image { width: 100%; height: 190px; }
.category-skeleton-content { padding: 20px; }
.category-skeleton-title { height: 22px; width: 60%; border-radius: 6px; margin-bottom: 12px; }
.category-skeleton-text { height: 14px; width: 90%; border-radius: 6px; margin-bottom: 18px; }
.category-skeleton-button { height: 42px; width: 100%; border-radius: 10px; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---------- بطاقة لوحة التحكم (CTA) ---------- */
.admin-cta {
  position: relative;
  overflow: hidden;
  padding: 72px 24px;
  text-align: center;
  background:
    radial-gradient(600px 260px at 15% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(135deg, var(--accent-from) 0%, var(--accent-to) 100%);
}

.admin-cta-inner { position: relative; max-width: 600px; margin: 0 auto; }

.admin-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.admin-cta-icon .ico { width: 32px; height: 32px; }

.admin-cta h2 {
  font-size: clamp(24px, 3.4vw, 30px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.admin-cta p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 28px;
}

.admin-cta .btn-hero-solid { color: var(--accent-from); }

/* ---------- المنتجات ---------- */
.products-section {
  padding: 40px 24px 72px;
  min-height: calc(100vh - 220px);
}

.category-filters {
  gap: 10px;
  margin-bottom: 28px;
}

.filter-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary-line);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.6);
}

.products-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-line);
  box-shadow: var(--shadow-md);
}

.product-card.product-unavailable {
  opacity: 1;
  background: #f8fafc;
}

.product-card.product-unavailable .product-image {
  filter: grayscale(1);
  opacity: 0.55;
}

.product-card.product-unavailable .product-name { color: var(--text-light); }

.product-img-wrap,
.product-card > .product-image {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border-bottom: 1px solid var(--border);
}

.product-image {
  display: block;
  width: 100%;
  height: 190px;
  padding: 14px;
  object-fit: contain;
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 14px 16px 16px;
}

.product-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-availability,
.product-stock {
  align-self: flex-start;
  margin: 0;
  padding: 3px 12px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.availability-available { border: none; }
.availability-unavailable { border: none; }

.quantity-selector {
  margin: auto 0 0;
  padding: 4px;
  gap: 4px;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}

.quantity-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.quantity-btn:disabled { box-shadow: none; background: transparent; }

.quantity-display {
  flex: 1;
  min-width: 0;
  color: var(--text);
  -moz-appearance: textfield;
  appearance: textfield;
}

input.quantity-display { outline: none; }

input.quantity-display::-webkit-outer-spin-button,
input.quantity-display::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.product-info > .btn-primary { margin-top: 2px; }

/* الترقيم */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 36px 0 8px;
}

.pagination-info { font-size: 14px; color: var(--text-light); font-weight: 600; }

.pagination-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.pagination-btn:hover { border-color: var(--primary-line); background: var(--primary-soft); color: var(--primary-dark); }

.pagination-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination-dots { align-self: center; color: var(--text-light); padding: 0 4px; }

/* قسم "أصناف مضافة حديثاً" */
.recent-products-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
}

.recent-products-box .section-title { margin-bottom: 8px; padding-bottom: 12px; font-size: 22px; }
.recent-products-box .section-title::after { background: #16a34a; }

/* ---------- السلة ---------- */
.cart-section {
  padding: 40px 24px 72px;
  background: var(--background);
}

.cart-container { max-width: 960px; }

.cart-header { margin-bottom: 28px; }

.branch-selection {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.branch-selection label { font-size: 14px; color: var(--text-light); }

.branch-selection .form-control {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc !important;
  padding: 10px 14px;
  font-family: inherit;
}

.cart-items {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.cart-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cart-item:hover {
  transform: none;
  border-color: var(--primary-line);
  box-shadow: var(--shadow-sm);
}

.cart-item-image { border-radius: 10px; box-shadow: none; background: #f1f5f9; object-fit: contain; }

.cart-item-name { font-size: 17px; font-weight: 700; }

.cart-item-actions {
  flex-direction: row;
  gap: 10px;
}

.cart-item-actions .quantity-selector {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 4px;
  gap: 2px;
}

.cart-item-actions .quantity-btn { width: 34px; height: 34px; font-size: 18px; }
.cart-item-actions .quantity-display { min-width: 44px; flex: none; }

.remove-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: 10px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
}

.remove-btn:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  transform: none;
  box-shadow: none;
}

.cart-summary {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 16px 32px -14px rgba(37, 99, 235, 0.6);
}

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  font-family: inherit;
  box-shadow: 0 14px 28px -12px rgba(16, 185, 129, 0.7);
}

#submitOrderBtn { margin-top: 0; }

.empty-cart {
  padding: 72px 24px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.empty-cart-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  border-radius: 28px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0;
  opacity: 1;
}

.empty-cart-icon .ico { width: 44px; height: 44px; }
.empty-cart h2 { font-size: 24px; font-weight: 800; }

/* ---------- سجل الطلبات ---------- */
.recent-orders-section {
  padding: 40px 24px 72px;
  background: transparent;
}

.recent-orders-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
}

.recent-orders-title .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0;
}

.recent-orders-title .icon .ico { width: 24px; height: 24px; }

.recent-orders-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.order-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-right: 4px solid var(--success);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.order-card.warning { border-right-color: var(--warning); }
.order-card.danger { border-right-color: var(--danger); }

.order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.timer-value {
  font-family: 'Cairo', ui-monospace, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  min-width: 112px;
  border-radius: 10px;
}

.order-item { border-radius: 8px; background: #f8fafc; border: 1px solid #f1f5f9; }

.show-all-btn,
.add-items-btn { border-radius: 10px; box-shadow: none; }

.add-items-modal-overlay { backdrop-filter: blur(6px); }
.add-items-modal { border-radius: var(--radius-xl); }

.loading-spinner { padding: 56px 24px; }

.spinner { width: 36px; height: 36px; border-width: 3px; }

/* ---------- التنبيهات ---------- */
.notification {
  top: 20px;
  right: 20px;
  min-width: 240px;
  max-width: calc(100vw - 40px);
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  box-shadow: var(--shadow-lg);
}

/* ---------- الفوتر ---------- */
.footer {
  position: relative;
  margin-top: 0;
  padding: 36px 24px;
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark), var(--accent-from));
}

.footer-content p { margin: 4px 0; font-size: 14px; }
.footer-content p:last-child { font-size: 13px; opacity: 0.55; }

/* ---------- شاشات صغيرة ---------- */
@media (max-width: 768px) {
  .header-content { padding: 8px 14px; }

  .nav-menu { display: none !important; }

  .mobile-cart-btn,
  .mobile-history-btn { display: flex; }

  .logo-text { font-size: 18px; }

  .hero { padding: 48px 18px 64px; }

  .categories { padding: 40px 16px 48px; }

  .category-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .category-image { height: 120px; padding: 12px; }
  .category-content { padding: 14px; }
  .category-content h3 { font-size: 16px; }
  .category-content p { display: none; }

  .admin-cta { padding: 52px 18px; }

  .products-section { padding: 24px 14px 56px; }

  /* فلاتر الأقسام: صف أفقي قابل للتمرير */
  .category-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    margin-inline: -14px;
    padding: 2px 14px 10px;
    scrollbar-width: none;
  }
  .category-filters::-webkit-scrollbar { display: none; }

  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-image { height: 140px; padding: 10px; }
  .product-info { padding: 10px 10px 12px; gap: 6px; }
  .product-name { font-size: 14px; }
  .product-description { display: none; }
  .quantity-btn { width: 32px; height: 32px; }
  .product-info > .btn-primary { padding: 9px 12px; font-size: 14px; }

  .cart-section { padding: 24px 14px 56px; }
  .cart-item-actions { justify-content: space-between; }

  .recent-orders-section { padding: 24px 14px 56px; }
  .recent-orders-grid { grid-template-columns: 1fr; }

  .notification { left: 14px; right: 14px; top: 14px; min-width: 0; }
}

@media (max-width: 480px) {
  .header-actions #enablePushBtn { font-size: 12px !important; padding: 5px 10px !important; }
  .hero-actions .btn-hero { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- الطباعة: لا نتدخل في تنسيق الطباعة ---------- */
@media print {
  .header, .footer, .hero::before { box-shadow: none; }
}
