/* =========================================================
   منصة جملة التمور — Wholesale Dates Marketplace
   styles.css  ·  Modern Saudi Heritage design system
   Works alongside Tailwind CDN (index.html). No build step.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --date: #3E2723;
  --date-600: #4E342E;
  --date-400: #7A5A4C;
  --palm: #1B4D3E;
  --palm-400: #2F7560;
  --sand: #FAF7F2;
  --sand-100: #F3EDE3;
  --sand-200: #E8DECD;
  --gold: #C5A059;
  --gold-200: #E8D4AA;
  --gold-500: #A8853F;
  --danger: #B3261E;

  --surface: #FFFFFF;
  --surface-2: #FDFBF8;
  --border: rgba(62, 39, 35, 0.10);
  --border-strong: rgba(62, 39, 35, 0.18);
  --text: #3E2723;
  --text-muted: #7A5A4C;
  --input-bg: #FFFFFF;
  --ring: rgba(197, 160, 89, 0.45);

  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html.dark {
  --surface: #1C1714;
  --surface-2: #221C18;
  --border: rgba(232, 222, 205, 0.09);
  --border-strong: rgba(232, 222, 205, 0.16);
  --text: #F3EDE3;
  --text-muted: rgba(232, 222, 205, 0.65);
  --input-bg: #26201C;
  --ring: rgba(197, 160, 89, 0.55);
  color-scheme: dark;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
html[lang="en"] body { font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif; }
html[lang="en"] .font-display { font-family: 'Inter', sans-serif; font-weight: 700; letter-spacing: -0.01em; }

body { color: var(--text); }
::selection { background: var(--gold-200); color: var(--date); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* Numbers always LTR & tabular inside RTL text */
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; font-family: 'Inter', sans-serif; }

/* Flip directional icons (arrows, send) in RTL */
[dir="rtl"] .dir-flip { transform: scaleX(-1); }

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

.line-clamp-1, .line-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-1 { -webkit-line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; }

/* Theme icon swap */
.theme-icon-dark { display: none; }
html.dark .theme-icon-light { display: none; }
html.dark .theme-icon-dark { display: inline-block; }

/* ---------- Heritage patterns ---------- */
/* Sadu-inspired band: repeating gold/emerald/cream triangles */
.pattern-band {
  background:
    linear-gradient(135deg, var(--gold) 25%, transparent 25%) -6px 0 / 12px 12px,
    linear-gradient(225deg, var(--gold) 25%, transparent 25%) -6px 0 / 12px 12px,
    linear-gradient(315deg, var(--palm) 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg, var(--palm) 25%, var(--date) 25%) 0 0 / 12px 12px;
}

.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(197,160,89,.22), transparent 60%),
    radial-gradient(800px 300px at 0% 110%, rgba(27,77,62,.55), transparent 60%),
    linear-gradient(160deg, #3E2723 0%, #2C1B17 55%, #1B4D3E 130%);
}
/* Eight-point star lattice (Najdi geometric motif) */
.hero-pattern {
  opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23C5A059' stroke-width='1'%3E%3Cpath d='M28 6l6 16 16 6-16 6-6 16-6-16-16-6 16-6z'/%3E%3Crect x='18' y='18' width='20' height='20' transform='rotate(45 28 28)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}

/* ---------- Brand ---------- */
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(140deg, var(--gold) 0%, #8E6E33 100%);
  color: var(--date);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 10px -2px rgba(0,0,0,.35);
  transition: transform .3s var(--ease);
}
.group:hover .brand-mark { transform: rotate(-6deg) scale(1.04); }
.brand-mark-sm { width: 30px; height: 30px; border-radius: 9px; }

/* ---------- Surfaces ---------- */
.surface {
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ---------- Header controls ---------- */
.portal-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem; border-radius: 9px;
  font-size: .85rem; font-weight: 600; white-space: nowrap;
  color: rgba(243, 237, 227, .78);
  transition: background .2s, color .2s;
}
.portal-btn:hover { color: #fff; background: rgba(255,255,255,.06); }
.portal-btn.is-active {
  color: var(--date);
  background: linear-gradient(140deg, #E8D4AA, var(--gold));
  box-shadow: 0 2px 8px -2px rgba(197,160,89,.6);
}
header .lg\:hidden .portal-btn { background: rgba(255,255,255,.05); }
header .lg\:hidden .portal-btn.is-active { background: linear-gradient(140deg, #E8D4AA, var(--gold)); }

.icon-btn-header {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  height: 38px; min-width: 38px; border-radius: 10px;
  color: var(--sand-100);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(197,160,89,.22);
  transition: background .2s, border-color .2s;
}
.icon-btn-header:hover { background: rgba(255,255,255,.12); border-color: rgba(197,160,89,.5); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  color: var(--text-muted);
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: rgba(197,160,89,.14); color: var(--text); }
.icon-btn.is-on { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.05rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; line-height: 1.2; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s;
  cursor: pointer; user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .45rem .8rem; font-size: .82rem; border-radius: 9px; }
.btn-xs { padding: .3rem .55rem; font-size: .75rem; border-radius: 8px; gap: .3rem; }

.btn-gold { background: linear-gradient(140deg, #D9BC80, var(--gold) 60%, #B08C45); color: var(--date); box-shadow: 0 4px 14px -6px rgba(197,160,89,.9); }
.btn-gold:hover { box-shadow: 0 6px 20px -6px rgba(197,160,89,1); filter: brightness(1.04); }

.btn-palm { background: var(--palm); color: #fff; box-shadow: 0 4px 14px -6px rgba(27,77,62,.9); }
.btn-palm:hover { background: #22604D; }

.btn-date { background: var(--date); color: var(--sand); }
.btn-date:hover { background: var(--date-600); }

.btn-wa { background: #1FA855; color: #fff; }
.btn-wa:hover { background: #18934A; }

.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--gold); background: rgba(197,160,89,.08); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: rgba(197,160,89,.12); color: var(--text); }

.btn-danger-ghost { background: transparent; color: var(--danger); border-color: rgba(179,38,30,.25); }
.btn-danger-ghost:hover { background: rgba(179,38,30,.08); }
html.dark .btn-danger-ghost { color: #F2B8B5; border-color: rgba(242,184,181,.25); }

.fab {
  position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 35;
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #D9BC80, var(--gold));
  color: var(--date);
  box-shadow: 0 10px 24px -8px rgba(62,39,35,.6);
}

/* ---------- Search ---------- */
.search-shell {
  display: flex; align-items: center; gap: .6rem;
  background: var(--sand);
  border-radius: 16px; padding: .4rem .4rem .4rem .9rem;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5), inset 0 0 0 1px rgba(197,160,89,.35);
}
[dir="rtl"] .search-shell { padding: .4rem .9rem .4rem .4rem; }
html.dark .search-shell { background: #26201C; }
.search-shell:focus-within { box-shadow: 0 10px 30px -10px rgba(0,0,0,.5), 0 0 0 3px var(--ring); }

/* ---------- Category strip ---------- */
.cat-chip {
  scroll-snap-align: start;
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-width: 92px; padding: .65rem .6rem .55rem;
  border-radius: 12px; border: 1px solid transparent;
  font-size: .8rem; font-weight: 600; text-align: center;
  color: var(--text);
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.cat-chip:hover { background: rgba(197,160,89,.10); transform: translateY(-1px); }
.cat-chip .cat-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.35rem;
  background: radial-gradient(circle at 30% 30%, #F5ECD9, #E8D4AA);
  box-shadow: inset 0 -2px 0 rgba(62,39,35,.08);
  transition: transform .25s var(--ease);
}
html.dark .cat-chip .cat-icon { background: radial-gradient(circle at 30% 30%, #4A3A2C, #332A25); }
.cat-chip .cat-count { font-size: .68rem; font-weight: 500; color: var(--text-muted); }
.cat-chip.is-active { background: rgba(27,77,62,.08); border-color: rgba(27,77,62,.35); }
html.dark .cat-chip.is-active { background: rgba(95,158,136,.12); border-color: rgba(95,158,136,.4); }
.cat-chip.is-active .cat-icon { background: linear-gradient(140deg, var(--palm-400), var(--palm)); color: #fff; transform: scale(1.06); }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field-label { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; color: var(--text-muted); }

.input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .58rem .75rem;
  font-size: .9rem; color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.input::placeholder { color: var(--text-muted); opacity: .6; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--ring); }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(179,38,30,.15); }
.input-sm { padding: .42rem .65rem; font-size: .82rem; }
select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A8853F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  padding-right: 2rem;
}
[dir="rtl"] select.input { background-position: left .6rem center; padding-right: .75rem; padding-left: 2rem; }

.checkbox { width: 18px; height: 18px; accent-color: var(--palm); cursor: pointer; }

.form-error { font-size: .8rem; color: var(--danger); background: rgba(179,38,30,.08); border-radius: 8px; padding: .5rem .7rem; }
html.dark .form-error { color: #F2B8B5; }

/* Toggle switch (admin verification) */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
  background: rgba(122,90,76,.3); transition: background .25s;
}
.switch .slider::before {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease);
}
.switch input:checked + .slider { background: var(--palm); }
.switch input:checked + .slider.gold { background: var(--gold); }
.switch input:checked + .slider::before { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + .slider::before { transform: translateX(-20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--ring); }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border-strong); }
.seg-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .38rem .6rem; border-radius: 8px;
  font-size: .82rem; font-weight: 600; color: var(--text-muted);
  transition: background .2s, color .2s;
}
.seg-lg .seg-btn { padding: .5rem .85rem; font-size: .88rem; }
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--date); color: var(--sand); }
html.dark .seg-btn.is-active { background: var(--gold); color: var(--date); }

/* ---------- Badges & pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .14rem .5rem; border-radius: 999px;
  font-size: .7rem; font-weight: 700; line-height: 1.35; white-space: nowrap;
}
.badge-verified { background: rgba(27,77,62,.10); color: var(--palm); }
html.dark .badge-verified { background: rgba(95,158,136,.18); color: #9FC7B9; }
.badge-gold { background: rgba(197,160,89,.18); color: #866930; }
html.dark .badge-gold { color: var(--gold-200); }
.badge-muted { background: rgba(122,90,76,.12); color: var(--text-muted); }
.badge-date { background: var(--date); color: var(--gold-200); }
.badge-sold { background: rgba(179,38,30,.12); color: var(--danger); }
html.dark .badge-sold { color: #F2B8B5; }
.badge-new { background: rgba(31,168,85,.14); color: #157A3D; }
html.dark .badge-new { color: #86D9A6; }

.grade-premium { background: linear-gradient(140deg, #F5ECD9, #E8D4AA); color: #6B4F1E; }
.grade-royal   { background: linear-gradient(140deg, #3E2723, #5D4037); color: var(--gold-200); }
.grade-second  { background: rgba(122,90,76,.14); color: var(--date-400); }
.grade-factory { background: rgba(27,77,62,.12); color: var(--palm); }
html.dark .grade-second  { color: var(--sand-200); }
html.dark .grade-factory { color: #9FC7B9; }
html.dark .grade-royal   { background: linear-gradient(140deg, #C5A059, #A8853F); color: #2C1B17; }

.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .4rem .3rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  background: rgba(197,160,89,.14); color: var(--text);
  border: 1px solid rgba(197,160,89,.35);
}
[dir="rtl"] .pill { padding: .3rem .7rem .3rem .4rem; }
.pill button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; }
.pill button:hover { background: rgba(62,39,35,.12); }

.hero-stat {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  color: var(--sand-100); background: rgba(255,255,255,.07);
  border: 1px solid rgba(197,160,89,.25);
}

/* ---------- Listing feed ---------- */
.feed { display: grid; gap: 1rem; }
.feed-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 560px)  { .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .feed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feed-list { grid-template-columns: 1fr; gap: .75rem; }

.listing-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(62,39,35,.05);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
  animation: cardIn .35s var(--ease) both;
}
.listing-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(62,39,35,.06), 0 18px 36px -12px rgba(62,39,35,.25); border-color: rgba(197,160,89,.45); }
.listing-card.is-featured { border-color: rgba(197,160,89,.6); box-shadow: 0 0 0 1px rgba(197,160,89,.35), 0 8px 24px -12px rgba(197,160,89,.6); }
.listing-card.is-sold { opacity: .72; }
.listing-card.is-sold .card-media img { filter: grayscale(.7); }

.card-media {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(140deg, #E8D4AA, #C5A059);
  cursor: pointer;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.listing-card:hover .card-media img { transform: scale(1.05); }
.card-media .media-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 3rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 50%),
    linear-gradient(140deg, #8D6E63, #3E2723);
}
.card-media::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(to top, rgba(28,17,14,.55), transparent);
  pointer-events: none;
}
.media-tags { position: absolute; top: .6rem; inset-inline-start: .6rem; inset-inline-end: .6rem; display: flex; justify-content: space-between; gap: .4rem; z-index: 2; }
.media-price {
  position: absolute; bottom: .55rem; inset-inline-start: .65rem; z-index: 2;
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.media-price .amount { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; }
.media-price .unit { font-size: .75rem; opacity: .9; }

.save-btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--date);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: transform .2s var(--ease), color .2s;
}
.save-btn:hover { transform: scale(1.1); }
.save-btn.is-on { color: #C62828; }
.save-btn.is-on svg { fill: currentColor; }

.card-body { padding: .85rem .95rem .95rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-title { font-weight: 700; font-size: .98rem; line-height: 1.45; cursor: pointer; }
.card-title:hover { color: var(--palm-400); }
html.dark .card-title:hover { color: var(--gold-200); }

.merchant-link {
  display: inline-flex; align-items: center; gap: .35rem; max-width: 100%;
  font-size: .82rem; font-weight: 600; color: var(--palm);
}
html.dark .merchant-link { color: #9FC7B9; }
.merchant-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.merchant-avatar {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 22px; height: 22px; border-radius: 7px;
  font-size: .68rem; font-weight: 800; color: #fff;
}

.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; font-size: .76rem; color: var(--text-muted); }
.meta-row > span { display: inline-flex; align-items: center; gap: .25rem; }

.spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .4rem; }
.spec {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: .4rem .5rem;
}
html.dark .spec { background: #26201C; }
.spec .k { display: block; font-size: .66rem; color: var(--text-muted); }
.spec .v { display: block; font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-actions { display: grid; grid-template-columns: 1fr auto auto; gap: .4rem; margin-top: auto; padding-top: .25rem; }

/* List view variant */
.feed-list .listing-card { flex-direction: row; }
.feed-list .card-media { aspect-ratio: auto; width: 220px; flex: 0 0 220px; min-height: 100%; }
.feed-list .card-body { padding: .8rem 1rem; }
.feed-list .spec-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.feed-list .card-actions { grid-template-columns: auto auto auto; justify-content: start; }
@media (max-width: 639px) {
  .feed-list .card-media { width: 120px; flex-basis: 120px; }
  .feed-list .media-price .amount { font-size: 1.05rem; }
  .feed-list .spec-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .feed-list .media-tags .badge:not(:first-child) { display: none; }
}

/* Featured mini cards */
.featured-card {
  scroll-snap-align: start;
  flex: 0 0 260px;
  display: flex; gap: .65rem; align-items: center;
  padding: .55rem; border-radius: 12px;
  background: linear-gradient(140deg, rgba(197,160,89,.16), rgba(197,160,89,.04));
  border: 1px solid rgba(197,160,89,.45);
  cursor: pointer;
  transition: transform .2s var(--ease);
}
.featured-card:hover { transform: translateY(-2px); }
.featured-card .thumb { width: 64px; height: 64px; border-radius: 9px; overflow: hidden; flex: 0 0 64px; background: linear-gradient(140deg, #8D6E63, #3E2723); display: grid; place-items: center; font-size: 1.6rem; }
.featured-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Filter drawer (mobile) ---------- */
@media (max-width: 1023px) {
  .filter-panel {
    position: fixed; z-index: 50; top: 0; bottom: 0; inset-inline-start: 0;
    width: min(340px, 88vw);
    overflow-y: auto;
    padding: .75rem;
    background: var(--sand);
    transform: translateX(-105%);
    transition: transform .3s var(--ease);
    box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  html.dark .filter-panel { background: #14100E; }
  [dir="rtl"] .filter-panel { transform: translateX(105%); }
  .filter-panel.is-open { transform: translateX(0) !important; }
}
.drawer-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(20,16,14,.55); backdrop-filter: blur(2px); }

/* ---------- Storefront ---------- */
.store-banner {
  position: relative; height: 210px; border-radius: 20px; overflow: hidden;
  background: linear-gradient(140deg, #3E2723, #1B4D3E);
}
@media (min-width: 640px) { .store-banner { height: 260px; } }
.store-banner img { width: 100%; height: 100%; object-fit: cover; }
.store-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(28,17,14,.75), rgba(28,17,14,.05) 60%); }
.store-logo {
  width: 96px; height: 96px; border-radius: 22px;
  display: grid; place-items: center;
  font-family: 'Reem Kufi', sans-serif; font-size: 2.1rem; color: #fff;
  border: 4px solid var(--surface);
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.45);
}
@media (min-width: 640px) { .store-logo { width: 116px; height: 116px; font-size: 2.6rem; } }
.store-stat { text-align: center; padding: .7rem .5rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
html.dark .store-stat { background: #26201C; }
.store-stat .v { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.2rem; }
.store-stat .k { font-size: .72rem; color: var(--text-muted); }

.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars svg { width: 15px; height: 15px; }
.stars .filled { fill: currentColor; }
.stars .empty { color: rgba(122,90,76,.3); }

.review-card { padding: .85rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
html.dark .review-card { background: #26201C; }

.verified-seal {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .65rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700;
  color: #fff; background: linear-gradient(140deg, #2F7560, #1B4D3E);
  box-shadow: 0 2px 8px -2px rgba(27,77,62,.6);
}

/* ---------- Panel / Admin ---------- */
.kpi {
  position: relative; overflow: hidden;
  padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.kpi::before {
  content: ''; position: absolute; inset-block-start: 0; inset-inline-start: 0;
  width: 4px; height: 100%; background: var(--kpi-accent, var(--gold));
}
.kpi .kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.kpi .kpi-value { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.kpi .kpi-label { font-size: .78rem; color: var(--text-muted); }

.row-card {
  display: flex; gap: .85rem; align-items: center;
  padding: .75rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s;
}
.row-card:hover { border-color: rgba(197,160,89,.45); }
.row-card .thumb { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; flex: 0 0 72px; background: linear-gradient(140deg, #8D6E63, #3E2723); display: grid; place-items: center; font-size: 1.8rem; }
.row-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 639px) {
  .row-card { flex-wrap: wrap; }
  .row-card .row-actions { width: 100%; }
}

.rfq-card { padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.rfq-card.is-new { border-inline-start: 4px solid var(--gold); }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.data-table th {
  text-align: start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-muted); padding: .55rem .7rem; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.data-table td { padding: .65rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: rgba(197,160,89,.05); }

.bar-track { height: 9px; border-radius: 999px; background: rgba(122,90,76,.12); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--palm), var(--gold)); transition: width .8s var(--ease); }
[dir="rtl"] .bar-fill { background: linear-gradient(270deg, var(--palm), var(--gold)); }

.empty-box { padding: 2.25rem 1rem; text-align: center; border-radius: var(--radius); border: 1.5px dashed var(--border-strong); color: var(--text-muted); }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal { align-items: center; padding: 1.25rem; } }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,16,14,.6); backdrop-filter: blur(3px); animation: fadeIn .2s ease both; }
.modal-panel {
  position: relative; width: 100%;
  max-height: 92vh; overflow-y: auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 1.25rem;
  box-shadow: 0 -10px 40px rgba(0,0,0,.3);
  animation: sheetUp .3s var(--ease) both;
}
@media (min-width: 640px) {
  .modal-panel { border-radius: 20px; padding: 1.5rem; animation: popIn .25s var(--ease) both; border: 1px solid var(--border); }
}
.modal-x { position: absolute; top: .9rem; inset-inline-end: .9rem; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-muted); z-index: 3; }
.modal-x:hover { background: rgba(197,160,89,.14); color: var(--text); }
.modal-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding-inline-end: 2.5rem; }
.modal-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
body.modal-open { overflow: hidden; }

.detail-media { position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: linear-gradient(140deg, #8D6E63, #3E2723); display: grid; place-items: center; font-size: 4rem; }
.detail-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Toasts ---------- */
.toast-host { position: fixed; z-index: 80; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 380px); pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem .95rem; border-radius: 12px;
  background: var(--date); color: var(--sand);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  border: 1px solid rgba(197,160,89,.3);
  font-size: .88rem; font-weight: 500;
  animation: toastIn .3s var(--ease) both;
}
.toast.is-leaving { animation: toastOut .25s ease both; }
.toast .toast-icon { color: var(--gold); flex: 0 0 auto; }
.toast.success .toast-icon { color: #86D9A6; }
.toast.error .toast-icon { color: #F2B8B5; }

/* ---------- Views ---------- */
.app-view { animation: fadeIn .25s ease both; }

/* ---------- Animations ---------- */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes popIn   { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut{ to { opacity: 0; transform: translateY(8px); } }
@keyframes pulseGold { 0%,100% { box-shadow: 0 0 0 0 rgba(197,160,89,.6); } 50% { box-shadow: 0 0 0 6px rgba(197,160,89,0); } }
.pulse-gold { animation: pulseGold 1.6s ease-in-out 2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Print ---------- */
@media print {
  header, footer, .fab, #filterPanel, .card-actions, .modal { display: none !important; }
  body { background: #fff; color: #000; }
}
