/* =========================================================
   سوق غمضان – Complete Stylesheet
   ========================================================= */

/* ── 1. CSS Variables ── */
:root {
  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-dark: #4F46E5;
  --secondary: #8B5CF6;
  --accent: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --success: #22C55E;

  --amazon: #FF9900;
  --aliexpress: #E62E04;
  --alibaba: #FF6A00;
  --shopify: #96BF48;

  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface2: #F0F2F8;
  --border: #E5E7EB;
  --text1: #1E2028;
  --text2: #6B7280;
  --text3: #9CA3AF;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow: 0 4px 16px rgba(0,0,0,.09);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.13);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --nav-h: 58px;
  --bottom-h: 64px;
  --max-w: 480px;

  --font-scale: 1;
}

[data-theme="dark"] {
  --bg: #0F1117;
  --surface: #1A1D2E;
  --surface2: #252840;
  --border: #2D3148;
  --text1: #F1F2F8;
  --text2: #9CA3AF;
  --text3: #6B7280;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.3);
  --shadow: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
}

/* ── 2. Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: calc(16px * var(--font-scale)); }
body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text1);
  min-height: 100vh;
  padding-top: var(--nav-h);
  padding-bottom: var(--bottom-h);
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; }

/* ── 3. Typography ── */
.text-display { font-size: 2rem; font-weight: 800; }
.text-h1 { font-size: 1.5rem; font-weight: 700; }
.text-h2 { font-size: 1.25rem; font-weight: 700; }
.text-h3 { font-size: 1.125rem; font-weight: 600; }
.text-body { font-size: 1rem; font-weight: 400; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--text2); }
.text-primary { color: var(--primary); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }

/* ── 4. Layout Helpers ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }
.full-container { max-width: var(--max-w); margin: 0 auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.p-16 { padding: 16px; }
.p-12 { padding: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; }

/* ── 5. Top Navigation ── */
.top-nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 900;
  height: var(--nav-h);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 2px 20px rgba(99,102,241,.35);
  max-width: var(--max-w); margin: 0 auto;
}
@media (min-width: 480px) {
  .top-nav { left: calc(50% - 240px); right: calc(50% - 240px); }
}
.nav-title {
  font-size: 1.1rem; font-weight: 800; color: #fff;
  letter-spacing: .3px;
}
.nav-icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.15);
  transition: background .2s;
  position: relative;
}
.nav-icon-btn:active { background: rgba(255,255,255,.3); }
.nav-actions { display: flex; gap: 6px; }
.nav-badge {
  position: absolute; top: -2px; inset-inline-end: -2px;
  background: var(--warning); color: #fff;
  font-size: .6rem; font-weight: 700;
  width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--primary);
}

/* ── 6. Drawer ── */
.drawer-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: -300px;
  width: 280px; z-index: 1001;
  background: var(--surface);
  transition: inset-inline-end .3s cubic-bezier(.25,.1,.25,1);
  overflow-y: auto; padding-bottom: 32px;
  box-shadow: var(--shadow-lg);
}
[dir="ltr"] .drawer { inset-inline-end: auto; inset-inline-start: -300px; }
.drawer.open { inset-inline-end: 0; }
[dir="ltr"] .drawer.open { inset-inline-start: 0; }
.drawer-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 32px 20px 24px;
  display: flex; align-items: center; gap: 14px;
}
.drawer-logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drawer-app-name { font-size: 1.1rem; font-weight: 800; color: #fff; }
.drawer-app-sub { font-size: .75rem; color: rgba(255,255,255,.75); margin-top: 2px; }
.drawer-menu { padding: 12px 0; }
.drawer-link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; width: 100%;
  font-size: .95rem; font-weight: 600; color: var(--text1);
  border-radius: 0;
  transition: background .15s, color .15s;
}
.drawer-link:hover, .drawer-link.active { background: rgba(99,102,241,.08); color: var(--primary); }
.drawer-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.drawer-divider { height: 1px; background: var(--border); margin: 8px 16px; }
.drawer-badge {
  margin-inline-start: auto; background: var(--primary); color: #fff;
  font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 12px;
}
.drawer-badge--pink { background: #EC4899; }
.drawer-logout-btn { color: var(--error); }
.drawer-logout-btn:hover { background: rgba(239,68,68,.08); }

/* ── 7. Bottom Navigation ── */
.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 900;
  height: var(--bottom-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  box-shadow: 0 -4px 20px rgba(0,0,0,.07);
  max-width: var(--max-w); margin: 0 auto;
}
@media (min-width: 480px) {
  .bottom-nav { left: calc(50% - 240px); right: calc(50% - 240px); }
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px;
  color: var(--text3); font-size: .6rem; font-weight: 600;
  transition: color .2s; position: relative;
}
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--primary); }
.bottom-nav-item svg { transition: transform .2s; }
.bottom-nav-item.active svg { transform: scale(1.1); }
.bottom-nav-cart-icon { position: relative; display: flex; }
.bottom-cart-badge {
  position: absolute; top: -4px; inset-inline-end: -6px;
  background: var(--warning); color: #fff;
  font-size: .55rem; font-weight: 800;
  min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

/* ── 8. App Main ── */
.app-main {
  max-width: var(--max-w); margin: 0 auto;
  min-height: calc(100vh - var(--nav-h) - var(--bottom-h));
  animation: fadeIn .3s ease;
}

/* ── 9. Screen Wrapper ── */
.screen { padding-bottom: 20px; }
.screen-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 10px;
}
.screen-back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface2); color: var(--text1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .2s;
}
.screen-back-btn:active { background: var(--border); }
.screen-title { font-size: 1.1rem; font-weight: 700; }

/* ── 10. Cards ── */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.glass-card {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-lg);
}
[data-theme="dark"] .glass-card {
  background: rgba(26,29,46,.7);
  border-color: rgba(255,255,255,.08);
}

/* ── 11. Product Card ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols,2), 1fr);
  gap: 12px; padding: 0 16px 16px;
}
.product-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
  animation: fadeInUp .4s ease forwards;
}
.product-card:active { transform: scale(.97); }
.product-card:hover { box-shadow: var(--shadow); }
.product-card__img-wrap {
  position: relative; padding-top: 100%;
  background: var(--surface2); overflow: hidden;
}
.product-card__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .35s;
}
.product-card:hover .product-card__img { transform: scale(1.04); }
.product-card__badge {
  position: absolute; top: 8px; inset-inline-start: 8px;
}
.product-card__wish {
  position: absolute; top: 8px; inset-inline-end: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.9); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; transition: transform .2s;
  border: none; cursor: pointer; z-index: 1;
}
.product-card__wish:active { transform: scale(1.3); }
.product-card__body { padding: 10px 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-card__title {
  font-size: .82rem; font-weight: 600; color: var(--text1);
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__price {
  font-size: .95rem; font-weight: 800; color: var(--primary);
}
.product-card__rating { display: flex; align-items: center; gap: 4px; margin-top: auto; }
.product-card__stars { color: var(--warning); font-size: .75rem; }
.product-card__rating-val { font-size: .7rem; color: var(--text2); }
.product-card__cart-btn {
  background: linear-gradient(135deg,var(--primary),var(--secondary));
  color: #fff; font-size: .75rem; font-weight: 700;
  border-radius: 10px; padding: 6px 10px;
  width: 100%; margin-top: 6px;
  transition: opacity .2s, transform .15s;
}
.product-card__cart-btn:active { transform: scale(.96); }
.product-card__cart-btn.in-cart { background: linear-gradient(135deg,var(--error),#F97316); }

/* ── 12. Platform Badge ── */
.platform-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: .65rem; font-weight: 700; white-space: nowrap;
}
.pb-amazon { background: rgba(255,153,0,.15); color: var(--amazon); }
.pb-aliexpress { background: rgba(230,46,4,.15); color: var(--aliexpress); }
.pb-alibaba { background: rgba(255,106,0,.15); color: var(--alibaba); }
.pb-shopify, .pb-shopify_stores_info { background: rgba(150,191,72,.15); color: var(--shopify); }
.pb-default { background: rgba(99,102,241,.15); color: var(--primary); }

/* ── 13. Shimmer Skeleton ── */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.shimmer {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-card {
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.skeleton-img { width: 100%; padding-top: 100%; }
.skeleton-line { height: 10px; margin: 8px 10px 0; border-radius: 6px; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-btn { height: 28px; margin: 8px 10px; border-radius: 8px; }

/* ── 14. Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 20px; border-radius: 14px;
  font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: all .2s; border: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg,var(--primary),var(--secondary));
  color: #fff; box-shadow: 0 4px 16px rgba(99,102,241,.4);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(99,102,241,.5); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: rgba(99,102,241,.08); }
.btn-error { background: var(--error); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost { background: var(--surface2); color: var(--text1); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .8rem; border-radius: 10px; }
.btn-loading { opacity: .7; pointer-events: none; position: relative; }
.btn-loading::after {
  content: ''; position: absolute; inset-inline-end: 12px;
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 15. Input Fields ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.input, .select-input {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  background: var(--surface2); border: 2px solid transparent;
  font-size: .95rem; color: var(--text1); font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.input:focus, .select-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-inline-end: 44px; }
.input-icon { position: absolute; inset-block: 0; inset-inline-end: 12px; display: flex; align-items: center; color: var(--text3); }
.field-error { font-size: .78rem; color: var(--error); margin-top: 4px; }

/* ── 16. Search Bar ── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border-radius: 14px;
  padding: 10px 14px; border: 2px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.search-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: .95rem; font-family: inherit; color: var(--text1);
}
.search-input::placeholder { color: var(--text3); }
.search-icon-btn { color: var(--text3); display: flex; padding: 2px; transition: color .2s; }
.search-icon-btn:hover { color: var(--primary); }

/* ── 17. Chips ── */
.chip {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: 20px;
  font-size: .8rem; font-weight: 600;
  background: var(--surface2); color: var(--text2);
  border: 1.5px solid transparent; cursor: pointer;
  white-space: nowrap; transition: all .2s;
}
.chip.active, .chip:hover { background: rgba(99,102,241,.12); color: var(--primary); border-color: var(--primary); }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 8px; }
.chip-scroll::-webkit-scrollbar { display: none; }

/* ── 18. Sections ── */
.section { margin-bottom: 8px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px;
}
.section-title { font-size: 1rem; font-weight: 700; }
.section-see-all { font-size: .82rem; font-weight: 600; color: var(--primary); }
.h-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 12px; }
.h-scroll::-webkit-scrollbar { display: none; }
.h-card { flex-shrink: 0; width: 150px; }
.h-card.h-card-sm { width: 130px; }

/* ── 19. Banner / Carousel ── */
.banner-wrap { position: relative; overflow: hidden; margin: 0 16px; border-radius: var(--radius-lg); }
.banner-img { width: 100%; aspect-ratio: 21/8; object-fit: cover; border-radius: var(--radius-lg); }
.banner-carousel { display: flex; overflow-x: auto; gap: 0; scroll-snap-type: x mandatory; }
.banner-carousel::-webkit-scrollbar { display: none; }
.banner-slide { flex-shrink: 0; width: 100%; scroll-snap-align: start; }
.banner-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0; }
.banner-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all .3s; }
.banner-dot.active { width: 18px; border-radius: 6px; background: var(--primary); }

/* ── 20. Quick Action Tiles ── */
.quick-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding: 8px 16px 12px; }
.qa-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 4px; border-radius: var(--radius); cursor: pointer;
  color: #fff; font-size: .72rem; font-weight: 700;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.qa-tile:active { transform: scale(.95); }
.qa-tile span:first-child { font-size: 1.5rem; }

/* ── 21. Empty State ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 24px;
  text-align: center; gap: 12px;
}
.empty-icon { font-size: 4rem; opacity: .5; }
.empty-title { font-size: 1.05rem; font-weight: 700; color: var(--text1); }
.empty-sub { font-size: .85rem; color: var(--text2); max-width: 240px; }

/* ── 22. Toast ── */
.toast-container { position: fixed; bottom: calc(var(--bottom-h) + 16px); inset-inline: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
  max-width: calc(var(--max-w) - 32px); margin: 0 auto;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--text1); color: var(--surface);
  padding: 12px 16px; border-radius: 12px;
  font-size: .87rem; font-weight: 600;
  box-shadow: var(--shadow-lg); pointer-events: all;
  animation: slideUp .3s ease; border-inline-start: 4px solid var(--primary);
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.warning { border-color: var(--warning); }

/* ── 23. Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-box {
  background: var(--surface); width: 100%; max-width: var(--max-w);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 32px;
  animation: slideUp .3s cubic-bezier(.25,.1,.25,1);
}
.modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; text-align: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ── 24. Product Detail ── */
.product-gallery { position: relative; background: var(--surface2); }
.gallery-main { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.gallery-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 4px; position: absolute; bottom: 0; inset-inline: 0; }
.gallery-slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.gallery-slider::-webkit-scrollbar { display: none; }
.gallery-slide { flex-shrink: 0; width: 100%; scroll-snap-align: start; aspect-ratio: 1/1; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 16px; }
.product-title-detail { font-size: 1.05rem; font-weight: 700; line-height: 1.4; }
.price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.price-big { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.rating-chip { display: flex; align-items: center; gap: 4px; background: rgba(245,158,11,.12); color: var(--warning); padding: 5px 10px; border-radius: 20px; font-weight: 700; font-size: .85rem; }
.product-description { padding: 0 16px 16px; }
.description-text { font-size: .9rem; line-height: 1.6; color: var(--text2); }
.translate-btn { font-size: .8rem; font-weight: 600; color: var(--primary); background: rgba(99,102,241,.1); padding: 5px 12px; border-radius: 8px; margin-top: 8px; }
.product-actions { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.buy-btn { background: var(--accent); }

/* ── 25. Reviews ── */
.reviews-section { padding: 0 16px 16px; }
.review-card { padding: 12px; background: var(--surface2); border-radius: var(--radius-sm); margin-top: 8px; }
.review-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.review-author { font-size: .85rem; font-weight: 700; }
.review-text { font-size: .85rem; color: var(--text2); line-height: 1.5; }
.review-form { margin-top: 12px; padding: 14px; background: rgba(99,102,241,.06); border-radius: var(--radius); border: 1.5px dashed rgba(99,102,241,.3); }
.star-selector { display: flex; gap: 6px; font-size: 1.5rem; cursor: pointer; margin: 8px 0; }

/* ── 26. Price Stats ── */
.price-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 12px 0; }
.stat-card { background: var(--surface2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.stat-label { font-size: .7rem; color: var(--text2); }
.stat-val { font-size: .95rem; font-weight: 800; margin-top: 3px; }
.stat-val.low { color: var(--success); }
.stat-val.high { color: var(--error); }
.stat-val.avg { color: var(--primary); }

/* ── 27. Cart ── */
.cart-summary-card {
  margin: 16px; padding: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.1));
  border: 1.5px solid rgba(99,102,241,.2);
  border-radius: var(--radius-lg);
}
.cart-item {
  display: flex; gap: 12px; background: var(--surface);
  margin: 0 16px 10px; padding: 12px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.cart-item__img { width: 72px; height: 72px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.cart-item__info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cart-item__title { font-size: .85rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item__price { font-size: .95rem; font-weight: 800; color: var(--primary); }
.cart-item__actions { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.qty-stepper { display: flex; align-items: center; gap: 4px; }
.qty-btn { width: 28px; height: 28px; border-radius: 8px; background: var(--surface2); font-size: 1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; color: var(--primary); transition: background .15s; }
.qty-btn:active { background: rgba(99,102,241,.2); }
.qty-val { font-size: .9rem; font-weight: 700; min-width: 24px; text-align: center; }
.cart-remove-btn { color: var(--text3); font-size: .75rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; transition: color .15s, background .15s; }
.cart-remove-btn:hover { color: var(--error); background: rgba(239,68,68,.08); }
.checkout-panel {
  position: sticky; bottom: var(--bottom-h); background: var(--surface);
  border-top: 1px solid var(--border); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}

/* ── 28. Auth ── */
.auth-logo {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 16px 20px; gap: 12px;
}
.auth-logo-circle {
  width: 80px; height: 80px; border-radius: 28px;
  background: linear-gradient(135deg,var(--primary),var(--secondary));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 28px rgba(99,102,241,.4);
  font-size: 2rem;
}
.auth-logo-text { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.tab-bar { display: flex; background: var(--surface2); border-radius: 12px; margin: 0 16px 16px; padding: 4px; }
.tab-btn { flex: 1; padding: 10px; border-radius: 9px; font-size: .9rem; font-weight: 700; color: var(--text2); transition: all .2s; }
.tab-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.auth-form { padding: 0 16px; }

/* ── 29. Profile ── */
.profile-header {
  background: linear-gradient(135deg,var(--primary),var(--secondary));
  border-radius: var(--radius-lg); margin: 16px;
  padding: 28px 20px; text-align: center; color: #fff;
  box-shadow: 0 8px 32px rgba(99,102,241,.3);
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: 3px solid rgba(255,255,255,.6);
  font-size: 2.2rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.wallet-card {
  background: linear-gradient(135deg,#059669,#34D399);
  border-radius: var(--radius-lg); margin: 0 16px 12px;
  padding: 18px 20px; color: #fff;
  box-shadow: 0 6px 24px rgba(5,150,105,.3);
}
.wallet-bal { font-size: 1.5rem; font-weight: 800; margin-top: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: var(--surface);
  margin: 0 16px 10px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); cursor: pointer;
  border: 1.5px solid rgba(99,102,241,.07);
  transition: border-color .2s, box-shadow .2s;
}
.menu-item:hover { border-color: rgba(99,102,241,.2); box-shadow: var(--shadow); }
.menu-icon-wrap {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(99,102,241,.1);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.menu-item-label { font-size: .95rem; font-weight: 600; flex: 1; }
.menu-item-chevron { color: var(--text3); }
.menu-item.danger { border-color: rgba(239,68,68,.15); }
.menu-item.danger .menu-icon-wrap { background: rgba(239,68,68,.1); }
.menu-item.danger .menu-item-label { color: var(--error); }

/* ── 30. Orders ── */
.order-card {
  background: var(--surface); margin: 0 16px 10px;
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  border: 1.5px solid var(--border);
  transition: border-color .2s;
}
.order-card:hover { border-color: var(--primary); }
.status-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.status-pending { background: rgba(245,158,11,.15); color: var(--warning); }
.status-confirmed { background: rgba(99,102,241,.15); color: var(--primary); }
.status-shipped { background: rgba(249,115,22,.15); color: #F97316; }
.status-delivered { background: rgba(34,197,94,.15); color: var(--success); }
.status-cancelled { background: rgba(239,68,68,.15); color: var(--error); }

/* ── 31. Category Cards ── */
.categories-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; padding: 16px; }
.category-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 20px 16px; text-align: center;
  box-shadow: var(--shadow-sm); cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .25s;
}
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.category-card:active { transform: scale(.97); }
.cat-icon { font-size: 2.4rem; margin-bottom: 10px; }
.cat-name { font-size: .9rem; font-weight: 700; }
.cat-count { font-size: .75rem; color: var(--text2); margin-top: 4px; }

/* ── 32. Checkout Steps ── */
.steps-bar { display: flex; justify-content: center; gap: 0; padding: 16px; margin: 0; }
.step-item { display: flex; align-items: center; gap: 0; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--text3); transition: all .3s; }
.step-dot.active { background: var(--primary); color: #fff; box-shadow: 0 3px 12px rgba(99,102,241,.4); }
.step-dot.done { background: var(--success); color: #fff; }
.step-line { width: 40px; height: 2px; background: var(--border); }
.step-line.done { background: var(--success); }

/* ── 33. Address Card ── */
.address-card {
  background: var(--surface); margin: 0 16px 10px;
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-sm); border: 1.5px solid var(--border);
  transition: border-color .2s;
}
.address-card.default { border-color: var(--primary); }
.address-default-badge { font-size: .7rem; font-weight: 700; color: var(--primary); background: rgba(99,102,241,.1); padding: 2px 8px; border-radius: 8px; }

/* ── 34. Settings ── */
.settings-section { margin: 0 16px 16px; }
.settings-section-title { font-size: .8rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; padding-inline-start: 4px; }
.setting-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--surface);
  border-radius: var(--radius-sm); margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}
.setting-label { font-size: .9rem; font-weight: 600; }
.setting-sub { font-size: .75rem; color: var(--text2); }
.toggle { width: 44px; height: 24px; border-radius: 12px; background: var(--border); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; border: none; }
.toggle.on { background: var(--primary); }
.toggle::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.toggle.on::after { inset-inline-start: calc(100% - 21px); }

/* ── 35. Price History Chart ── */
.chart-wrap { padding: 16px; }
.chart-canvas-wrap { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.price-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.price-table th, .price-table td { padding: 10px 14px; font-size: .82rem; border-bottom: 1px solid var(--border); text-align: start; }
.price-table th { font-weight: 700; color: var(--text2); background: var(--surface2); }

/* ── 36. Admin ── */
.admin-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; padding: 16px; }
.stat-box { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 16px; box-shadow: var(--shadow-sm); border-inline-start: 4px solid var(--primary); }
.stat-box-val { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.stat-box-label { font-size: .78rem; color: var(--text2); margin-top: 4px; }

/* ── 37. Loading Screen ── */
.loading-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px;
  min-height: calc(100vh - var(--nav-h) - var(--bottom-h));
  color: var(--text2);
}
.loading-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}

/* ── 38. Back to Top ── */
.back-to-top {
  position: fixed; bottom: calc(var(--bottom-h) + 16px); inset-inline-end: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: all .3s; z-index: 500;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }

/* ── 39. Animations ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.anim-fade-up { animation: fadeInUp .4s ease forwards; }
.anim-scale { animation: scaleIn .35s cubic-bezier(.34,1.56,.64,1) forwards; }

/* stagger children */
.stagger > * { opacity: 0; animation: fadeInUp .4s ease forwards; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }
.stagger > *:nth-child(7) { animation-delay: 360ms; }
.stagger > *:nth-child(8) { animation-delay: 420ms; }

/* ── 40. Auth Guard / Unauthenticated ── */
.auth-prompt {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 24px; gap: 16px; text-align: center;
}
.auth-prompt-icon { font-size: 4rem; }
.auth-prompt h2 { font-size: 1.2rem; font-weight: 700; }
.auth-prompt p { font-size: .87rem; color: var(--text2); max-width: 250px; }

/* ── 41. Order Success ── */
.success-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; gap: 16px; }
.success-icon { width: 90px; height: 90px; border-radius: 50%; background: linear-gradient(135deg,var(--success),#4ADE80); display: flex; align-items: center; justify-content: center; animation: scaleIn .5s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 8px 28px rgba(34,197,94,.35); }

/* ── 42. Order Timeline ── */
.order-timeline { padding: 16px; }
.timeline-item { display: flex; gap: 12px; }
.timeline-left { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--border); border: 3px solid var(--surface); display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; z-index: 1; }
.timeline-dot.active { background: var(--primary); border-color: rgba(99,102,241,.3); }
.timeline-dot.done { background: var(--success); }
.timeline-line { width: 2px; flex: 1; background: var(--border); margin: 4px 0; min-height: 32px; }
.timeline-line.done { background: var(--success); }
.timeline-content { padding-bottom: 20px; flex: 1; padding-inline-start: 4px; }
.timeline-label { font-size: .88rem; font-weight: 700; }
.timeline-date { font-size: .75rem; color: var(--text2); margin-top: 2px; }

/* ── 43. Wishlist Heart ── */
.wish-heart { color: var(--text3); transition: color .2s, transform .2s; }
.wish-heart.active { color: #EC4899; animation: pulse .3s ease; }

/* ── 44. No Internet / Error ── */
.error-retry { display: flex; flex-direction: column; align-items: center; padding: 40px 24px; gap: 12px; text-align: center; }
.error-msg { font-size: .9rem; color: var(--text2); max-width: 240px; }

/* ── 45. Responsive – Full Screen Layout ── */

/* ---- Hide desktop panels on mobile ---- */
.desktop-side { display: none; }

/* ---- Small mobile ---- */
@media (max-width: 360px) {
  .quick-actions { gap: 6px; }
  .qa-tile { padding: 12px 2px; font-size: .66rem; }
  .product-grid { gap: 8px; padding: 0 10px 12px; }
}

/* ---- Phablet / Large mobile (480px+) ---- */
@media (min-width: 480px) {
  :root { --max-w: 100%; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
}

/* ── Desktop sidebar auto-show (1024px+) ── */
@media (min-width: 1024px) {
  :root { --sidebar-w: 260px; --max-w: 100%; }

  /* RTL: sidebar on RIGHT, content fills the left */
  .drawer {
    position: fixed;
    top: 0; bottom: 0;
    right: 0;
    left: auto;
    width: var(--sidebar-w);
    transform: none !important;
    box-shadow: -2px 0 20px rgba(0,0,0,.08);
    z-index: 800;
    border-left: 1px solid var(--border);
    overflow-y: auto;
  }
  /* LTR override: sidebar on LEFT */
  [dir="ltr"] .drawer {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 20px rgba(0,0,0,.08);
  }

  /* No overlay on desktop */
  .drawer-overlay { display: none !important; }

  /* Hide hamburger */
  #drawerToggle { display: none; }

  /* RTL: body right padding = sidebar width, content shifts left */
  body {
    padding-right: var(--sidebar-w);
    padding-left: 0;
    padding-bottom: 0;
  }
  [dir="ltr"] body {
    padding-left: var(--sidebar-w);
    padding-right: 0;
  }

  /* Top nav: full width minus right sidebar (RTL) */
  .top-nav {
    left: 0;
    right: var(--sidebar-w);
    inset-inline: unset;
    max-width: none;
    margin: 0;
    border-radius: 0;
  }
  [dir="ltr"] .top-nav {
    left: var(--sidebar-w);
    right: 0;
  }

  /* Bottom nav hidden on desktop – sidebar provides full navigation */
  .bottom-nav { display: none; }

  /* Content area full width */
  .app-main { max-width: none; margin: 0; }

  /* Product grids – more columns */
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
  .h-card { width: 180px; }

  /* Product Detail: 2-column Layout */
  .pd-layout {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 32px;
    align-items: start;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
  }
  .pd-col-left {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
  }
  .product-gallery {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  .product-info { padding-top: 0 !important; }
  .pd-desktop-price-history { display: block; margin-top: 24px; border: 1px solid var(--border); border-radius: 12px; }
  .pd-mobile-price-history { display: none; }

  /* Toasts – inside content area */
  .toast-container {
    right: calc(var(--sidebar-w) + 16px);
    left: 16px;
    inset-inline: unset;
    max-width: 400px;
  }
  [dir="ltr"] .toast-container { left: calc(var(--sidebar-w) + 16px); right: 16px; }

  /* Back-to-top */
  .back-to-top {
    right: calc(var(--sidebar-w) + 16px);
    inset-inline-end: unset;
    bottom: 24px;
  }
  [dir="ltr"] .back-to-top { right: 16px; left: auto; }

  /* Checkout panel bottom boundary */
  .checkout-panel { bottom: 0; }

  /* Loading height */
  .loading-screen { min-height: calc(100vh - var(--nav-h)); }
}

/* ---- Wide desktop (1280px+) ---- */
@media (min-width: 1280px) {
  :root { --sidebar-w: 280px; }
  .product-grid { grid-template-columns: repeat(5, 1fr); }
  .h-card { width: 200px; }
}

/* ---- Very wide (1600px+) ---- */
@media (min-width: 1600px) {
  .product-grid { grid-template-columns: repeat(6, 1fr); }
}



