:root {
  --bg-white: #FFFFFF;
  --bg-cream: #FAF8F2;
  --gold-main: #D4A017;
  --gold-light: #E5A93C;
  --gold-grad: linear-gradient(135deg, #E5A93C 0%, #D4A017 100%);
  --gold-shadow: 0 4px 12px rgba(212, 160, 23, 0.25);
  --red-discount: #D32F2F;
  --text-dark: #1A1A1A;
  --text-muted: #666666;
  --border-soft: #EFECE6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--bg-cream);
  color: var(--text-dark);
  padding-bottom: 78px;
  overflow-x: hidden;
}

.tabular-nums { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* إشعارات عائمة */
.toast-container {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  background: var(--text-dark);
  color: #FFF;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  border-right: 4px solid var(--gold-light);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* شريط إغلاق المتجر */
.closed-banner {
  background: var(--red-discount);
  color: #FFF;
  padding: 10px 14px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1002;
}

/* الهيدر الزجاجي */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1.5px solid rgba(212, 160, 23, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
}

.icon-btn {
  background: var(--bg-cream);
  border: 1px solid var(--border-soft);
  color: var(--text-dark);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease;
}

.icon-btn:active { transform: scale(0.92); }
.header-left-actions { display: flex; gap: 8px; }

.cart-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  background: var(--red-discount);
  color: #FFF;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-bounce { animation: bounceCart 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes bounceCart {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.22); }
  70% { transform: scale(0.95); }
}

/* شعار العمده */
.brand-logo {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.logo-title {
  font-family: 'Cairo', sans-serif;
  font-weight: 900;
  font-size: 1.65rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 3px;
}

.crown-icon { font-size: 1rem; }

.logo-curve {
  width: 68px;
  height: 4px;
  background: var(--gold-grad);
  border-radius: 50%;
  margin: 2px 0;
}

.logo-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-main);
}

/* شريط البحث */
.search-bar-wrapper {
  background: var(--bg-white);
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.search-input-box { position: relative; display: flex; align-items: center; }

.search-input-box input {
  width: 100%;
  padding: 10px 38px 10px 34px;
  border-radius: 10px;
  border: 1.5px solid var(--gold-main);
  background: var(--bg-cream);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.92rem;
  outline: none;
}

.search-icon { position: absolute; right: 12px; color: var(--gold-main); }
.clear-search { position: absolute; left: 10px; background: none; border: none; font-size: 1rem; color: var(--text-muted); cursor: pointer; }

.container { max-width: 1100px; margin: 0 auto; padding: 12px; }

/* البانر الرئيسي */
.hero-banner {
  background: linear-gradient(135deg, #FFFDF7 0%, #F7EFE0 100%);
  border: 1.5px solid var(--gold-main);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--gold-shadow);
}

.hero-pill {
  display: inline-block;
  background: rgba(212, 160, 23, 0.15);
  color: #9A7209;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.hero-banner h1 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 12px;
}

.btn-gold-primary {
  background: var(--gold-grad);
  color: #FFF;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--gold-shadow);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-gold-primary:active { transform: scale(0.96); }
.btn-gold-primary:disabled { background: #CCCCCC; box-shadow: none; cursor: not-allowed; }
.full-width { width: 100%; }

/* أزرار الفلترة السريعة وشريط الثقة */
.filters-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.filters-scroll::-webkit-scrollbar { display: none; }

.filter-chip {
  background: var(--bg-white);
  border: 1.5px solid var(--gold-main);
  color: var(--text-dark);
  padding: 7px 16px;
  border-radius: 20px;
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background: var(--gold-grad);
  color: #FFF;
  box-shadow: var(--gold-shadow);
}

.trust-strip {
  background: #FFF9E6;
  border: 1px dashed var(--gold-main);
  color: #7A5A00;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 8px;
  margin: 8px 0 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-header h2 { font-family: 'Cairo', sans-serif; font-size: 1.1rem; font-weight: 900; }
.link-btn { background: none; border: none; color: var(--gold-main); font-weight: 800; font-family: 'Tajawal', sans-serif; cursor: pointer; }
.count-tag { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; }

/* شبكة الأقسام (3 أعمدة) */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.category-card {
  background: var(--bg-white);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.category-card:active { transform: scale(0.96); }
.category-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #FFF; }

.category-name-box {
  background: var(--bg-cream);
  border-top: 1.5px solid var(--gold-main);
  padding: 6px 4px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-dark);
}

/* شبكة المنتجات (3 منتجات في الصف على الموبايل) */
.products-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

@media (min-width: 768px) {
  .products-grid-3col { grid-template-columns: repeat(5, 1fr); gap: 14px; }
  .categories-grid { grid-template-columns: repeat(6, 1fr); gap: 12px; }
}

.product-card {
  background: var(--bg-white);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  animation: fadeUp 0.25s ease forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-card.sold-out { opacity: 0.68; }
.product-card.sold-out img { filter: grayscale(80%); }

.discount-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--red-discount);
  color: #FFF;
  font-size: 0.64rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 6px;
  z-index: 2;
}

.sold-out-overlay {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(26, 26, 26, 0.9);
  color: #FFF;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 3;
}

.prod-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #FFF;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prod-img-wrap img { width: 100%; height: 100%; object-fit: contain; }

.prod-title {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2em;
}

.prod-weight { font-size: 0.68rem; color: var(--text-muted); margin: 2px 0; }

.prod-prices {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  margin: 3px 0 6px;
}

.current-price { font-size: 0.85rem; font-weight: 800; color: var(--text-dark); }
.old-price { font-size: 0.68rem; color: var(--text-muted); text-decoration: line-through; }

.add-btn-outline {
  width: 100%;
  background: var(--bg-cream);
  border: 1.5px solid var(--gold-main);
  color: var(--text-dark);
  font-family: 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: 0.76rem;
  padding: 5px 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.add-btn-outline:active { transform: scale(0.94); background: var(--gold-light); color: #FFF; }
.add-btn-outline:disabled { border-color: #CCC; color: #888; background: #F2F2F2; cursor: not-allowed; }

.qty-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gold-grad);
  color: #FFF;
  border-radius: 8px;
  padding: 2px;
}

.qty-stepper button {
  background: rgba(255,255,255,0.22);
  border: none;
  color: #FFF;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
}

.qty-stepper span { font-size: 0.82rem; font-weight: 800; }

/* Skeleton Shimmer */
.skeleton-card {
  background: #ECE8DF;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.cat-skel { aspect-ratio: 1 / 1.25; }
.prod-skel { height: 185px; }

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* زر واتساب عائم */
.whatsapp-float {
  position: fixed;
  bottom: 78px;
  left: 14px;
  width: 50px;
  height: 50px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  z-index: 990;
  transition: transform 0.2s ease;
}
.whatsapp-float:active { transform: scale(0.9); }

/* التنقل السفلي */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1.5px solid rgba(212, 160, 23, 0.35);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px;
  z-index: 1000;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.nav-item.active { color: var(--gold-main); }
.nav-cart-icon-wrap { position: relative; }
.mini-badge {
  position: absolute;
  top: -4px;
  left: -8px;
  background: var(--red-discount);
  color: #FFF;
  font-size: 0.65rem;
  padding: 0 4px;
  border-radius: 10px;
}

/* القوائم المنزلقة (Drawers) */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  z-index: 1100;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.slide-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 88%;
  max-width: 380px;
  background: var(--bg-white);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.right-drawer { right: 0; transform: translateX(100%); }
.right-drawer.open { transform: translateX(0); }

.left-drawer { left: 0; transform: translateX(-100%); }
.left-drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 14px 16px;
  border-bottom: 1.5px solid var(--gold-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-cream);
}

.drawer-header h3 { font-family: 'Cairo', sans-serif; font-size: 1.05rem; }
.cart-header-actions { display: flex; align-items: center; gap: 8px; }

.share-btn {
  background: #FFF;
  border: 1px solid var(--gold-main);
  color: var(--text-dark);
  padding: 4px 10px;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.close-drawer-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 4px; }

.drawer-list { padding: 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.drawer-cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--bg-cream);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.drawer-cat-item img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: #FFF; }

/* السلة وشريط التقدم */
.min-order-box { padding: 10px 14px; background: #FFF9E6; border-bottom: 1px solid var(--border-soft); }
.min-order-text { font-size: 0.8rem; font-weight: 700; margin-bottom: 5px; color: #7A5A00; }
.progress-track { width: 100%; height: 6px; background: #E6DEC8; border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold-grad); width: 0%; transition: width 0.3s ease; }

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

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--bg-cream);
}

.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 0.85rem; margin-bottom: 2px; }
.cart-item-info span { font-size: 0.78rem; color: var(--gold-main); font-weight: 800; }

.checkout-footer {
  padding: 12px 14px;
  border-top: 1.5px solid var(--gold-main);
  background: var(--bg-cream);
  max-height: 62vh;
  overflow-y: auto;
}

.cart-summary-row, .cart-total-final {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.cart-total-final {
  font-size: 1.05rem;
  padding-top: 6px;
  border-top: 1px dashed #CCC;
  color: var(--text-dark);
}

.checkout-form { display: flex; flex-direction: column; gap: 8px; }
.checkout-form input, .checkout-form select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #D5CFC2;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.88rem;
  background: #FFF;
}

.address-row { display: flex; gap: 6px; }
.gps-btn {
  background: var(--text-dark);
  color: #FFF;
  border: none;
  border-radius: 8px;
  padding: 0 10px;
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
}
.gps-status { font-size: 0.76rem; color: #2E7D32; font-weight: 700; }

/* نافذة تأكيد الطلب */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
}

.modal-card {
  background: #FFF;
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  border: 2px solid var(--gold-main);
}

.success-icon { font-size: 3rem; margin-bottom: 8px; }
.order-number-badge {
  background: var(--bg-cream);
  border: 1.5px dashed var(--gold-main);
  font-family: 'Cairo', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold-main);
  padding: 8px 16px;
  border-radius: 10px;
  margin: 12px 0;
}
.success-note { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 16px; }

/* شريط تثبيت التطبيق */
.install-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: #FFF9E6; border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px; color: var(--text-dark);
}
.install-text { flex: 1; line-height: 1.5; font-weight: 600; }
.install-btn {
  background: var(--gold-grad); color: #fff; border: 0; border-radius: 8px;
  padding: 7px 16px; font-family: inherit; font-weight: 700; cursor: pointer;
}
.install-close { background: none; border: 0; font-size: 16px; color: var(--text-muted); cursor: pointer; padding: 4px 6px; }
