@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap");

/* ============================================================
   iCarValue — design tokens
   ============================================================ */
:root {
  --font-display: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-muted: #f1f3f5;
  --line: #e5e7eb;
  --line-strong: #d1d5db;

  --text: #16181d;
  --text-soft: #374151;
  --muted: #6b7280;

  --primary: #e1232a;
  --primary-strong: #bf1c22;
  --primary-soft: rgba(225, 35, 42, 0.10);

  --secondary: #16181d;
  --success: #15a05f;
  --danger: #dc2626;
  --warning: #f59e0b;

  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 6px 18px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 48px rgba(16, 24, 40, 0.14);

  /* --- Navbar (light / frosted-neumorphism) --- */
  --nav-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 245, 245, 0.82));
  --nav-text: #222222;
  --nav-text-dim: #5b5f66;
  --nav-border: rgba(15, 17, 21, 0.08);
  --nav-tray: rgba(255, 255, 255, 0.55);
  --nav-hover: rgba(15, 17, 21, 0.05);
  --nav-edge: rgba(225, 35, 42, 0.55);
  --nav-edge-soft: rgba(225, 35, 42, 0.20);
  --nav-shadow:
    0 18px 38px -20px rgba(20, 22, 30, 0.40),
    0 6px 16px -10px rgba(20, 22, 30, 0.20),
    0 3px 18px -6px var(--nav-edge-soft);
  --nav-inset: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(15, 17, 21, 0.04);
  --nav-logo-filter: none;
  --nav-carbon: 0;
  --nav-glass-blur: 18px;
  --nav-badge-ring: #ffffff;
}

body.dark {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #1d212a;
  --surface-muted: #20242e;
  --line: #2a2f3a;
  --line-strong: #3a414f;
  --text: #f3f5f8;
  --text-soft: #d3d8e0;
  --muted: #9aa3b2;
  --primary: #f04148;
  --primary-strong: #ff5c62;
  --primary-soft: rgba(240, 65, 72, 0.16);
  --secondary: #f3f5f8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 55px rgba(0, 0, 0, 0.55);

  /* --- Navbar (dark / carbon-glass + neon edge) --- */
  --nav-surface: linear-gradient(180deg, rgba(17, 17, 17, 0.82), rgba(5, 5, 5, 0.86));
  --nav-text: #ffffff;
  --nav-text-dim: rgba(255, 255, 255, 0.60);
  --nav-border: rgba(255, 255, 255, 0.09);
  --nav-tray: rgba(255, 255, 255, 0.045);
  --nav-hover: rgba(255, 255, 255, 0.07);
  --nav-edge: rgba(240, 65, 72, 0.90);
  --nav-edge-soft: rgba(240, 65, 72, 0.42);
  --nav-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 26px 60px -22px rgba(0, 0, 0, 0.95),
    0 8px 30px -8px var(--nav-edge-soft);
  --nav-inset: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  --nav-logo-filter: brightness(0) invert(1);
  --nav-carbon: 1;
  --nav-glass-blur: 22px;
  --nav-badge-ring: #0a0a0a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  transition: background-color 450ms ease, color 450ms ease;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a {
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-top: 0;
}

p {
  margin-top: 0;
}

/* ============================================================
   Header — premium floating "F1 dashboard" pod
   ============================================================ */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 50;
  width: min(100% - 30px, 1340px);
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 12px 9px 11px;
  border-radius: 30px;
  background: var(--nav-surface);
  -webkit-backdrop-filter: blur(var(--nav-glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--nav-glass-blur)) saturate(150%);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  isolation: isolate;
  transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 500ms ease, background 500ms ease, border-color 500ms ease;
}

/* Neon-red gradient edge ring (thin in light, luminous in dark) */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(115deg,
    var(--nav-edge) 0%,
    transparent 26%,
    transparent 74%,
    var(--nav-edge) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
  transition: opacity 500ms ease;
}

/* Carbon-fiber weave + glass reflection (carbon fades out in light mode) */
.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 38%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 4px);
  background-size: auto, 5px 5px, 5px 5px;
  opacity: calc(0.45 + var(--nav-carbon) * 0.55);
  pointer-events: none;
  z-index: -1;
}

body:not(.dark) .topbar::after {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 42%);
}

.topbar:hover {
  transform: translateY(-3px);
}

.topbar:hover::before {
  opacity: 1;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

/* Brand logo (image lockup) */
.brand {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Illuminated curved container around the logo */
.topbar .brand {
  position: relative;
  padding: 7px 20px;
  border-radius: 20px;
  background: var(--nav-tray);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-inset);
  overflow: hidden;
  flex-shrink: 0;
}

.topbar .brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 140% at 8% 50%, var(--nav-edge-soft), transparent 62%);
  opacity: 0.9;
  pointer-events: none;
}

.topbar .brand::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--nav-edge), transparent);
  filter: blur(0.4px);
  opacity: 0.7;
}

.topbar .brand-logo {
  position: relative;
  height: 34px;
  filter: var(--nav-logo-filter);
  transition: filter 450ms ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  margin: 0 auto;
}

.nav-links a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 12px 6px;
  color: var(--nav-text-dim);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 13px;
  white-space: nowrap;
}

.nav-links a .nav-ico {
  display: inline-flex;
}

.nav-links a .nav-ico svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.9;
  transition: transform 200ms ease, filter 200ms ease;
}

.nav-links a:hover {
  color: var(--nav-text);
  background: var(--nav-hover);
}

.nav-links a:hover .nav-ico svg {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 7px var(--nav-edge));
}

.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active .nav-ico svg {
  filter: drop-shadow(0 0 9px var(--nav-edge));
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: 0 0 12px 1px var(--nav-edge), 0 0 5px var(--primary);
}

/* Grouped glass control tray on the right */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 5px;
  border-radius: 18px;
  background: var(--nav-tray);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-inset);
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--nav-text);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--nav-hover);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 0 14px -2px var(--nav-edge-soft);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

#themeToggle svg {
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.dark #themeToggle svg {
  transform: rotate(-150deg);
}

.icon-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--nav-badge-ring);
}

/* Auth zone is visually separated from the icon cluster by a divider */
.topbar-actions #authActionLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px 0 16px;
  margin-left: 5px;
  border-radius: 12px;
  border: 1px solid var(--nav-edge-soft);
  background: transparent;
  color: var(--nav-text);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative;
}

.topbar-actions #authActionLink::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: var(--primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.topbar-actions #authActionLink:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px -6px var(--nav-edge), 0 0 0 1px var(--primary);
  transform: translateY(-1px);
}

.topbar-actions #authActionLink:hover::before {
  background: #fff;
}

.user-chip {
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--nav-hover);
  border: 1px solid var(--nav-border);
  color: var(--nav-text);
  font-weight: 600;
  font-size: 0.84rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Auth-injected signup link rendered as the solid red CTA */
.topbar-actions a[data-auth-injected] {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  margin-left: 3px;
  border-radius: 12px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px -8px var(--nav-edge);
}

.topbar-actions a[data-auth-injected]:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  transform: translateY(-1px);
}

/* ============================================================
   Buttons
   ============================================================ */
.primary-btn,
.ghost-btn,
.danger-btn,
.whatsapp-btn,
.inline-search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
}

.primary-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(225, 35, 42, 0.22);
}

.primary-btn:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  transform: translateY(-1px);
}

.ghost-btn,
.inline-search-link {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.ghost-btn:hover,
.inline-search-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.danger-btn {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.danger-btn:hover {
  filter: brightness(0.94);
}

.whatsapp-btn {
  background: #1faf60;
  border-color: #1faf60;
  color: #fff;
}

.whatsapp-btn:hover {
  filter: brightness(0.95);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* ============================================================
   Layout shell
   ============================================================ */
.page-wrap {
  width: min(1200px, calc(100% - 40px));
  margin: 48px auto 72px;
  display: grid;
  gap: 32px;
}

.home-shell {
  gap: 56px;
}

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.panel-lifted {
  box-shadow: var(--shadow-md);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.section-head h1,
.section-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.inline-link {
  color: var(--primary);
  font-weight: 700;
}

.muted-text {
  color: var(--muted);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 560px;
  overflow: hidden;
  background: #0b0c0e;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("uploads/live-2.jpg");
  background-size: cover;
  background-position: center right;
  transform: scale(1.04);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 9, 11, 0.92) 0%, rgba(8, 9, 11, 0.72) 42%, rgba(8, 9, 11, 0.32) 72%, rgba(8, 9, 11, 0.18) 100%),
    linear-gradient(180deg, rgba(8, 9, 11, 0.2), rgba(8, 9, 11, 0.55));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 84px max(20px, calc((100% - 1200px) / 2)) 128px;
  color: #fff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
}

.hero-badge::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(225, 35, 42, 0.3);
}

.hero h1 {
  max-width: 16ch;
  margin: 22px 0 0;
  color: #fff;
  font-size: clamp(2.5rem, 5.4vw, 4.4rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.hero h1 .accent {
  color: var(--primary);
}

.hero-lead {
  max-width: 50ch;
  margin: 22px 0 0;
  font-size: 1.1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 34px;
}

.hero-feature {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
}

.hero-feature span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.hero-feature svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

/* ============================================================
   Search bar (overlapping hero)
   ============================================================ */
.search-bar-wrap {
  position: relative;
  z-index: 10;
  width: min(1200px, calc(100% - 40px));
  margin: -68px auto 0;
}

.marketplace-search {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 18px;
  align-items: end;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.search-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.search-field > span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}

.search-field input,
.search-field select {
  min-height: 50px;
}

.search-submit {
  min-height: 50px;
  padding: 0 26px;
  align-self: end;
}

/* ============================================================
   Forms
   ============================================================ */
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea {
  min-height: 130px;
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}

.filters-grid,
.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.full-width {
  grid-column: 1 / -1;
}

.inline-actions,
.filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.image-uploader {
  display: grid;
  gap: 12px;
}

.image-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 22px;
  border: 2px dashed rgba(225, 35, 42, 0.35);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text-soft);
  text-align: center;
  cursor: pointer;
}

.image-dropzone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.image-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-dropzone strong {
  font-size: 1rem;
  color: var(--text);
}

.image-dropzone span,
.form-message {
  color: var(--muted);
  font-size: 0.88rem;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.image-preview {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.image-preview.is-cover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.image-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1.25 / 1;
  object-fit: cover;
}

.cover-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(14, 18, 24, 0.76);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.image-preview-actions {
  display: flex;
  gap: 6px;
  padding: 8px;
}

.mini-icon-btn {
  flex: 1;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.mini-icon-btn.danger {
  color: var(--danger);
}

.image-preview progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 48px;
  width: calc(100% - 16px);
}

.listing-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 15, 0.58);
}

.listing-edit-card {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: min(90vh, 860px);
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.listing-edit-card h2 {
  margin-top: 0;
}

.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============================================================
   Category section
   ============================================================ */
.category-rack.panel {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

.category-rack .section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.category-rack .section-head h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  margin-top: 14px;
  border-radius: 2px;
  background: var(--primary);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.category-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.category-photo {
  position: relative;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-muted);
}

.category-icon {
  position: absolute;
  left: 18px;
  bottom: -22px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 3px solid var(--surface);
  color: var(--primary);
}

.category-icon svg {
  width: 22px;
  height: 22px;
}

.category-info {
  padding: 30px 18px 20px;
}

.category-info strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--text);
}

.category-info small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================================================
   Vehicle cards
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.vehicle-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.vehicle-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.vehicle-card-photo {
  position: relative;
  overflow: hidden;
  background: var(--surface-muted);
}

.vehicle-card-photo > img {
  width: 100%;
  aspect-ratio: 1.4 / 1;
  object-fit: cover;
  background: var(--surface-muted);
  display: block;
}

.photo-count-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 18, 24, 0.78);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.vehicle-card-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.vehicle-card-body h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-soft);
}

.badge.featured {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.3);
}

.badge.verified {
  background: rgba(21, 160, 95, 0.12);
  color: var(--success);
  border-color: rgba(21, 160, 95, 0.26);
}

.price {
  margin: 0;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
}

.meta-row {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================================================
   Editorial band
   ============================================================ */
.editorial-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: center;
}

.editorial-band h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
}

.editorial-points {
  display: grid;
  gap: 14px;
}

.editorial-points article {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.editorial-points strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.editorial-points p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* ============================================================
   Price estimator
   ============================================================ */
.estimator-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: center;
}

.estimator-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
}

.estimator-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.estimator-form-wrap {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.estimate-result {
  margin: 16px 0 0;
  color: var(--primary);
  font-weight: 700;
}

/* ============================================================
   CTA banner
   ============================================================ */
.cta-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  border: none;
  color: #fff;
  background: linear-gradient(120deg, #16181d 0%, #2a1012 55%, var(--primary) 130%);
}

.cta-banner h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
}

.cta-banner .eyebrow,
.cta-banner .muted-text {
  color: rgba(255, 255, 255, 0.78);
}

.cta-banner .eyebrow {
  color: #ff9ca0;
}

/* ============================================================
   Browse page
   ============================================================ */
.browse-shell {
  gap: 28px;
}

.browse-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.browse-banner h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
}

.browse-banner-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.browse-pill {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.browse-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.filter-sidebar {
  position: sticky;
  top: 96px;
}

.sidebar-filters {
  grid-template-columns: 1fr;
}

.browse-results-panel {
  min-width: 0;
}

.browse-results-head {
  align-items: center;
}

.browse-results-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

#resultCount {
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid rgba(225, 35, 42, 0.2);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}

/* ============================================================
   Vehicle detail
   ============================================================ */
.vehicle-detail {
  display: grid;
  gap: 18px;
}

.listing-gallery {
  display: grid;
  gap: 12px;
}

.gallery-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #11151b;
}

.gallery-main {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  transition: opacity 160ms ease;
  cursor: zoom-in;
}

.gallery-nav,
.fullscreen-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  color: #11151b;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-nav.prev,
.fullscreen-nav.prev { left: 12px; }
.gallery-nav.next,
.fullscreen-nav.next { right: 12px; }

.gallery-counter,
.fullscreen-counter {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(14, 18, 24, 0.78);
  color: #fff;
  font-weight: 800;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}

.gallery-thumb {
  flex: 0 0 92px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-muted);
  cursor: pointer;
  scroll-snap-align: start;
}

.gallery-thumb.active {
  border-color: var(--primary);
}

.gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1.3 / 1;
  object-fit: cover;
}

.fullscreen-gallery {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 12, 0.96);
  touch-action: none;
}

.fullscreen-gallery img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  transition: transform 120ms ease;
}

.fullscreen-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #11151b;
  font-size: 2rem;
  cursor: pointer;
}

/* ============================================================
   Messages
   ============================================================ */
.messages-layout {
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: start;
}

.conversation-list {
  display: grid;
  gap: 10px;
}

.conversation-item {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.conversation-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chat-window {
  min-height: 360px;
  max-height: 520px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.chat-bubble {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: 16px;
  line-height: 1.5;
}

.chat-bubble.me {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
}

.chat-bubble.them {
  border: 1px solid var(--line);
  background: var(--surface);
}

.chat-form {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.chat-form input {
  flex: 1;
}

/* ============================================================
   Stats, plans, admin
   ============================================================ */
.stats-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.stat-card,
.plan-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.stat-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.plan-card h2,
.plan-card h3 {
  margin: 0 0 10px;
}

.plan-price {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}

.plan-card ul {
  padding-left: 20px;
  margin: 0 0 16px;
  color: var(--text-soft);
}

.plan-card li {
  margin-bottom: 6px;
}

.featured-plan {
  border-color: rgba(225, 35, 42, 0.4);
  box-shadow: 0 16px 36px rgba(225, 35, 42, 0.14);
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.admin-row strong {
  font-family: var(--font-display);
}

.admin-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================================================
   Auth pages
   ============================================================ */
.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 0% 0%, rgba(225, 35, 42, 0.08), transparent 38%),
    var(--bg);
}

.auth-card {
  width: min(560px, 100%);
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  margin: 18px 0 8px;
  font-size: 1.9rem;
}

.auth-card .form-grid {
  margin-top: 18px;
}

.auth-card > p {
  color: var(--muted);
}

.brand-auth {
  display: inline-flex;
  margin-bottom: 6px;
}

/* ============================================================
   Prose
   ============================================================ */
.prose h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 12px;
}

.prose h2 {
  margin: 26px 0 10px;
  font-size: 1.25rem;
}

.prose p,
.prose li {
  color: var(--text-soft);
  line-height: 1.7;
}

.prose ul {
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer-inner {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer .brand-logo {
  height: 36px;
}

.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy {
  width: 100%;
  text-align: center;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .editorial-band,
  .estimator-shell,
  .browse-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketplace-search {
    grid-template-columns: 1fr 1fr;
  }

  .marketplace-search .search-submit {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 880px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 24px;
  }

  .topbar .brand {
    order: 1;
  }

  .topbar-actions {
    order: 2;
    margin-left: auto;
  }

  .nav-links {
    order: 3;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  /* Elevation-on-hover is a desktop affordance; keep mobile pod static */
  .topbar:hover {
    transform: none;
  }

  .hero {
    min-height: 500px;
  }

  .hero-features {
    gap: 18px;
  }

  .messages-layout {
    grid-template-columns: 1fr;
  }

  .browse-banner,
  .cta-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .page-wrap {
    width: min(100% - 28px, 1200px);
    margin-top: 36px;
  }

  .home-shell {
    gap: 44px;
  }

  .panel {
    padding: 20px;
  }

  .hero-inner {
    padding-top: 60px;
    padding-bottom: 96px;
  }

  .marketplace-search {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .chat-bubble {
    max-width: 90%;
  }

  .footer-links {
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .inline-actions .primary-btn,
  .inline-actions .ghost-btn,
  .inline-actions .danger-btn,
  .inline-actions .whatsapp-btn {
    flex: 1;
  }

  .topbar .brand {
    padding: 6px 14px;
  }

  .topbar-actions #authActionLink {
    padding: 0 12px;
    font-size: 0.74rem;
  }

  .nav-links a {
    font-size: 0.62rem;
    padding: 6px 10px 5px;
  }
}

/* Responsive logo sizing */
@media (max-width: 620px) {
  .brand-logo,
  .topbar .brand-logo {
    height: 32px;
  }
}

@media (max-width: 400px) {
  .brand-logo,
  .topbar .brand-logo {
    height: 28px;
  }
}

/* International phone field: a country/dial-code selector sitting flush against
   the number input. Defaults to Ghana and wraps cleanly on small screens. */
.phone-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.phone-field .phone-country {
  flex: 0 0 auto;
  max-width: 42%;
  min-width: 116px;
}

.phone-field input[type="tel"] {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 420px) {
  .phone-field {
    flex-wrap: wrap;
  }
  .phone-field .phone-country {
    max-width: 100%;
    flex: 1 1 100%;
  }
}
