/* ============== Minassa Cars — tokens & base ============== */
:root {
  /* sand neutrals */
  --sand-50:  #faf6ee;
  --sand-100: #f4ecdf;
  --sand-150: #ece1cf;
  --sand-200: #e4d6bf;
  --sand-300: #d4c2a4;
  --surface:  #ffffff;
  --surface-2:#fffdf9;

  /* ink */
  --ink:   #1c1813;
  --ink-2: #6c6253;
  --ink-3: #9c9384;

  /* royal blue primary */
  --blue:      #1d4ed8;
  --blue-600:  #2456e0;
  --blue-700:  #1b44bf;
  --blue-800:  #16359a;
  --blue-soft: #eaf0ff;
  --blue-ring: rgba(29,78,216,.20);

  /* status */
  --green:      #15803d;
  --green-soft: #e6f5ec;
  --amber:      #b45309;
  --amber-soft: #fcefda;
  --red:        #b91c1c;
  --red-soft:   #fdeaea;

  /* vendor tiers */
  --bronze: #9c6b3c;
  --silver: #8a929c;
  --gold:   #bf9322;

  /* lines & shadow */
  --line:   #ece2d2;
  --line-2: #e1d4bd;
  --sh-sm: 0 1px 2px rgba(40,30,15,.06), 0 1px 1px rgba(40,30,15,.04);
  --sh-md: 0 6px 20px -8px rgba(40,30,15,.16), 0 2px 6px rgba(40,30,15,.05);
  --sh-lg: 0 22px 50px -22px rgba(30,22,10,.32), 0 6px 16px -10px rgba(30,22,10,.18);

  --r-card: 20px;
  --r-ctrl: 12px;

  --maxw: 1180px;
  --font: 'Cairo', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--sand-100);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--blue-ring); }

/* number tabular for prices/timers */
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- prototype chrome ---------- */
.proto {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 80% at 80% -10%, #efe7d8 0%, #e7dcc8 50%, #ddd0b6 100%);
}
.proto-bar {
  flex: 0 0 auto;
  height: 52px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: rgba(28,24,19,.92);
  color: #f3ece0;
  backdrop-filter: blur(8px);
  z-index: 50;
}
.proto-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; font-size: 14px; }
.proto-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,216,.35); }
.proto-segwrap { display: flex; gap: 4px; background: rgba(255,255,255,.08); padding: 4px; border-radius: 11px; }
.proto-seg {
  font-size: 12.5px; font-weight: 600; color: #c8bda8;
  padding: 6px 13px; border-radius: 8px; transition: .14s;
  white-space: nowrap;
}
.proto-seg:hover { color: #fff; }
.proto-seg.on { background: #f3ece0; color: #1c1813; }
.proto-spacer { flex: 1; }
.proto-device { display: flex; gap: 4px; background: rgba(255,255,255,.08); padding: 4px; border-radius: 11px; }
.proto-device button { font-size: 12.5px; font-weight: 600; color: #c8bda8; padding: 6px 11px; border-radius: 8px; display: flex; align-items: center; gap: 6px; transition: .14s; }
.proto-device button.on { background: #f3ece0; color: #1c1813; }
.proto-device button:hover:not(.on) { color: #fff; }

.proto-stage {
  flex: 1; min-height: 0; position: relative;
  display: flex; align-items: stretch; justify-content: center;
  overflow: hidden;
}
.proto-stage.is-mobile { align-items: center; padding: 22px 0; }

/* desktop scroll surface */
.viewport-desktop { width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden; background: var(--sand-50); }

/* phone frame */
.phone {
  width: 392px; height: calc(100% - 16px); max-height: 840px;
  background: #0b0a08; border-radius: 46px; padding: 11px;
  box-shadow: var(--sh-lg), 0 0 0 2px rgba(0,0,0,.25) inset;
  flex: 0 0 auto;
}
.phone-screen {
  width: 100%; height: 100%; background: var(--sand-50);
  border-radius: 36px; overflow: hidden; position: relative;
  display: flex; flex-direction: column;
}
.phone-statusbar {
  height: 30px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 4px 24px 0; font-size: 12.5px; font-weight: 700; color: var(--ink);
}
.phone-statusbar .dots { display: flex; align-items: center; gap: 5px; }
.viewport-mobile { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; }

/* scrollbars */
.viewport-desktop::-webkit-scrollbar, .viewport-mobile::-webkit-scrollbar { width: 10px; }
.viewport-desktop::-webkit-scrollbar-thumb, .viewport-mobile::-webkit-scrollbar-thumb { background: #cdbc9f; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }

/* ---------- shared app primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.mob .wrap { padding: 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 14.5px; border-radius: var(--r-ctrl);
  padding: 12px 18px; transition: .15s; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, var(--sh-sm); }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: var(--sand-50); box-shadow: inset 0 0 0 1px var(--line-2), var(--sh-sm); }
.btn-blue-soft { background: var(--blue-soft); color: var(--blue-700); }
.btn-blue-soft:hover { background: #dfe8ff; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 22px; font-size: 15.5px; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; line-height: 1;
}
.pill-green  { background: var(--green-soft); color: var(--green); }
.pill-amber  { background: var(--amber-soft); color: var(--amber); }
.pill-red    { background: var(--red-soft); color: var(--red); }
.pill-blue   { background: var(--blue-soft); color: var(--blue-700); }
.pill-ink    { background: var(--sand-150); color: var(--ink-2); }

.badge-sponsor {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 8px;
  background: linear-gradient(180deg, #ffe9b8, #f6cf73); color: #6b4e10;
  box-shadow: 0 1px 2px rgba(120,80,0,.2);
}

/* vendor chip */
.vendor { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 9px 4px 7px; border-radius: 999px; line-height: 1; }
.vendor .gem { width: 13px; height: 13px; border-radius: 3px; transform: rotate(45deg); flex: 0 0 auto; }
.vendor.bronze  { background: #f4e7d8; color: #8a5a2c; }
.vendor.bronze  .gem { background: linear-gradient(135deg,#c89165,#9c6b3c); }
.vendor.silver  { background: #eef0f3; color: #5c646e; }
.vendor.silver  .gem { background: linear-gradient(135deg,#c7cdd5,#8a929c); }
.vendor.gold    { background: #fbf0d2; color: #936c12; }
.vendor.gold    .gem { background: linear-gradient(135deg,#f0cf6f,#bf9322); }
.vendor.premium { background: linear-gradient(180deg,#1b2440,#0f1830); color: #dbe6ff; }
.vendor.premium .gem { background: linear-gradient(135deg,#7aa2ff,#1d4ed8); }

/* car photo + fallback */
.photo { position: relative; overflow: hidden; background: var(--sand-150); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background-image: repeating-linear-gradient(135deg, #e7dcc8 0 11px, #e1d4bd 11px 22px);
  color: #a99878; font: 600 12px var(--font); letter-spacing: .04em;
}

/* spec chip row */
.specrow { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.spec { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.spec svg { color: var(--ink-3); }

/* favorite heart */
.heart { width: 36px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.92); display: grid; place-items: center; box-shadow: var(--sh-sm); transition: .14s; }
.heart:hover { background: #fff; transform: scale(1.06); }
.heart.on svg { fill: var(--red); color: var(--red); }

/* inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.control {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border-radius: var(--r-ctrl);
  box-shadow: inset 0 0 0 1px var(--line-2); padding: 0 12px; height: 46px;
}
.control:focus-within { box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 4px var(--blue-ring); }
.control select, .control input { border: none; outline: none; background: none; width: 100%; font-size: 14.5px; color: var(--ink); height: 100%; }
.control svg { color: var(--ink-3); flex: 0 0 auto; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: .14s; white-space: nowrap;
}
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), var(--sh-sm); }
.chip.on { background: var(--ink); color: var(--sand-50); box-shadow: none; }

/* card base */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--sh-sm); overflow: hidden; }

/* section heading */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sec-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.mob .sec-title { font-size: 19px; }
.sec-sub { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.link-more { font-size: 13.5px; font-weight: 600; color: var(--blue-700); display: inline-flex; align-items: center; gap: 4px; }
.link-more:hover { gap: 7px; }

/* rating */
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.rating svg { color: var(--gold); }

/* fade/scale entrance */
@keyframes fadeUp { from { transform: translateY(12px); } to { transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .fade-up { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1); }
}

/* nav */
.topnav { position: sticky; top: 0; z-index: 30; background: rgba(250,246,238,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topnav-inner { height: 66px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand .mk { width: 30px; height: 30px; border-radius: 9px; background: var(--blue); display: grid; place-items: center; color: #fff; box-shadow: var(--sh-sm); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { font-size: 14.5px; font-weight: 600; color: var(--ink-2); padding: 9px 13px; border-radius: 10px; transition: .14s; }
.nav-links a:hover { color: var(--ink); background: var(--sand-100); }
.nav-links a.active { color: var(--blue-700); background: var(--blue-soft); }

/* mobile bottom nav */
.botnav { position: absolute; bottom: 0; left: 0; right: 0; z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; padding: 8px 6px 12px; }
.botnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--ink-3); padding: 4px 0; }
.botnav button.on { color: var(--blue-700); }

.hidden-mob { }
.mob .only-desktop { display: none !important; }
.only-mobile { display: none !important; }
.mob .only-mobile { display: revert !important; }

/* generic grids */
.grid-cards { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.mob .grid-cards { grid-template-columns: 1fr; }

/* hide scrollbar utility (horizontal rails) */
.hscroll { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ---------- RTL physical-property overrides ---------- */
[dir="rtl"] .carcard-tags { left: auto; right: 12px; }
[dir="rtl"] .heart-pos { right: auto; left: 11px; }
[dir="rtl"] .trust-num { right: auto; left: 4px; }
[dir="rtl"] .gallery-live { left: auto; right: 14px; }
[dir="rtl"] .gallery-count { right: auto; left: 14px; }
[dir="rtl"] .auction-mini-live { left: auto; right: 10px; }
[dir="rtl"] .overlay-top { flex-direction: row-reverse; }
[dir="rtl"] .link-more svg { transform: scaleX(-1); }
[dir="rtl"] .crumb svg { transform: scaleX(-1); }
