@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ═══════════════════════════════════════════════════════════════
   NOVA — clean & professional
   Light surfaces · professional blue · green = savings only
   ═══════════════════════════════════════════════════════════════ */
:root {
  --primary: #1a56db;
  --primary-dark: #1e429f;
  --primary-darker: #233876;
  --primary-bg: #eff6ff;
  --primary-border: #dbe7fd;

  --success: #047857;
  --success-light: #059669;
  --success-bg: #ecfdf5;
  --success-border: #c7ecdb;

  --danger: #dc2626;
  --danger-bg: #fef2f2;

  --bg: #f8f9fb;
  --card: #ffffff;
  --tile: #f1f5f9;
  --border: #e5e7eb;
  --border-strong: #d1d9e6;

  --text-1: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;

  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow: 0 4px 12px rgba(15,23,42,0.07);
  --shadow-lg: 0 12px 32px rgba(15,23,42,0.12);

  --radius-sm: 10px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --nav-h: 64px;
  --header-h: 60px;

  --font: 'IBM Plex Sans Arabic', 'Cairo', Tahoma, sans-serif;
}

html, body { height: 100%; width: 100%; background: var(--bg); direction: rtl; overflow-x: hidden; }

body {
  font-family: var(--font);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#root { height: 100%; width: 100%; display: flex; flex-direction: column; max-width: 100%; position: relative; background: var(--bg); }

/* ═══════════════════════════════ HEADER — Glassmorphism ═══════════════════════════════ */
.app-header {
  background: rgba(26, 86, 219, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 16px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-box {
  width: 36px;
  height: 36px;
  background: #ffffff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
}

.logo-text { color: white; }
.logo-text h1 { font-size: 19px; font-weight: 700; line-height: 1; letter-spacing: 1px; }
.logo-text span { font-size: 10px; color: rgba(255,255,255,0.75); font-weight: 400; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.header-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.16);
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 17px;
  position: relative;
  box-shadow: 0 2px 0 rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.28);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.2s;
}
.header-btn:active {
  background: rgba(255,255,255,0.24);
  transform: translateY(2px);
  box-shadow: 0 0 0 rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.28);
}

.badge {
  position: absolute;
  top: 3px; left: 3px;
  width: 15px; height: 15px;
  background: var(--success-light);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--primary);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.14);
  border: none;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
}

/* ═══════════════════════════════ SEARCH ═══════════════════════════════ */
.search-container {
  background: var(--primary);
  padding: 2px 16px 16px;
  flex-shrink: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 0 14px;
  height: 46px;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(15,23,42,0.12);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-1);
  background: transparent;
  text-align: right;
  font-weight: 400;
}

.search-bar input::placeholder { color: var(--text-3); }
.search-icon { color: var(--text-3); font-size: 17px; }

/* AI Glow Mic Icon */
.search-mic {
  background: linear-gradient(135deg, var(--primary), #d946ef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 19px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.search-mic:hover, .search-mic:active {
  transform: scale(1.15) rotate(5deg);
}

.search-input-wrap { position: relative; flex: 1; }
.search-input {
  width: 100%;
  height: 46px;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-1);
  background: transparent;
  text-align: right;
}

/* ═══════════════════════════════ SCROLL ═══════════════════════════════ */
.page-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + 12px);
  -webkit-overflow-scrolling: touch;
}
.page-scroll::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════ BOTTOM NAV — Glassmorphism ═══════════════════════════════ */
.bottom-nav, .tab-bar {
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  border-top: 1px solid #eef1f5;
  position: sticky;
  bottom: 0;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.nav-item, .tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.18s;
  position: relative;
  min-height: 44px;
}

.nav-item svg, .tab-item svg {
  width: 40px;
  height: 30px;
  padding: 5px 10px;
  border-radius: 12px;
  box-sizing: border-box;
  background: #f1f5f9;
  box-shadow: 0 2px 0 #dfe4ea, inset 0 1px 0 rgba(255,255,255,0.7);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.18s ease;
}

.nav-item.active, .tab-item.active { color: var(--primary); font-weight: 600; }

.nav-item.active svg, .tab-item.active svg {
  stroke: #ffffff;
  background: linear-gradient(180deg, #2f6bf0 0%, #1a56db 100%);
  box-shadow: 0 3px 0 #163fa6, 0 6px 12px rgba(26,86,219,0.38), inset 0 1px 0 rgba(255,255,255,0.4);
  transform: translateY(-4px);
}

.nav-item:active svg, .tab-item:active svg {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 #163fa6, 0 2px 5px rgba(26,86,219,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}

.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════ SECTION HEADERS ═══════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}
.section-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.divider {
  height: 8px;
  background: var(--bg);
  margin: 16px 0;
}
.fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════ BANNERS ═══════════════════════════════ */
.banners-row {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.banners-row::-webkit-scrollbar { display: none; }

.banner-card, .promo-card {
  min-width: calc(100% - 40px);
  height: 140px;
  border-radius: var(--radius-lg);
  scroll-snap-align: start;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.banner-1 { background: var(--primary); }
.banner-2 { background: var(--primary-dark); }
.banner-3 { background: var(--primary-darker); }

.banner-content {
  padding: 20px;
  color: white;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.banner-tag {
  background: rgba(255,255,255,0.18);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  margin-bottom: 8px;
  width: fit-content;
}

.banner-title { font-size: 19px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.banner-sub { font-size: 12px; opacity: 0.75; font-weight: 400; }
.banner-emoji { position: absolute; left: 16px; bottom: 16px; font-size: 52px; opacity: 0.18; }
.banner-art { position: absolute; inset: 0; pointer-events: none; }

.hero-banner, .hero-card { box-shadow: var(--shadow); }

/* ═══════════════════════════════ CATEGORIES ═══════════════════════════════ */
.categories-scroll {
  display: flex;
  gap: 12px;
  padding: 4px 16px 16px;
  overflow-x: auto;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.cat-chip, .category-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.cat-chip:active, .category-circle:active { transform: scale(0.96); }

.cat-icon-wrap, .icon-circle {
  width: 58px;
  height: 58px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--tile);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.cat-chip.active .cat-icon-wrap {
  background: var(--primary-bg);
  border-color: var(--primary);
}

.cat-tile { animation: catPop 0.3s ease both; }
@keyframes catPop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.cat-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
  max-width: 64px;
  line-height: 1.3;
}
.cat-chip.active .cat-name { color: var(--primary); font-weight: 600; }

.cat-anim-icon { display: inline-block; }

/* ═══════════════════════════════ PRODUCT CARDS — Floating Hover State ═══════════════════════════════ */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  border: 1px solid var(--border);
  position: relative;
  animation: cardIn 0.25s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.product-card:active { transform: scale(0.985); box-shadow: var(--shadow); }

@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  }
}

.product-card-img {
  width: 100%;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
}

.product-card-body { padding: 11px 12px 13px; }

.product-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.45;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-brand {
  font-size: 10.5px;
  color: var(--text-3);
  margin-bottom: 9px;
  font-weight: 500;
}

.product-card-price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.price-from { font-size: 9.5px; color: var(--text-3); font-weight: 400; margin-bottom: 2px; }

.price-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  letter-spacing: -0.2px;
}

.price-currency { font-size: 10px; font-weight: 500; color: var(--text-2); }

.product-fav-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 30px;
  height: 30px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}

.stores-count-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════ HORIZONTAL PRODUCTS ═══════════════════════════════ */
.products-scroll {
  display: flex;
  gap: 12px;
  padding: 4px 16px 16px;
  overflow-x: auto;
}
.products-scroll::-webkit-scrollbar { display: none; }

.product-card-h {
  width: 148px;
  flex-shrink: 0;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.product-card-h:active { transform: scale(0.975); box-shadow: var(--shadow); }

@media (hover: hover) {
  .product-card-h:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  }
}

.product-card-h-img {
  width: 100%;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
}

.product-card-h-body { padding: 9px 11px 11px; }

.product-card-h-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.product-card-h-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-top: 5px;
  letter-spacing: -0.2px;
}

.product-card-h-currency { font-size: 10px; color: var(--text-2); font-weight: 500; }

/* ═══════════════════════════════ STORES ═══════════════════════════════ */
.stores-scroll {
  display: flex;
  gap: 10px;
  padding: 4px 16px 16px;
  overflow-x: auto;
}
.stores-scroll::-webkit-scrollbar { display: none; }

.store-chip {
  flex-shrink: 0;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-width: 80px;
  transition: border-color 0.15s, transform 0.15s;
}
.store-chip:active { transform: scale(0.97); border-color: var(--primary); background: var(--primary-bg); }
.store-chip-emoji { font-size: 26px; }
.store-chip-name { font-size: 11px; font-weight: 600; color: var(--text-1); text-align: center; max-width: 70px; line-height: 1.25; }
.store-chip-area { font-size: 10px; color: var(--text-3); }
.store-row { transition: background 0.15s; }
.store-row:active { background: var(--primary-bg); }

.stores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}

.store-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.15s;
}
.store-card:active { transform: scale(0.975); border-color: var(--primary); }

.store-card-emoji { font-size: 34px; }
.store-card-name { font-size: 12px; font-weight: 600; color: var(--text-1); text-align: center; line-height: 1.3; }
.store-card-area { font-size: 11px; color: var(--text-3); }
.store-card-type { font-size: 10px; background: var(--primary-bg); border: 1px solid var(--primary-border); color: var(--primary); padding: 3px 9px; border-radius: 20px; font-weight: 600; }

/* ═══════════════════════════════ FILTER PILLS ═══════════════════════════════ */
.filter-bar {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill, .quick-filter, .chip, .tag-pill, .trending-chip, .search-tag {
  flex-shrink: 0;
  padding: 7px 15px;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-pill:active, .quick-filter:active, .chip:active, .trending-chip:active { border-color: var(--primary); color: var(--primary); }

.filter-pill.active, .quick-filter.active, .chip.active {
  background: linear-gradient(180deg, #2f6bf0 0%, #1a56db 100%);
  border-color: #163fa6;
  color: white;
  box-shadow: 0 3px 0 #163fa6, 0 5px 10px rgba(26,86,219,0.28), inset 0 1px 0 rgba(255,255,255,0.35);
  transform: translateY(-1px);
}
.filter-pill.active:active, .quick-filter.active:active, .chip.active:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #163fa6, 0 1px 3px rgba(26,86,219,0.22), inset 0 1px 0 rgba(255,255,255,0.35);
}

/* ═══════════════════════════════ PRODUCT LIST ═══════════════════════════════ */
.product-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  margin: 0 16px 10px;
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.product-list-item:active { transform: scale(0.985); box-shadow: var(--shadow); }

@media (hover: hover) {
  .product-list-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  }
}

.product-list-emoji {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
  background: var(--tile);
  border: 1px solid var(--border);
}

.product-list-info { flex: 1; min-width: 0; }

.product-list-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-list-brand {
  font-size: 10.5px;
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: 500;
}

.product-list-stores {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 400;
}

.product-list-right { text-align: left; flex-shrink: 0; }

.product-list-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  letter-spacing: -0.2px;
}

.product-list-currency { font-size: 10px; color: var(--text-2); font-weight: 500; }
.product-list-label { font-size: 9.5px; color: var(--text-3); text-align: left; margin-top: 3px; }

/* ═══════════════════════════════ PRODUCT DETAIL ═══════════════════════════════ */
.detail-header, .page-header {
  background: var(--primary);
  padding: 50px 16px 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
}
.page-header {
  padding: 14px 16px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  flex-shrink: 0;
}

.detail-back, .page-header-back {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.16);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 19px;
}
.page-header-back { position: static; flex-shrink: 0; }

.detail-fav {
  position: absolute;
  top: 14px;
  left: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.16);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

.detail-emoji-wrap {
  width: 96px;
  height: 96px;
  background: rgba(255,255,255,0.14);
  border: none;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  margin-bottom: 14px;
}

.detail-product-name {
  font-size: 17px;
  font-weight: 700;
  color: white;
  text-align: center;
  margin-bottom: 4px;
}

.detail-product-sub { font-size: 11.5px; color: rgba(255,255,255,0.7); }

.page-header-title { font-size: 16px; font-weight: 700; color: white; flex: 1; }
.page-header-emoji { font-size: 22px; }

/* Price summary */
.price-summary {
  background: var(--card);
  margin: 16px;
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.price-summary-item { text-align: center; }
.price-summary-label { font-size: 10.5px; color: var(--text-3); font-weight: 500; margin-bottom: 5px; }
.price-summary-val { font-size: 19px; font-weight: 700; letter-spacing: -0.2px; }
.price-summary-val.green { color: var(--success); }
.price-summary-val.red { color: var(--danger); }
.price-summary-val.blue { color: var(--primary); }
.price-summary-divider { width: 1px; height: 38px; background: var(--border); }
.price-summary-currency { font-size: 10px; color: var(--text-2); font-weight: 500; }

/* Savings note */
.savings-banner {
  margin: 0 16px 16px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.savings-banner-icon { font-size: 22px; }
.savings-banner-text { flex: 1; }
.savings-banner-title { font-size: 13px; font-weight: 700; color: var(--success); }
.savings-banner-sub { font-size: 11px; color: #10805f; }

/* ═══════════════════════════════ PRICE COMPARISON ═══════════════════════════════ */
.price-list { padding: 0 16px 16px; }

.price-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 10px;
  margin-top: 4px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

/* 3D Depth Best Deal Upgrade */
.price-row.best-deal {
  transform: scale(1.02);
  background: var(--card);
  border: 1px solid var(--success);
  box-shadow: 
    0 8px 24px rgba(4, 120, 87, 0.12),
    0 2px 4px rgba(4, 120, 87, 0.04), 
    inset 0 2px 0 rgba(255, 255, 255, 0.8);
  z-index: 10;
  position: relative;
}

.price-row.best-deal::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--success);
}

.price-row-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tile);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
}

.price-row.best-deal .price-row-rank {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.price-row-emoji { font-size: 20px; flex-shrink: 0; }
.price-row-info { flex: 1; }
.price-row-store { font-size: 13px; font-weight: 600; color: var(--text-1); }
.price-row-area { font-size: 11px; color: var(--text-3); }

.price-row-right { text-align: left; flex-shrink: 0; }
.price-row-price { font-size: 18px; font-weight: 700; color: var(--text-1); line-height: 1; letter-spacing: -0.2px; }
.price-row.best-deal .price-row-price { color: var(--success); }
.price-row-bhd { font-size: 10px; color: var(--text-2); font-weight: 500; }

@keyframes softPulse {
  0% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(4, 120, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0); }
}

.best-badge {
  background: var(--success);
  color: white;
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--font);
  display: inline-block;
  margin-top: 3px;
  animation: softPulse 2s infinite;
}

.out-of-stock-badge {
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 9.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 3px;
}

/* ═══════════════════════════════ SEARCH RESULTS ═══════════════════════════════ */
.search-page-bar {
  background: var(--card);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-page-input {
  flex: 1;
  height: 44px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-1);
  text-align: right;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-page-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.12); }

.search-back-btn {
  width: 44px; height: 44px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 19px;
  color: var(--text-2);
  flex-shrink: 0;
}

.results-count {
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 400;
}
.results-count span { color: var(--primary); font-weight: 700; }

/* ═══════════════════════════════ EMPTY STATES ═══════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  gap: 12px;
  text-align: center;
}

.empty-emoji { font-size: 56px; }
.empty-title { font-size: 17px; font-weight: 700; color: var(--text-1); }
.empty-sub { font-size: 13px; color: var(--text-3); line-height: 1.7; }

.empty-btn {
  margin-top: 10px;
  background: linear-gradient(180deg, #2f6bf0 0%, #1a56db 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 30px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 0 #163fa6, 0 7px 14px rgba(26,86,219,0.32), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.empty-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #163fa6, 0 2px 4px rgba(26,86,219,0.25), inset 0 1px 0 rgba(255,255,255,0.35);
}

/* ═══════════════════════════════ NOVA POINTS ═══════════════════════════════ */
.nova-points {
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  margin: 0 16px 16px;
  border-radius: var(--radius);
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nova-points-left { color: var(--text-1); }
.nova-points-label { font-size: 10.5px; color: var(--primary); font-weight: 600; }
.nova-points-value { font-size: 22px; font-weight: 700; color: var(--text-1); letter-spacing: -0.2px; margin: 2px 0; }
.nova-points-sub { font-size: 10.5px; color: var(--text-3); }
.nova-points-btn {
  background: linear-gradient(180deg, #2f6bf0 0%, #1a56db 100%);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  color: white;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 0 #163fa6, 0 6px 12px rgba(26,86,219,0.32), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.nova-points-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #163fa6, 0 1px 3px rgba(26,86,219,0.25), inset 0 1px 0 rgba(255,255,255,0.35);
}

/* ═══════════════════════════════ STATS ═══════════════════════════════ */
.stats-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-anim { animation: cardIn 0.3s ease both; }

.stat-value { font-size: 21px; font-weight: 700; color: var(--primary); letter-spacing: -0.3px; }
.stat-label { font-size: 10.5px; color: var(--text-3); font-weight: 500; margin-top: 3px; }

/* ═══════════════════════════════ OVERLAYS ═══════════════════════════════ */
.modal, .drawer, .sheet, .bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(17,24,39,0.45);
}
.bottom-sheet > *, .sheet > *, .drawer > * {
  background: var(--card);
  width: 100%;
  max-width: 430px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 16px calc(20px + var(--nav-h));
  box-shadow: var(--shadow-lg);
  animation: sheetUp 0.25s cubic-bezier(.22,1,.36,1) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ═══════════════════════════════ UTILITIES ═══════════════════════════════ */
.pb-nav { padding-bottom: calc(var(--nav-h) + 16px); }

.skeleton {
  background: linear-gradient(90deg, #eef0f3 25%, #f8f9fb 37%, #eef0f3 63%);
  background-size: 400% 100%;
  animation: skeletonWave 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonWave {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

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

/* ═══════════════════════════════ RESPONSIVE / SAFE AREA ═══════════════════════════════ */
#app-root {
  height: 100vh;
  height: var(--app-height, 100vh);
}

.bottom-nav, .tab-bar { padding-bottom: env(safe-area-inset-bottom, 0); }
.page-scroll { padding-bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0)); scroll-behavior: smooth; }
.app-header { padding-top: env(safe-area-inset-top, 0); height: calc(var(--header-h) + env(safe-area-inset-top, 0)); }

* { max-width: 100vw; }
html, body { overflow-x: hidden; }

@media (max-width: 320px) {
  .products-grid { grid-template-columns: 1fr; }
}

.nav-item, .tab-item { min-height: 44px; }

@media screen and (max-width: 480px) {
  #app-root { max-width: 100% !important; }
}

@media screen and (max-width: 390px) {
  .logo-text span { display: none; }
}