/*
  AutoNova - dealership template
  Change the variables in :root to re-theme the whole site.
*/

:root {
  --bg: #0c0c0e;
  --bg-alt: #141417;
  --card: #1a1a1e;
  --line: #2b2b31;
  --gold: #c9a24b;
  --gold-light: #e6c679;
  --text: #ffffff;
  --muted: #a5a5ad;
  --danger: #d9534f;
  --header-h: 74px;
}

/* ---------- base ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
  font-weight: 700;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 84px 0;
}

.alt {
  background: var(--bg-alt);
}

.text-center {
  text-align: center;
}

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
}

.section-head h2 {
  font-size: 2.3rem;
}

.section-head p {
  color: var(--muted);
  margin-top: 10px;
}

.section-cta {
  text-align: center;
  margin-top: 36px;
}

/* ---------- buttons and form fields ---------- */

.btn {
  display: inline-block;
  padding: 13px 28px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #111;
  font: 600 0.95rem Inter, sans-serif;
  cursor: pointer;
  transition: 0.3s;
  border-radius: 2px;
}

.btn:hover {
  background: transparent;
  color: var(--gold);
}

.btn.ghost {
  background: transparent;
  color: #fff;
  border-color: #fff;
}

.btn.ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  background: #101013;
  border: 1px solid var(--line);
  color: #fff;
  font: inherit;
  border-radius: 2px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  outline: 0;
}

input.err,
select.err,
textarea.err {
  border-color: var(--danger);
}

label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 5px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 1.4rem 'Playfair Display', serif;
  letter-spacing: 2px;
}

.logo b {
  color: var(--gold);
}

.logo svg {
  width: 30px;
  height: 30px;
}

.nav {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
}

.nav a {
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: 0.3s;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  border-color: var(--gold);
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icons a {
  position: relative;
  color: #fff;
}

.header-icons em {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--gold);
  color: #111;
  font: 700 0.65rem Inter, sans-serif;
  border-radius: 50%;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
}

.burger {
  display: none;
  min-width: 32px;
  min-height: 32px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ---------- hero and page headers ---------- */

.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 60px 0;
  background:
    linear-gradient(90deg, rgba(12, 12, 14, 0.95) 25%, rgba(12, 12, 14, 0.35)),
    url(https://images.unsplash.com/photo-1503376780353-7e6692767b70?auto=format&fit=crop&w=1800&q=80) center / cover,
    #111;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  max-width: 760px;
  animation: rise 0.9s both;
}

.hero p {
  max-width: 520px;
  color: #d0d0d5;
  margin: 20px 0 32px;
  animation: rise 0.9s 0.2s both;
}

.hero .actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  animation: rise 0.9s 0.4s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-head {
  padding: 70px 0 56px;
  text-align: center;
  background:
    linear-gradient(rgba(12, 12, 14, 0.8), var(--bg)),
    url(https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?auto=format&fit=crop&w=1600&q=70) center / cover,
    #111;
}

.page-head h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
}

.page-head p {
  color: var(--muted);
  margin-top: 8px;
}

.crumb a {
  color: var(--gold);
}

/* ---------- quick search box on the home page ---------- */

.search {
  margin-top: -60px;
  position: relative;
  z-index: 5;
  padding: 0;
}

.search-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  padding: 26px;
}

.search-box .btn {
  align-self: end;
}

/* ---------- car cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

.car {
  background: var(--card);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: 0.35s;
}

.car:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
}

.car-photo {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #111;
}

.car-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.6s;
}

.car:hover .car-photo img {
  transform: scale(1.06);
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #1f7a4d;
  border-radius: 2px;
}

.badge.reserved {
  background: #b7791f;
}

.badge.sold {
  background: #a33;
}

.badge.inline {
  position: static;
  display: inline-block;
}

.wish {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}

.wish.on {
  color: #ef4a5b;
}

.car-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.car-body small {
  color: var(--muted);
}

.car-body h3 {
  font-size: 1.25rem;
  margin: 4px 0 12px;
}

.specs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.specs i {
  color: var(--gold);
  margin-right: 6px;
}

.car-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.car-foot strong {
  color: var(--gold-light);
  font-size: 1.2rem;
}

.cmp {
  background: none;
  border: 1px solid var(--line);
  color: #fff;
  padding: 6px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  transition: 0.3s;
}

.cmp:hover,
.cmp.on {
  border-color: var(--gold);
  color: var(--gold);
}

.grid.list {
  grid-template-columns: 1fr;
}

.list .car {
  flex-direction: row;
}

.list .car-photo {
  width: 340px;
  aspect-ratio: auto;
  flex-shrink: 0;
}

/* ---------- generic content blocks ---------- */

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.cols.one {
  grid-template-columns: 1fr;
}

.box {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 30px;
  transition: 0.3s;
}

.box:hover {
  border-color: var(--gold);
}

.box i.ic {
  display: block;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 16px;
}

.box h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.box p {
  color: var(--muted);
  font-size: 0.93rem;
}

.brands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.brands a {
  border: 1px solid var(--line);
  padding: 26px 10px;
  text-align: center;
  font: 700 1.1rem 'Playfair Display', serif;
  transition: 0.3s;
  background: var(--card);
}

.brands a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  text-align: center;
}

.counters b {
  display: block;
  font: 700 2.8rem 'Playfair Display', serif;
  color: var(--gold);
}

.counters span {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split.top {
  align-items: start;
}

.split h2 {
  font-size: 2.2rem;
}

.split img {
  width: 100%;
  border: 1px solid var(--line);
}

.split p {
  color: var(--muted);
  margin-top: 14px;
}

.quote p {
  font-style: italic;
  margin-bottom: 16px;
  color: #d6d6db;
}

.quote b {
  display: block;
}

.quote small {
  color: var(--muted);
}

.stars {
  color: var(--gold);
  margin-bottom: 10px;
}

.post {
  background: var(--card);
  border: 1px solid var(--line);
  transition: 0.3s;
}

.post:hover {
  border-color: var(--gold);
}

.post img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
}

.post div {
  padding: 22px;
}

.post small {
  color: var(--gold);
}

.post h3 {
  margin: 6px 0 8px;
  font-size: 1.15rem;
}

.post p {
  color: var(--muted);
  font-size: 0.9rem;
}

.newsletter {
  background: linear-gradient(135deg, #1c1810, #0c0c0e);
  border-top: 1px solid var(--line);
  text-align: center;
}

.newsletter form {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 24px auto 0;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #6d5420);
  display: grid;
  place-items: center;
  font: 700 1.6rem 'Playfair Display', serif;
  color: #111;
  margin: 0 auto 14px;
}

.box.tc {
  text-align: center;
}

/* ---------- inventory page ---------- */

.inventory {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

.filters {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 24px;
  position: sticky;
  top: 94px;
  display: grid;
  gap: 16px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  color: var(--muted);
}

.toolbar > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toolbar select {
  width: auto;
}

.toolbar label {
  margin: 0;
}

.view-btn {
  background: var(--card);
  border: 1px solid var(--line);
  color: #fff;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.view-btn.on {
  background: var(--gold);
  color: #111;
}

.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
}

.pagination button {
  width: 42px;
  height: 42px;
  background: var(--card);
  border: 1px solid var(--line);
  color: #fff;
  cursor: pointer;
}

.pagination button.on,
.pagination button:hover {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
}

.empty {
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.grid .empty {
  grid-column: 1 / -1;
}

.empty .btn {
  margin-top: 16px;
}

/* ---------- vehicle details ---------- */

.detail {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
}

.gallery-main {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  cursor: zoom-in;
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.thumbs img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  width: 100%;
}

.thumbs img.on {
  border-color: var(--gold);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 26px;
  margin-bottom: 24px;
}

.panel h3 {
  margin-bottom: 14px;
  font-size: 1.2rem;
}

.panel.first {
  margin-top: 24px;
}

.panel .muted,
.muted {
  color: var(--muted);
}

.vehicle-title {
  font-size: 1.8rem;
  margin: 12px 0 4px;
}

.price {
  font: 700 2.2rem 'Playfair Display', serif;
  color: var(--gold-light);
  margin: 14px 0;
}

.monthly {
  color: var(--muted);
  font-size: 0.9rem;
}

.monthly a {
  color: var(--gold);
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

td,
th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.92rem;
}

td:first-child,
th:first-child {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  min-width: 640px;
}

.table-wrap.narrow table {
  min-width: 0;
}

.compare-photo {
  display: block;
  margin-bottom: 8px;
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}

.features li i {
  color: var(--gold);
  margin-right: 8px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: 1fr 1fr;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 84vh;
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 16px;
}

.lightbox .close {
  top: 10px;
  right: 14px;
}

.lightbox .prev {
  left: 10px;
}

.lightbox .next {
  right: 10px;
}

/* ---------- faq, calculator, article, 404 ---------- */

.faq {
  max-width: 820px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--line);
  margin-bottom: 10px;
  background: var(--card);
}

.faq-item button {
  width: 100%;
  text-align: left;
  padding: 18px 22px;
  background: none;
  border: 0;
  color: #fff;
  font: 600 1rem Inter, sans-serif;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: 0.35s;
  color: var(--muted);
  padding: 0 22px;
}

.faq-item.open .faq-answer {
  max-height: 220px;
  padding-bottom: 18px;
}

.faq-item.open i {
  transform: rotate(45deg);
  color: var(--gold);
}

.calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.result {
  background: linear-gradient(135deg, #221c0e, #141417);
  border: 1px solid var(--gold);
  padding: 34px;
  text-align: center;
}

.result b {
  display: block;
  font: 700 3rem 'Playfair Display', serif;
  color: var(--gold-light);
}

.result p {
  color: var(--muted);
}

.result dl {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  text-align: left;
}

.result dl div {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.result .btn {
  margin-top: 22px;
}

.fine-print {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 14px;
}

.article {
  max-width: 780px;
  margin: 0 auto;
}

.article.pad-top {
  padding-top: 0;
}

.article p {
  color: #cfcfd4;
  margin-bottom: 18px;
}

.article .lead {
  font-size: 1.1rem;
  color: #e4e4e8;
}

.article h1 {
  font-size: 2.4rem;
  margin: 10px 0 20px;
}

.article .meta {
  color: var(--gold);
  font-size: 0.85rem;
}

.article img {
  width: 100%;
  margin: 24px 0;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.not-found {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.not-found h1 {
  font-size: clamp(6rem, 20vw, 11rem);
  color: var(--gold);
  line-height: 1;
}

.not-found p {
  color: var(--muted);
  margin: 12px 0 28px;
}

/* ---------- footer and small widgets ---------- */

.site-footer {
  background: #08080a;
  border-top: 1px solid var(--line);
  padding: 64px 0 24px;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: 36px;
}

.site-footer h4 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.site-footer li {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer li a:hover {
  color: var(--gold);
}

.site-footer p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 14px;
}

.site-footer form {
  display: flex;
  gap: 8px;
}

.site-footer form .btn {
  padding: 10px 16px;
}

.copyright {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--gold);
  color: #111;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 40;
}

.to-top.show {
  opacity: 1;
  pointer-events: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 120px);
  background: var(--card);
  border: 1px solid var(--gold);
  padding: 14px 24px;
  z-index: 300;
  transition: 0.4s;
  max-width: 90vw;
}

.toast.show {
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: 0.7s;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .inventory,
  .detail,
  .calc,
  .split {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .search-box {
    grid-template-columns: 1fr 1fr;
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  /* backdrop-filter would make the header the containing block of the fixed menu */
  .site-header {
    background: rgba(12, 12, 14, 0.98);
    backdrop-filter: none;
  }

  .burger {
    display: block;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    width: 260px;
    background: #0c0c0e;
    flex-direction: column;
    padding: 28px;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s, visibility 0.35s;
    border-left: 1px solid var(--line);
  }

  body.nav-open .nav {
    transform: none;
    visibility: visible;
  }
}

@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }

  .list .car {
    flex-direction: column;
  }

  .list .car-photo {
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .form-grid.two,
  .features {
    grid-template-columns: 1fr;
  }

  .section-head h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 560px) {
  .search-box,
  .footer-cols {
    grid-template-columns: 1fr;
  }

  .newsletter form {
    flex-direction: column;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .hero .actions .btn {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
