/**
 * Phase 8C — Inventory listing & cards (scoped). Does not target .mc-home-* homepage rules.
 * Phase 8C.1 — compact grid, filter balance, category hero without duplicate visible H1.
 */

/* --- Category hero: title SR-only (visible H1 is below hero) --- */
.mc-inventory-hero.page-hero--listing h1.mc-inventory-hero__title--sr-only,
.mc-inventory-hero__title--sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px !important;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  font-size: 1px !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

.mc-inventory-hero.page-hero--listing .page-hero__content,
.mc-inventory-hero .mc-inventory-hero__content {
  max-width: 720px;
}

.mc-inventory-hero__subtitle {
  margin: 0 0 14px;
  font-weight: 600;
}

.mc-inventory-hero__trust {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.mc-inventory-hero__trust-item {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #f8fafc;
}

.mc-inventory-hero__cta {
  margin-top: 4px;
}

/* --- Hub (title + pills) --- */
.mc-inventory-hub {
  margin-bottom: 8px;
}

.mc-inventory-pill-nav {
  gap: 10px;
}

.mc-inventory-pill-nav a {
  font-weight: 700;
}

/* --- Layout: mobile-first stack --- */
.mc-inventory-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 960px) {
  .mc-inventory-layout {
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    gap: 20px 32px;
  }

  .mc-filter-panel {
    position: sticky;
    top: 88px;
  }
}

/* --- Filter panel --- */
.mc-filter-panel__inner {
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.95);
}

.mc-filter-panel__title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted, #64748b);
}

.mc-filter-panel__fields {
  gap: 10px;
}

.mc-filter-panel__submit {
  margin-top: 4px;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  font-size: 0.95rem !important;
}

.mc-filter-panel__reset {
  display: block;
  text-align: center;
  margin-top: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

/* --- Results bar --- */
.mc-results-bar {
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  margin-bottom: 16px !important;
}

.mc-results-bar__title {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted, #64748b);
}

.mc-results-bar__count {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text, #0f172a);
}

.mc-active-filters {
  margin-bottom: 14px;
}

.mc-active-filters .active-filter-chip {
  border-radius: 999px;
  font-weight: 600;
}

/* --- Vehicle grid: compact 2-col desktop, capped width so one card does not stretch full page --- */
.mc-inventory-page .mc-vehicle-grid {
  gap: 16px !important;
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 920px;
  justify-content: start;
}

@media (min-width: 640px) {
  .mc-inventory-page .mc-vehicle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Card --- */
.mc-inventory-page .mc-vehicle-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--color-border, #e2e8f0);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.mc-inventory-page .mc-vehicle-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12);
}

.mc-vehicle-card__media {
  position: relative;
  display: block;
  background: #e2e8f0;
  overflow: hidden;
}

.mc-inventory-page .mc-vehicle-card__image {
  width: 100%;
  height: clamp(180px, 42vw, 220px);
  min-height: 180px;
  max-height: 280px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

@media (min-width: 640px) {
  .mc-inventory-page .mc-vehicle-card__image {
    height: clamp(230px, 28vw, 270px);
    min-height: 230px;
  }
}

.mc-inventory-page .mc-vehicle-card:hover .mc-vehicle-card__image {
  transform: scale(1.03);
}

.mc-vehicle-card__badge {
  position: absolute;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.mc-vehicle-card__badge--status {
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
}

.mc-vehicle-card__badge--status.mc-vehicle-card__badge--available {
  background: rgba(22, 101, 52, 0.92);
}

.mc-vehicle-card__badge--status.mc-vehicle-card__badge--reserved {
  background: rgba(161, 98, 7, 0.95);
}

.mc-vehicle-card__badge--status.mc-vehicle-card__badge--sold {
  background: rgba(71, 85, 105, 0.95);
}

.mc-vehicle-card__badge--type {
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
}

.mc-vehicle-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 12px;
}

.mc-vehicle-card__ref {
  font-size: 0.75rem;
  color: var(--color-muted, #64748b);
  margin-bottom: 6px;
}

.mc-vehicle-card__title {
  margin: 0 0 6px;
  font-size: 0.98rem;
  line-height: 1.35;
}

.mc-vehicle-card__title a {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.mc-vehicle-card__title a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mc-vehicle-card__price {
  font-size: 1.2rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.03em;
  margin-bottom: 8px !important;
}

.mc-vehicle-card__meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0 0 8px;
  padding: 8px 0 0;
  border-top: 1px solid var(--color-border, #e2e8f0);
}

.mc-vehicle-card__meta-row {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.74rem;
}

.mc-vehicle-card__meta-row + .mc-vehicle-card__meta-row::before {
  content: "·";
  margin: 0 8px;
  color: var(--color-muted, #94a3b8);
  font-weight: 700;
}

/* Visually compact row; labels remain for screen readers */
.mc-vehicle-card__meta-row dt {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mc-vehicle-card__meta-row dd {
  margin: 0;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}

.mc-vehicle-card__desc {
  margin: 0 0 8px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-muted, #64748b);
  flex: 1;
}

.mc-vehicle-card__primary {
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: #0f172a !important;
  color: #fff !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  text-align: center;
}

.mc-vehicle-card__primary:hover {
  background: #1e293b !important;
}

.mc-vehicle-card__secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
}

.mc-vehicle-card__link-secondary {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  padding: 6px 4px;
}

.mc-vehicle-card__link-secondary:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Empty state --- */
.mc-empty-state {
  text-align: center;
  padding: 48px 24px !important;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border: 1px dashed var(--color-border, #cbd5e1) !important;
}

.mc-empty-state__title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-text, #0f172a);
}

.mc-empty-state__text {
  margin: 0 auto 22px;
  max-width: 440px;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-muted, #64748b);
}

.mc-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.mc-empty-state__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  font-size: 0.95rem;
}

.mc-empty-state__cta--primary {
  background: #0f172a;
  color: #fff;
}

.mc-empty-state__cta--primary:hover {
  background: #1e293b;
}

.mc-empty-state__cta--ghost {
  background: #fff;
  color: #0f172a;
  border: 2px solid #cbd5e1;
}

.mc-empty-state__cta--ghost:hover {
  border-color: #0f172a;
}
