/* Frontend – home & listing details */
@import "bootstrap.min-LGMA4jJ.css";
@import "fontawesome/css/all.min-YDSp_vZ.css";

/* Symfony form_div_layout adds .help-text; Bootstrap styles .form-text. Keep both aligned. */
.help-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: var(--bs-secondary-color);
}

/* Surfaces inherit from app.css tokens */
body {
  background-color: var(--app-bg);
  color: var(--app-text);
}

.shadow-soft {
  box-shadow: var(--app-shadow-md);
}

.result-spec {
  font-size: 0.9rem;
  color: var(--bs-secondary-color, var(--app-text-muted));
}

.result-price {
  font-weight: 700;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* -------------------------------------------------------------------------- */
/* Buttons (Bootstrap-compatible variations) */
/* -------------------------------------------------------------------------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-padding-y: 0.55rem;
  --bs-btn-padding-x: 1rem;
  --bs-btn-border-radius: 0.65rem;
  --bs-btn-focus-box-shadow: var(--app-focus-ring);
  letter-spacing: 0.01em;
  box-shadow: var(--app-shadow-xs);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--app-shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  --bs-btn-bg: var(--btn-primary-bg);
  --bs-btn-border-color: var(--btn-primary-bg);
  --bs-btn-color: var(--btn-primary-text);
  --bs-btn-hover-bg: var(--btn-primary-hover);
  --bs-btn-hover-border-color: var(--btn-primary-hover);
  --bs-btn-hover-color: var(--btn-primary-text);
  --bs-btn-active-bg: var(--btn-primary-active);
  --bs-btn-active-border-color: var(--btn-primary-active);
  --bs-btn-active-color: var(--btn-primary-text);
  --bs-btn-disabled-bg: #bfdbfe;
  --bs-btn-disabled-border-color: #bfdbfe;
}

.btn-secondary {
  --bs-btn-bg: var(--btn-secondary-bg);
  --bs-btn-border-color: #d1d9e3;
  --bs-btn-color: var(--btn-secondary-text);
  --bs-btn-hover-bg: var(--btn-secondary-hover);
  --bs-btn-hover-border-color: #c3cdd9;
  --bs-btn-hover-color: var(--btn-secondary-text);
  --bs-btn-active-bg: var(--btn-secondary-active);
  --bs-btn-active-border-color: #8ba0b5;
  --bs-btn-active-color: #f8fafc;
}

.btn-success {
  --bs-btn-bg: var(--btn-success-bg);
  --bs-btn-border-color: var(--btn-success-bg);
  --bs-btn-color: var(--btn-success-text);
  --bs-btn-hover-bg: var(--btn-success-hover);
  --bs-btn-hover-border-color: var(--btn-success-hover);
  --bs-btn-hover-color: var(--btn-success-text);
  --bs-btn-active-bg: var(--btn-success-active);
  --bs-btn-active-border-color: var(--btn-success-active);
  --bs-btn-active-color: var(--btn-success-text);
}

.btn-outline-secondary {
  --bs-btn-color: var(--btn-outline-text);
  --bs-btn-border-color: var(--btn-outline-border);
  --bs-btn-hover-color: var(--app-text);
  --bs-btn-hover-bg: var(--btn-outline-bg-hover);
  --bs-btn-hover-border-color: #b8c4d4;
  --bs-btn-active-color: var(--app-text);
  --bs-btn-active-bg: #e8eef5;
  --bs-btn-active-border-color: #b8c4d4;
  box-shadow: none;
}

/* Optional soft button variation for low-emphasis actions */
.btn-subtle {
  --bs-btn-color: var(--btn-subtle-text);
  --bs-btn-bg: var(--btn-subtle-bg);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #1d4ed8;
  --bs-btn-hover-bg: var(--btn-subtle-hover);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: #1e40af;
  --bs-btn-active-bg: rgba(96, 165, 250, 0.32);
  --bs-btn-active-border-color: transparent;
  box-shadow: none;
}

.card-cover {
  width: 100%;
}

.card-cover-placeholder {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-cover-placeholder i {
  font-size: 3rem;
}

.card a img {
  transition: transform 0.35s ease;
}

.card:hover a img {
  transform: scale(1.02);
}

/*
 * Overlay WebP: when the cover uses the template aspect ratio (--listing-card-cover-ar), contain shows
 * the full composite with no empty bars. Fixed-height cards without dimensions fall back to cover.
 */
.listing-card-public-cover--overlay-fit img.listing-card-img--overlay,
.listings-page-card-cover--overlay-fit img.listing-card-img--overlay {
  object-fit: contain;
  object-position: center;
}

img.listing-card-img--overlay {
  object-fit: cover;
  object-position: center;
}

.listing-card-featured-badge {
  top: 45px;
}

/* Sidebar search/inventory grids: shorter image band than full-width home — pull Featured below overlay banner up slightly */
.listings-page .listing-card-public .listing-card-featured-badge,
.listings-page .listings-page-card .listing-card-featured-badge {
  top: 1.75rem;
}

/* -------------------------------------------------------------------------- */
/* Public listing cards (reference-style layout) */
/* -------------------------------------------------------------------------- */
.card.listing-card-public.border-0.shadow-soft {
  border-radius: 1rem;
}

.listing-card-status-badge {
  background-color: #00b894;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.listing-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.listing-card-spec-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--bs-secondary-color, #6c757d);
}

.listing-card-spec-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.listing-card-spec-item i {
  flex-shrink: 0;
  opacity: 0.85;
  font-size: 0.8em;
}

.listing-card-subtitle {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--bs-secondary-color, #6c757d);
  margin-bottom: 0;
}

.listing-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.listing-card-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--bs-gray-800, #343a40);
  background-color: var(--bs-gray-100, #f8f9fa);
  border-radius: 0.25rem;
}

.listing-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bs-primary);
  margin-bottom: 0;
}

.listing-card-price--muted {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--bs-secondary-color, #6c757d);
}

.listing-card-actions {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: auto;
}

.listing-card-actions__primary {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  border-radius: 0.5rem;
}

.listing-card-more {
  flex: 0 0 auto;
}

.listing-card-more-btn.dropdown-toggle {
  width: 2.75rem;
  min-width: 2.75rem;
  padding-left: 0;
  padding-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: var(--bs-secondary-color, #6c757d);
}

.listing-card-more-btn.dropdown-toggle::after {
  display: none;
}

.listing-card-more-menu {
  min-width: 10rem;
}

.listing-card-featured-h__main {
  flex: 1 1 auto;
  min-height: 0;
}

.listings-page .listing-card-public .listing-card-title {
  font-size: 0.9375rem;
}

.listings-page .listing-card-public .listing-card-spec-row {
  font-size: 0.75rem;
  gap: 0.35rem 0.75rem;
}

.listings-page .listing-card-public .listing-card-price {
  font-size: 1.25rem;
}

.listings-page .listing-card-public .listing-card-price--muted {
  font-size: 1rem;
}

/* -------------------------------------------------------------------------- */
/* Hero (home) */
/* -------------------------------------------------------------------------- */
.hero-bg-1 {
  background-image: linear-gradient(
    135deg,
    var(--hero-gradient-start) 0%,
    var(--hero-gradient-mid) 48%,
    var(--hero-gradient-end) 100%
  );
}

.hero-cover {
  --hero-pad-y: clamp(2rem, 6vw, 4rem);
  position: relative;
  min-height: clamp(300px, 42vh, 380px);
  display: flex;
  align-items: center;
  padding-block: var(--hero-pad-y);
  border-color: var(--app-border) !important;
}

.hero-bg-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-cover .hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.08);
  transition:
    opacity 1s ease-in-out,
    transform 12s ease-out;
}

.hero-cover .hero-bg.active {
  opacity: 1;
  transform: scale(1);
}

.hero-cover .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    var(--hero-overlay-top) 0%,
    var(--hero-overlay-mid) 45%,
    var(--hero-overlay-bottom) 100%
  );
  pointer-events: none;
}

.hero-cover .container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-cover h1 {
  color: var(--app-text-inverse);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
  max-width: 22ch;
  margin-inline: auto;
}

.hero-cover .hero-lead {
  color: rgba(248, 250, 252, 0.88);
  font-size: clamp(0.9rem, 0.82rem + 0.45vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.5;
  max-width: 36rem;
  letter-spacing: 0.01em;
}

.hero-cover .hero-search-container {
  overflow: visible;
}

.hero-cover .brand-grid {
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: clamp(0.75rem, 2vw, 1.125rem);
  max-width: min(52rem, 100%);
  margin: 0 auto;
}

.brand-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--app-text-inverse);
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  padding: 1rem 0.75rem;
  border-radius: var(--app-radius-md);
  background: var(--hero-brand-panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hero-brand-panel-border);
  box-shadow: var(--app-shadow-xs);
}

.brand-item:hover {
  transform: translateY(-3px);
  background: var(--hero-brand-panel-hover);
  color: var(--app-text-inverse);
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: var(--app-shadow-md);
}

.brand-logo-container {
  width: 60px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-surface);
  border-radius: var(--app-radius-sm);
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow-xs);
}

.brand-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-name {
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  opacity: 0.95;
  letter-spacing: 0.01em;
}

.hero-search-container {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: min(32rem, 100%);
  margin-top: clamp(0.75rem, 2vw, 1.25rem);
}

.hero-search-input-group {
  border-radius: var(--app-radius-pill);
  overflow: hidden;
  box-shadow: var(--hero-search-shadow);
  background: var(--hero-search-surface);
  border: 1px solid var(--app-border);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.hero-search-input-group:focus-within {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: var(--hero-search-shadow), var(--app-focus-ring);
}

.hero-search-input {
  border: none;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  background: var(--hero-search-surface);
  color: var(--app-text);
  border-radius: var(--app-radius-pill) 0 0 var(--app-radius-pill);
}

.hero-search-input::placeholder {
  color: var(--app-text-muted);
}

.hero-search-input:focus {
  border: none;
  box-shadow: none;
  background: var(--hero-search-surface);
  outline: none;
}

.hero-search-btn {
  border: none;
  padding: 0.875rem 1.35rem;
  font-weight: 600;
  border-radius: 0 var(--app-radius-pill) var(--app-radius-pill) 0;
  letter-spacing: 0.02em;
}

.hero-search-btn:focus-visible {
  z-index: 2;
}

.hero-search-suggest {
  z-index: 5;
}

.hero-search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 0.35rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.35rem 0;
  border-radius: var(--app-radius-md);
  background: var(--hero-search-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--hero-search-shadow);
}

.hero-search-suggestions__item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--app-text);
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.hero-search-suggestions__item:hover,
.hero-search-suggestions__item:focus-visible {
  background: rgba(37, 99, 235, 0.08);
  color: var(--app-text);
  outline: none;
}

.hero-search-suggestions__item--active {
  background: rgba(37, 99, 235, 0.12);
}

.hero-search-suggestions__item--error,
.hero-search-suggestions__item--error:hover,
.hero-search-suggestions__item--error:focus-visible {
  background: none;
  cursor: default;
  pointer-events: none;
}

.hero-cover .hero-advanced-toggle {
  opacity: 0.92;
}

.hero-cover .hero-advanced-toggle:hover,
.hero-cover .hero-advanced-toggle:focus-visible {
  color: rgba(255, 255, 255, 0.95) !important;
  opacity: 1;
}

.hero-cover .hero-advanced-filters {
  margin-top: 0.125rem;
  padding: 1rem 1.125rem;
  border-radius: var(--app-radius-md);
  background: var(--hero-search-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--hero-search-shadow);
}

.hero-cover .hero-advanced-filters .form-control,
.hero-cover .hero-advanced-filters .form-select {
  border-color: var(--app-border);
  background: var(--hero-search-surface);
  color: var(--app-text);
}

.hero-cover .hero-advanced-filters .form-control:focus,
.hero-cover .hero-advanced-filters .form-select:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: var(--app-focus-ring);
}

@media (min-width: 768px) {
  .hero-cover {
    min-height: clamp(380px, 48vh, 460px);
  }
}

@media (min-width: 992px) {
  .hero-cover {
    min-height: clamp(420px, 52vh, 520px);
  }
}

@media (max-width: 576px) {
  .brand-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
  }

  .brand-item {
    padding: 0.625rem 0.4rem;
  }

  .brand-logo-container {
    width: 50px;
    height: 38px;
  }

  .brand-name {
    font-size: 0.6875rem;
  }

  .hero-search-input,
  .hero-search-btn {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 0.9375rem;
  }
}

@media (min-width: 993px) {
  .brand-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* -------------------------------------------------------------------------- */
/* Details page */
/* -------------------------------------------------------------------------- */
.spec-kv {
  font-size: 0.95rem;
  color: var(--bs-secondary-color, var(--app-text-muted));
}

.gallery-main .carousel-inner .ratio > img {
  object-fit: contain;
}

.gallery-main .ratio i.fa-car {
  font-size: 4rem;
}

.seller-avatar {
  width: 56px;
  height: 56px;
}

.copy-feedback {
  display: none;
}

.share-modal-dialog {
  max-width: 22rem;
}

.share-icon-btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 2.75rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.thumb img {
  object-fit: contain;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--app-radius-sm);
}

.thumb.active img {
  border-color: var(--bs-primary, var(--app-accent));
}

.thumbs-container {
  position: relative;
}

.thumbs-wrapper {
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 8px;
  display: flex;
  gap: 0.5rem;
}

.thumb-item {
  width: 120px;
  flex-shrink: 0;
}

.sticky-cta {
  position: sticky;
  top: 1rem;
}

.feature-group {
  margin-bottom: 1rem;
}

.feature-group:last-child {
  margin-bottom: 0;
}

.feature-group-title {
  color: var(--app-text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.feature-item {
  font-size: 0.9rem;
  color: var(--app-text-secondary);
  line-height: 1.45;
}

.hero-slim {
  background: var(--app-surface);
  border-color: var(--app-border);
}

@media (max-width: 991.98px) {
  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--app-surface);
    border-top: 1px solid var(--app-border-strong);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
    z-index: 1030;
    /* iOS home-indicator clearance for the bottom-most fixed element. */
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  }
}

/* Desktop compare bar gets safe-area padding too in case Bootstrap is ever
   rendered in a Safari iframe with a notch. Cheap insurance, evaluates to 0
   on regular desktops. */
#compare-bar {
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 991.98px) {
  #compare-bar { display: none !important; }
}

/* ── Mobile compare FAB ───────────────────────────────────────────────── */
.compare-fab {
  position: fixed;
  right: 1rem;
  /* Default bottom for pages without a sticky mobile-bar at the bottom. */
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 1040;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 0;
  background: #212529;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.compare-fab:hover,
.compare-fab:focus-visible {
  transform: translateY(-2px);
  color: #fff;
}
.compare-fab[hidden] {
  display: none;
}
.compare-fab__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.7rem;
}

/* When a sticky bottom bar is present on the page (listing detail), lift the
   FAB above it so it doesn't overlap. Approx mobile-bar height + spacing. */
body:has(.mobile-bar) .compare-fab {
  bottom: calc(7rem + env(safe-area-inset-bottom));
}

/* Offcanvas footer reuses Bootstrap offcanvas conventions. */
.offcanvas-footer {
  background: var(--app-surface);
}

/* Breadcrumb (under navbar). Theming via CSS variables */
.breadcrumb-nav {
  --breadcrumb-bg: var(--app-surface-muted);
  --breadcrumb-border-color: var(--app-border);
  --breadcrumb-separator-color: var(--app-text-muted);
  --breadcrumb-link-color: var(--app-accent);
  --breadcrumb-link-hover-color: var(--app-accent-hover);
  --breadcrumb-active-color: var(--app-text-secondary);
  background-color: var(--breadcrumb-bg);
  border-bottom: 1px solid var(--breadcrumb-border-color);
}

.breadcrumb {
  background-color: transparent;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--breadcrumb-separator-color);
  font-weight: bold;
}

.breadcrumb-link {
  color: var(--breadcrumb-link-color);
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: var(--breadcrumb-link-hover-color);
  text-decoration: underline;
}

.breadcrumb-item.active span {
  color: var(--breadcrumb-active-color);
  font-weight: 500;
}

/* Navbar */
.navbar-front {
  z-index: 1030;
  background: var(--app-surface) !important;
  border-bottom: 1px solid var(--app-border);
  box-shadow: var(--app-shadow-xs);
}

.navbar-front .navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.navbar-front .nav-link {
  font-weight: 500;
  border-radius: var(--app-radius-sm);
}

.navbar-front .nav-link:hover {
  background: var(--app-surface-muted);
}

.navbar-front .nav-link.active {
  color: var(--app-accent) !important;
}

/* Publish sidebar on listing forms */
.publish-sidebar-sticky {
  top: 56px;
  z-index: 10;
}

/* Forms – light touch, Bootstrap-compatible */
.form-control,
.form-select {
  border-color: var(--app-border-strong);
  border-radius: var(--app-radius-sm);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: var(--app-focus-ring);
}

.form-text {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  line-height: 1.35;
  color: #8b95a5;
  opacity: 1;
}

.form-check .form-text {
  margin-left: 1.6rem;
}

/* Cards on listings */
.card.border-0.shadow-soft {
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-md);
  overflow: hidden;
}

.card.border-0.shadow-soft .card-body {
  padding: 1.125rem 1.25rem;
}

.ways-to-buy-icon-wrap {
  width: 2.5rem;
  min-width: 2.5rem;
  height: 2.5rem;
  font-size: 0.85rem;
}

/* Listings by make: compact cards (3 per row) + filter sidebar */
.listings-page .listings-sidebar-filter {
  position: sticky;
  top: 1rem;
  z-index: 2;
}

@media (max-width: 991.98px) {
  .listings-page .listings-sidebar-filter {
    position: static;
  }

  .listings-page {
    padding-bottom: 4.5rem;
  }

  #filter-offcanvas {
    top: 0;
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    z-index: 1050;
  }
}

.listings-page .listings-page-card .listings-page-card-cover {
  aspect-ratio: 4 / 3;
}

.listings-page .listings-page-card .listings-page-card-cover.listings-page-card-cover--overlay-fit {
  height: auto;
  min-height: 0;
  aspect-ratio: var(--listing-card-cover-ar);
  display: flex;
  align-items: stretch;
  font-size: 0;
}

.listings-page .listings-page-card .card-body {
  padding: 0.625rem 0.75rem;
}

.listings-page-card-title {
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 600;
}

.listings-page-card-spec {
  font-size: 0.75rem;
  line-height: 1.35;
}

/* Featured listing: horizontal card (image left, details right) */
.listing-card-featured-h {
  flex-direction: row;
  align-items: stretch;
}

.listing-card-featured-h__img-link {
  flex: 0 0 44%;
  max-width: 44%;
  display: block;
  overflow: hidden;
}

.listing-card-featured-h__img-wrap {
  height: 100%;
  min-height: 190px;
  position: relative;
}

.listing-card-featured-h__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.listing-card-featured-h__img-wrap .card-cover-placeholder {
  height: 100%;
  min-height: 190px;
  border-radius: 0;
}

.listing-card-featured-h .listing-card-featured-h__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 1.125rem;
  flex: 1;
  gap: 0.75rem;
}

@media (max-width: 575.98px) {
  .listing-card-featured-h {
    flex-direction: column;
  }

  .listing-card-featured-h__img-link {
    flex: none;
    max-width: 100%;
  }

  .listing-card-featured-h__img-wrap {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  /* Overlay composites: use template aspect ratio, not the 4/3 fallback */
  .listing-card-featured-h__img-wrap.listing-card-public-cover--overlay-fit,
  .listing-card-featured-h__img-wrap.listings-page-card-cover--overlay-fit {
    aspect-ratio: var(--listing-card-cover-ar);
    min-height: 0;
  }
}

/* Home + dealer profile: full-size listing cards (match landing) */
.listing-card-public .listing-card-public-cover {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: stretch;
  font-size: 0;
}

.listing-card-public .listing-card-public-cover.listing-card-public-cover--overlay-fit {
  height: auto;
  min-height: 0;
  aspect-ratio: var(--listing-card-cover-ar);
}

.listing-card-public .card-cover-placeholder.listing-card-public-cover {
  aspect-ratio: 4 / 3;
}

/* -------------------------------------------------------------------------- */
/* Dealer public profile */
/* -------------------------------------------------------------------------- */
.dealer-hero {
  position: relative;
  background: var(--app-surface, #fff);
  border-color: var(--app-border) !important;
}

.dealer-banner-wrap {
  position: relative;
  max-height: min(42vh, 320px);
  min-height: 200px;
  overflow: hidden;
  background: #1a1f26;
}

.dealer-banner-img {
  width: 100%;
  height: min(42vh, 320px);
  min-height: 200px;
  object-fit: cover;
  display: block;
}

.dealer-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.92) 0%,
    rgba(15, 23, 42, 0.35) 45%,
    transparent 100%
  );
  pointer-events: none;
}

.dealer-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: 1.5rem;
  padding-top: 2rem;
}

.dealer-hero-inner {
  align-items: flex-end;
}

.dealer-hero-title {
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.dealer-verified-badge {
  background: rgba(34, 197, 94, 0.95) !important;
  color: #fff !important;
  font-weight: 600;
}

.dealer-hero-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  background: #fff;
}

.dealer-hero-logo--on-light {
  width: 80px;
  height: 80px;
}

.dealer-hero-logo-placeholder {
  width: 80px;
  height: 80px;
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border);
}

.dealer-banner-placeholder {
  background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 55%, #f8fafc 100%);
}

.dealer-profile-main {
  background: var(--app-bg);
}

.dealer-contact-card .card-body {
  padding: 1.5rem 1.75rem;
}

.dealer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dealer-contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 0;
}

.dealer-contact-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--app-radius-sm, 0.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--btn-primary-bg, #2563eb) 10%, transparent);
  color: var(--btn-primary-bg, #2563eb);
  font-size: 1rem;
}

.dealer-contact-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bs-secondary-color, #64748b);
  margin-bottom: 0.2rem;
}

.dealer-contact-value {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

/* -------------------------------------------------------------------------- */
/* Blog */
/* -------------------------------------------------------------------------- */

.blog-back-link {
  color: var(--bs-secondary-color, #64748b);
  font-weight: 600;
  font-size: 0.95rem;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.blog-back-link:hover {
  color: var(--btn-primary-bg, #2563eb);
}

.blog-index-header {
  border-bottom: 1px solid var(--app-border);
}

.blog-card {
  border-radius: 1rem !important;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--app-shadow-lg) !important;
}

.blog-card__media {
  border-bottom: 1px solid var(--app-border);
}

.blog-card__date {
  letter-spacing: 0.06em;
  font-size: 0.72rem !important;
}

.blog-card__title-link:hover {
  color: var(--btn-primary-bg, #2563eb) !important;
}

.blog-card__excerpt {
  line-height: 1.55;
  font-size: 0.95rem;
}

.blog-post-show-card {
  border-radius: 1.25rem;
  background: var(--app-surface, #fff);
}

.blog-post-show-card__body {
  background: var(--app-surface, #fff);
}

.blog-post-show__hero {
  overflow: hidden;
  background: color-mix(in srgb, var(--app-border, #e2e8f0) 35%, var(--app-surface, #f8fafc));
}

.blog-post-show__hero-img {
  display: block;
  width: 100%;
  max-height: min(48vh, 480px);
  object-fit: cover;
}

.blog-post-show__header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--app-border);
}

.blog-post-show__title {
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.blog-post-show__meta {
  font-size: 0.95rem;
}

.blog-post-show__meta-dot {
  opacity: 0.45;
  user-select: none;
}

.blog-post-show__body {
  font-size: 1.125rem;
  line-height: 1.8;
  max-width: 100%;
}

@media (min-width: 992px) {
  .blog-post-show__body {
    font-size: 1.1875rem;
    line-height: 1.82;
  }
}

/* Listing card hover overlay */
.listing-card-hover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem 0.5rem;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.45));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.listing-card-public:hover .listing-card-hover-overlay {
  opacity: 1;
  pointer-events: auto;
}

.listing-card-hover-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.listing-card-hover-btn:hover {
  background: #fff;
  transform: scale(1.1);
}

/* Footer */
footer#contact {
  border-top: 1px solid var(--app-border);
  background: var(--app-surface);
}

/* =========================================================
   Pricing page — comparison table + mobile stacked cards
   ========================================================= */

.pricing-table thead th.plan-col {
  vertical-align: top;
  padding-top: 2.5rem; /* leaves room for the absolute-positioned ribbon */
  padding-bottom: 1rem;
  position: relative;
}

.pricing-table .plan-col-name {
  font-size: 1.05rem;
}

.pricing-table .plan-col-tagline {
  margin-top: 0.15rem;
  min-height: 1.25em;
}

.pricing-table .plan-col-price {
  margin-top: 0.6rem;
  line-height: 1.1;
}

.pricing-table .plan-col-price-amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--bs-body-color, #212529);
}

.pricing-table .plan-col-price-currency {
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
  margin-left: 0.25rem;
}

.pricing-table .plan-col-period {
  margin-top: 0.2rem;
}

/* Featured column highlight (both table + card contexts). */
.plan-col-ribbon {
  position: absolute;
  top: 0.5rem; /* sits inside the header cell so .table-responsive overflow doesn't clip it */
  left: 50%;
  transform: translateX(-50%);
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}

.pricing-table .plan-col-featured {
  background-color: rgba(13, 110, 253, 0.04);
}

.pricing-table thead th.plan-col-featured {
  border-top: 3px solid var(--bs-primary, #0d6efd);
}

/* Mobile / narrow viewport stacked cards. */
.plan-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.plan-card {
  position: relative;
  border: 1px solid var(--app-border, #dee2e6);
  border-radius: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--app-surface, #fff);
  box-shadow: var(--app-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
}

.plan-card-featured {
  border-color: var(--bs-primary, #0d6efd);
  border-width: 2px;
  box-shadow: 0 4px 18px rgba(13, 110, 253, 0.12);
}

.plan-card-ribbon {
  position: absolute;
  top: -0.75rem;
  left: 1rem;
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}

.plan-card-header {
  margin-bottom: 0.9rem;
}

.plan-card-price {
  line-height: 1.1;
}

.plan-card-price-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bs-body-color, #212529);
}

.plan-card-price-currency {
  font-size: 1rem;
  color: var(--bs-secondary-color);
  margin-left: 0.25rem;
}

.plan-card-price-period {
  margin-left: 0.35rem;
}

.plan-card-features li {
  padding: 0.15rem 0;
  font-size: 0.95rem;
}

/* -------------------------------------------------------------------------- */
/* Dealer site home */
/* -------------------------------------------------------------------------- */
.dealer-home-banner {
  max-width: 1400px;
  margin-inline: auto;
  padding: 0;
}

.dealer-home-banner__img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--app-surface-muted);
}

@media (min-width: 768px) {
  .dealer-home-banner {
    padding: 1.5rem 1rem 0;
  }

  .dealer-home-banner__img {
    aspect-ratio: 3 / 1;
    object-fit: cover;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg, 1rem);
  }
}

.dealer-home-welcome {
  padding-block: 2rem;
}

.dealer-home-welcome-card {
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg, 1rem);
  box-shadow: var(--app-shadow-md);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  max-width: 56rem;
  margin-inline: auto;
}

.dealer-home-welcome--overlap {
  padding-block: 0 2rem;
}

.dealer-home-welcome--overlap .dealer-home-welcome-card {
  margin-top: -1.5rem;
}

@media (min-width: 768px) {
  .dealer-home-welcome--overlap .dealer-home-welcome-card {
    margin-top: -3.5rem;
  }
}

@media (min-width: 992px) {
  .dealer-home-welcome--overlap .dealer-home-welcome-card {
    margin-top: -4.5rem;
  }
}

.dealer-home-welcome-card__title {
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  color: var(--app-text);
}

.dealer-home-welcome-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--app-text-muted);
}

.dealer-home-welcome-meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dealer-home-welcome-meta i {
  width: 1rem;
  text-align: center;
  color: var(--app-text-muted);
}

.dealer-home-welcome-meta a {
  color: inherit;
  text-decoration: none;
}

.dealer-home-welcome-meta a:hover {
  color: var(--app-text);
  text-decoration: underline;
}

.dealer-home-welcome-card__about {
  color: var(--app-text);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.dealer-home-welcome-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.dealer-home-search {
  background: var(--app-bg);
  border-top: 1px solid var(--app-border);
  border-bottom: 1px solid var(--app-border);
}

.dealer-home-search-container {
  width: 100%;
  max-width: min(40rem, 100%);
}

.dealer-home-search .hero-advanced-toggle {
  color: var(--app-text-muted);
  opacity: 0.9;
}

.dealer-home-search .hero-advanced-toggle:hover,
.dealer-home-search .hero-advanced-toggle:focus-visible {
  color: var(--app-text);
  opacity: 1;
}

.dealer-home-search .hero-advanced-filters {
  margin-top: 0.125rem;
  padding: 1rem 1.125rem;
  border-radius: var(--app-radius-md);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow-xs);
}

.dealer-home-brands {
  background: var(--app-surface-muted, var(--app-bg));
}

.dealer-home-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: clamp(0.75rem, 2vw, 1.125rem);
  max-width: min(64rem, 100%);
  margin: 0 auto;
}

.dealer-home-brand-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--app-text);
  padding: 1rem 0.75rem;
  border-radius: var(--app-radius-md);
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow-xs);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.dealer-home-brand-item:hover {
  transform: translateY(-2px);
  color: var(--app-text);
  text-decoration: none;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--app-shadow-sm);
}

.dealer-home-brand-item__logo {
  width: 60px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  margin-bottom: 0.5rem;
}

.dealer-home-brand-item__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.dealer-home-brand-item__name {
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
}

@media (max-width: 576px) {
  .dealer-home-brand-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
  }

  .dealer-home-brand-item {
    padding: 0.625rem 0.4rem;
  }

  .dealer-home-brand-item__logo {
    width: 50px;
    height: 38px;
  }

  .dealer-home-brand-item__name {
    font-size: 0.6875rem;
  }
}

@media (min-width: 993px) {
  .dealer-home-brand-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* -------------------------------------------------------------------------- */
/* Turbo frame: loading state + active-filter chips (search results)          */
/* -------------------------------------------------------------------------- */
turbo-frame#search-results {
  display: block;
  transition: opacity 0.15s ease;
}

turbo-frame#search-results[aria-busy='true'],
turbo-frame#search-results[busy] {
  opacity: 0.55;
  pointer-events: none;
}

.search-active-chips {
  padding: 0.5rem 0.75rem;
  background-color: var(--app-surface-subtle, #f3f5f8);
  border: 1px solid var(--app-border-subtle, #e5e9ef);
  border-radius: 0.65rem;
}

.search-chip,
.search-chip-clear {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.search-chip {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background-color: #fff;
  color: var(--bs-primary-text-emphasis, #084298);
  border: 1px solid var(--bs-primary-border-subtle, #b6d4fe);
}

.search-chip:hover,
.search-chip:focus-visible {
  background-color: var(--bs-primary, #0d6efd);
  color: #fff;
  border-color: var(--bs-primary, #0d6efd);
  outline: none;
}

.search-chip-clear {
  padding: 0.35rem 0.5rem;
  color: var(--bs-secondary-color, #6c757d);
  background-color: transparent;
  border: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.search-chip-clear:hover,
.search-chip-clear:focus-visible {
  color: var(--bs-danger, #dc3545);
  outline: none;
}
