/* ── Variables ── */
:root {
  --navy:   #0d1526;
  --navy2:  #1e2f52;
  --navy3:  #2a4070;
  --blue:   #1d4ed8;
  --blue2:  #1e40af;
  --slate1: #f4f5f7;
  --slate2: #e8eaee;
  --slate3: #d0d4dc;
  --slate4: #a0a8b8;
  --slate5: #6b7590;
  --green:  #28a745;
  --red:    #da1515;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(13,21,38,.08);
  --shadow2: 0 6px 28px rgba(13,21,38,.13);
}

*, *::before, *::after { box-sizing: border-box; }

body.listing-details-page {
  background: #f2f3f5;
  color: var(--navy);
  overflow-x: hidden;
}

/* ── PAGE WRAPPER ── */
.listing-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 60px;
  overflow-x: hidden;
}

/* ── ACTION BAR ── */
.listing-action-bar {
  position: relative;
  width: 100%;
  margin-top: 80px;
  padding: 12px 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-back-btn {
  position: absolute;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  /* #4a5270, not --slate5 (C5, axe color-contrast): #6b7590 was 4.13:1 on the #f2f3f5 page; this is 6.92:1.
     Dark mode keeps its own light-on-navy colour (theme.css). */
  color: #4a5270;
  padding: 7px 14px;
  border: 1.5px solid var(--slate3);
  border-radius: 8px;
  transition: all .2s;
  text-decoration: none;
}
.nav-back-btn:hover {
  color: var(--navy);
  border-color: var(--navy2);
  background: var(--slate1);
  transform: translateY(-3px);
}
.nav-back-btn:active { transform: translateY(3px); }
.nav-back-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.listing-action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-right: 364px; /* 340px sidebar + 24px gap — centers over image column */
}

/* "Report this listing" — small, quiet, on every public listing page (the
   /safety/report chooser). Mirrors .nav-back-btn's placement on the right. */
.listing-report-link {
  position: absolute;
  right: 24px;
  font-size: 12px;
  font-weight: 600;
  /* Full-strength #4a5270 (C5, axe color-contrast): --slate5 at 85% opacity measured 3.19:1 on the #f2f3f5 page;
     this is 6.92:1. "Quiet" now comes from its size and place, not from fading it below the floor. */
  color: #4a5270;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.listing-report-link:hover { color: var(--navy); opacity: 1; }
/* On the dark page gradient the slate link measured 2.5:1 at the gradient's light end (#1e2f52) — a gradient the
   automated checkers cannot read, so it never showed. 75% white is 8.2:1 there. */
[data-theme="dark"] .listing-report-link { color: rgba(255, 255, 255, .75); }
[data-theme="dark"] .listing-report-link:hover { color: #ffffff; }

.action-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
}
.action-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

.btn-edit   { background: var(--navy); color: #fff; }
.btn-edit:hover { background: var(--navy2); color: #fff; transform: translateY(-3px); }
.btn-edit:active { transform: translateY(3px); }
/* #15803d, not var(--green) #28a745: white on #28a745 is 3.1:1, under the 4.5:1 floor at every width; this is 5.0:1
   (owner-view layout check, Nov 22 2026 — docs/FOLDABLE_LAYOUT_PLAN.md W8). */
.btn-sold   { background: #15803d; color: #fff; border: none; }
.btn-sold:hover { filter: brightness(.92); color: #fff; transform: translateY(-3px); }
.btn-sold:active { transform: translateY(3px); }
.btn-delete { background: var(--red); color: #fff; }
.btn-delete:hover { filter: brightness(.92); color: #fff; transform: translateY(-3px); }
.btn-delete:active { transform: translateY(3px); }
.btn-support { background: transparent; color: var(--navy); border-color: var(--slate3); }
.btn-support:hover { background: var(--slate1); border-color: var(--navy2); transform: translateY(-3px); }
.btn-support:active { transform: translateY(3px); }

/* ── MOBILE TITLE ── */
.mobile-listing-title {
  display: none;
  margin-bottom: 16px;
}
.mobile-listing-title .m-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--navy);
  line-height: 1.1;
}
.mobile-listing-title .m-price {
  font-family: 'Montserrat', sans-serif;
  font-size: 32px;
  font-weight: 800;
  /* #1e7e34, the call-for-price colour below, for every price (C5, axe color-contrast): var(--green) is 2.82:1 on
     the #f2f3f5 page, under even the 3:1 large-text floor; #1e7e34 is 4.63:1. Dark mode keeps --green (4.2:1). */
  color: #1e7e34;
  margin-top: 4px;
}
[data-theme="dark"] .mobile-listing-title .m-price { color: var(--green); }
/* "Call for price" in the phone title (layoutCheck, Nov 7: var(--green) is 2.82:1 on the light page,
   under the 3:1 large-text floor). #1e7e34 is 4.6:1 on #f2f3f5; #4ade80 is 10:1 on the dark page. */
.mobile-listing-title .m-price.m-price--cfp { color: #1e7e34; }
[data-theme="dark"] .mobile-listing-title .m-price.m-price--cfp { color: #4ade80; }
/* The phone title had no dark colour: navy on the dark page gradient, so the car's name could not be
   read (seen beside the label above, Nov 7). Same light text the dark cards use. */
[data-theme="dark"] .mobile-listing-title .m-title { color: #f1f5f9; }

/* ── LISTING TOP GRID: GALLERY + SIDEBAR ── */
/* Keeps .ListingContainer for carousel JS hook */
.ListingContainer {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
  min-width: 0;
}

/* ── GALLERY ── */
/* Keeps .ImageCarousel for carousel JS */
.ImageCarousel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: unset;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

/* Keeps .MainImageContainer for carousel JS */
.MainImageContainer {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  aspect-ratio: 16/10;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Keeps .MainImg for carousel JS */
.MainImg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .3s;
  border-radius: 0;
  margin: 0;
}

/* In-page main image opens the fullscreen viewer on click */
.ListingContainer .MainImg { cursor: zoom-in; }

/* Keeps .MainVideo for carousel JS */
.MainVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  background-color: #000;
  max-height: none;
  border-radius: 0;
  margin: 0;
}

/* Keeps #ImageCount for carousel JS */
#ImageCount {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 4;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(13,21,38,.6);
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background .2s;
}
.carousel-arrow:hover { background: rgba(13,21,38,.85); }
.left-arrow { left: 10px; }
.right-arrow { right: 10px; }

.gallery-fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all .2s;
  z-index: 4;
}
.gallery-fav-btn:hover { background: #fff; transform: scale(1.1); }
.gallery-fav-btn .favorite-icon { width: 16px; height: 16px; }


.enlarge-btn {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s;
  z-index: 4;
  margin-top: 0;
  display: inline-block;
}
.enlarge-btn:hover { background: rgba(0,0,0,.75); }

/* Keeps .ThumbnailCarousel for carousel JS */
.ThumbnailCarousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 0;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.ThumbnailCarousel::-webkit-scrollbar { display: none; }

.ThumbnailCarousel .MediaThumb {
  width: 72px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .2s;
  padding: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
}
.ThumbnailCarousel .MediaThumb:hover { border-color: var(--navy2); }
.ThumbnailCarousel .MediaThumb.active { border-color: var(--blue); }

/* Video tile: a styled badge, deliberately NOT a <video> — embedding the raw
   storage URL bypassed playback metering and pulled preload bytes per render.
   The actual stream is fetched per play via POST /listings/:id/video-url. */
.ThumbnailCarousel .MediaThumb--video {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  background: var(--navy1, #14213d);
  color: #fff;
}
.ThumbnailCarousel .MediaThumb--video .video-thumb-glyph { font-size: 16px; line-height: 1; }
.ThumbnailCarousel .MediaThumb--video .video-thumb-label {
  font-size: 9px; letter-spacing: .08em; text-transform: uppercase; opacity: .85;
}

.ThumbnailCarousel img,
.ThumbnailCarousel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--slate1);
  border-radius: 0;
  box-shadow: none;
}

/* ── SIDEBAR ── */
/* Keeps .Sidebar for layout */
.Sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px;
  flex: unset;
}

.sidebar-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1.5px solid var(--slate2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.price-card { padding: 20px; }

.listing-title-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--navy);
  line-height: 1.1;
  margin: 0 0 6px; /* it is the page's <h1> now — neutralise UA heading margins */
}

.listing-price-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -.01em;
  line-height: 1;
  margin-bottom: 14px;
}

.listing-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.meta-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--slate5);
}
.meta-row svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.meta-row strong { color: var(--navy); font-weight: 600; }
.meta-row a { color: var(--navy2); font-weight: 600; text-decoration: none; }
.meta-row a:hover { color: var(--blue2); }

.contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--blue);
  padding: 13px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.contact-btn:hover {
  background: var(--blue2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,123,255,.3);
  color: #fff;
}
.contact-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.overview-card-inner { padding: 16px 18px; }

.card-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-heading::before { content: ''; width: 16px; height: 2px; background: var(--blue); flex-shrink: 0; }

.overview-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.overview-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--slate2);
}
.overview-list li:last-child { border-bottom: none; }
.ov-label { color: var(--slate5); font-weight: 500; flex-shrink: 0; }
.ov-val { color: var(--navy); font-weight: 600; text-align: right; }

/* ── CONTENT SECTIONS ── */
.listing-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1.5px solid var(--slate2);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--navy);
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--slate2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Description */
.description-text { font-size: 14px; line-height: 1.75; color: #374151; }

/* History & Analysis */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.history-items { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--slate1);
  border-radius: 8px;
  font-size: 13px;
}
.history-icon {
  width: 36px; height: 36px;
  background: var(--navy);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
/* layoutCheck (Nov 9): the icon's text colour was navy on its navy tile (1:1 — the emoji paints its own colours, but a
   text fallback would vanish), and the label was #6b7590 on #f4f5f7 (4.21:1). White on navy; #4b5563 is 7:1. */
.history-icon { color: #ffffff; }
.history-label { color: #4b5563; font-size: 11px; margin-bottom: 2px; }
.history-val { color: var(--navy); font-weight: 700; font-size: 14px; }
/* "Not reported" (views/partials/vehicleHistory.ejs): neutral — not a warning, not a green "clean". A literal colour,
   no dark override: theme.css keeps .section-card white in dark mode, and #4b5563 is 7:1 on the #f4f5f7 row. */
.history-val.history-val--unknown { color: #4b5563; font-weight: 600; }

.analysis-rows { display: flex; flex-direction: column; }
.analysis-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 10px 0;
  border-bottom: 1px solid var(--slate2);
}
.analysis-row:last-child { border-bottom: none; }
.analysis-label { color: var(--slate5); }
.analysis-val { color: var(--navy); font-weight: 700; }
.coming-soon { color: var(--slate4); font-style: italic; font-weight: 400; }

/* The shopper price line (owner, Nov 13 2026): one plain fact and the fee disclaimer directly under it, in the same
   row and at the SAME weight and size as body text — never a badge, never a footnote. Stacks under the label on a
   phone. No dark-mode override: theme.css keeps .section-card white in dark mode (same as the rows above). */
.analysis-row--compare { align-items: flex-start; gap: 12px; }
.price-compare { display: flex; flex-direction: column; gap: 4px; text-align: right; font-weight: 400; max-width: 70%; }
.price-compare-text, .price-compare-disclaimer { color: var(--navy); font-size: 13px; font-weight: 400; line-height: 1.45; }
/* "How we compare" (owner, Nov 14 2026): a visible link-styled disclosure under the line; the explainer opens in place. */
.price-compare-how { font-size: 13px; line-height: 1.45; color: var(--navy); margin-top: 8px; } /* 12px from the disclaimer with the 4px row gap (§6.1) */
.price-compare-how > summary { cursor: pointer; color: #1d4ed8; text-decoration: underline; font-weight: 600; list-style: none; display: inline-block; padding: 8px 0; }
.price-compare-how > summary::-webkit-details-marker { display: none; }
.price-compare-how-text { display: block; margin-top: 12px; font-weight: 400; }
@media (max-width: 600px) {
  .analysis-row--compare { flex-direction: column; gap: 8px; }
  .price-compare { text-align: left; max-width: 100%; }
}

/* "Under review" in the owner's action bar, where Edit / Mark Sold / Delete
   would be (listing hidden by moderation). Same .badge-review fill as the
   dashboard card; sized to sit beside the Back button. */
.listing-review-badge { display: inline-flex; align-items: center; align-self: center;
                        font-size: 11px; padding: 7px 12px; letter-spacing: 0.08em; }

/* Dealership */
.dealer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dealer-info-col { display: flex; flex-direction: column; gap: 10px; }

.dealer-logo {
  max-height: 64px; max-width: 160px;
  object-fit: contain;
  border: 1px solid var(--slate2);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.dealer-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--slate5);
  align-items: flex-start;
}
.dealer-row svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; margin-top: 1px; flex-shrink: 0; }
.dealer-row a { color: var(--navy2); font-weight: 600; text-decoration: none; }
.dealer-row a:hover { color: var(--blue2); }

.dealer-map {
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--slate2);
  height: 220px;
}
.dealer-map iframe { width: 100%; height: 100%; border: none; display: block; }

/* Payment Calculator */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.calc-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate5);
}
.input-wrapper { position: relative; }
.input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--slate4);
  pointer-events: none;
}

.EstimatePaymentsCalculator input,
.EstimatePaymentsCalculator select {
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: var(--navy);
  background: #fff;
  border: 1.5px solid var(--slate3);
  border-radius: 8px;
  padding: 9px 12px 9px 26px;
  outline: none;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.EstimatePaymentsCalculator input:focus,
.EstimatePaymentsCalculator select:focus {
  border-color: var(--navy3);
  box-shadow: 0 0 0 3px rgba(42,64,112,.08);
}
.EstimatePaymentsCalculator input.no-prefix,
.EstimatePaymentsCalculator select {
  padding-left: 12px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7590' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: #fff;
}
/* The APR box is a text box the shopper types into (legal review, Nov 14 2026: no preset rate) — no dropdown chevron. */
.EstimatePaymentsCalculator input.no-prefix { background-image: none; }

.EstimatePaymentsCalculator button[type="button"] {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--navy);
  color: #fff;
  padding: 11px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all .2s;
  align-self: flex-start;
}
.EstimatePaymentsCalculator button[type="button"]:hover { background: var(--navy2); transform: translateY(-1px); }

.results-grid { display: flex; flex-direction: column; }
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--slate2);
  font-size: 14px;
}
.result-item:last-child { border-bottom: none; }
.result-label { color: var(--slate5); }
/* Smaller and lighter than the asking price (36 / 32 px at 800): the asking price is always the most prominent pricing
   figure on the page (legal re-check, Nov 14 2026). */
.result-val {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
}
/* 5.1:1 on the white card: at 20 px / 600 this is normal-size text (4.5:1); --green (#28a745) is only 3.13:1. */
.result-val.highlight { color: #1e7e34; }
/* The calculator's words (legal review, Nov 14 2026; utils/paymentCalculator/copy.js): body size, normal weight, readable
   on the white card in both themes (.section-card stays white in dark mode, theme.css) — never 11 px italic, never
   hover-only. The assumptions line and the disclaimer sit inside the monthly-payment row, directly under the figure. */
.calc-intro,
[data-theme="dark"] .calc-intro { margin: 0 0 16px; font-size: 15px; font-weight: 400; line-height: 1.5; color: #374151; }
.calc-hint,
[data-theme="dark"] .calc-hint { margin: 8px 0 0; font-size: 13px; font-weight: 400; line-height: 1.45; color: #4b5563; }
.result-item--monthly { flex-wrap: wrap; row-gap: 8px; }
.calc-note,
[data-theme="dark"] .calc-note { flex-basis: 100%; margin: 0; font-size: 14px; font-weight: 400; line-height: 1.5; color: #374151; }
.calc-note:empty { display: none; }
.calc-disclaimer {
  flex-basis: 100%;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #374151;
}
[data-theme="dark"] .calc-disclaimer { color: #374151; }

/* ── MARK SOLD MODAL ── */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal.hidden { display: none; }
.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  max-width: 400px;
  width: 88%;
  text-align: center;
  box-shadow: var(--shadow2);
}
.modal-content p { margin-bottom: 16px; font-size: 14px; color: var(--slate5); }
#sale-price-input {
  padding: 10px 14px;
  border: 1.5px solid var(--slate3);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  width: 100%;
  margin-bottom: 12px;
}
#sale-price-input:focus { border-color: var(--navy3); }
/* The refusal, inside the modal (white in both themes: theme.css keeps cards
   white). #b91c1c on #fff is 6.5:1; 12px from the input above, 16px to the
   buttons (§6.1). */
.modal-content p.sale-price-error { margin: 0 0 16px; color: #b91c1c; font-weight: 600; }
.modal-content p.sale-price-error[hidden] { display: none; }

/* ── FULLSCREEN CAROUSEL OVERLAY ── */
.ImageOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 200;
  display: none;
}
.ImageOverlay.visible { display: block; }

.FullScreenCarouselPopup {
  position: fixed;
  inset: 0;
  /* dvh: on a phone the viewer follows the real viewport when the browser
     chrome comes and goes and when the phone rotates (UAT #150) */
  height: 100vh;
  height: 100dvh;
  background: rgba(5,8,15,.97);
  display: none;
  flex-direction: column;
  z-index: 201;
}
.FullScreenCarouselPopup.visible { display: flex; }

.FullScreenCarouselPopup .close-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background .2s;
}
.FullScreenCarouselPopup .close-btn:hover { background: rgba(255,255,255,.3); }

.FullScreenCarouselPopup .ImageBlock {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.FullScreenCarouselPopup .MainImageContainer {
  flex: 1;
  border-radius: 0;
  background: transparent;
  aspect-ratio: unset;
  min-height: 0;
  max-width: none;
}

.FullScreenCarouselPopup .MainImg {
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  object-fit: contain;
}

.FullScreenCarouselPopup .carousel-arrow {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
.FullScreenCarouselPopup .left-arrow { left: 16px; }
.FullScreenCarouselPopup .right-arrow { right: 16px; }

.FullScreenCarouselPopup .ThumbnailCarousel {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-wrap: nowrap;
  background: transparent;
  scrollbar-width: none;
  margin-bottom: 0;
}
.FullScreenCarouselPopup .ThumbnailCarousel::-webkit-scrollbar { display: none; }

.FullScreenCarouselPopup .ThumbnailCarousel .MediaThumb {
  width: 64px;
  height: 46px;
  opacity: .5;
  border: 2px solid transparent;
  transition: opacity .2s, border-color .2s;
  flex-shrink: 0;
}
.FullScreenCarouselPopup .ThumbnailCarousel .MediaThumb:hover { opacity: .85; }
.FullScreenCarouselPopup .ThumbnailCarousel .MediaThumb.active { opacity: 1; border-color: var(--blue); }

#FullImageCount {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0,0,0,.65);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  z-index: 5;
}

body.fullscreen-open #SmallScreenPrev,
body.fullscreen-open #SmallScreenNext,
body.fullscreen-open #ImageCount { display: none; }

/* ── RESPONSIVE ── */
/* The car page's phone layout ends at 879px (was 960) and 880–1100px is a 50/50 two-pane layout (docs/FOLDABLE_LAYOUT_PLAN.md
   W3): an iPhone Duo opened and held sideways (951px) or a Galaxy Z Fold 8's inner screen (~930) is a book, and Apple's
   guidance is to put content on either side of the fold. Equal columns with the page's equal side padding put the fold
   in the 24px gap: the photos on the left page, the price and the seller's buttons on the right. The same number is in
   guestInquiry.css (the Call / Message bar) and .contact-btn--phone-only below; tests/ui/foldableLayout.test.js holds
   all three together. */
@media (min-width: 880px) and (max-width: 1100px) {
  .ListingContainer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* The phone-only "Contact Seller" button (shown when the Call / Message bar is off): CSS decides, so folding or
   unfolding the phone after the page loaded shows or hides it (it used to be a one-time innerWidth check at load). */
.contact-btn.contact-btn--phone-only { display: none; }
@media (max-width: 879px) {
  .contact-btn.contact-btn--phone-only { display: flex; }
}

@media (max-width: 879px) {
  .ListingContainer { grid-template-columns: 1fr; }
  .Sidebar { position: static; flex-direction: row; }
  .mobile-listing-title { display: block; }
  .desktop-price-card { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .dealer-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }

  .ImageCarousel {
    width: 100%;
    max-width: 100%;
  }
  .MainImageContainer {
    width: 100%;
    max-width: 100%;
  }
  .MainImg {
    max-width: 100%;
    width: 100%;
  }
  .ThumbnailCarousel {
    max-width: 100%;
    width: 100%;
  }
}

/* Delete listing confirmation */
.delete-confirm-text {
  color: #374151;
  font-size: 0.95rem;
  margin: 0 0 20px;
}

.delete-confirm-form {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn--delete-confirm {
  width: auto;
  padding: 10px 24px;
}

.btn--delete-cancel {
  width: auto;
  padding: 10px 24px;
  background: #6b7280;
}

/* Form wrapper that participates in flex/grid as if it were not there */
.form-display-contents {
  display: contents;
}

/* Sub-text in section headers */
.section-header-sub {
  font-weight: 400;
  font-size: 0.82rem;
  opacity: 0.8;
}

@media (max-width: 700px) {
  .Sidebar { flex-direction: column; }
  .dealer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .listing-page { padding: 0 12px 48px; }
  .listing-action-bar {
    flex-direction: column;
    padding: 10px 12px;
    gap: 8px;
  }
  .nav-back-btn { position: static; width: 100%; justify-content: center; }
  /* gap 8 (was 6): the §6.1 minimum between controls (docs/FOLDABLE_LAYOUT_PLAN.md W8) */
  .listing-action-btns { justify-content: center; gap: 8px; flex-wrap: wrap; margin-right: 0; }
  .listing-report-link { position: static; }
  .action-btn { font-size: 12px; padding: 7px 12px; }
  .section-card { padding: 16px; }
  .two-col { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
}

/* Landscape phone: the strip and its padding took a third of the height and
   the photo shrank to a letterbox slot (UAT #150). */
@media (orientation: landscape) and (max-height: 500px) {
  .FullScreenCarouselPopup .ThumbnailCarousel { padding: 6px 12px; gap: 4px; }
  .FullScreenCarouselPopup .ThumbnailCarousel .MediaThumb { width: 52px; height: 36px; }
}

/* Why a video is not playing, said on the tile (UAT #78: the play cap must read
   as the cap working, not as a broken player). */
.MainImageContainer .video-notice {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(13, 21, 38, 0.88);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center;
}

/* ── Report / Block seller (views/listingDetails.ejs, utils/userBlocks.js) ── */
.listing-safety-links {
  position: absolute;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.listing-safety-links .listing-report-link { position: static; }
.listing-block-menu { position: relative; }
.listing-block-menu > summary { list-style: none; cursor: pointer; }
.listing-block-menu > summary::-webkit-details-marker { display: none; }
.listing-block-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(13, 21, 38, 0.18);
  text-align: left;
}
.listing-block-title { margin: 0; font-weight: 700; font-size: 14px; }
.listing-block-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: #4b5563; }
.listing-block-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.listing-block-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #111827;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  resize: vertical;
}
.listing-block-report-fields { display: flex; flex-direction: column; gap: 8px; }
.listing-block-report-fields[hidden] { display: none; }
.listing-block-submit {
  align-self: flex-end;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: #da1515;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.listing-block-submit:hover { background: #ad0f0f; }
@media (max-width: 600px) {
  /* In the stacked action bar the panel spans the bar, anchored to the links
     row rather than to its own (centred) summary, so it never runs off-screen. */
  .listing-safety-links { position: relative; right: auto; justify-content: center; width: 100%; }
  .listing-block-menu { position: static; }
  .listing-block-panel { left: 0; right: 0; width: auto; }
}

/* The floating location pin (sitewide.css .location-box: fixed, top 100px, right 20px, 40px round) sits on this page's
   first row. Below 1400px the page reaches the window's edge, so the pin covered "Report this listing" (and on a
   491–600px window the full-width Back button) — measured at 594, 692, 951 and 1024px (docs/FOLDABLE_LAYOUT_PLAN.md W5).
   Keep the row's right end clear of it. ≤ 490px the pin moves to the bottom on car pages, so nothing is needed there. */
@media (min-width: 601px) and (max-width: 1400px) {
  /* (above 600px only: at ≤ 600px these are position: relative/static in the stacked bar, where `right` would shift them) */
  .listing-safety-links, .listing-report-link { right: 72px; }
}
@media (min-width: 491px) and (max-width: 600px) {
  /* the pin's 40px + its 20px from the edge + a 12px gap (at 60 the Back button touched it, 594×368) */
  .listing-action-bar { padding-right: 72px; }
}

/* The seller / staff action row — Edit · Mark Sold · Delete · Request Support — on the car page and the sold-car page
   (docs/FOLDABLE_LAYOUT_PLAN.md W8, owner report Sun Nov 22 2026). On desktop the row is centred over the photo column
   (margin-right: 364px) while Back and Report sit absolute at the bar's two ends. From 601 to ~1260px that centring ran
   the row UNDER the Back button — measured as the listing's owner at 669, 692, 951, 1024, 1101, 1150, 1200 and 1250px:
   "Back to Results" on top of Edit / Mark Sold / Delete — every opened foldable, an iPad held sideways, small laptops.
   There the bar becomes a wrapping row: Back on the left, Report on the right, the action buttons on their own centred
   line below. 72px on the right keeps the row clear of the floating location pin (as above). From 1280px the desktop
   row clears the Back button and is unchanged; pages without the row keep the layout above. */
@media (min-width: 601px) and (max-width: 1279px) {
  .listing-action-bar:has(.listing-action-btns) {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 12px 72px 12px 20px;
  }
  .listing-action-bar:has(.listing-action-btns) .nav-back-btn,
  .listing-action-bar:has(.listing-action-btns) .listing-safety-links { position: static; }
  .listing-action-bar:has(.listing-action-btns) .listing-action-btns { order: 3; flex: 1 0 100%; margin-right: 0; }
}

/* Vehicle type badge beside the title (docs/VEHICLE_TYPES_PLAN.md). Colours come from cardContainer.css
   .badge-vtype--* (fixed fills, the same in both themes); here only the spacing: its own line, 8px above the title. */
.listing-vtype-badge { display: inline-block; margin: 0 8px 8px 0; }
