* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #ea580c;
  --blue-light: #fff7ed;
  --blue-dark: #c2410c;
  --red: #ef4444;
  --green: #22c55e;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-blue: 0 8px 24px rgba(234,88,12,0.22);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}
body {
  font-family: 'Cairo', sans-serif;
  background: #f1f5f9;
  color: var(--gray-800);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* التمدد للكمبيوتر */
#app {
  width: 100%;
  max-width: 1200px !important;
  background: var(--white);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 60px rgba(0,0,0,0.12);
  overflow-x: hidden;
  margin: 0 auto;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* Sidebar transition */
#sidebar {
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  transform: translateX(100%);
}
#menu-backdrop {
  transition: opacity 0.28s ease;
  opacity: 0;
}

/* ===== HEADER ===== */
#header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px !important;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  z-index: 50;
  border-bottom: 1px solid var(--gray-100);
  box-shadow: 0 2px 12px rgba(234,88,12,0.09);
  padding: 10px 16px 8px;
  transition: all 0.3s;
}
.header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.header-logo { display: flex; align-items: center; gap: 10px; }
.logo-circle {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2.5px solid var(--blue);
  overflow: hidden;
  background: white;
  padding: 2px;
  box-shadow: 0 4px 12px rgba(234,88,12,0.22);
}
.logo-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.logo-name { font-size: 20px; font-weight: 900; color: var(--blue); font-style: italic; letter-spacing: -0.5px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 14px;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; background: var(--gray-50);
  border: 1px solid var(--gray-100);
  color: var(--gray-700);
  position: relative;
}
.icon-btn.blue { background: var(--blue); color: white; box-shadow: var(--shadow-blue); border-color: var(--blue); }
.icon-btn:active { transform: scale(0.9); }
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: white;
  font-size: 9px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white; font-family: 'Cairo', sans-serif;
}
.search-row { display: flex; align-items: center; gap: 8px; }
.search-wrap { flex: 1; position: relative; }
.search-wrap svg { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--blue); }
#searchInput {
  width: 100%; padding: 12px 44px 12px 14px;
  border-radius: 14px; border: 1.5px solid var(--gray-100);
  background: var(--gray-50); font-family: 'Cairo', sans-serif;
  font-size: 13px; font-weight: 600; color: var(--gray-800);
  outline: none; transition: all 0.2s; text-align: right;
}
#searchInput:focus { background: white; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(234,88,12,0.10); }
#searchInput::placeholder { color: var(--gray-400); }
.wish-btn-header {
  width: 44px; height: 44px; border-radius: 14px;
  border: 1.5px solid var(--gray-100); background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--red); box-shadow: var(--shadow-sm);
}

#page-home { padding-bottom: 20px; }

/* Banner */
.banner-wrap { margin: 0 16px 24px; border-radius: var(--radius-lg); overflow: hidden; height: 200px; position: relative; box-shadow: 0 8px 24px rgba(234,88,12,0.20); }
.banner-slide {
  position: absolute; inset: 0; padding: 24px 20px;
  display: flex; align-items: center; justify-content: space-between;
  opacity: 0; transition: all 0.5s; transform: translateX(20px);
}
.banner-slide.active { opacity: 1; transform: translateX(0); }
.banner-badge { background: rgba(255,255,255,0.2); backdrop-filter: blur(6px); color: white; font-size: 10px; font-weight: 700; padding: 4px 12px; border-radius: 20px; display: inline-block; margin-bottom: 8px; }
.banner-title { font-size: 22px; font-weight: 900; color: white; margin-bottom: 4px; line-height: 1.3; }
.banner-sub { font-size: 12px; color: rgba(255,255,255,0.88); font-weight: 600; margin-bottom: 14px; }
.banner-btn { background: white; color: var(--blue); font-size: 11px; font-weight: 800; padding: 8px 18px; border-radius: 12px; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.12); font-family: 'Cairo', sans-serif; }
.banner-icon { position: absolute; left: -16px; top: 50%; transform: translateY(-50%) rotate(12deg) scale(1.4); opacity: 0.15; }
.banner-dots { position: absolute; bottom: 14px; right: 18px; display: flex; gap: 5px; }
.dot { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.5); transition: all 0.3s; width: 6px; }
.dot.active { width: 20px; background: white; }

/* Section */
.section { padding: 0 16px; margin-bottom: 26px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 17px; font-weight: 900; color: var(--gray-800); }
.section-title-row { display: flex; align-items: center; gap: 8px; }
.title-icon { width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.title-icon.yellow { background: #fef3c7; color: #d97706; }
.title-icon.green { background: #dcfce7; color: #16a34a; }
.see-all { font-size: 13px; font-weight: 700; color: var(--blue); background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 4px; font-family: 'Cairo', sans-serif; }

/* Categories */
.cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 15px 10px; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; padding: 4px 0; transition: all 0.2s; }
.cat-item:hover { transform: translateY(-4px); }
.cat-circle { width: 70px; height: 70px; border-radius: 50%; overflow: hidden; border: 2px solid white; box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: all 0.2s; }
.cat-item:hover .cat-circle { box-shadow: 0 4px 14px rgba(234,88,12,0.28); }
.cat-circle img { width: 100%; height: 100%; object-fit: cover; }
.cat-name { font-size: 11px; font-weight: 700; color: var(--gray-700); text-align: center; }

/* Brands */
.brands-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.brands-scroll::-webkit-scrollbar { display: none; }
.brand-card {
  min-width: 88px; background: white; border-radius: var(--radius);
  border: 1.5px solid var(--gray-100); padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.brand-card:hover { border-color: #fed7aa; transform: scale(1.03); }
.brand-logo { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; filter: grayscale(30%); }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-name { font-size: 11px; font-weight: 800; color: var(--gray-700); }

/* Product Grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.product-card {
  background: white; border-radius: var(--radius); border: 1.5px solid var(--gray-100);
  overflow: hidden; position: relative; transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.product-card:hover { box-shadow: 0 6px 20px rgba(234,88,12,0.14); transform: translateY(-2px); }
.prod-badges { position: absolute; top: 8px; left: 8px; z-index: 5; display: flex; flex-direction: column; gap: 4px; }
.badge-tag { font-size: 9px; font-weight: 800; padding: 3px 8px; border-radius: 20px; color: white; }
.badge-tag.new { background: var(--green); }
.badge-tag.disc { background: var(--red); }
.wish-btn {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.9); backdrop-filter: blur(4px);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--gray-400); transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.wish-btn.active { color: var(--red); background: #fff1f2; }
.wish-btn:active { transform: scale(0.88); }
.prod-img { aspect-ratio: 1; overflow: hidden; background: var(--gray-50); }
.prod-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.product-card:hover .prod-img img { transform: scale(1.08); }
.prod-info { padding: 10px; }
.prod-name { font-size: 13px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-brand { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.prod-brand-icon { background: var(--blue-light); color: var(--blue); padding: 1px; border-radius: 4px; display: flex; }
.prod-brand-name { font-size: 10px; font-weight: 700; color: var(--blue); }
.prod-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.price-now { font-size: 15px; font-weight: 900; color: var(--gray-900); }
.price-old { font-size: 11px; color: var(--gray-400); text-decoration: line-through; }
.prod-opts { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; }
.prod-opts::-webkit-scrollbar { display: none; }
.opt-tag { font-size: 9px; padding: 4px 8px; background: var(--gray-100); border-radius: 6px; color: var(--gray-600); white-space: nowrap; font-weight: 600; }
.prod-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn-detail {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 9px; border-radius: 10px; border: 1.5px solid var(--gray-200);
  font-size: 12px; font-weight: 700; color: var(--gray-600);
  background: white; cursor: pointer; font-family: 'Cairo', sans-serif; transition: all 0.2s;
}
.btn-add {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 9px; border-radius: 10px; border: none;
  font-size: 12px; font-weight: 700; color: white;
  background: var(--blue); cursor: pointer; font-family: 'Cairo', sans-serif; transition: all 0.2s;
}
.btn-add:hover { background: var(--blue-dark); }
.btn-add:active, .btn-detail:active { transform: scale(0.95); }

/* ===== WISHLIST PAGE & GRID FIX ===== */
#page-wishlist { padding-top: 72px; padding-bottom: 100px; }
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  padding: 0 16px;
}
.wishlist-grid .product-card {
  width: 100%;
  max-width: 100%;
}

/* ===== PRODUCT DETAILS PAGE ===== */
#page-product { padding-top: 72px; padding-bottom: 100px; background: white; min-height: 100vh; }
.sub-header {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 1200px !important;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100); z-index: 50;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.back-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--gray-100);
  background: var(--gray-50); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--gray-700); transition: all 0.2s;
}
.back-btn:active { transform: scale(0.9); }
.sub-title { font-size: 15px; font-weight: 800; color: var(--gray-800); }
.prod-gallery { padding: 0 16px 16px; max-width: 500px; margin: 0 auto; }
.gallery-main { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1; background: var(--gray-50); position: relative; margin-bottom: 10px; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-disc { position: absolute; top: 14px; right: 14px; background: var(--red); color: white; font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 20px; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.thumb-btn { width: 60px; height: 60px; border-radius: 12px; overflow: hidden; border: 2px solid var(--gray-100); flex-shrink: 0; cursor: pointer; transition: all 0.2s; }
.thumb-btn.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(234,88,12,0.18); }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.prod-detail-info { padding: 0 16px 20px; max-width: 500px; margin: 0 auto; }
.tags-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tag-blue { background: var(--blue-light); color: var(--blue); font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 20px; display: flex; align-items: center; gap: 4px; }
.tag-gray { background: var(--gray-100); color: var(--gray-600); font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 20px; }
.prod-detail-name { font-size: 22px; font-weight: 900; color: var(--gray-900); margin-bottom: 10px; line-height: 1.3; }
.prod-detail-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.price-big { font-size: 28px; font-weight: 900; color: var(--blue); }
.price-old-big { font-size: 16px; color: var(--gray-400); text-decoration: line-through; }
.opts-section { margin-bottom: 18px; }
.opts-label { font-size: 13px; font-weight: 800; color: var(--gray-700); margin-bottom: 8px; }
.opts-row { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-chip {
  padding: 8px 16px; border-radius: 12px; border: 2px solid var(--gray-200);
  background: white; font-size: 12px; font-weight: 700; color: var(--gray-600);
  cursor: pointer; font-family: 'Cairo', sans-serif; transition: all 0.2s;
}
.opt-chip.selected { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.prod-desc { font-size: 13px; color: var(--gray-600); line-height: 1.7; margin-bottom: 20px; font-weight: 600; }
.prod-detail-footer {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 1200px !important;
  background: white; border-top: 1px solid var(--gray-100); padding: 14px 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  z-index: 50; box-shadow: 0 -6px 20px rgba(0,0,0,0.06);
}
.btn-wish-large {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px; border-radius: 14px; border: 2px solid var(--gray-200);
  font-size: 13px; font-weight: 800; color: var(--gray-600);
  background: white; cursor: pointer; font-family: 'Cairo', sans-serif; transition: all 0.2s;
}
.btn-wish-large.active { border-color: #fecaca; color: var(--red); background: #fff1f2; }
.btn-cart-large {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px; border-radius: 14px; border: none;
  font-size: 13px; font-weight: 800; color: white;
  background: var(--blue); cursor: pointer; font-family: 'Cairo', sans-serif; transition: all 0.2s;
  box-shadow: 0 6px 16px rgba(234,88,12,0.32);
}
.btn-cart-large:active { transform: scale(0.97); }

/* ===== CART PAGE ===== */
#page-cart { padding-top: 72px; padding-bottom: 130px; background: var(--gray-50); min-height: 100vh; }
.cart-items { padding: 14px 14px 0; display: flex; flex-direction: column; gap: 10px; max-width: 600px; margin: 0 auto; }
.cart-item {
  background: white; border-radius: var(--radius); border: 1px solid var(--gray-100);
  padding: 12px; display: flex; gap: 10px; box-shadow: var(--shadow-sm);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.cart-item-img { width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--gray-50); flex-shrink: 0; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.cart-item-name { font-size: 12px; font-weight: 800; color: var(--gray-800); margin-bottom: 2px; }
.cart-item-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.cart-item-brand { font-size: 10px; color: var(--blue); font-weight: 700; }
.cart-item-opt { font-size: 9px; background: var(--blue-light); color: var(--blue); padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.cart-item-bottom { display: flex; align-items: center; justify-content: space-between; }
.cart-item-price { font-size: 15px; font-weight: 900; color: var(--gray-900); }
.qty-ctrl { display: flex; align-items: center; gap: 8px; background: var(--gray-50); border-radius: 10px; padding: 4px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 8px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.qty-btn.minus { background: white; color: var(--gray-600); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.qty-btn.plus { background: var(--blue); color: white; box-shadow: 0 2px 6px rgba(234,88,12,0.32); }
.qty-num { font-size: 13px; font-weight: 900; width: 16px; text-align: center; }
.cart-remove { padding: 6px; color: var(--gray-300); background: none; border: none; cursor: pointer; align-self: flex-start; transition: all 0.2s; }
.cart-remove:hover { color: var(--red); }
.delivery-info { margin: 14px auto; max-width: 600px; background: white; border-radius: var(--radius); padding: 14px; border: 1px solid var(--gray-100); box-shadow: var(--shadow-sm); }
.delivery-title { font-size: 13px; font-weight: 800; color: var(--gray-800); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.delivery-edit { font-size: 11px; color: var(--blue); font-weight: 700; background: none; border: none; cursor: pointer; font-family: 'Cairo', sans-serif; }
.delivery-row { display: flex; align-items: center; gap: 8px; color: var(--gray-600); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.delivery-row svg { color: var(--blue); }
.cart-summary {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 1200px !important;
  background: white; border-top: 1px solid var(--gray-100); padding: 14px 16px;
  z-index: 50; border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
}
.cart-total-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 4px; max-width: 600px; margin-left: auto; margin-right: auto; }
.cart-total-label { font-size: 13px; font-weight: 700; color: var(--gray-500); }
.cart-total-price { font-size: 22px; font-weight: 900; color: var(--blue); }
.btn-checkout {
  width: 100%; max-width: 600px; margin: 0 auto; padding: 16px; border-radius: 16px; border: none;
  background: var(--blue); color: white; font-size: 15px; font-weight: 800;
  cursor: pointer; font-family: 'Cairo', sans-serif;
  box-shadow: 0 8px 20px rgba(234,88,12,0.30); transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-checkout:hover { background: var(--blue-dark); }
.empty-state { padding: 60px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.empty-icon { width: 80px; height: 80px; background: var(--gray-100); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gray-400); margin-bottom: 16px; }
.empty-title { font-size: 19px; font-weight: 900; color: var(--gray-800); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--gray-400); font-weight: 600; margin-bottom: 20px; }
.btn-start-shop { background: var(--blue); color: white; border: none; padding: 12px 32px; border-radius: 16px; font-size: 14px; font-weight: 800; cursor: pointer; font-family: 'Cairo', sans-serif; box-shadow: var(--shadow-blue); }

/* ===== DEAL CATEGORY CARDS ===== */
.deal-cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 15px 10px; }
.deal-cat-card {
  cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: all 0.22s;
}
.deal-cat-card:active { transform: scale(0.93); }
.deal-cat-circle-wrap {
  width: 88px; height: 88px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--blue); box-shadow: 0 4px 16px rgba(234,88,12,0.30);
  position: relative; flex-shrink: 0;
}
.deal-cat-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.deal-cat-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 70%);
}
.deal-cat-info { text-align: center; }
.deal-cat-badge {
  font-size: 9px; font-weight: 800; background: var(--blue); color: white;
  padding: 2px 8px; border-radius: 20px; display: inline-block; margin-bottom: 3px;
}
.deal-cat-name { font-size: 12px; font-weight: 900; color: var(--gray-800); line-height: 1.3; }
