/* Vehicle cards and detail template; all images stay on a consistent 4:3 stage. */
.car-gallery--card { aspect-ratio: 4 / 3; background: #e8edf3; }
.car-gallery--card .car-gallery__open { height: 100%; }
.car-gallery--card .vcard__img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.car-gallery--card .car-gallery__open::after { inset-block-start: 58%; }
.vcard__title a { color: inherit; text-decoration: none; }
.vcard__title a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.vcard__details { display: flex; justify-content: space-between; gap: 8px; color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; }
.vcard__contact { min-height: 42px; margin-top: 4px; justify-content: center; gap: 8px; }
.vcard__contact .icon { width: 17px; height: 17px; flex: none; }

/* Home: two visible rows, then horizontal columns of more featured Afghan cars. */
#rack-afghanistan[data-rack] {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  grid-auto-columns: minmax(0, calc((100% - 20px) / 2));
  gap: 20px;
  margin: 0;
  padding: 2px 2px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
#rack-afghanistan .rack__item { min-width: 0; flex: none; scroll-snap-align: start; }
#rack-afghanistan .inventory-empty { grid-column: 1 / -1; }
@media (max-width: 767px) {
  #rack-afghanistan[data-rack] { grid-auto-columns: minmax(84vw, 84vw); gap: 12px; }
  #rack-afghanistan .vcard__body { padding: 14px; }
  #rack-afghanistan .vcard__specs { gap: 4px 9px; }
}

/* USA progress/listing rails stay one row and can be swiped horizontally. */
#rack-purchased[data-rack], #onway-rack[data-rack], #purchased-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: minmax(0, 1fr);
  grid-auto-columns: minmax(260px, calc((100% - 60px) / 4));
  gap: 20px;
  margin-inline: 0;
  padding: 2px 2px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
#rack-purchased .rack__item, #onway-rack .rack__item, #purchased-grid > .vcard { min-width: 0; flex: none; scroll-snap-align: start; }
#purchased-grid > .inventory-empty { grid-column: auto; min-width: min(100%, 480px); }
@media (max-width: 767px) {
  #rack-purchased[data-rack], #onway-rack[data-rack], #purchased-grid { grid-auto-columns: minmax(82vw, 82vw); gap: 12px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  #rack-purchased[data-rack], #onway-rack[data-rack], #purchased-grid { grid-auto-columns: minmax(42vw, 42vw); }
}

.vehicle-detail-page { min-height: 100vh; background: #f5f7fb; }
.vehicle-topbar { background: #0f1b33; border-bottom: 1px solid rgba(255,255,255,.12); }
.vehicle-topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.vehicle-topbar .brand img { display: block; width: min(168px, 42vw); height: auto; }
.vehicle-topbar nav { display: flex; flex-wrap: wrap; gap: 18px; }
.vehicle-topbar nav a { color: #e8eef8; font-size: 14px; font-weight: 650; text-decoration: none; }
.vehicle-topbar nav a:hover { color: #81e0ae; }
.vehicle-main { min-height: 70vh; padding-block: 28px 56px; }
.vehicle-back { display: inline-block; margin-bottom: 18px; color: var(--accent); font-weight: 700; text-decoration: none; }
.vehicle-detail__heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 12px 0 22px; }
.vehicle-detail__heading h1 { margin: 0; font-size: clamp(27px, 4vw, 42px); line-height: 1.18; }
.vehicle-detail__ref { margin-top: 8px; color: var(--text-soft); font-size: 13px; }
.vehicle-detail__price { margin: 0; color: var(--accent); font-size: clamp(22px, 3vw, 32px); font-weight: 800; white-space: nowrap; }
.vehicle-detail__layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .8fr); gap: 22px; align-items: start; }
.vehicle-gallery, .vehicle-summary, .vehicle-specifications, .vehicle-damage, .vehicle-bottom-contact { overflow: hidden; border: 1px solid #e1e7ef; border-radius: 18px; background: #fff; box-shadow: 0 10px 32px rgba(17,31,55,.06); }
.vehicle-gallery__stage { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #e8edf3; }
.vehicle-gallery__stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vehicle-gallery__thumbs { display: flex; gap: 9px; overflow-x: auto; padding: 12px; }
.vehicle-gallery__thumb { width: 86px; height: 64px; flex: 0 0 86px; overflow: hidden; border: 2px solid transparent; border-radius: 9px; padding: 0; background: #e8edf3; cursor: pointer; }
.vehicle-gallery__thumb.is-active { border-color: var(--accent); }
.vehicle-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-summary { padding: 22px; }
.vehicle-summary h2, .vehicle-damage h2 { margin: 0 0 16px; font-size: 20px; }
.vehicle-summary dl, .vehicle-spec-grid { display: grid; grid-template-columns: minmax(105px, .85fr) minmax(0, 1.15fr); margin: 0; }
.vehicle-summary dt, .vehicle-summary dd, .vehicle-spec-grid dt, .vehicle-spec-grid dd { margin: 0; padding: 10px 0; border-bottom: 1px solid #edf0f4; font-size: 14px; }
.vehicle-summary dt, .vehicle-spec-grid dt { color: var(--text-soft); }
.vehicle-summary dd, .vehicle-spec-grid dd { font-weight: 700; overflow-wrap: anywhere; }
.vehicle-contact { display: flex; justify-content: center; width: 100%; min-height: 48px; margin-top: 18px; }
.vehicle-contact__note { margin: 10px 0 0; color: var(--text-soft); font-size: 12px; line-height: 1.55; text-align: center; }
.vehicle-specifications { margin-top: 24px; padding: clamp(18px, 3vw, 30px); }
.vehicle-specifications .section-head { margin-bottom: 12px; }
.vehicle-spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; }
.vehicle-spec-grid dt, .vehicle-spec-grid dd { border-bottom: 1px solid #edf0f4; }
.vehicle-disclosure { margin: 16px 0 0; color: var(--text-soft); font-size: 12px; line-height: 1.65; }
.vehicle-damage { margin-top: 20px; padding: 22px; border-inline-start: 4px solid #e2a43b; }
.vehicle-damage p { margin: 0; line-height: 1.65; white-space: pre-wrap; }
.vehicle-damage small { display: block; margin-top: 9px; color: var(--text-soft); }
.vehicle-bottom-contact { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding: 22px; background: #101d32; color: #fff; }
.vehicle-bottom-contact h2 { margin: 0 0 5px; font-size: 20px; }
.vehicle-bottom-contact p { margin: 0; color: #c8d3e2; }
.vehicle-bottom-contact .btn { flex: 0 0 auto; }
.vehicle-error { padding: 38px 18px; text-align: center; }
.vehicle-error h1 { margin-bottom: 10px; }
.vehicle-footer { padding: 20px 0; color: #c9d3e2; background: #0f1b33; }
.vehicle-footer .container { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.vehicle-footer p { margin: 0 auto 0 0; }
.vehicle-footer a { color: inherit; }
html[dir="rtl"] .vehicle-topbar__inner, html[dir="rtl"] .vehicle-detail__heading, html[dir="rtl"] .vehicle-bottom-contact { direction: rtl; }
html[dir="rtl"] .vehicle-footer p { margin: 0 0 0 auto; }
@media (max-width: 760px) {
  .vehicle-topbar__inner { min-height: 64px; }
  .vehicle-topbar nav { gap: 9px; }
  .vehicle-topbar nav a { font-size: 11px; }
  .vehicle-detail__heading { align-items: start; flex-direction: column; gap: 8px; }
  .vehicle-detail__layout { grid-template-columns: minmax(0, 1fr); }
  .vehicle-spec-grid { grid-template-columns: minmax(0, 1fr); }
  .vehicle-bottom-contact { align-items: stretch; flex-direction: column; }
}
/* Marketplace-style cards and structured detail page refinement */
.car-gallery--card { aspect-ratio: 4 / 3; background: #edf1f5; }
.car-gallery--card .car-gallery__open::after { content: none; }
.car-gallery--card .vcard__img { object-fit: cover; }
.vcard { border: 1px solid #e5e9ef; border-radius: 12px; box-shadow: 0 3px 12px rgba(17,31,55,.05); }
.vcard__body { gap: 6px; padding: 11px 13px 13px; }
.vcard__title { font-size: 15px; line-height: 1.35; }
.vcard__specs { gap: 4px 10px; font-size: 12px; }
.vcard__price { font-size: 17px; }
.vehicle-section-nav { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 18px; padding: 8px 0 12px; border-bottom: 1px solid #e1e7ef; }
.vehicle-section-nav a { flex: none; padding: 8px 13px; border-radius: 999px; background: #fff; color: var(--text); font-size: 13px; font-weight: 700; text-decoration: none; }
.vehicle-section-nav a:hover, .vehicle-section-nav a:focus-visible { background: #eaf4ef; color: var(--accent); }
.vehicle-summary__price { margin: 0 0 12px; color: var(--accent); font-size: 25px; font-weight: 850; }
.vehicle-summary dl { grid-template-columns: minmax(80px, .7fr) minmax(0, 1.3fr); }
.vehicle-trust { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e9edf2; }
.vehicle-trust p { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: start; margin: 0; padding: 9px 0; }
.vehicle-trust p + p { border-top: 1px solid #edf0f4; }
.vehicle-trust p > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #eef3f8; color: #42536c; font-size: 13px; font-weight: 800; }
.vehicle-trust strong, .vehicle-trust small { display: block; }
.vehicle-trust strong { font-size: 12px; line-height: 1.4; }
.vehicle-trust small { margin-top: 3px; color: var(--text-soft); font-size: 11px; line-height: 1.5; }
.vehicle-specifications { scroll-margin-top: 24px; }
.vehicle-specifications--info { border-top: 3px solid var(--accent); }
.vehicle-key-facts { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid #e8edf2; border-radius: 12px; background: #e8edf2; }
.vehicle-key-facts dt, .vehicle-key-facts dd { margin: 0; padding: 10px 12px; background: #fff; }
.vehicle-key-facts dt { color: var(--text-soft); font-size: 11px; }
.vehicle-key-facts dd { font-size: 14px; font-weight: 750; overflow-wrap: anywhere; }
.vehicle-damage { display: grid; grid-template-columns: minmax(190px,.65fr) minmax(0,1.35fr); gap: 14px 24px; scroll-margin-top: 24px; }
.vehicle-damage .eyebrow { margin: 0 0 5px; }
.vehicle-damage h2 { margin: 0; }
.vehicle-damage p { align-self: center; }
.vehicle-damage small { grid-column: 2; margin: -10px 0 0; }
@media (max-width: 760px) {
  .vehicle-summary { padding: 18px; }
  .vehicle-key-facts { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .vehicle-damage { grid-template-columns: 1fr; }
  .vehicle-damage small { grid-column: 1; margin-top: -6px; }
  #rack-afghanistan[data-rack] { grid-auto-columns: minmax(82vw,82vw); }
}
/* Screenshot-led structure: a slim section rail, gallery/facts, and contact/trust card. */
.vehicle-content-grid { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 22px; align-items: start; }
.vehicle-section-nav { position: sticky; top: 16px; display: flex; flex-direction: column; align-items: stretch; gap: 3px; margin: 0; padding: 0; border: 0; overflow: visible; }
.vehicle-section-nav a { border-radius: 7px; background: transparent; color: var(--text-soft); padding: 10px 9px; font-size: 12px; }
.vehicle-section-nav a::before { content: '›'; display: inline-block; margin-inline-end: 7px; color: #8794a6; }
.vehicle-content-main { min-width: 0; }
.vehicle-detail__layout { grid-template-columns: minmax(0,1.55fr) minmax(265px,.8fr); }
.vehicle-gallery { overflow: hidden; }
.vehicle-key-section { padding: 15px 16px 16px; background: #fff; }
.vehicle-key-section .eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.vehicle-key-facts { grid-template-columns: repeat(4,minmax(0,1fr)); }
.vehicle-key-facts dt { padding: 9px 10px 3px; }
.vehicle-key-facts dd { padding: 3px 10px 10px; }
.vehicle-specifications { margin-top: 18px; }
.vehicle-damage { margin-top: 18px; }
.vehicle-summary { border-radius: 10px; box-shadow: none; }
.vehicle-trust p:first-child > span:first-child { background: #eaf5ef; color: #24834f; }
.vehicle-trust p:last-child > span:first-child { background: #f1f3f6; }
@media (max-width: 900px) {
  .vehicle-content-grid { grid-template-columns: 1fr; gap: 10px; }
  .vehicle-section-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 8px; border-bottom: 1px solid #e1e7ef; }
  .vehicle-section-nav a { flex: none; }
}
@media (max-width: 760px) {
  .vehicle-detail__layout { grid-template-columns: minmax(0,1fr); }
  .vehicle-key-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) { .vehicle-detail-page *, .vehicle-detail-page *::before, .vehicle-detail-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
.vehicle-gallery__stage { position: relative; }
.vehicle-gallery__arrow { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.75); border-radius: 50%; background: rgba(15,27,51,.72); color: #fff; font-size: 27px; line-height: 1; cursor: pointer; }
.vehicle-gallery__arrow:hover { background: var(--accent); }
.vehicle-gallery__arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.vehicle-gallery__arrow--prev { inset-inline-start: 12px; }
.vehicle-gallery__arrow--next { inset-inline-end: 12px; }
.vehicle-gallery__count { position: absolute; inset-inline-end: 12px; bottom: 12px; z-index: 2; padding: 4px 9px; border-radius: 999px; background: rgba(15,27,51,.76); color: #fff; font-size: 12px; font-weight: 700; }
/* Four editorial spec tiles and paired detail rows, inspired by the references. */
.vehicle-key-facts { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; border: 1px solid #e3e8ef; border-radius: 10px; background: #fff; }
.vehicle-key-fact { min-width: 0; min-height: 94px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; text-align: center; background: #fff; }
.vehicle-key-fact + .vehicle-key-fact { border-inline-start: 1px solid #e3e8ef; }
.vehicle-key-fact__icon { display: grid; place-items: center; width: 24px; height: 24px; color: #5d6e84; }
.vehicle-key-fact__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vehicle-key-fact__copy, .vehicle-key-fact__label, .vehicle-key-fact__value { display: block; min-width: 0; }
.vehicle-key-fact__label { color: var(--text-soft); font-size: 11px; line-height: 1.3; }
.vehicle-key-fact__value { margin-top: 3px; color: var(--accent); font-size: 14px; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; }
.vehicle-summary dl { display: block; }
.vehicle-summary dl > .vehicle-spec-item { display: grid; grid-template-columns: minmax(75px,.7fr) minmax(0,1.3fr); gap: 10px; }
.vehicle-summary dl dt, .vehicle-summary dl dd { padding: 10px 0; border-bottom: 1px solid #edf0f4; }
.vehicle-spec-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 28px; }
.vehicle-spec-grid > .vehicle-spec-item { display: grid; grid-template-columns: minmax(90px,1fr) minmax(0,1fr); align-items: start; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e7ebf0; }
.vehicle-spec-grid dt, .vehicle-spec-grid dd { min-width: 0; margin: 0; padding: 0; border: 0; font-size: 13px; line-height: 1.45; }
.vehicle-spec-grid dt { color: var(--text-soft); }
.vehicle-spec-grid dd { text-align: end; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .vehicle-key-fact { min-height: 84px; padding: 10px 5px; }
  .vehicle-key-fact__value { font-size: 13px; }
  .vehicle-spec-grid { grid-template-columns: 1fr; gap: 0; }
}
/* Home Afghanistan inventory: independent, equal-card rails for each row. */
#rack-afghanistan[data-rack] {
  display: flex;
  flex-direction: column;
  gap: 14px;
  grid-template-columns: none;
  grid-template-rows: none;
  grid-auto-flow: initial;
  grid-auto-columns: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
}
#rack-afghanistan .rack-row {
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 2px 2px 9px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-behavior: auto;
  touch-action: pan-x pan-y;
  scrollbar-width: thin;
}
#rack-afghanistan .rack-row::-webkit-scrollbar { height: 5px; }
#rack-afghanistan .rack-row > .rack__item {
  flex: 0 0 calc((100% - 32px) / 3);
  width: calc((100% - 32px) / 3);
  min-width: 0;
  min-height: 0;
  height: auto;
  scroll-snap-align: start;
}
#rack-afghanistan .rack-row > .vcard { min-height: 0; }
#rack-afghanistan .rack-row .car-gallery--card { width: 100%; aspect-ratio: 4 / 3; }
#rack-afghanistan .rack-row .vcard__body { flex: 1; }
#rack-afghanistan .rack-row .inventory-empty { flex: 1 0 100%; min-width: 100%; }
@media (min-width: 768px) and (max-width: 1023px) {
  #rack-afghanistan .rack-row > .rack__item { flex-basis: calc((100% - 16px) / 2); width: calc((100% - 16px) / 2); }
}
@media (max-width: 767px) {
  #rack-afghanistan[data-rack] { gap: 10px; }
  #rack-afghanistan .rack-row { gap: 12px; padding-bottom: 7px; scroll-snap-type: x proximity; }
  #rack-afghanistan .rack-row > .rack__item { flex-basis: 84vw; width: 84vw; }
  #rack-afghanistan .rack-row .vcard__body { padding: 14px; }
}
