/* ═══════════════════════════════════════════════════════════════════════════
   deals.shariar.dev — Design System
   Light/Dark theme, mobile-first, RTL/LTR bilingual support
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (Light Theme Default) ── */
:root {
  /* Brand */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-dark: #1e40af;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;

  /* Surfaces */
  --bg: #f0f4f9;
  --bg-gradient: linear-gradient(135deg, #f0f4f9 0%, #e8eef5 100%);
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-hover: 0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);

  /* Header */
  --header-bg: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  --header-text: #ffffff;

  /* Text */
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Borders */
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Misc */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.25s cubic-bezier(.4,0,.2,1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', 'Noto Sans', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --card-bg: #1e293b;
  --card-border: #334155;
  --card-shadow: 0 1px 3px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.1);
  --card-shadow-hover: 0 10px 25px rgba(0,0,0,.3), 0 4px 10px rgba(0,0,0,.2);

  --header-bg: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);

  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: #334155;
  --border-light: #1e293b;

  --primary-light: #1e3a5f;
  --success-light: #064e3b;
  --danger-light: #7f1d1d;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }
button { cursor: pointer; font-family: inherit; }

/* ── Layout ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header ── */
.header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  padding-bottom: 0;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--header-text);
  flex-shrink: 0;
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(4px);
}
.logo-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.logo-text span {
  font-size: 11px;
  opacity: .75;
  display: block;
  font-weight: 400;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--header-text);
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.header-btn:hover {
  background: rgba(255,255,255,.2);
  transform: translateY(-1px);
}
.header-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
}
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: inline; }
[data-theme="dark"] .theme-toggle .sun { display: inline; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ── Search Bar ── */
.search-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 16px;
  position: relative;
  z-index: 50;
}
.search-container {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  overflow: hidden;
  border: 2px solid transparent;
  transition: var(--transition);
}
.search-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(37,99,235,.15);
}
.search-container input {
  flex: 1;
  border: none;
  padding: 16px 20px;
  font-size: 16px;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
}
.search-container input::placeholder { color: var(--text-muted); }
.search-container button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 24px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.search-container button:hover { background: var(--primary-hover); }
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--card-shadow-hover);
  z-index: 100;
  display: none;
  max-height: 300px;
  overflow-y: auto;
}
.search-suggestions.active { display: block; }
.search-suggestion-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.search-suggestion-item:hover { background: var(--primary-light); }
.search-suggestion-item:last-child { border-bottom: none; }
.search-suggestion-item .sugg-icon { font-size: 18px; }
.search-suggestion-item .sugg-name { flex: 1; }
.search-suggestion-item .sugg-cat { font-size: 11px; color: var(--text-muted); }

/* ── Flash Sale Banner ── */
.flash-sale {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 16px;
}
.flash-sale-banner {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #dc2626 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.flash-sale-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 20px,
    rgba(255,255,255,.05) 20px,
    rgba(255,255,255,.05) 40px
  );
}
.flash-sale-content { position: relative; z-index: 1; }
.flash-sale-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}
.flash-sale-sub {
  font-size: 14px;
  opacity: .9;
}
.flash-countdown {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
}
.countdown-item {
  background: rgba(0,0,0,.25);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  text-align: center;
  min-width: 50px;
}
.countdown-value {
  font-size: 22px;
  font-weight: 800;
  display: block;
  line-height: 1.2;
}
.countdown-label {
  font-size: 10px;
  text-transform: uppercase;
  opacity: .8;
}

/* ── Stats Bar ── */
.stats-bar {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  transition: var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.amber { background: #fef3c7; color: #d97706; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-value {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Categories ── */
.categories-section {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 16px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
}
.section-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}
.categories-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.categories-grid::-webkit-scrollbar { display: none; }
.category-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 24px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  color: var(--text);
  font-family: inherit;
  flex-shrink: 0;
}
.category-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.category-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.category-chip .chip-icon { font-size: 15px; }

/* ── Sort Bar ── */
.sort-bar {
  max-width: 1200px;
  margin: 16px auto 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sort-bar .result-count {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.sort-select {
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--card-bg);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}
.sort-select:focus { border-color: var(--primary); }

/* ── Products Grid ── */
.products-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Product Card ── */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary);
}
.product-badge {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
[dir="ltr"] .product-badge { right: 12px; }
[dir="rtl"] .product-badge { left: 12px; }
.product-badge.saving {
  background: var(--success);
  color: white;
}
.product-badge.flash {
  background: var(--danger);
  color: white;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}
.product-badge.lowest {
  background: var(--accent);
  color: white;
}

.product-image-wrap {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--border-light);
  position: relative;
  overflow: hidden;
}
.product-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.product-card:hover .product-image-wrap img {
  transform: scale(1.08);
}
.product-image-wrap .placeholder-icon {
  font-size: 64px;
  opacity: .3;
}

.product-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-category {
  font-size: 10px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.product-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.product-rating {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.product-rating .stars { letter-spacing: 1px; }
.product-rating span {
  color: var(--text-muted);
  font-size: 11px;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.current-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}
.was-price {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
}
.savings-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
}
.product-platforms {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.platform-dot {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  opacity: .8;
}
.platform-dot.available { opacity: 1; }
.platform-dot.amazon { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .platform-dot.amazon { background: #78350f40; color: #fbbf24; }

.product-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}
.product-actions .btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}
.btn-primary-solid {
  background: var(--primary);
  color: white;
}
.btn-primary-solid:hover {
  background: var(--primary-hover);
  transform: scale(1.02);
}
.btn-share {
  background: var(--border-light);
  color: var(--text-secondary);
  flex: 0 0 42px;
  border-radius: 50%;
  font-size: 16px;
}
.btn-share:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Skeleton Loaders ── */
.skeleton {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  overflow: hidden;
  padding: 0;
}
.skeleton-img {
  height: 200px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-body {
  padding: 14px 16px 16px;
}
.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 8px;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.h20 { height: 20px; }
.skeleton-line.h30 { height: 30px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Coupon Section ── */
.coupons-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 20px;
}
.coupons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.coupon-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--primary);
  padding: 18px;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
}
.coupon-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}
.coupon-card.expiring {
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--danger-light) 100%);
}
.coupon-store {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.coupon-discount {
  font-size: 28px;
  font-weight: 800;
  color: var(--success);
  margin-bottom: 4px;
}
.coupon-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}
.coupon-expiry {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.coupon-expiry.expiring-soon { color: var(--danger); font-weight: 700; }
.coupon-code-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.coupon-code {
  flex: 1;
  padding: 10px 14px;
  background: var(--border-light);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 2px;
  color: var(--text);
  user-select: all;
}
.coupon-copy-btn {
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.coupon-copy-btn:hover { background: var(--primary-hover); }
.coupon-copy-btn.copied {
  background: var(--success);
  animation: scale-pop .3s ease;
}
@keyframes scale-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ── Comparison Table (in modal/product page) ── */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.comparison-table th {
  background: var(--border-light);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-align: inherit;
}
.comparison-table td {
  padding: 10px 14px;
  font-size: 14px;
  border-top: 1px solid var(--border);
}
.comparison-table tr:hover td { background: var(--border-light); }
.comparison-table .best-price {
  font-weight: 800;
  color: var(--success);
}
.comparison-table .best-price::after {
  content: ' ★';
  font-size: 12px;
}
.comparison-table .btn-buy {
  padding: 6px 14px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.comparison-table .btn-buy:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

/* ── Featured Deal Banner ── */
.featured-deal {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 16px;
}
.featured-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  box-shadow: var(--card-shadow-hover);
}
.featured-image {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: white;
  padding: 12px;
}
.featured-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.featured-info { flex: 1; }
.featured-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.featured-name {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.3;
}
.featured-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.featured-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.featured-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}
.featured-was {
  font-size: 18px;
  color: var(--text-muted);
  text-decoration: line-through;
}
.featured-save {
  font-size: 14px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.featured-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  transition: var(--transition);
  font-family: inherit;
}
.featured-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

/* ── Footer ── */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 32px 16px 20px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}
.footer h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.footer p, .footer a {
  font-size: 13px;
  line-height: 2;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
}
.footer a:hover { color: var(--primary); }
.footer-bottom {
  max-width: 1200px;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  animation: modalIn .3s ease;
  border: 1px solid var(--card-border);
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
[dir="ltr"] .modal-close { right: 12px; }
[dir="rtl"] .modal-close { left: 12px; }
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-image {
  width: 100%;
  max-height: 250px;
  object-fit: contain;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--border-light);
}
.modal h2 { font-size: 20px; margin-bottom: 8px; line-height: 1.3; }
.modal .price-large { font-size: 30px; font-weight: 800; color: var(--primary); }
.modal .price-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

/* Specs list */
.specs-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px 0;
}
.specs-list li {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.specs-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
[dir="ltr"] .toast-container { right: 20px; }
[dir="rtl"] .toast-container { left: 20px; }
.toast {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  box-shadow: var(--card-shadow-hover);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn .3s ease, toastOut .3s ease 2.5s forwards;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
[data-theme="dark"] .toast { background: #1e293b; }
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ── Empty / Loading States ── */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.loading-state .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }

/* ── WhatsApp Floating Button ── */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  z-index: 998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(37,211,102,.3);
  transition: var(--transition);
  text-decoration: none;
}
[dir="ltr"] .whatsapp-float { left: 20px; }
[dir="rtl"] .whatsapp-float { right: 20px; }
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37,211,102,.4);
  color: white;
}

/* ── RTL Adjustments ── */
[dir="rtl"] .search-container input { text-align: right; }
[dir="rtl"] .featured-card { text-align: right; }
[dir="rtl"] .comparison-table th,
[dir="rtl"] .comparison-table td { text-align: right; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .header-inner { padding: 10px 12px 6px; }
  .logo-text h1 { font-size: 16px; }
  .logo-text span { font-size: 10px; }
  .logo-icon { width: 34px; height: 34px; font-size: 16px; }
  .header-btn { padding: 5px 10px; font-size: 12px; }
  .header-btn-icon { width: 32px; height: 32px; }
  .header-actions { gap: 4px; }

  .search-section { padding: 0 12px 12px; }
  .search-container input { padding: 12px 16px; font-size: 15px; }
  .search-container button { padding: 0 16px; font-size: 14px; }
  .search-container button span { display: none; }

  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-image-wrap { height: 150px; padding: 12px; }
  .product-body { padding: 10px 12px 12px; }
  .product-name { font-size: 13px; }
  .current-price { font-size: 18px; }
  .product-actions .btn { font-size: 12px; padding: 8px; }
  .btn-share { flex: 0 0 36px; height: 36px; font-size: 14px; }

  .coupons-grid { grid-template-columns: 1fr; gap: 12px; }

  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-value { font-size: 16px; }
  .stat-icon { width: 34px; height: 34px; font-size: 15px; }

  .featured-card { flex-direction: column; text-align: center; padding: 16px; }
  .featured-image { width: 120px; height: 120px; }
  .featured-price-row { justify-content: center; }
  .featured-name { font-size: 17px; }

  .flash-sale-banner { padding: 16px; flex-direction: column; text-align: center; }
  .countdown-item { padding: 6px 10px; min-width: 40px; }
  .countdown-value { font-size: 18px; }

  .modal { padding: 16px; }
  .specs-list { grid-template-columns: 1fr; }

  .section-title { font-size: 16px; }
  .skeleton-img { height: 150px; }
}

@media (max-width: 420px) {
  .products-grid { grid-template-columns: 1fr; gap: 10px; }
  .header-btn span { display: none; }
  .header-btn { padding: 6px 10px; }
}

/* ── Print ── */
@media print {
  .header, .search-section, .footer, .whatsapp-float, .modal-overlay { display: none !important; }
  .product-card { break-inside: avoid; border: 1px solid #ddd; }
}
