/* ─────────────────────────────────────────
   Car detail page · AVTOKREDO
   ───────────────────────────────────────── */

/* Breadcrumbs */
.crumbs {
  padding: 12px 0 4px;
  border-bottom: 1px solid var(--line);
}
.crumbs__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}
.crumbs__inner a {
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.crumbs__inner a:hover {
  color: var(--accent-darker);
  border-bottom-color: var(--accent);
}
.crumbs__inner span { opacity: .5; }
.crumbs__cur { color: var(--ink) !important; opacity: 1 !important; font-weight: 500; }

/* Hero layout */
.carHero { padding: clamp(20px, 3vw, 36px) 0 clamp(40px, 6vw, 80px); }
.carHero__inner {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: clamp(24px, 3vw, 44px);
  align-items: start;
}
.carHero__main { min-width: 0; }

/* Title row */
.carTitle {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.carTitle__brand { display: flex; gap: 14px; align-items: center; }
.carTitle__logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bLogo, var(--ink));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 2px 8px -2px rgba(0,0,0,.18);
}
.carTitle h1 {
  font-family: var(--display);
  font-weight: 700; /* match the unified landing H1 scale (was 400 → lighter than page H2s) */
  font-size: var(--h1-page, clamp(32px, 4.5vw, 52px)); /* R16: unified page-H1 token */
  text-wrap: balance;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 4px 0 0;
  color: var(--ink);
}
.carTitle__actions { display: flex; gap: 8px; }
.iconBtn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  transition: background .15s, color .15s, border-color .15s;
}
.iconBtn:hover { background: var(--bg-2); color: var(--ink); border-color: var(--line-2); }
.iconBtn--wide {
  width: auto;
  height: auto;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  gap: 8px;
}

/* Gallery */
.gallery {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.gallery__main {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--dark);
  overflow: hidden;
}
.gallery__main svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gallery__counter {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
}
.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.gallery__nav:hover { background: #fff; }
.gallery__nav--prev { left: 14px; }
.gallery__nav--next { right: 14px; }
.gallery__pill {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--accent);
  color: #0e1a13;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 8px;
  background: var(--bg);
}
.gallery__thumb {
  border: 2px solid transparent;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  padding: 0;
  aspect-ratio: 5 / 3;
  transition: border-color .15s;
}
.gallery__thumb svg { width: 100%; height: 100%; display: block; }
.gallery__thumb.is-on { border-color: var(--accent); }
.gallery__thumb--more {
  background: var(--bg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--ink-3);
}
.gallery__thumb--more:hover { background: var(--ink); color: var(--on-dark); }

/* Spec strip */
.specs {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.specs li {
  background: var(--paper);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* R32-13: with gap:1px over a --line background, the empty cells of an incomplete last row painted
   as grey blocks (read as a phantom 8th spec). Make the final item fill the row remainder. (Ported
   from parser/car.css — the theme-loaded copy was missing this R30 fix.) */
.specs li:last-child:nth-child(4n+1) { grid-column: 1 / -1; }
.specs li:last-child:nth-child(4n+2) { grid-column: span 3; }
.specs li:last-child:nth-child(4n+3) { grid-column: span 2; }

/* Icon variant — adds 24×24 inline SVG before label/value */
.specs--icons li {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.specs--icons li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.specs__icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cta-hover);
  background: oklch(0.96 0.04 148);
  border-radius: 8px;
  padding: 4px;
}
.specs__icon svg { width: 100%; height: 100%; }
@media (max-width: 600px) {
  .specs--icons { grid-template-columns: repeat(2, 1fr); }
  .specs--icons li b { font-size: 16px; }
}
.specs li span {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.specs li b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.specs li small {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  margin-left: 4px;
  letter-spacing: 0.04em;
  vertical-align: top;
}

/* Trust checks */
.checks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 32px;
}
.checks__item {
  background: var(--paper);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.checks__ico {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #0e1a13;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.checks__item b { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 2px; }
.checks__item span { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }

/* Description / Carbody text */
.carText { margin-bottom: 32px; max-width: 64ch; }
.carText h2,
.carSec__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--h2-display, clamp(26px, 2.8vw, 36px)); /* R19 #17 */
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 32px 0 14px;
  color: var(--ink);
}
.carText p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 12px;
}

/* Full specs */
.specsFull {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 32px;
}
.specsFull__group { background: var(--paper); padding: 22px 24px; }
.specsFull__group h3 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 12px;
  font-weight: 500;
}
.specsFull__group dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  font-size: 14px;
}
.specsFull__group dt {
  color: var(--ink-3);
}
.specsFull__group dd {
  margin: 0;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
}

/* ─── APPLY column (sticky) ─── */
.apply {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.apply__price {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px 20px;
}
.apply__priceLbl {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.apply__priceBig {
  /* R32-3: big decision-driving figure → sans (Manrope) bold + tabular, not the terminal mono.
     Matches card prices unified to sans in R30/R31; wins the cascade over .mono via source order. */
  font-family: var(--sans);
  font-size: 38px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.apply__priceBig small {
  font-size: 0.5em;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 4px;
  letter-spacing: 0;
}
.apply__priceCmp {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.apply__monthly {
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 22px 24px 20px;
}
.apply__monthlyLbl {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-darker);
  margin-bottom: 6px;
}
.apply__monthlyBig {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--accent-darker);
  line-height: 1;
}
.apply__monthlyBig small {
  font-size: 0.42em;
  font-weight: 400;
  color: var(--accent-darker);
  opacity: .7;
  margin-left: 4px;
  letter-spacing: 0;
}
.apply__monthlyDetails {
  display: grid;
  gap: 4px;
  font-size: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed color-mix(in oklab, var(--accent) 40%, transparent);
  color: var(--accent-darker);
}
.apply__monthlyDetails div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.apply__monthlyDetails span { opacity: .65; }
.apply__monthlyDetails b { font-weight: 500; }

.apply__tweak {
  margin-top: 12px;
}
.apply__tweak summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--accent-darker);
  font-weight: 500;
  text-align: center;
  padding: 8px 0;
  border-radius: var(--r-sm);
  list-style: none;
  position: relative;
  user-select: none;
}
.apply__tweak summary::-webkit-details-marker { display: none; }
.apply__tweak summary::after {
  content: "▾";
  margin-left: 6px;
  transition: transform .2s;
  display: inline-block;
}
.apply__tweak[open] summary::after { transform: rotate(180deg); }
.apply__tweakBody {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.apply__tweakBody label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--accent-darker);
}
.apply__tweakBody label span { float: right; font-weight: 600; }

.apply__form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.apply__h {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.apply__sub {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: -6px 0 8px;
}
.apply__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.apply__field > span {
  font-size: 12px;
  color: var(--ink-3);
}
.apply__field input,
.apply__field select {
  padding: 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: 500 15px/1.2 var(--sans);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  appearance: none;
}
.apply__field input:focus,
.apply__field select:focus {
  border-color: var(--cta, oklch(0.62 0.20 150));
  background: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--cta, oklch(0.62 0.20 150)) 22%, transparent);
}
.apply__field input::placeholder { color: var(--ink-soft); font-weight: 400; }
.apply__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
  margin: 6px 0;
}
.apply__check input { accent-color: var(--accent-deep); flex-shrink: 0; margin-top: 2px; }
.apply__check a { color: var(--accent-deep); border-bottom: 1px solid var(--accent-deep); }
.apply__fine {
  font-size: 10.5px;
  color: var(--ink-soft);
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 4px 0 0;
}
.apply__success {
  background: var(--dark);
  color: var(--on-dark);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.apply__success b { color: var(--accent); font-size: 15px; }
.apply__success span { font-size: 13px; opacity: .8; line-height: 1.45; }

.apply__trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.apply__trust div {
  background: var(--paper);
  padding: 14px 12px;
  text-align: center;
}
.apply__trust b {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  font-weight: 400;
}
.apply__trust span {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.3;
}

.apply__seller {
  background: var(--dark);
  color: var(--on-dark);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}
.apply__sellerHead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.apply__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #0e1a13;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.apply__sellerHead b { display: block; font-size: 14.5px; }
.apply__sellerHead span { font-size: 11px; opacity: .55; letter-spacing: 0.04em; }
.apply__sellerActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.apply__seller .iconBtn {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: var(--on-dark);
  font-size: 12.5px;
}
.apply__seller .iconBtn:hover {
  background: rgba(255,255,255,.12);
  color: var(--accent);
}

/* Similar */
.similar { background: var(--bg-2); padding: clamp(40px, 6vw, 80px) 0; }

/* Sticky CTA on car page — always visible on mobile (override hidden) */
.stickyCta__num b { color: var(--accent); }

/* Responsive */
@media (max-width: 1080px) {
  .carHero__inner { grid-template-columns: 1fr; }
  /* let the single column shrink to viewport — .apply lacked min-width:0, so its
     min-content held the whole hero at ~433px and clipped payment figures on phones */
  .carHero__inner > * { min-width: 0; max-width: 100%; }
  .apply { position: static; min-width: 0; }
  .apply .mono { overflow-wrap: anywhere; }
  .checks { grid-template-columns: 1fr; }
  .specsFull { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .specs { grid-template-columns: repeat(2, 1fr); }
  /* R32-13: 2-col — an odd last item spans both so no grey orphan cell. */
  .specs li:last-child:nth-child(2n+1) { grid-column: 1 / -1; }
  .specs li:last-child:nth-child(4n+2),
  .specs li:last-child:nth-child(4n+3) { grid-column: auto; }
  .gallery__thumbs { grid-template-columns: repeat(5, 1fr); }
  .gallery__thumbs button:nth-child(n+6) { display: none; }
  .gallery__thumbs button.gallery__thumb--more { display: inline-flex; }
  .carTitle h1 { font-size: 28px; }
  .apply__priceBig { font-size: 32px; }
  .apply__trust { grid-template-columns: 1fr; }
  /* R32-11: submit label carries the live monthly figure ("Отримати розрахунок на 24 500 ₴/міс →")
     — too wide for the pill at 390px; nowrap clipped the leading "О". Let it wrap to centered lines. */
  .apply .btn--xl,
  .apply__form .btn--xl { white-space: normal; line-height: 1.2; font-size: 14.5px; padding: 14px 16px; height: auto; }
}
