/* ===================================================================
   شمس العراق — الهوية البصرية
   برتقالي غالب، أصفر شمسي، لمسات سوداء في الإطارات
   =================================================================== */

:root {
  --sun-orange: #FF8C00;
  --sun-orange-dark: #E67700;
  --sun-yellow: #FFB300;
  --sun-yellow-light: #FFD54F;
  --ink: #1A1A1A;
  --ink-soft: #3a3a3a;
  --line: #ececec;
  --bg: #fff8ef;
  --card: #ffffff;
  --muted: #8a8a8a;
  --success: #2e7d32;
  --danger: #c62828;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(230, 119, 0, 0.10);
  --shadow-hover: 0 10px 30px rgba(230, 119, 0, 0.22);
  --font: "Segoe UI", "Tahoma", "Cairo", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
}

/* لمسات لسهولة اللمس والماوس */
a, button, .btn, .bn-item, .cat-chip, .top-link, select, input, .tile, .product-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;  /* إزالة تأخير 300ms على اللمس */
}
button, .btn, a, .bn-item { -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--sun-orange); outline-offset: 2px; }
.drag-scroll, .hscroll { -webkit-overflow-scrolling: touch; }
img { -webkit-user-drag: none; user-drag: none; }

a { color: var(--sun-orange-dark); text-decoration: none; }
a:hover { color: var(--sun-orange); }

img { max-width: 100%; }

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

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--sun-orange);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: var(--sun-orange-dark); color: #fff; box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-yellow { background: var(--sun-yellow); color: var(--ink); }
.btn-yellow:hover { background: var(--sun-yellow-light); color: var(--ink); }
.btn-ghost { background: #fff; color: var(--ink); }
.btn-ghost:hover { background: #fff6e9; color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-width: 1.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- الهيدر ---------- */
.topbar {
  background: linear-gradient(120deg, rgba(255,140,0,.72) 0%, rgba(255,179,0,.72) 100%);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  color: #fff;
  border-bottom: 1px solid rgba(0,0,0,.18);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand .logo {
  width: 42px; height: 42px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  object-fit: contain;
}
.brand .brand-name { font-size: 18px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* أيقونة الرسائل في الهيدر */
.icon-btn {
  position: relative; flex: 0 0 auto;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: rgba(0,0,0,.14); border: 1.5px solid rgba(0,0,0,.3);
  border-radius: 10px; color: #fff;
}
.icon-btn:hover { background: rgba(0,0,0,.24); color: #fff; }
.icon-badge {
  position: absolute; top: -6px; left: -6px;
  background: var(--danger); color: #fff;
  border-radius: 50%; min-width: 18px; height: 18px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ---------- البحث العصري بالاقتراحات ---------- */
.search-box { position: relative; flex: 1; }
.search-suggest {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0; left: 0;
  background: #fff; border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: var(--shadow-hover); z-index: 80;
  max-height: 70vh; overflow-y: auto; padding: 6px;
}
.search-suggest.open { display: block; }
.ss-group { font-size: 12px; font-weight: 800; color: var(--muted); padding: 8px 10px 4px; }
.ss-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); }
.ss-item:hover { background: #fff3e0; color: var(--ink); }
.ss-thumb { width: 40px; height: 40px; border-radius: 8px; background: #fff3e0; display: flex; align-items: center; justify-content: center; font-size: 18px; overflow: hidden; flex: 0 0 auto; }
.ss-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ss-text { display: flex; flex-direction: column; }
.ss-text b { font-size: 14px; font-weight: 600; }
.ss-text small { color: var(--sun-orange-dark); font-weight: 700; }
.ss-empty { padding: 14px; text-align: center; color: var(--muted); }

/* ---------- شريط المنتج العلوي (رجوع/مشاركة) ---------- */
.product-topbar {
  position: sticky; top: 56px; z-index: 35;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
}
.pt-btn { background: #fff3e0; border: 1.5px solid var(--sun-orange); color: var(--ink);
  border-radius: 20px; padding: 6px 14px; font-weight: 700; font-size: 13px; cursor: pointer; }
.pt-btn:hover { background: #ffe7c4; }
.pt-title { font-weight: 700; font-size: 14px; color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- شبكة كل المتاجر ---------- */
.stores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.store-card2 { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.store-card2:hover { border-color: var(--sun-orange); box-shadow: var(--shadow-hover); }
.sc2-banner { height: 80px; position: relative; background-size: cover; background-position: center; }
.sc2-badge { position: absolute; top: 8px; right: 8px; background: var(--ink); color: var(--sun-yellow); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.sc2-body { padding: 10px 12px; }
.sc2-name { font-weight: 800; font-size: 15px; }
.sc2-thumbs { display: flex; gap: 5px; margin-top: 8px; }
.sc2-thumbs img, .sc2-thumbs .ph { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: #fff3e0; border: 1px solid var(--line); }

/* تقليل الفراغ بين الصفوف المتلاصقة */
.section.tight { margin: 12px 0; }

/* ---------- المحادثة الحية ---------- */
.chat-card { padding: 0; overflow: hidden; }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(120deg, var(--sun-orange), var(--sun-yellow));
  color: #fff; border-bottom: 2px solid var(--ink);
}
.chat-title { font-weight: 800; font-size: 16px; display: flex; flex-direction: column; }
.chat-title .online { font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 5px; opacity: .95; }
.chat-body {
  height: 60vh; min-height: 320px; overflow-y: auto;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
  background: #fff8ef;
}
.msg { max-width: 78%; display: flex; flex-direction: column; }
.msg.me { align-self: flex-start; align-items: flex-start; }
.msg.them { align-self: flex-end; align-items: flex-end; }
.msg .bubble {
  padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.6;
  border: 1.5px solid var(--line); word-break: break-word;
}
.msg.me .bubble { background: var(--sun-orange); color: #fff; border-color: var(--sun-orange-dark); border-bottom-right-radius: 4px; }
.msg.them .bubble { background: #fff; color: var(--ink); border-bottom-left-radius: 4px; }
.msg .meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-input input {
  flex: 1; padding: 11px 14px; border: 1.5px solid #d8d8d8; border-radius: 22px;
  font-family: inherit; font-size: 15px; outline: none;
}
.chat-input input:focus { border-color: var(--sun-orange); }

.search {
  flex: 1;
  display: flex;
  background: #fff;
  border-radius: 10px;
  border: 2px solid var(--ink);
  overflow: hidden;
}
.search input {
  flex: 1;
  border: 0;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: transparent;
}
.search button {
  border: 0;
  background: var(--ink);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  font-size: 16px;
}

.top-actions { display: flex; align-items: center; gap: 8px; }
.top-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #fff;
  background: rgba(0,0,0,.12);
  padding: 7px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(0,0,0,.35);
  font-size: 12px;
  font-weight: 700;
  position: relative;
}
.top-link:hover { color: #fff; background: rgba(0,0,0,.22); }
.top-link .ic { font-size: 18px; }
.badge-count {
  position: absolute;
  top: -7px; left: -7px;
  background: var(--ink);
  color: var(--sun-yellow);
  border-radius: 50%;
  min-width: 20px; height: 20px;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.top-link.merchant { background: var(--ink); border-color: var(--sun-yellow); }

/* ---------- صف البحث + زر الثلاث خطوط ---------- */
.search-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }

.hamburger {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}
.hamburger span { display: block; width: 22px; height: 3px; border-radius: 3px; background: var(--sun-yellow); transition: .2s; }
.hamburger:hover { background: #000; }

/* ---------- درج التصنيفات (Off-canvas) ---------- */
.cat-drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.cat-drawer.open { visibility: visible; }
.cat-drawer-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .25s ease;
}
.cat-drawer.open .cat-drawer-overlay { opacity: 1; }
.cat-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 290px; max-width: 84vw;
  background: var(--card);
  border-left: 3px solid var(--ink);
  box-shadow: -8px 0 28px rgba(0,0,0,.25);
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.cat-drawer.open .cat-drawer-panel { transform: translateX(0); }
.cat-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(120deg, var(--sun-orange), var(--sun-yellow));
  color: #fff; font-weight: 800; font-size: 18px;
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0;
}
.cat-drawer-close {
  background: rgba(0,0,0,.2); color: #fff; border: 0;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px;
}
.cat-drawer-link {
  display: block; padding: 14px 18px;
  color: var(--ink); font-weight: 600; font-size: 15px;
  border-bottom: 1px solid var(--line);
}
.cat-drawer-link:hover { background: #fff3e0; color: var(--ink); }
.cat-drawer-link.all { background: var(--ink); color: #fff; }
.cat-drawer-link.all:hover { background: #000; color: var(--sun-yellow); }

/* ---------- شجرة التصنيفات داخل الدرج ---------- */
.cat-tree-row {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.cat-tree-link {
  flex: 1; padding: 13px 18px; color: var(--ink); font-weight: 600; font-size: 15px;
}
.cat-tree-link:hover { background: #fff3e0; color: var(--ink); }
.cat-tree-arrow {
  width: 48px; flex: 0 0 auto;
  background: #fff8ef; border: 0; border-right: 1px solid var(--line);
  color: var(--sun-orange-dark); font-size: 16px; cursor: pointer;
  transition: transform .15s ease;
}
.cat-tree-arrow:hover { background: #ffe7c4; }
.cat-tree-children { display: none; background: #fffdf9; }
.cat-tree-node.open > .cat-tree-children { display: block; }
/* إزاحة الأبناء للداخل لإظهار التسلسل */
.cat-tree-children .cat-tree-link { padding-right: 36px; font-weight: 500; font-size: 14px; }
.cat-tree-children .cat-tree-children .cat-tree-link { padding-right: 54px; }
.cat-tree-children .cat-tree-children .cat-tree-children .cat-tree-link { padding-right: 72px; }
.cat-tree-loading { padding: 10px 18px; color: var(--muted); font-size: 13px; }

/* ---------- الأقسام والعناوين ---------- */
.section { margin: 26px 0; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 20px;
  font-weight: 800;
  position: relative;
  padding-right: 14px;
}
.section-title::before {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 24px;
  background: var(--sun-orange);
  border-radius: 4px;
}

/* ---------- البانر الترحيبي ---------- */
.hero {
  background: linear-gradient(120deg, var(--sun-orange) 0%, var(--sun-yellow) 100%);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: #fff;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0; font-size: 26px; text-shadow: 0 1px 3px rgba(0,0,0,.25); }
.hero p { margin: 8px 0 0; font-size: 16px; }

/* ---------- السلايدر الأفقي ---------- */
.hscroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }
.hscroll::-webkit-scrollbar { height: 8px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--sun-yellow); border-radius: 8px; }

/* ---------- منطقة سحب أفقي بدون شريط سكرول ظاهر ---------- */
.drag-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;          /* فايرفوكس */
  -ms-overflow-style: none;       /* إيدج قديم */
  cursor: grab;
  scroll-behavior: smooth;
}
.drag-scroll::-webkit-scrollbar { display: none; }  /* كروم/سفاري */
.drag-scroll.dragging { cursor: grabbing; scroll-behavior: auto; }
.drag-scroll.dragging a { pointer-events: none; }
.drag-scroll > * { flex: 0 0 auto; }

/* ---------- البطاقة المربعة بصور مصغرة ---------- */
.tile {
  width: 168px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  color: var(--ink);
  transition: box-shadow .15s ease, transform .08s ease;
  user-select: none;
}
.tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); color: var(--ink); }
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 1/1;
  background: var(--line);
}
.tile-grid.mini { aspect-ratio: 2/1; }
.tile-thumb {
  background: #fff8ef;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 26px; color: var(--sun-yellow);
}
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.tile-thumb.empty { background: #fff3e0; }
.tile-label {
  padding: 9px 10px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  border-top: 1.5px solid var(--line);
}
/* بطاقة المتجر المميز */
.store-tile .tile-banner {
  height: 70px; background-size: cover; background-position: center;
  position: relative; border-bottom: 1.5px solid var(--ink);
}
.tile-store-logo {
  position: absolute; bottom: -16px; right: 10px;
  width: 38px; height: 38px; border-radius: 8px; object-fit: cover;
  border: 2px solid #fff; background: #fff;
}

/* ---------- بطاقة المتجر المميز ---------- */
.store-card {
  width: 260px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.store-card:hover { box-shadow: var(--shadow-hover); }
.store-card .banner {
  height: 90px;
  background: linear-gradient(120deg, var(--sun-orange), var(--sun-yellow));
}
.store-card .body { padding: 12px; }
.store-card .thumbs { display: flex; gap: 6px; margin-top: 8px; }
.store-card .thumbs img, .store-card .thumbs .ph {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  background: #fff3e0; border: 1px solid var(--line);
}
.store-name { font-weight: 800; font-size: 16px; }
.store-meta { color: var(--muted); font-size: 12px; }

/* ---------- شبكة المنتجات ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, transform .08s ease, border-color .15s ease;
}
.product-card:hover { box-shadow: var(--shadow-hover); border-color: var(--sun-orange); transform: translateY(-2px); }
.product-card .img {
  position: relative;
  aspect-ratio: 1/1;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-card .img img { width: 100%; height: 100%; object-fit: cover; }
.product-card .img .placeholder { color: var(--sun-yellow); font-size: 46px; }
.discount-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--danger); color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 8px;
}
.installment-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: var(--ink); color: var(--sun-yellow);
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 8px;
}
.product-card .body { padding: 7px 8px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.product-title { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price { font-size: 15px; font-weight: 800; color: var(--sun-orange-dark); }
.price small { font-size: 11px; font-weight: 600; color: var(--muted); }
.price-old { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.installment-note { font-size: 11px; color: var(--ink-soft); }
.rating { color: var(--sun-yellow); font-size: 12px; }
.rating .count { color: var(--muted); }

/* ---------- بطاقات التصنيفات ---------- */
.cat-card {
  width: 150px; text-align: center;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 16px 10px;
}
.cat-card:hover { border-color: var(--sun-orange); }
.cat-card .circle {
  width: 70px; height: 70px; margin: 0 auto 10px;
  border-radius: 50%; background: #fff3e0;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--sun-orange);
}
.cat-card .name { font-weight: 700; font-size: 14px; }

/* ---------- شريط الأدوات/الفلترة ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.filter-dropdown { position: relative; }
.filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-right: 5px; padding: 0 4px;
  background: var(--ink); color: var(--sun-yellow);
  border-radius: 50%; font-size: 11px; font-weight: 800;
}
.clear-filters { color: var(--danger); border-color: var(--danger); }
.clear-filters:hover { background: #ffebee; color: var(--danger); }
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: #fff; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 14px;
}
/* قائمة فلترة منسدلة — مخفية حتى الضغط على زر الفلترة، تظهر تحته */
.toolbar.collapsible {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  width: min(320px, 90vw);
  flex-direction: column;
  align-items: stretch;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  margin-bottom: 0;
}
.toolbar.collapsible.open { display: flex; animation: slideDown .18s ease; }
.toolbar.collapsible label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.toolbar.collapsible select, .toolbar.collapsible input[type="number"] { width: 100%; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.toolbar select, .toolbar input {
  padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--line);
  font-family: inherit; font-size: 14px; background: #fff;
}

/* ---------- النماذج ---------- */
.auth-wrap { max-width: 440px; margin: 40px auto; }
.card {
  background: var(--card); border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card h1, .card h2 { margin-top: 0; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.form-control {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1.5px solid #d8d8d8; font-size: 15px; font-family: inherit;
  background: #fff; outline: none;
}
.form-control:focus { border-color: var(--sun-orange); box-shadow: 0 0 0 3px rgba(255,140,0,.15); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* حقل الهاتف العراقي */
.phone-field { display: flex; border: 1.5px solid #d8d8d8; border-radius: 10px; overflow: hidden; background:#fff; }
.phone-field:focus-within { border-color: var(--sun-orange); box-shadow: 0 0 0 3px rgba(255,140,0,.15); }
.phone-flag {
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
  background: #fff8ef; border-left: 1.5px solid var(--line); font-weight: 700; font-size: 14px; white-space: nowrap;
}
.phone-flag .flag { width: 26px; height: 18px; border-radius: 3px; }
.phone-field input { flex: 1; border: 0; padding: 12px; font-size: 18px; letter-spacing: 2px;
  direction: ltr; text-align: left; outline: none; font-family: inherit; }

/* خانات رمز OTP */
.otp-inputs { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.otp-inputs input {
  width: 48px; height: 56px; text-align: center; font-size: 24px; font-weight: 800;
  border: 2px solid #d8d8d8; border-radius: 10px; outline: none;
}
.otp-inputs input:focus { border-color: var(--sun-orange); box-shadow: 0 0 0 3px rgba(255,140,0,.15); }
.otp-dev {
  background: #fff3cd; border: 1.5px dashed var(--sun-orange-dark);
  color: #7a5200; padding: 10px 12px; border-radius: 10px; margin: 12px 0; font-size: 14px;
}

/* ---------- التنبيهات ---------- */
.alerts { margin: 12px 0; }
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 8px; font-size: 14px; border: 1.5px solid; }
.alert-success { background: #e8f5e9; color: var(--success); border-color: #a5d6a7; }
.alert-danger { background: #ffebee; color: var(--danger); border-color: #ef9a9a; }
.alert-info { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.alert-warning { background: #fff3cd; color: #7a5200; border-color: var(--sun-yellow); }

/* ---------- شريط العلامات ---------- */
.partners { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; }
.partners .logos { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: center; }
.partners .logos img { height: 38px; opacity: .85; }
.partners .pill { background: #fff3e0; border: 1.5px solid var(--sun-yellow); border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 13px; }

/* ---------- الفوتر ---------- */
.footer { background: var(--ink); color: #ddd; margin-top: 40px; padding: 30px 0 16px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer h4 { color: var(--sun-yellow); margin: 0 0 12px; }
.footer a { color: #ddd; display: block; padding: 3px 0; }
.footer a:hover { color: var(--sun-yellow); }
.footer .copyright { text-align: center; border-top: 1px solid #333; margin-top: 20px; padding-top: 14px; color: #aaa; font-size: 13px; }

/* ---------- زر راسلنا العائم ---------- */
.fab-chat {
  position: fixed; bottom: 20px; left: 20px; z-index: 60;
  background: var(--ink); color: #fff;
  border: 2px solid var(--sun-yellow);
  border-radius: 30px; padding: 12px 18px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-hover);
}
.fab-chat:hover { color: #fff; background: #000; }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 3px rgba(46,204,113,.3); }

/* ---------- الشريط السفلي الطافي ---------- */
.bottom-nav {
  display: flex;  /* يظهر على كل الأجهزة */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  z-index: 70;
  padding: 6px 4px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
/* على الحاسبة: شريط عائم مركزي (Dock) بدل الشريط الممتد */
@media (min-width: 761px) {
  .bottom-nav {
    max-width: 560px; margin: 0 auto;
    left: 0; right: 0; bottom: 16px;
    border: 1.5px solid var(--ink);
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
  }
}
body { padding-bottom: 84px; }  /* مساحة للشريط السفلي على كل الأجهزة */
.top-actions { display: none; }  /* استبدلناها بالشريط السفلي على كل الأجهزة */
.bn-item { background: none; border: 0; cursor: pointer; font-family: inherit; }
.bn-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-soft);
  font-size: 11px; font-weight: 700;
  padding: 4px 0;
  border-radius: 10px;
}
.bn-item:hover, .bn-item.active { color: var(--sun-orange-dark); }
.bn-item.active { background: #fff3e0; }
.bn-ic { font-size: 20px; position: relative; }
.bn-badge {
  position: absolute; top: -6px; left: -10px;
  background: var(--danger); color: #fff;
  border-radius: 50%; min-width: 17px; height: 17px;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #fff;
}

/* ---------- مساعدات ---------- */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-2 { margin-bottom: 12px; }
.flex { display: flex; } .gap { gap: 10px; } .between { justify-content: space-between; } .items-center { align-items: center; }
.tag { display: inline-block; background: #fff3e0; color: var(--ink); border-radius: 6px; padding: 2px 8px; font-size: 12px; }

/* ---------- استجابة الهاتف ---------- */
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding: 5px 10px; }
  .search-wrap { order: 3; flex-basis: 100%; }
  .brand .brand-name { font-size: 16px; }

  /* بطاقتان في الصف على الهاتف (منتجات + متاجر) */
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stores-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card .img .placeholder { font-size: 38px; }
  .product-card .add-btn { font-size: 13px; padding: 7px 8px; }

  .footer .cols { grid-template-columns: 1fr; }

  /* على الهاتف: تختفي أزرار الهيدر وتظهر بدلاً منها في الشريط السفلي */
  .top-actions { display: none; }
  .bottom-nav { display: flex; }

  /* مساحة سفلية حتى لا يغطّي الشريط المحتوى */
  body { padding-bottom: 72px; }
  .footer { margin-bottom: 64px; }
}

/* زر المحادثة الطافي فوق الشريط السفلي */
.fab-chat { bottom: 84px; left: 14px; padding: 9px 15px; z-index: 65; }
.fab-label { font-size: 13px; }
@media (min-width: 761px) { .fab-chat { bottom: 22px; } }
