/* =====================================================================
   JayJerman.ng - Premium Car Marketplace
   Design tokens per brief: Deep Blue / Orange / Green on a soft neutral field
   ===================================================================== */

:root {
  --jj-primary: #0D47A1;
  --jj-primary-dark: #082e6b;
  --jj-primary-light: #e8eefb;
  --jj-orange: #FF6F00;
  --jj-orange-dark: #cc5900;
  --jj-green: #00C853;
  --jj-bg: #F7F9FC;
  --jj-card: #FFFFFF;
  --jj-text: #16213a;
  --jj-text-soft: #5b6b8c;
  --jj-border: #e6eaf3;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 10px 30px rgba(13, 71, 161, 0.08);
  --shadow-card: 0 4px 18px rgba(16, 24, 64, 0.06);
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

[data-theme="dark"] {
  --jj-bg: #0b1220;
  --jj-card: #121a2b;
  --jj-text: #eef2fb;
  --jj-text-soft: #a9b4cc;
  --jj-border: #232f47;
  --jj-primary-light: #17223f;
}

* { box-sizing: border-box; }

html {
  height: 100%;
  overflow-x: hidden;
}

/* Page shell: nav / main content / footer as three grid rows. The middle
   row (main content) is the only one allowed to grow, so the footer is
   always pinned to the bottom of the viewport on short pages and to the
   bottom of the content on long ones - never floating mid-page. Using
   CSS Grid (rather than flexbox) here, with !important on the properties
   that actually matter, makes this immune to being silently overridden by
   any other rule anywhere else in the stylesheet, now or in the future. */
body {
  font-family: var(--font-body);
  background: var(--jj-bg);
  color: var(--jj-text);
  transition: background .25s ease, color .25s ease;
  overflow-x: hidden;
  max-width: 100vw;
  display: grid !important;
  grid-template-rows: auto 1fr auto !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
}

.jj-main-content {
  min-height: 0 !important;
  min-width: 0 !important;
}
.jj-footer {
  min-height: 0 !important;
}

h1, h2, h3, h4, h5, h6, .jj-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--jj-text);
}

a { text-decoration: none; }

.text-orange { color: var(--jj-orange); }
.text-green { color: var(--jj-green); }
.bg-primary-soft { background: var(--jj-primary-light); }

/* ---------------------------------------------------------------- */
/* Navbar */
/* ---------------------------------------------------------------- */
.jj-navbar {
  background: var(--jj-card) !important;
  border-bottom: 1px solid var(--jj-border);
}
.jj-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--jj-primary);
  letter-spacing: -0.5px;
}
.jj-navbar .nav-link {
  font-weight: 600;
  color: var(--jj-text-soft);
  margin: 0 6px;
}
.jj-navbar .nav-link:hover { color: var(--jj-primary); }
.btn-icon {
  border: 1px solid var(--jj-border);
  background: var(--jj-bg);
  color: var(--jj-text);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------------------------------------------------------------- */
/* Buttons */
/* ---------------------------------------------------------------- */
.btn-primary {
  background: var(--jj-primary);
  border-color: var(--jj-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--jj-primary-dark);
  border-color: var(--jj-primary-dark);
}
.btn-outline-primary {
  color: var(--jj-primary);
  border-color: var(--jj-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.btn-outline-primary:hover {
  background: var(--jj-primary);
  border-color: var(--jj-primary);
}
.btn-orange {
  background: var(--jj-orange);
  border-color: var(--jj-orange);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.btn-orange:hover { background: var(--jj-orange-dark); color: #fff; }
.btn-green {
  background: var(--jj-green);
  border-color: var(--jj-green);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------- */
/* Hero */
/* ---------------------------------------------------------------- */
.jj-hero {
  background: linear-gradient(135deg, var(--jj-primary) 0%, #123a8f 55%, #1655c7 100%);
  color: #fff;
  padding: 70px 0 110px;
  position: relative;
  overflow: hidden;
}
.jj-hero::after {
  content: '';
  position: absolute;
  right: -120px; top: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: rgba(255, 111, 0, 0.18);
  z-index: 1;
  pointer-events: none; /* decorative only - must never intercept clicks */
}
/* The search card below overlaps the bottom of the hero (negative margin +
   its own z-index) to create the "floating card" effect. These rules make
   sure the hero's own content - especially its buttons - always wins any
   click in that overlap zone, no matter what. */
.jj-hero > .container {
  position: relative;
  z-index: 10;
}
.jj-hero .btn {
  position: relative;
  z-index: 999;
  pointer-events: auto;
}
.jj-hero h1 {
  color: #fff;
  font-size: 2.75rem;
  line-height: 1.15;
}
.jj-hero .lead { color: rgba(255,255,255,0.85); }

.jj-search-card {
  background: var(--jj-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  margin-top: -70px;
  position: relative;
  z-index: 5;
}

.jj-search-card .form-control,
.jj-search-card .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--jj-border);
}

/* ---------------------------------------------------------------- */
/* Section headers */
/* ---------------------------------------------------------------- */
.jj-section { padding: 60px 0; }
.jj-section-title {
  font-size: 1.75rem;
  margin-bottom: 4px;
}
.jj-section-sub { color: var(--jj-text-soft); margin-bottom: 30px; }

/* ---------------------------------------------------------------- */
/* Cards */
/* ---------------------------------------------------------------- */
.jj-card {
  background: var(--jj-card);
  border: 1px solid var(--jj-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
  height: 100%;
}
.jj-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}
.jj-car-card .jj-car-img {
  height: 190px !important;
  max-height: 190px !important;
  object-fit: cover !important;
  width: 100% !important;
  display: block;
  background: var(--jj-primary-light);
}
.jj-car-card .jj-body { padding: 16px; }
.jj-car-card .jj-price {
  color: var(--jj-primary);
  font-weight: 800;
  font-size: 1.15rem;
}
.jj-badge-featured {
  background: var(--jj-orange);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  position: absolute;
  top: 12px; left: 12px;
}
.jj-badge-verified {
  background: var(--jj-green);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
.jj-card-img-wrap { position: relative; }
.jj-fav-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.9);
  border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #d33;
}
.jj-meta-row {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--jj-text-soft);
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- */
/* Brand & category pills */
/* ---------------------------------------------------------------- */
.jj-pill {
  background: var(--jj-card);
  border: 1px solid var(--jj-border);
  border-radius: var(--radius-md);
  padding: 18px 10px;
  text-align: center;
  display: block;
  color: var(--jj-text);
  font-weight: 600;
  transition: all .2s ease;
}
.jj-pill:hover {
  border-color: var(--jj-primary);
  color: var(--jj-primary);
  transform: translateY(-3px);
}
.jj-pill i { font-size: 1.6rem; color: var(--jj-primary); display: block; margin-bottom: 8px; }

/* ---------------------------------------------------------------- */
/* Stats strip */
/* ---------------------------------------------------------------- */
.jj-stats { background: var(--jj-primary-light); }
.jj-stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--jj-primary);
}

/* ---------------------------------------------------------------- */
/* Testimonials */
/* ---------------------------------------------------------------- */
.jj-testimonial {
  background: var(--jj-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  height: 100%;
}
.jj-testimonial .stars { color: var(--jj-orange); }

/* ---------------------------------------------------------------- */
/* Footer */
/* ---------------------------------------------------------------- */
.jj-footer {
  background: #0b1a3a;
}
.footer-link { color: rgba(255,255,255,0.6); display: block; margin-bottom: 8px; }
.footer-link:hover { color: #fff; }

/* ---------------------------------------------------------------- */
/* Dashboard */
/* ---------------------------------------------------------------- */
.jj-sidebar {
  background: var(--jj-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--jj-border);
  padding: 14px;
}
.jj-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--jj-text-soft);
  font-weight: 600;
  margin-bottom: 4px;
}
.jj-sidebar a:hover, .jj-sidebar a.active {
  background: var(--jj-primary-light);
  color: var(--jj-primary);
}
.jj-stat-card {
  background: var(--jj-card);
  border: 1px solid var(--jj-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.jj-stat-card .num { font-size: 1.8rem; font-weight: 800; font-family: var(--font-display); }
.jj-stat-card .label { color: var(--jj-text-soft); font-size: 0.85rem; }

.jj-alert-fee {
  background: linear-gradient(135deg, #fff3e0, #ffe6cc);
  border: 1px solid var(--jj-orange);
  border-radius: var(--radius-md);
  padding: 20px;
}

/* ---------------------------------------------------------------- */
/* Forms */
/* ---------------------------------------------------------------- */
.jj-form-card {
  background: var(--jj-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px;
}
.form-label { font-weight: 600; font-size: 0.9rem; }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--jj-border);
  padding: 10px 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--jj-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 71, 161, 0.12);
}

.jj-dropzone {
  border: 2px dashed var(--jj-border);
  border-radius: var(--radius-md);
  padding: 30px;
  text-align: center;
  color: var(--jj-text-soft);
  cursor: pointer;
  transition: border-color .2s;
}
.jj-dropzone.dragover { border-color: var(--jj-primary); background: var(--jj-primary-light); }

/* ---------------------------------------------------------------- */
/* Image upload tiles: spinner -> progress -> success/error          */
/* ---------------------------------------------------------------- */
.jj-upload-tile {
  max-width: 120px;
}
.jj-upload-thumb {
  position: relative !important;
  width: 100% !important;
  height: 80px !important;
  max-width: 120px !important;
  max-height: 80px !important;
  border-radius: var(--radius-sm);
  overflow: hidden !important;
  background: var(--jj-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.jj-upload-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  display: block;
}
.jj-upload-spinner {
  font-size: 1.4rem;
  color: var(--jj-primary);
}
.jj-upload-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(13, 71, 161, 0.15);
}
.jj-upload-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--jj-orange);
  transition: width 0.2s ease;
}
.jj-upload-success {
  animation: jjUploadPop 0.35s ease;
}
@keyframes jjUploadPop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}
.jj-upload-check {
  position: absolute;
  bottom: 4px; left: 4px;
  color: var(--jj-green);
  background: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  animation: jjCheckIn 0.3s ease 0.1s both;
}
@keyframes jjCheckIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.jj-upload-remove, .jj-upload-star {
  position: absolute;
  top: 3px;
  width: 20px; height: 20px;
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
}
.jj-upload-remove {
  right: 3px;
  background: rgba(0,0,0,0.6);
  color: #fff;
}
.jj-upload-star {
  left: 3px;
  background: rgba(255,255,255,0.85);
  color: var(--jj-text-soft);
}
.jj-upload-star.active {
  background: var(--jj-orange);
  color: #fff;
}
.jj-upload-error {
  color: #d33;
  font-size: 1.2rem;
  flex-direction: column;
  gap: 4px;
  cursor: default;
}

/* ---------------------------------------------------------------- */
/* Post-a-car wizard (steps like Jiji's posting flow)                */
/* ---------------------------------------------------------------- */
.jj-wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
  overflow-x: auto;
  gap: 4px;
}
.jj-wizard-steps::before {
  content: '';
  position: absolute;
  top: 16px; left: 0; right: 0;
  height: 2px;
  background: var(--jj-border);
  z-index: 0;
}
.jj-wizard-step {
  flex: 1;
  min-width: 84px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.jj-wizard-step .jj-wizard-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--jj-card);
  border: 2px solid var(--jj-border);
  color: var(--jj-text-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin: 0 auto 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.jj-wizard-step .jj-wizard-label {
  font-size: 0.72rem;
  color: var(--jj-text-soft);
  font-weight: 600;
  white-space: nowrap;
}
.jj-wizard-step.active .jj-wizard-dot {
  background: var(--jj-primary);
  border-color: var(--jj-primary);
  color: #fff;
}
.jj-wizard-step.active .jj-wizard-label { color: var(--jj-primary); }
.jj-wizard-step.completed .jj-wizard-dot {
  background: var(--jj-green);
  border-color: var(--jj-green);
  color: #fff;
}
.jj-wizard-step.completed .jj-wizard-dot::after {
  content: '\2713';
}
.jj-wizard-step.completed .jj-wizard-dot { font-size: 0; }
.jj-wizard-step.completed .jj-wizard-dot::after { font-size: 0.9rem; }

.jj-wizard-panel { display: none; }
.jj-wizard-panel.active { display: block; animation: jjFadeIn 0.3s ease both; }

.jj-wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--jj-border);
}

.jj-preview-card {
  border: 1px solid var(--jj-border);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--jj-bg);
}
.jj-preview-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--jj-border);
  font-size: 0.9rem;
}
.jj-preview-row:last-child { border-bottom: none; }
.jj-preview-row .label { color: var(--jj-text-soft); }
.jj-preview-row .value { font-weight: 600; text-align: right; }

.jj-word-count {
  font-size: 0.78rem;
  color: var(--jj-text-soft);
  margin-top: 4px;
}
.jj-word-count.jj-insufficient { color: var(--jj-orange); }
.jj-word-count.jj-ok { color: var(--jj-green); }

/* ---------------------------------------------------------------- */
/* Car detail page: main viewer + thumbnail strip gallery, and an     */
/* overflow-safe title row                                           */
/* ---------------------------------------------------------------- */

.jj-car-page { max-width: 1180px; }

/* --- Gallery --- */
.jj-gallery-panel {
  background: var(--jj-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  padding: 10px;
}
.jj-main-viewer {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  border-radius: var(--radius-md);
}
.jj-main-viewer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
@media (max-width: 576px) {
  .jj-main-viewer { aspect-ratio: 4 / 3; }
}
.jj-zoom-hint {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
}
.jj-photo-counter {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}
.jj-thumb-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 2px;
  scrollbar-width: thin;
}
.jj-thumb {
  width: 76px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.55;
  border: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.jj-thumb:hover { opacity: 0.85; transform: translateY(-2px); }
.jj-thumb.active { opacity: 1; border-color: var(--jj-primary); }

/* --- Title + meta + icon actions --- */
.jj-car-title {
  font-size: 1.65rem;
  margin-bottom: 6px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.jj-title-block { min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.jj-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--jj-text-soft);
}
.jj-badge-featured-inline {
  background: var(--jj-orange);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
}
.jj-icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--jj-border);
  background: var(--jj-card);
  color: var(--jj-text-soft);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.jj-icon-btn:hover { border-color: var(--jj-primary); color: var(--jj-primary); }

/* --- Signature element: quick-stats strip with icon badges --- */
.jj-quickstats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 768px) {
  .jj-quickstats { grid-template-columns: repeat(3, 1fr); }
}
.jj-quickstat {
  background: var(--jj-card);
  border: 1px solid var(--jj-border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-card);
}
.jj-quickstat-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.jj-quickstat-value {
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.2;
}
.jj-quickstat-label {
  font-size: 0.72rem;
  color: var(--jj-text-soft);
}

/* --- Generic content panel used throughout the page --- */
.jj-panel {
  background: var(--jj-card);
  border: 1px solid var(--jj-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
}
.jj-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--jj-primary);
}
.jj-panel-title i { font-size: 0.9rem; }

/* --- Specifications --- */
.jj-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--jj-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.jj-spec-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--jj-border);
  border-right: 1px solid var(--jj-border);
}
.jj-spec-row:nth-child(2n) { border-right: none; }
.jj-spec-label { color: var(--jj-text-soft); }
.jj-spec-value { font-weight: 600; text-align: right; }
.jj-spec-extra { display: none; }
.jj-specs-grid.jj-specs-expanded .jj-spec-extra { display: flex; }
.jj-showmore-btn {
  background: none;
  border: none;
  color: var(--jj-primary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 0 0;
  cursor: pointer;
}
@media (max-width: 576px) {
  .jj-specs-grid { grid-template-columns: 1fr; }
  .jj-spec-row { border-right: none !important; }
}

/* --- Features --- */
.jj-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.jj-feature-chip {
  background: var(--jj-primary-light);
  color: var(--jj-text);
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.jj-feature-chip i { color: var(--jj-green); margin-right: 6px; }

/* --- Sticky sidebar (desktop only) --- */
@media (min-width: 992px) {
  .jj-sticky-sidebar { position: sticky; top: 90px; }
}

/* --- Price + contact card --- */
.jj-price-card {
  background: linear-gradient(135deg, var(--jj-primary) 0%, #123a8f 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  color: #fff;
}
.jj-price-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
}
.jj-price-note {
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
  margin-bottom: 16px;
}
.jj-price-card .btn-primary {
  background: #fff;
  color: var(--jj-primary);
  border-color: #fff;
}
.jj-price-card .btn-primary:hover { background: #eef2fb; }
.jj-price-card .btn-outline-primary {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
.jj-price-card .btn-outline-primary:hover { background: rgba(255,255,255,0.12); }

/* --- Seller card --- */
.jj-seller-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--jj-primary-light);
  color: var(--jj-primary);
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* --- Related cars list item --- */
.jj-related-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  text-decoration: none;
  align-items: center;
}
.jj-related-item:last-child { margin-bottom: 0; }
.jj-related-item img {
  width: 64px; height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.jj-related-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--jj-text);
  line-height: 1.3;
}
.jj-related-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--jj-primary);
}

/* --- Safety tips box --- */
.jj-safety-box {
  background: var(--jj-primary-light);
  border: 1px solid var(--jj-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.jj-safety-box h6 { color: var(--jj-primary); }
.jj-safety-box ul { padding-left: 18px; color: var(--jj-text-soft); }
.jj-safety-box li { margin-bottom: 4px; }

/* Edit-listing page: "x" delete button on each existing photo thumbnail */
.jj-existing-photo-thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 70px;
}
.jj-existing-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.jj-existing-photo-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.jj-existing-photo-remove:hover { background: #d33; }
.jj-existing-photo.jj-removing { opacity: 0.4; pointer-events: none; }


/* Flex items default to min-width:auto, which lets long unbroken content
   (like a long car title) silently push its flex row wider than the
   viewport, causing the whole page to horizontally scroll on mobile.
   min-width:0 lets it shrink properly, and the word-break rules make
   sure a long title wraps instead of forcing extra width. */
.jj-title-block {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
.jj-title-block h3 {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ---------------------------------------------------------------- */
/* Image lightbox: click to view, slide between photos, zoom in/out  */
/* ---------------------------------------------------------------- */
.jj-lightbox-trigger { cursor: zoom-in; }

.jj-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 24, 0.94);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.jj-lightbox.active { display: flex; }

.jj-lightbox-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.jj-lightbox-stage img {
  max-width: 92vw;
  max-height: 80vh;
  max-height: 80dvh; /* dvh tracks the real visible viewport on mobile (accounting for the address bar), vh alone can report a taller area than what's actually visible - the line above is a fallback for older browsers, this one wins where supported */
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.15s ease;
  will-change: transform;
  touch-action: none;
}
.jj-lightbox-stage.dragging img { transition: none; cursor: grabbing; }
.jj-lightbox-stage.zoomed img { cursor: grab; }

.jj-lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 2010;
}
.jj-lightbox-toolbar {
  position: absolute;
  top: 16px; left: 16px;
  display: flex;
  gap: 8px;
  z-index: 2010;
}
.jj-lightbox-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}
.jj-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  z-index: 2010;
}
.jj-lightbox-prev { left: 12px; }
.jj-lightbox-next { right: 12px; }
.jj-lightbox-counter {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  background: rgba(255,255,255,0.12);
  padding: 4px 14px;
  border-radius: 20px;
}

@media (max-width: 576px) {
  .jj-lightbox-stage img {
    max-width: 94vw;
    max-height: 60vh;
    max-height: 60dvh;
  }
  .jj-lightbox-nav { width: 40px; height: 40px; font-size: 1rem; }
  .jj-lightbox-toolbar { top: auto; bottom: 60px; left: 50%; transform: translateX(-50%); }
  .jj-lightbox-counter { bottom: 14px; }
}

/* ---------------------------------------------------------------- */
/* Loading / animations */
/* ---------------------------------------------------------------- */
.jj-fade-in { animation: jjFadeIn .5s ease both; }
@keyframes jjFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.jj-skeleton {
  background: linear-gradient(90deg, var(--jj-border) 25%, #f0f3fa 37%, var(--jj-border) 63%);
  background-size: 400% 100%;
  animation: jjSkeleton 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes jjSkeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------------------------------------------------------------- */
/* Misc */
/* ---------------------------------------------------------------- */
.jj-blank-body {
  background: var(--jj-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jj-verified-tag {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--jj-green); font-weight: 700; font-size: 0.8rem;
}

.jj-impersonation-banner {
  background: var(--jj-orange);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
}
.jj-impersonation-banner a {
  color: #fff;
  text-decoration: underline;
  margin-left: 8px;
}

@media (max-width: 768px) {
  .jj-hero h1 { font-size: 2rem; }
  .jj-search-card { margin-top: -40px; }
}
