:root {
  --ink: #18211f;
  --muted: #5d6863;
  --line: #d9e0dd;
  --panel: #ffffff;
  --paper: #f5f1ea;
  --forest: #1f5c4d;
  --forest-dark: #123b33;
  --clay: #b85d3b;
  --gold: #d9aa45;
  --sky: #dbe9ef;
  --shadow: 0 18px 48px rgba(25, 33, 31, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.multi-select {
  position: relative;
}

.multi-select summary {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 36px 0 12px;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::after {
  position: absolute;
  right: 13px;
  content: "\25BE";
}

.multi-select-menu {
  display: grid;
  max-height: 280px;
  margin-top: 6px;
  padding: 8px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(20, 36, 31, 0.14);
}

.multi-select-menu label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 4px 6px;
  color: var(--ink);
  cursor: pointer;
}

.multi-select-menu input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--forest);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(245, 241, 234, 0.9);
  border-bottom: 1px solid rgba(24, 33, 31, 0.1);
  backdrop-filter: blur(16px);
}

.brand,
.topbar nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  min-width: 0;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: var(--forest);
  border-radius: 8px;
  font-size: 0.78rem;
}

.topbar nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.94rem;
}

.topbar nav a {
  padding: 8px 4px;
}

.hero {
  position: relative;
  min-height: min(720px, calc(100vh - 64px));
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--forest-dark);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 27, 23, 0.84), rgba(14, 27, 23, 0.42) 44%, rgba(14, 27, 23, 0.1)),
    linear-gradient(0deg, rgba(14, 27, 23, 0.7), transparent 42%);
}

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

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  padding: clamp(72px, 11vw, 126px) clamp(22px, 6vw, 70px);
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f1c567;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 14ch;
  margin-bottom: 18px;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-action,
.secondary-action,
.ghost-button,
.save-button,
.load-more-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  padding: 0 20px;
  color: var(--forest-dark);
  background: #fff;
}

.secondary-action {
  padding: 0 20px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
}

.finder-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 34px);
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 54px);
}

.filters {
  position: sticky;
  top: 82px;
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(24, 33, 31, 0.08);
}

.mobile-filter-trigger,
.filter-close,
.filter-backdrop,
.filter-drawer-footer {
  display: none;
}

.filter-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters-header,
.results-toolbar,
.section-heading,
.site-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.results-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.copy-search-button {
  min-height: 42px;
  white-space: nowrap;
}

.filters h2,
.results h2,
.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.08;
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--forest);
  border-color: var(--line);
  background: #fff;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.filter-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.filter-section .field:first-of-type {
  margin-top: 10px;
}

.filter-section-title {
  margin: 0;
  color: var(--forest-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field span,
.sort-field span,
.feature-grid legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9d2cd;
  border-radius: 8px;
}

input[type="number"] {
  font-weight: 750;
}

input[type="range"] {
  min-height: 28px;
  padding: 0;
  accent-color: var(--forest);
}

output {
  color: var(--forest-dark);
  font-weight: 800;
}

.range-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feature-grid {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.feature-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  color: var(--ink);
}

.feature-grid input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--forest);
}

.results {
  min-width: 0;
}

.sort-field {
  display: grid;
  width: min(210px, 45vw);
  gap: 6px;
}

.card-spec-panel {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) minmax(0, 2fr);
  gap: 14px;
  align-items: end;
  margin-top: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card-spec-panel h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.1;
}

.card-spec-selects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.spec-picker {
  display: grid;
  gap: 6px;
}

.spec-picker span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.spec-picker select {
  min-height: 38px;
  padding: 0 8px;
  font-size: 0.86rem;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  margin: 18px 0;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--forest-dark);
  background: var(--sky);
  border: 1px solid #c1d8df;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.results-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.results-pagination[hidden] {
  display: none;
}

.load-more-button {
  min-width: 210px;
  padding: 0 18px;
  color: #fff;
  background: var(--forest);
}

.load-more-button:hover {
  background: var(--forest-dark);
}

.rv-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(24, 33, 31, 0.08);
}

.floorplan-media {
  display: grid;
  min-height: clamp(340px, 28vw, 460px);
  overflow: hidden;
  place-items: center;
  padding: clamp(8px, 1.4vw, 20px);
  background:
    linear-gradient(180deg, #ffffff, #f8faf9),
    #fff;
  border-right: 1px solid var(--line);
}

.floorplan-media img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: clamp(320px, 26vw, 430px);
  object-fit: contain;
}

.match-score {
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
}

.card-body {
  display: grid;
  gap: 16px;
  align-content: center;
  padding: clamp(22px, 3vw, 34px);
}

.card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-kicker .type {
  padding: 5px 8px;
  color: var(--forest-dark);
  background: #edf4f0;
  border-radius: 999px;
  text-transform: none;
}

.model-year {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.rv-card h3 {
  margin: 0;
  font-size: clamp(1.18rem, 1.7vw, 1.5rem);
  line-height: 1.12;
}

.rv-card .brand-line {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
}

.spec {
  padding: 10px;
  background: #f7f9f8;
  border: 1px solid #e1e7e4;
  border-radius: 8px;
}

.spec span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.spec strong {
  display: block;
  margin-top: 3px;
  font-size: 0.98rem;
  line-height: 1.15;
}

.spec small,
.compare-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.save-button {
  width: 100%;
  color: #fff;
  background: var(--forest);
}

.save-button.saved {
  color: var(--forest-dark);
  background: var(--gold);
}

.source-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  color: var(--forest);
  font-size: 0.86rem;
  font-weight: 900;
}

.empty-state,
.loading-state {
  grid-column: 1 / -1;
  padding: 32px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #b9c4be;
  border-radius: 8px;
}

.loading-state {
  border-style: solid;
}

.compare-section {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 0 clamp(26px, 4vw, 54px) clamp(46px, 6vw, 78px);
}

.compare-table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compare-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.compare-table th {
  color: var(--muted);
  background: #f7f9f8;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.compare-table td {
  color: var(--ink);
}

.compare-page-link {
  margin-top: 18px;
}

.site-footer {
  align-items: center;
  padding: 22px clamp(18px, 4vw, 54px);
  color: rgba(255, 255, 255, 0.72);
  background: var(--forest-dark);
}

@media (max-width: 1180px) {
  .rv-card {
    grid-template-columns: 1fr;
  }

  .floorplan-media {
    min-height: 330px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .floorplan-media img {
    width: 100%;
    max-width: 100%;
    max-height: 320px;
  }
}

@media (max-width: 900px) {
  .finder-layout,
  .card-spec-panel {
    grid-template-columns: 1fr;
  }

  .finder-layout {
    position: relative;
    padding-top: 20px;
  }

  .mobile-filter-trigger {
    position: sticky;
    top: 74px;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 48px;
    color: #fff;
    background: var(--forest);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(18, 59, 51, 0.2);
    font-weight: 800;
  }

  .filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    display: block;
    background: rgba(18, 33, 29, 0.56);
  }

  .filter-backdrop[hidden] {
    display: none;
  }

  .filters {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 40;
    width: min(92vw, 420px);
    max-height: 100dvh;
    overflow-y: auto;
    padding: 22px 22px 96px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    transform: translateX(105%);
    transition: transform 180ms ease;
    visibility: hidden;
  }

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

  .filter-close {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1.75rem;
    line-height: 1;
  }

  .filter-drawer-footer {
    position: sticky;
    bottom: -96px;
    display: block;
    margin: 26px -22px -96px;
    padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--line);
  }

  .primary-filter-action {
    width: 100%;
    min-height: 48px;
    color: #fff;
    background: var(--forest);
    border: 0;
    border-radius: 8px;
    font-weight: 800;
  }

  body.filter-drawer-open {
    overflow: hidden;
  }

  .hero {
    min-height: 680px;
  }

  .hero::after {
    background:
      linear-gradient(0deg, rgba(14, 27, 23, 0.82), rgba(14, 27, 23, 0.18)),
      linear-gradient(90deg, rgba(14, 27, 23, 0.7), rgba(14, 27, 23, 0.1));
  }
}

@media (max-width: 650px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .topbar nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 620px;
  }

  .hero-copy {
    padding-top: 94px;
  }

  .range-pair,
  .card-spec-selects,
  .cards-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  .results-toolbar,
  .filters-header,
  .section-heading,
  .results-pagination,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-field {
    width: 100%;
  }
}
