/* ==========================================================================
   pages.css — page-specific styles
   Sections are added page by page (inventory -> vehicle -> home).
   ========================================================================== */

/* ==========================================================================
   Inventory page
   ========================================================================== */

/* ---- Title band --------------------------------------------------------- */
.page-title {
  padding: var(--space-4) 0;
  background-image: linear-gradient(var(--color-band-start), var(--color-band-end));
  border-bottom: 1px solid var(--color-border);
}

.page-title__heading {
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
}

.breadcrumb {
  margin-top: var(--space-1);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  padding: 0 var(--space-1);
  color: var(--color-text-muted);
}

.breadcrumb__link {
  color: var(--color-link);
}

.breadcrumb__link:hover {
  text-decoration: underline;
}

/* ---- Results header ----------------------------------------------------- */
.inventory {
  padding-top: var(--space-4);
  padding-bottom: var(--space-5);
}

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.results-bar__title {
  font-size: var(--fs-lg);
}

.results-bar__count {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.results-bar__tools {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.results-bar__filters-btn {
  position: relative;
  min-height: 40px;
}

.results-bar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: var(--fs-xs);
  color: var(--color-white);
  background-color: var(--color-brand);
  border-radius: var(--radius-pill);
}

.results-bar__sort {
  flex: 1 1 150px;
  max-width: 220px;
}

.results-bar__sort .field__control {
  min-height: 40px;
  font-size: var(--fs-base);
}

/* Grid / list switch */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.view-toggle__btn {
  width: 40px;
  height: 38px;
  font-size: var(--fs-md);
  color: var(--color-link);
  transition: background-color var(--transition);
}

.view-toggle__btn + .view-toggle__btn {
  border-left: 1px solid var(--color-border);
}

.view-toggle__btn:hover {
  background-color: var(--color-surface-alt);
}

.view-toggle__btn[aria-pressed="true"] {
  background-color: var(--color-divider);
}

/* ---- Layout: filters + results ------------------------------------------ */
.inventory__layout {
  display: block;
}

.inventory__results {
  min-width: 0;
}

.inventory__note {
  margin-top: var(--space-4);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* ---- Filters (drawer on mobile) ----------------------------------------- */
.filters {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-modal);
  width: min(340px, 90vw);
  overflow-y: auto;
  visibility: hidden;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-menu);
  transform: translateX(-100%);
  /* visibility waits for the slide-out so focus can move in as soon as it opens */
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
}

.filters.is-open {
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}

.filters__form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: var(--space-3);
}

.filters__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.filters__title {
  flex: 1;
  font-size: 19px;
  text-transform: uppercase;
}

.filters__clear {
  font-size: var(--fs-xs);
  color: var(--color-link);
}

.filters__clear:hover {
  text-decoration: underline;
}

.filters__close {
  align-self: center;
  width: 32px;
  height: 32px;
  font-size: var(--fs-lg);
}

.filters__group {
  min-width: 0;
  margin: 0 0 var(--space-3);
  padding: 0;
  border: 0;
}

.filters__group .field__label {
  display: block;
  margin-bottom: var(--space-1);
  padding: 0;
}

.filters__options {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filters__options--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
}

.filters__group .field__control {
  min-height: 40px;
  font-size: var(--fs-base);
}

/* Min / max number inputs */
.filter-range__inputs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-range__inputs .field__control {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
}

.filter-range__to {
  font-size: var(--fs-xs);
}

/* Collapsible groups */
.filter-section {
  margin: 0 calc(var(--space-3) * -1);
  border-top: 1px solid var(--color-border-light);
}

.filter-section__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  text-align: left;
  background-color: var(--color-bg);
}

.filter-section__toggle i {
  font-size: var(--fs-xs);
  transition: transform var(--transition);
}

.filter-section__toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.filter-section__panel {
  padding: var(--space-2) var(--space-3) var(--space-3);
}

/* "Show N results" button pinned to the bottom of the drawer */
.filters__apply {
  position: sticky;
  bottom: 0;
  margin: auto calc(var(--space-3) * -1) calc(var(--space-3) * -1);
  padding: var(--space-3);
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
}

.filters__apply .btn {
  text-transform: none;
}

/* ---- Results list --------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.chips__clear {
  padding: 4px var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-link);
}

.chips__clear:hover {
  text-decoration: underline;
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* One column, horizontal cards on wider screens (see responsive.css) */
.vehicle-grid--list {
  grid-template-columns: minmax(0, 1fr);
}

.vehicle-grid__item {
  min-width: 0;
}

.pagination {
  margin-bottom: var(--space-2);
}

/* ---- Vehicle page (added in the vehicle step) -------------------------- */
.vehicle {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-3);
  padding-bottom: var(--space-5);
}

.breadcrumb--back {
  margin: 0;
  font-size: var(--fs-xs);
}

.breadcrumb--back .breadcrumb__link i {
  margin-right: var(--space-1);
}

.vehicle__not-found {
  margin-top: var(--space-4);
}

/* Title card: vehicle on the left, seller on the right */
.vehicle-header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.vehicle-header__title {
  padding-right: 48px;
  font-size: var(--fs-xl);
}

.vehicle-header__sub {
  margin-top: var(--space-1);
  font-size: var(--fs-md);
}

.vehicle-header__seller {
  padding-top: var(--space-3);
  text-align: center;
  border-top: 1px solid var(--color-divider);
}

.vehicle-header__seller-name {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--color-link);
}

.vehicle-header__phone {
  display: block;
  margin: var(--space-1) 0;
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.vehicle-header__fav {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  font-size: var(--fs-xl);
  color: var(--color-brand);
  transition: transform var(--transition);
}

.vehicle-header__fav:hover {
  transform: scale(1.12);
}

/* Two-column body */
.vehicle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

.vehicle-layout__main,
.vehicle-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

/* Price card */
.price-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
}

.price-card__price {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: var(--fw-bold);
  line-height: 1.1;
}

.price-card__price sup {
  position: relative;
  top: 4px;
  font-size: var(--fs-md);
  vertical-align: top;
}

.price-card__monthly {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  color: var(--color-link);
}

.price-card__note {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Enquiry (message seller) */
.enquiry {
  padding: var(--space-4);
  background-color: var(--color-divider);
  scroll-margin-top: var(--space-3);
}

.enquiry__title {
  margin-bottom: var(--space-3);
  font-size: 19px;
  text-transform: uppercase;
}

.enquiry__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.enquiry__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.enquiry__count {
  margin-top: var(--space-1);
  font-size: var(--fs-xs);
  text-align: right;
  color: var(--color-text-muted);
}

.enquiry__submit {
  margin-top: var(--space-1);
  text-transform: uppercase;
}

.enquiry__legal {
  font-size: 10px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.enquiry__success {
  text-align: center;
}

.enquiry__success-icon {
  margin-bottom: var(--space-2);
  font-size: 40px;
  color: var(--color-success);
}

.enquiry__success-title {
  font-size: var(--fs-lg);
}

.enquiry__success-text {
  margin-top: var(--space-2);
}

/* Seller info card */
.seller__name {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--color-link);
}

.seller__location {
  margin: var(--space-1) 0 var(--space-3);
}

/* Loan calculator */
.loan__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}

.loan__error {
  margin-top: var(--space-2);
}

.loan__result {
  margin-top: var(--space-3);
  padding: var(--space-3);
  text-align: center;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border-light);
}

.loan__label {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.loan__payment {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: var(--fw-bold);
  line-height: 1.2;
  color: var(--color-brand);
}

.loan__detail {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* Bottom action bar (mobile only) */
.sticky-cta {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-fixed);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-top);
}

.sticky-cta__info {
  flex: 1;
  min-width: 0;
}

.sticky-cta__title {
  overflow: hidden;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-cta__price {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--color-brand);
}

/* Keep the back-to-top button clear of the bottom bar */
.has-sticky-cta .back-to-top {
  bottom: 80px;
}

/* ==========================================================================
   Home page — shared section helpers and the classic hero (Home 1)
   Variation themes live in home-variants.css
   ========================================================================== */
.section--white {
  background-color: var(--color-surface);
}

.section__title--center,
.section__intro--center {
  text-align: center;
}

.section__intro {
  margin-bottom: var(--space-4);
}

.section__kicker {
  margin-bottom: var(--space-1);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  color: var(--color-brand);
}

.section__icon {
  margin-right: var(--space-1);
  color: var(--color-brand);
}

.section__head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.section__more {
  margin-top: var(--space-4);
  text-align: center;
}

.link-strong {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  color: var(--color-link);
}

.link-strong:hover {
  text-decoration: underline;
}

/* ---- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
}

.hero__stage {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 210px;
  overflow: hidden;
  background-color: var(--color-text);
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__stage::after {
  position: absolute;
  inset: 0;
  content: "";
  background-image: linear-gradient(90deg, var(--color-shade-strong), var(--color-shade-soft));
}

.hero__content {
  position: relative;
  z-index: 1;
  padding-block: var(--space-4);
}

.hero__title {
  font-size: 34px;
  font-weight: var(--fw-black);
  line-height: 1.1;
  color: var(--color-white);
  text-shadow: 0 2px 10px var(--color-shade-strong);
}

.hero__subtitle {
  margin-top: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  color: var(--color-white);
  text-shadow: 0 2px 10px var(--color-shade-strong);
}

.hero__highlight {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  background-color: var(--color-brand);
  border-radius: var(--radius-md);
  text-shadow: none;
}

.hero__band {
  padding: var(--space-3) 0 var(--space-4);
  background-image: linear-gradient(90deg, var(--color-brand-dark), var(--color-brand));
}

.hero-search {
  position: relative;
  padding: var(--space-3);
  background-color: var(--color-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-menu);
  backdrop-filter: blur(6px);
}

.hero-search__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

/* Fields stay light in every theme so placeholder text keeps its contrast */
.hero-search .field__control {
  color: var(--color-ink);
  background-color: var(--color-white);
}

.hero-search select.field__control {
  border-color: var(--color-white);
}

.hero__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-3);
  font-family: var(--font-heading);
  color: var(--color-white);
}

.hero__advanced {
  font-weight: var(--fw-bold);
  color: var(--color-white);
}

.hero__advanced:hover {
  color: var(--color-white);
  text-decoration: underline;
}

.hero__stat {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  text-align: center;
}

/* ---- Section content spacing ------------------------------------------------ */
.brands-box {
  padding: 0;
}

.brands-box__title {
  padding: var(--space-3);
  font-size: var(--fs-base);
  border-bottom: 1px solid var(--color-border-light);
}

.brands-box .brand-list {
  padding: var(--space-3);
}

.brands__all {
  margin-top: var(--space-3);
  text-align: center;
}

.card-row,
.news-grid,
.body-grid,
.tool-grid,
.why-grid {
  margin-top: var(--space-4);
}

.section__head + .news-grid {
  margin-top: var(--space-3);
}

.cta-band .btn {
  flex: none;
}

/* ==========================================================================
   About page
   ========================================================================== */
.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}

.about-intro__kicker {
  text-align: left;
}

.about-intro__text {
  margin-top: var(--space-3);
  font-size: var(--fs-md);
  line-height: 1.7;
}

.about-intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.about-intro__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.fact-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-4) var(--space-2);
  text-align: center;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-card);
}

.fact-grid__value {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  line-height: 1.1;
  color: var(--color-brand);
}

.fact-grid__label {
  margin-top: var(--space-1);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact {
  padding-top: var(--space-4);
  padding-bottom: var(--space-5);
}

.contact__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.contact__side {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.contact__note {
  margin-bottom: var(--space-3);
  font-size: var(--fs-xs);
}

.contact__form .field__label {
  font-weight: var(--fw-semibold);
}

.contact-card__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-card__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.contact-card__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--color-brand);
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-pill);
}

.contact-card__label {
  display: block;
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.contact-card__value {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  color: var(--color-link);
}

.contact-card__value:hover {
  text-decoration: underline;
}

.hours {
  width: 100%;
}

.hours th,
.hours td {
  padding: var(--space-1) 0;
  text-align: left;
}

.hours th {
  font-weight: var(--fw-semibold);
}

.hours td {
  text-align: right;
}

.location-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.location-list__item:last-child {
  border-bottom: 0;
}

.location-list__link {
  font-weight: var(--fw-semibold);
  color: var(--color-link);
}

.location-list__link i {
  margin-right: var(--space-1);
  color: var(--color-brand);
}

.location-list__link:hover {
  text-decoration: underline;
}

.location-list__count {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}
