/* ==========================================================================
   Inventory listing, vehicle pages, lead pop-ups, lightbox, compare.
   Same type scale and spacing as site.css; nothing new is introduced beyond
   what the current Dealer.com inventory offers.
   ========================================================================== */

.mobile-only { display: none; }
.link-btn {
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--accent-ink); font: inherit; cursor: pointer; text-decoration: underline;
}

/* --- swatch ---------------------------------------------------------------- */
.swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25); vertical-align: -2px; margin-right: 8px;
  background: #999;
}
.swatch[data-color="Black"] { background: #111; }
.swatch[data-color="White"] { background: #fff; }
.swatch[data-color="Silver"] { background: #c8c9cc; }
.swatch[data-color="Gray"] { background: #6f7378; }
.swatch[data-color="Red"] { background: #a8201a; }
.swatch[data-color="Blue"] { background: #1f4e8c; }
.swatch[data-color="Green"] { background: #2e6b3a; }
.swatch[data-color="Brown"] { background: #6b4a2b; }
.swatch[data-color="Gold"] { background: #c9a227; }
.swatch[data-color="Orange"] { background: #d9632a; }
.swatch[data-color="Purple"] { background: #5b2d82; }
.swatch[data-color="Other"] { background: linear-gradient(135deg, #ddd 50%, #888 50%); }

/* --- search + suggestions + chips ---------------------------------------- */
.inv-search { margin: 20px 0 10px; position: relative; }
.inv-search__form { position: relative; }
.inv-search__form input[type="search"] {
  width: 100%; height: 56px; border: 1px solid var(--field-border); border-radius: 0;
  background: #fff; font: 18px var(--font-body); padding: 0 56px 0 20px; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.inv-search__form input:focus { outline: 2px solid var(--accent); }
.inv-search__btn {
  position: absolute; right: 0; top: 0; height: 56px; width: 56px;
  background: none; border: 0; cursor: pointer; color: var(--dark);
}
.inv-search__btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.inv-suggest {
  list-style: none; margin: 0; padding: 6px 0; position: absolute; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--field-border); border-top: 0; z-index: 30;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}
.inv-suggest li { padding: 8px 20px; cursor: pointer; font-size: 15px; }
.inv-suggest li mark { background: none; font-weight: 700; color: inherit; }
.inv-suggest li:hover, .inv-suggest li.is-active { background: var(--line-soft); }

.chips { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.chips__track { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; flex: 1; }
.chips__track::-webkit-scrollbar { display: none; }
.chips__arrow {
  flex: none; width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  color: var(--ink-soft); font-size: 18px; line-height: 1; padding: 0;
}
.chips__arrow:disabled { opacity: 0.35; cursor: default; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--line); background: #fff; padding: 6px 12px; font: 14px var(--font-body);
  color: var(--accent-ink); cursor: pointer;
}
.chip .count { color: var(--ink-soft); font-size: 12px; }
.chip.is-active { background: var(--dark); color: #fff; border-color: var(--dark); }
.chip.is-active .count { color: var(--on-dark-muted); }
.chip--search { color: var(--ink); background: var(--line-soft); }
.chip--search .x { font-size: 16px; line-height: 1; margin-left: 2px; }
.chip--miles { background: var(--line-soft); color: var(--ink); border: 0; cursor: default; margin: 4px 0 10px; }

/* --- results bar / drawer -------------------------------------------------- */
.results-bar { padding-top: 10px; }
.filter-toggle { display: none; }
.inv-drawer__head, .inv-drawer__close { display: none; }
.pill-list { list-style: none; margin: 0; padding: 0 0 8px 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list label {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); padding: 6px 12px;
  cursor: pointer; font-size: 15px;
}
.pill-list input { margin: 0; accent-color: var(--accent); }
.pill-list label.is-active { background: var(--dark); color: #fff; border-color: var(--dark); }
.pill-list label.is-active .count { color: var(--on-dark-muted); }
.filter-group__list label.is-zero, .pill-list label.is-zero { opacity: 0.45; }

/* --- vehicle card: carousel, tabs, columns -------------------------------- */
.carousel { position: relative; }
.carousel__main { display: block; }
.carousel__main img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line-soft); }
.carousel__btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: rgba(27, 36, 48, 0.75); color: #fff; cursor: pointer;
  font-size: 22px; line-height: 1; padding: 0; opacity: 0; transition: opacity 0.15s;
}
.carousel:hover .carousel__btn, .carousel__btn:focus-visible { opacity: 1; }
.carousel__btn--prev { left: 10px; }
.carousel__btn--next { right: 10px; }
.carousel__btn:hover { background: var(--accent); }
.carousel__thumbs {
  list-style: none; margin: 6px 0 0; padding: 0; display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: thin;
}
.carousel__thumbs li { flex: none; width: 72px; }
.carousel__thumbs button { border: 2px solid transparent; padding: 0; background: none; cursor: pointer; display: block; width: 100%; }
.carousel__thumbs button.is-active { border-color: var(--accent); }
.carousel__thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--line-soft); }

.vehicle__cols { display: flex; gap: 30px; align-items: flex-start; margin-top: 12px; }
.vehicle__specs { flex: 1; }
.vehicle__pricing { width: 300px; flex: none; border: 1px solid var(--line-soft); padding: 16px 20px 20px; }
.vehicle__pricing .spec { margin: 0; }
.vehicle__pricing .spec__label { text-transform: none; min-width: 0; flex: 1; }
.vehicle__pricing .spec__value { padding-left: 12px; }
.vehicle__pricing .spec__item--discount .spec__value { color: #1f6b2e; }
.vehicle__pricing .spec__item--total { border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 6px; }
.vehicle__pricing .spec__item--total .spec__value { font-family: var(--font-display); font-size: 24px; }
.vehicle__pricing .btn { margin-top: 12px; }
.vehicle__actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.compare-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; }
.compare-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.vehicle__details { font-weight: 600; }
.vehicle__details::after { content: " \203A"; }
.vehicle__tabs { display: none; }

/* --- compare tray + table -------------------------------------------------- */
.compare-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  padding: 12px 5%; display: flex; align-items: center; gap: 16px;
}
.compare-tray[hidden] { display: none; }
.compare-tray__items { display: flex; gap: 10px; flex: 1; overflow-x: auto; }
.compare-tray__item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-soft); padding: 4px 8px 4px 4px; font-size: 13px; white-space: nowrap; }
.compare-tray__item img { width: 56px; aspect-ratio: 4 / 3; object-fit: cover; }
.compare-tray__item button { background: none; border: 0; cursor: pointer; font-size: 16px; color: var(--ink-soft); padding: 0 2px; }
.compare-tray__msg { color: var(--ink-soft); white-space: nowrap; }
.compare-tray__close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink); padding: 0 4px; }
.compare-table { border-collapse: collapse; width: 100%; font-size: 15px; }
.compare-table th, .compare-table td { border-bottom: 1px solid var(--line-soft); padding: 8px 10px; text-align: left; vertical-align: top; }
.compare-table th:first-child { width: 150px; color: var(--ink-soft); font-weight: 400; text-transform: uppercase; font-size: 13px; }
.compare-table thead th { font-family: var(--font-display); font-size: 18px; }
.compare-table thead img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 6px; }
.compare-table .total { font-family: var(--font-display); font-size: 22px; font-weight: 700; }

/* --- modal (lead forms, highlights, compare) -------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; background: rgba(27, 36, 48, 0.72);
}
.modal[hidden] { display: none; }
.modal__box { background: #fff; width: 100%; max-width: 560px; padding: 24px 28px 28px; position: relative; }
.modal__box--wide { max-width: 1100px; }
.modal__title { font-size: 18px; font-weight: 400; color: var(--ink-soft); padding-bottom: 14px; }
.modal__close {
  position: absolute; right: 14px; top: 12px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--line-soft); cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink);
}
.modal__close:hover { background: var(--line); }
.modal__intro { font-size: 18px; line-height: 1.5; }
.modal .form { max-width: none; }
.modal .form__grid { grid-template-columns: 1fr; }
.modal .vehicle-ref { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; }
.modal .vehicle-ref img { width: 90px; aspect-ratio: 4 / 3; object-fit: cover; }
.modal .vehicle-ref strong { display: block; font-family: var(--font-display); font-size: 18px; line-height: 1.2; }
.modal__thanks { text-align: center; padding: 20px 0 0; }
.modal__thanks p { font-size: 18px; }

/* --- VDP photo strip --------------------------------------------------------- */
.vdp-strip { position: relative; background: var(--dark-2); }
.vdp-strip__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 2px; }
.vdp-strip__track::-webkit-scrollbar { display: none; }
.vdp-strip__item { flex: none; width: 33.333%; scroll-snap-align: start; border: 0; padding: 0; background: none; cursor: zoom-in; }
.vdp-strip__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.vdp-strip__btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(27, 36, 48, 0.85); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0;
}
.vdp-strip__btn--prev { left: 14px; }
.vdp-strip__btn--next { right: 14px; }
.vdp-strip__btn:hover { background: var(--accent); }
.vdp-strip__count, .vdp-strip__share {
  position: absolute; bottom: 14px; left: 14px; border: 0; background: rgba(255, 255, 255, 0.92); color: var(--ink);
  font: 13px var(--font-body); padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.vdp-strip__count svg { width: 16px; height: 16px; fill: currentColor; }
.vdp-strip__share { left: auto; right: 14px; bottom: auto; top: 14px; }
.vdp-strip__share svg { width: 14px; height: 14px; fill: currentColor; }

/* --- lightbox --------------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 120; background: #0d1117; color: #fff; display: flex; flex-direction: column; }
.lightbox[hidden] { display: none; }
.lightbox__top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-size: 14px; }
.lightbox__tools { display: flex; gap: 6px; }
.lightbox__tools button, .lightbox__nav {
  background: rgba(255, 255, 255, 0.1); border: 0; color: #fff; width: 36px; height: 36px; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 0;
}
.lightbox__tools button:hover, .lightbox__nav:hover { background: var(--accent); }
.lightbox__stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 0.2s; cursor: zoom-in; }
.lightbox.is-zoomed .lightbox__stage img { transform: scale(1.8); cursor: zoom-out; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; font-size: 28px; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__counter { text-align: center; font-size: 14px; padding: 8px; }
.lightbox__thumbs { list-style: none; margin: 0; padding: 0 12px 12px; display: flex; gap: 6px; overflow-x: auto; }
.lightbox__thumbs li { flex: none; width: 90px; }
.lightbox__thumbs button { border: 2px solid transparent; padding: 0; background: none; cursor: pointer; display: block; width: 100%; opacity: 0.6; }
.lightbox__thumbs button.is-active { border-color: var(--accent); opacity: 1; }
.lightbox__thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }

/* --- VDP content --------------------------------------------------------------- */
.vdp-kicker { font-size: 18px; font-weight: 400; color: var(--ink-soft); line-height: 1; padding-bottom: 6px; }
.vdp-title { font-size: 34px; line-height: 1; padding-bottom: 20px; }
.vdp-specs { list-style: none; margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
.vdp-specs .spec__item { border-bottom: 1px solid var(--line-soft); }
.vdp-specs .spec__label { min-width: 130px; text-transform: none; color: var(--ink-soft); }
.feature-list--icons { columns: 2; column-gap: 30px; }
.feature-list--icons li { display: flex; align-items: center; gap: 10px; padding: 5px 0; break-inside: avoid; }
.feature-list--icons li::before { display: none; }
.feature-list--icons svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--dark); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.feature-list--plain { list-style: none; padding: 0; columns: 2; column-gap: 30px; }
.feature-list--plain li { padding: 4px 0; break-inside: avoid; }
.feature-list--plain li::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--accent); margin-right: 10px; vertical-align: middle; }

.acc { border-top: 1px solid var(--line-soft); }
.acc:last-child { border-bottom: 1px solid var(--line-soft); }
.acc__head {
  width: 100%; background: none; border: 0; text-align: left; cursor: pointer; padding: 12px 0;
  font: 700 16px/1.4 var(--font-body); color: var(--ink); display: flex; align-items: center; gap: 12px;
}
.acc__head::before {
  content: ""; width: 18px; height: 18px; flex: none; border: 1.5px solid var(--ink); border-radius: 50%;
  background: linear-gradient(var(--ink), var(--ink)) center/8px 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center/1.5px 8px no-repeat;
}
.acc.is-open > .acc__head::before { background: linear-gradient(var(--ink), var(--ink)) center/8px 1.5px no-repeat; }
.acc__body { display: none; padding: 0 0 14px 30px; }
.acc.is-open > .acc__body { display: block; }
.acc__body ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 30px; }
.acc__body li { padding: 3px 0; break-inside: avoid; }
.acc--notes .acc__body { columns: 1; }
.acc--notes .acc__body p { padding-bottom: 1em; }

.vdp-cols { align-items: stretch; }
.price-card { display: none; position: sticky; top: 20px; border: 1px solid var(--line); padding: 16px 20px 20px; }
.price-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 10px; }
.price-card .price-card__title { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.2; padding-bottom: 6px; }
.price-card .price-card__total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 10px; }
.price-card .price-card__total strong { font-family: var(--font-display); font-size: 26px; }
.price-card .price-card__total small { display: block; color: var(--ink-soft); }
.vdp-side.is-compact .price-box { display: none; }
.vdp-side.is-compact .price-card { display: block; }
.price-box .btn-row .btn { flex: 1; }

.reco { list-style: none; margin: 0; padding: 27px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.reco li { border: 1px solid var(--line-soft); }
.reco a { color: var(--ink); display: block; }
.reco img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.reco .reco__body { text-align: center; padding: 12px 10px 16px; }
.reco .reco__kicker { font-size: 13px; color: var(--ink-soft); }
.reco .reco__name { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.2; }
.reco .reco__price { padding-top: 4px; }

.vdp-bar { display: none; }

/* section-level accordions ("Detailed Specifications", "Dealer Notes") are
   plain headed sections on desktop and collapsible on phones */
@media (min-width: 981px) {
  .acc--section { border: 0 !important; margin-top: 10px; }
  .acc--section > .acc__head { font-size: 26px; font-weight: 700; line-height: 1; padding: 0 0 10px; pointer-events: none; }
  .acc--section > .acc__head::before { display: none; }
  .acc--section > .acc__body { display: block; padding: 0 0 20px; }
  .acc--section > .acc__body > .acc:first-child { border-top: 1px solid var(--line-soft); }
}

/* header phone icon (shown on phones) */
@media (min-width: 1151px) { .header-tools { display: none; } }
.header-phone { color: #fff; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.header-phone svg { width: 22px; height: 22px; fill: currentColor; }

/* --- responsive ---------------------------------------------------------------- */
@media (max-width: 980px) {
  .mobile-only { display: block; }
  .vehicle__cols { flex-direction: column; gap: 16px; }
  .vehicle__pricing { width: 100%; }
  .results-bar { justify-content: space-between; }
  .filter-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .filter-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
  .results-bar .sort-field { display: none; }

  /* filters become a full-screen drawer */
  .inv-drawer {
    position: fixed; inset: 0; z-index: 90; background: #fff; overflow-y: auto; padding: 16px 5% 40px;
    transform: translateX(100%); transition: transform 0.2s; width: 100% !important;
  }
  .inv-drawer.is-open { transform: none; }
  .inv-drawer__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; }
  .inv-drawer__head h3 { padding: 0; font-size: 22px; }
  .inv-drawer__close { display: block; width: 36px; height: 36px; border: 2px solid var(--accent); background: #fff; font-size: 22px; cursor: pointer; }
  .inv-drawer .filter-group__list { display: flex; flex-wrap: wrap; gap: 8px; }
  .inv-drawer .filter-group__list li { padding: 0; }
  .inv-drawer .filter-group__list label { border: 1px solid var(--line); padding: 8px 12px; }
  .inv-drawer .filter-group__list label.is-active { background: var(--dark); color: #fff; }
  .inv-drawer .filter-group__list li.field { width: 48%; }
  .inv-drawer .filter-group__list li.field label { border: 0; padding: 0; }
  .inv-drawer .widget { margin-bottom: 30px; }
  .inv-drawer__apply { position: sticky; bottom: 0; background: #fff; padding: 12px 0; border-top: 1px solid var(--line-soft); }

  /* card tabs */
  .vehicle__tabs { display: flex; border-bottom: 1px solid var(--line); margin-top: 8px; }
  .vehicle__tabs button {
    flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px; cursor: pointer;
    font: 16px var(--font-body); color: var(--ink-soft);
  }
  .vehicle__tabs button.is-active { color: var(--ink); border-bottom-color: var(--accent); }
  .vehicle [data-panel] { display: none; }
  .vehicle [data-panel].is-active { display: block; }
  .vehicle__pricing { border: 0; padding: 10px 0 0; }
  .compare-tray { padding: 10px 4%; }
  .compare-tray__items { display: none; }

  .vdp-strip__item { width: 100%; }
  .vdp-specs { grid-template-columns: 1fr; }
  .feature-list--icons, .feature-list--plain, .acc__body ul { columns: 1; }
  .vdp-side { position: static; }
  .vdp-side.is-compact .price-box { display: block; }
  .vdp-side.is-compact .price-card { display: none; }
  .reco { grid-template-columns: repeat(2, 1fr); }

  /* sticky bottom bar on vehicle pages */
  .vdp-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: #fff;
    border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12); padding: 10px 4%;
    align-items: center; gap: 12px;
  }
  .vdp-bar__text { flex: 1; min-width: 0; line-height: 1.3; }
  .vdp-bar__text .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
  .vdp-bar__text .p { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
  .vdp-bar__text a { font-size: 13px; margin-left: 8px; }
  .vdp-bar .btn { white-space: nowrap; padding: 10px 16px; }
  body.has-vdp-bar { padding-bottom: 76px; }
  .site-footer { padding-bottom: 60px; }
}

@media (max-width: 600px) {
  .modal { padding: 16px 10px; }
  .modal__box { padding: 20px 18px 24px; }
  .reco { grid-template-columns: 1fr 1fr; gap: 10px; }
  .carousel__thumbs li { width: 56px; }
  .lightbox__thumbs li { width: 64px; }
  .vdp-title { font-size: 28px; }
}
