/* Sage Motors — draft site styles
   Colours from the brand kit. Sora for UI type, DM Serif Display Italic for the tagline. */

:root {
  --navy: #0c1b33;
  --navy-deep: #07101e;
  --navy-soft: #16243d;
  --gold: #d4a017;
  --gold-deep: #b8860b;
  --gold-hover: #e8b423;
  --white: #ffffff;
  --ivory: #f6f1e6;
  --ivory-dark: #ebe3d2;
  --ink: #0c1b33;
  --muted: #5a6472;
  --line: rgba(12, 27, 51, 0.12);
  --line-gold: rgba(212, 160, 23, 0.45);
  --font: "Sora", "Segoe UI", Tahoma, sans-serif;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --radius: 14px;
  --header-h: 5rem;
  --wrap: 70rem;
  --shadow: 0 10px 30px rgba(12, 27, 51, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 5.5rem;
}

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

a {
  color: var(--gold-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--navy);
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--gold);
  color: var(--navy);
  padding: 0.5rem 0.9rem;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

.wrap.narrow {
  width: min(100% - 2rem, 42rem);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
}

.logo img {
  height: 3.7rem;
  width: auto;
}

.logo:hover {
  opacity: 0.9;
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-gold);
  background: transparent;
  color: var(--white);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.nav-toggle-bars {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--white);
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1.15rem;
  height: 2px;
  background: var(--white);
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.site-nav ul {
  display: flex;
  gap: 0.15rem 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.site-nav a {
  display: inline-block;
  color: var(--white);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 400;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  letter-spacing: 0.01em;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.04);
}

.site-nav a[aria-current="page"] {
  color: var(--gold);
  font-weight: 600;
}

/* Hero */

.hero {
  position: relative;
  background: radial-gradient(1200px 480px at 50% -10%, #163056 0%, var(--navy) 58%, var(--navy-deep) 100%);
  color: var(--white);
  overflow: hidden;
  min-height: 28rem;
  display: flex;
  align-items: center;
  text-align: center;
  padding: 4.5rem 0 5rem;
  border-bottom: 3px solid var(--gold);
}

.hero-arc {
  position: absolute;
  inset: 8% 0 auto;
  width: 100%;
  height: 42%;
  pointer-events: none;
  opacity: 0.95;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 44rem;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.15rem, 5.4vw, 4rem);
  line-height: 1.15;
  letter-spacing: 0;
  margin: 0 0 1.1rem;
  color: var(--white);
}

.lede {
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.86);
  max-width: 32rem;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.95rem 1.45rem;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-gold {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

.btn-gold:hover,
.btn-gold:focus-visible {
  background: var(--gold-hover);
  color: var(--navy);
  border-color: var(--gold-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.45);
}

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

.btn-ghost-dark {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn-ghost-dark:hover,
.btn-ghost-dark:focus-visible {
  background: var(--navy);
  color: var(--white);
}

.btn:active {
  transform: translateY(1px);
}

/* Page sections */

main {
  flex: 1 0 auto;
}

.section {
  padding: 3.75rem 0;
}

.section-alt {
  background: var(--white);
}

.section-navy {
  background: var(--navy);
  color: var(--white);
}

.section-head {
  text-align: center;
  margin-bottom: 2.25rem;
}

.section-head h1,
.section-head h2 {
  margin-bottom: 0.5rem;
}

.section-kicker {
  color: var(--gold-deep);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 0.55rem;
}

.section-navy .section-kicker {
  color: var(--gold);
}

.section-head p,
.intro {
  color: var(--muted);
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

.section-navy .section-head p,
.section-navy .intro {
  color: rgba(255, 255, 255, 0.78);
}

.page-hero {
  background: var(--navy);
  color: var(--white);
  padding: 2.75rem 0 2.4rem;
  border-bottom: 3px solid var(--gold);
  text-align: center;
}

.page-hero .tagline-sm {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--gold);
  margin: 0.6rem 0 0;
}

.page-hero p:last-child {
  margin-bottom: 0;
}

/* How it works steps */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem 1.4rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  position: relative;
}

.section-navy .step {
  background: var(--navy-soft);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

.step h3,
.step h2 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

@media (min-width: 861px) {
  .step h3,
  .step h2 {
    min-height: 2.6em;
  }
}

.step p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.section-navy .step p {
  color: rgba(255, 255, 255, 0.75);
}

.section-cta {
  text-align: center;
  margin-top: 2.25rem;
}

/* Inventory cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18.5rem, 22.5rem));
  gap: 1.5rem;
  justify-content: start;
}

.car-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.car-card-media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--navy-soft);
}

.car-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.car-card:hover .car-card-media img {
  transform: scale(1.04);
}

.car-card-body {
  padding: 1.15rem 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.car-card-title {
  font-size: 1.2rem;
  margin: 0;
}

.car-card-title a {
  color: var(--navy);
  text-decoration: none;
}

.car-card-title a:hover {
  color: var(--gold-deep);
}

.car-card-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.25rem;
  list-style: none;
  margin: 0.4rem 0 0.15rem;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.spec-row li {
  background: var(--ivory);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

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

.price-label {
  margin: 0;
  font-weight: 600;
  color: var(--gold-deep);
  letter-spacing: 0.01em;
}

.price-label-lg {
  font-size: 1.25rem;
  margin: 0.4rem 0 1rem;
}

.text-link {
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
}

.text-link:hover {
  color: var(--gold-deep);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--ivory-dark);
  color: var(--navy);
}

.badge-in-stock {
  background: var(--gold);
  color: var(--navy);
}

.badge-on-the-way {
  background: var(--navy);
  color: var(--white);
}

.badge-sold {
  background: #d9d4cb;
  color: #4a4a4a;
}

.car-card[data-status="Sold"] {
  opacity: 0.78;
}

.empty-state {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty-state-copy {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.55;
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

@media (max-width: 520px) {
  .empty-state-copy,
  .empty-state-actions {
    padding-right: 7.25rem;
  }
  .empty-state-actions {
    justify-content: flex-start;
  }
}

/* Car detail */

.detail-page {
  padding: 2.25rem 0 3.5rem;
}

.detail {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.25rem;
  align-items: start;
}

.gallery-main {
  background: var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

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

.gallery-thumbs {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.gallery-thumb {
  flex: 1 1 0;
  max-width: 7.5rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--navy);
  aspect-ratio: 4 / 3;
}

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

.gallery-thumb.is-active,
.gallery-thumb:focus-visible {
  border-color: var(--gold);
}

.breadcrumb {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

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

.breadcrumb a:hover {
  color: var(--gold-deep);
}

.detail-title {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  margin: 0.55rem 0 0.3rem;
}

.detail-sub {
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.spec-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1.25rem;
  margin: 0 0 1.4rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.spec-list dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.spec-list dd {
  margin: 0;
  font-weight: 600;
}

.detail-h2 {
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
}

.feature-list {
  margin: 0 0 1.4rem;
  padding: 0 0 0 1.15rem;
}

.feature-list li {
  margin: 0.25rem 0;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Forms */

.form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem;
}

.field {
  margin-bottom: 1.15rem;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.field .hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
  background-color: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230c1b33' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 0.75rem;
  padding-right: 2.3rem;
}

.field textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
  background: var(--white);
}

.form-status {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--ivory);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
}

.form-status.is-error {
  border-left-color: #8a2b12;
}

.form-status:focus,
.form-success:focus {
  outline: 2px solid var(--gold);
}

.form-success {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem;
  border-left: 3px solid var(--gold);
}

.form-success h2 {
  margin: 0 0 0.5rem;
}

.form-success p {
  margin: 0;
}

.field .optional {
  font-weight: 400;
  color: var(--muted);
}

.field-error {
  display: none;
  color: #8a2b12;
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.field.is-invalid .field-error {
  display: block;
}

.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select {
  border-color: #8a2b12;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.about-copy p {
  font-size: 1.05rem;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.4rem;
}

.contact-card h2 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.contact-card address {
  font-style: normal;
  margin-bottom: 1.15rem;
}

.social-list,
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-list li,
.contact-list li {
  margin: 0.35rem 0;
}

.social-list a {
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
}

.social-list a:hover {
  color: var(--gold-deep);
}

/* Footer */

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.82);
  padding: 2.75rem 0 1.5rem;
  border-top: 3px solid var(--gold);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-brand .logo img {
  height: 4.5rem;
}

.footer-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--white);
  margin: 0.75rem 0 0;
}

.site-footer h2 {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.site-footer address {
  font-style: normal;
  line-height: 1.55;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}

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

.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.1rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-legal p {
  margin: 0;
}

/* Floating chat */

#chat-dock {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-end;
}

.chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.8rem 1.1rem 0.8rem 0.85rem;
  border-radius: 999px;
  border: 2px solid var(--gold);
  box-shadow: 0 10px 24px rgba(12, 27, 51, 0.28);
}

.chat-btn:hover,
.chat-btn:focus-visible {
  background: #142748;
  color: var(--gold);
}

.chat-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

/* Responsive */

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .detail,
  .about-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    gap: 1.5rem;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    border-bottom: 2px solid var(--gold);
    padding: 0.4rem 0 2rem;
    min-height: calc(100vh - var(--header-h));
    z-index: 45;
  }

  .site-header {
    position: sticky;
  }

  .site-nav.is-open {
    display: block;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars {
    background: transparent;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
    top: 0;
    transform: rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    width: min(100% - 2rem, var(--wrap));
    margin-inline: auto;
  }

  .site-nav a {
    display: block;
    padding: 0.85rem 0.4rem;
  }

  .hero {
    min-height: 0;
    padding: 3.25rem 0 3.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .section {
    padding: 2.75rem 0;
  }
}

@media (max-width: 420px) {
  .logo img {
    height: 3.15rem;
  }

  .chat-btn span {
    /* keep the label; it is short */
  }
}
