:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #66716d;
  --line: #dfe5e1;
  --paper: #f8faf7;
  --white: #ffffff;
  --green: #0f3b2f;
  --green-2: #1d604d;
  --red: #b63232;
  --gold: #b8872d;
  --steel: #495a64;
  --shadow: 0 18px 45px rgba(26, 34, 31, 0.12);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

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

button,
input {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  padding: 7px 20px;
  color: #eef6f1;
  background: var(--green);
  font-size: 0.88rem;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.topbar-logo-svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(24px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid rgba(223, 229, 225, 0.82);
  background: rgba(248, 250, 247, 0.96);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-svg {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #33423e;
  font-size: 0.96rem;
}

.main-nav a {
  border-bottom: 2px solid transparent;
  padding: 4px 0;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  border-color: var(--red);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.lang-toggle:hover {
  border-color: var(--green);
  color: var(--green);
}

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.nav-cta,
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.nav-cta,
.button-primary {
  color: var(--white);
  background: var(--red);
}

.nav-cta:hover,
.button-primary:hover {
  background: #9f2929;
}

.button-secondary {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.9);
}

.button-secondary:hover {
  border-color: var(--green);
}

.hero {
  position: relative;
  display: grid;
  min-height: 68vh;
  align-items: end;
  padding: 88px max(24px, calc((100vw - var(--max)) / 2)) 0;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(15, 27, 23, 0.82) 0%, rgba(15, 27, 23, 0.52) 45%, rgba(15, 27, 23, 0.16) 100%),
    url("../images/factory-1.jpg") center / cover no-repeat;
}

.hero-content {
  max-width: 720px;
  padding-bottom: 56px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.hero h1 {
  margin: 0;
  font-size: 4rem;
  line-height: 1.05;
}

.hero-copy {
  max-width: 620px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.12rem;
  line-height: 1.85;
}

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

.hero-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 0;
  background: rgba(13, 28, 23, 0.82);
}

.hero-strip div {
  min-height: 86px;
  padding: 18px 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-strip div:first-child {
  border-left: 0;
}

.hero-strip strong,
.hero-strip span {
  display: block;
}

.hero-strip strong {
  font-size: 1.18rem;
}

.hero-strip span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.section {
  padding: 76px max(24px, calc((100vw - var(--max)) / 2));
}

.section-alt {
  background: #eef3ef;
}

.section-heading {
  max-width: 680px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.18;
}

.inline-heading {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.text-link {
  color: var(--green-2);
  font-weight: 800;
  border-bottom: 2px solid rgba(29, 96, 77, 0.24);
  padding-bottom: 4px;
}

.notice {
  margin: -14px 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.about-copy {
  color: #2f3f3a;
  font-size: 1.04rem;
  line-height: 1.95;
}

.about-copy p {
  margin: 0 0 18px;
}

.photo-carousel {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #101816;
  aspect-ratio: 16 / 10;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: var(--green);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: background 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn--prev { left: 12px; }
.carousel-btn--next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 2;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
  background: white;
  transform: scale(1.25);
}

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

.service-grid--row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
}

.service-grid article,
.card,
.contact-card,
.contact-list,
.stock-tools {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.service-grid article {
  padding: 18px;
}

.service-grid span {
  color: var(--red);
  font-weight: 900;
}

.service-grid h3 {
  margin: 8px 0 5px;
  font-size: 1rem;
}

.service-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

.inventory-panel {
  padding-top: 58px;
  padding-bottom: 36px;
  background: var(--white);
}

.stock-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  box-shadow: none;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #fbfcfb;
}

.search-box span {
  color: var(--green);
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, auto);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.segment-button {
  min-height: 48px;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 16px;
  color: #2f3f3a;
  background: var(--white);
  cursor: pointer;
}

.segment-button:first-child {
  border-left: 0;
}

.segment-button.is-active {
  color: var(--white);
  background: var(--green);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  width: 100%;
  min-width: 0;
}

.card {
  overflow: hidden;
}

.card-media {
  aspect-ratio: 4 / 3;
  background: #dfe5e1;
}

.card-media img {
  height: 100%;
  object-fit: cover;
}

.card-body {
  display: grid;
  gap: 14px;
  padding: 20px;
  min-width: 0;
  overflow: hidden;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 4px;
  padding: 0 9px;
  color: var(--white);
  background: var(--steel);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.parts {
  background: var(--green-2);
}

.badge.cars {
  background: var(--red);
}

.price {
  color: var(--red);
  font-weight: 900;
}

.card h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.meta-list div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  min-width: 0;
}

.meta-list dt {
  color: #394843;
  font-weight: 800;
  min-width: 0;
}

.meta-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
  color: #40504b;
  background: #f7faf8;
  font-size: 0.82rem;
}

.card-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--green);
  background: #edf6f1;
  font-weight: 900;
}

.card-action:hover {
  color: var(--white);
  background: var(--green);
}

.empty-state {
  margin: 0;
  border: 1px dashed #bdc8c1;
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  background: var(--white);
}

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

.contact-section .section-kicker {
  color: #f0c36a;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
}

.contact-card,
.contact-list {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.contact-card {
  padding: 28px;
}

.contact-card h3 {
  margin: 0 0 14px;
  font-size: 1.35rem;
}

.contact-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.85;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.contact-list div {
  min-height: 128px;
  padding: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.contact-list div:nth-child(1),
.contact-list div:nth-child(2) {
  border-top: 0;
}

.contact-list div:nth-child(odd) {
  border-left: 0;
}

.contact-list dt {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
}

.contact-list dd {
  margin: 10px 0 0;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.55;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px max(24px, calc((100vw - var(--max)) / 2));
  color: #dbe7e1;
  background: #101816;
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #f0c36a;
  font-weight: 800;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .topbar::-webkit-scrollbar {
    display: none;
  }

  .header-right {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: 64vh;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .about-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .service-grid--row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-carousel {
    aspect-ratio: 16 / 9;
  }

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

  .segment {
    grid-template-columns: repeat(3, 1fr);
  }

  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  /* ── Header ─────────────────────────────────────── */
  .site-header {
    flex-wrap: nowrap;
    align-items: center;
    padding: 12px 16px;
  }

  .hamburger {
    display: flex;
    margin-left: auto;
  }

  /* Override the 980px wrapping behaviour */
  .header-right {
    display: none;
    order: unset;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 16px 20px;
    background: rgba(248, 250, 247, 0.98);
    border-bottom: 2px solid var(--line);
    backdrop-filter: blur(16px);
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }

  .header-right.is-open {
    display: flex;
  }

  .main-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .main-nav a {
    display: block;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    border-bottom-width: 1px;
  }

  .header-right .nav-cta {
    display: flex;
    width: 100%;
    margin-top: 14px;
    justify-content: center;
    min-height: 48px;
  }

  .header-right .lang-toggle {
    display: flex;
    width: 100%;
    margin-top: 8px;
    justify-content: center;
    min-height: 44px;
  }

  /* ── Topbar ──────────────────────────────────────── */
  .topbar {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    padding: 8px 16px;
    justify-content: flex-start;
  }

  .topbar::-webkit-scrollbar {
    display: none;
  }

  /* ── Hero ────────────────────────────────────────── */
  .hero {
    min-height: auto;
    padding: 48px 16px 0;
  }

  .hero-content {
    padding-bottom: 24px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-copy {
    font-size: 0.95rem;
    line-height: 1.75;
    margin-top: 14px;
  }

  /* ── Stats bar: 2 × 2 grid ───────────────────────── */
  .hero-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-strip div {
    min-height: 70px;
    padding: 14px 16px;
  }

  .hero-strip div:nth-child(odd) {
    border-left: 0;
  }

  .hero-strip div:nth-child(3),
  .hero-strip div:nth-child(4) {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .hero-strip strong {
    font-size: 1.05rem;
  }

  .hero-strip span {
    font-size: 0.82rem;
  }

  /* ── Sections ────────────────────────────────────── */
  .section {
    padding: 48px 16px;
  }

  .section-heading h2 {
    font-size: 1.65rem;
  }

  /* ── About ───────────────────────────────────────── */
  .about-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .photo-carousel {
    aspect-ratio: 4 / 3;
  }

  /* ── Service cards ───────────────────────────────── */
  .service-grid,
  .service-grid--row {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  /* ── Inventory ───────────────────────────────────── */
  .stock-tools {
    grid-template-columns: 1fr;
  }

  .segment {
    grid-template-columns: repeat(3, 1fr);
  }

  .segment-button {
    padding: 0 8px;
    font-size: 0.84rem;
  }

  /* ── Listings ────────────────────────────────────── */
  .listing-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .inline-heading {
    display: block;
  }

  .inline-heading .text-link {
    display: inline-flex;
    margin-top: 14px;
  }

  /* ── Contact ─────────────────────────────────────── */
  .contact-card {
    padding: 20px;
  }

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

  .contact-list div,
  .contact-list div:nth-child(2) {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    min-height: auto;
    padding: 20px 16px;
  }

  .contact-list div:first-child {
    border-top: 0;
  }

  /* ── Footer ──────────────────────────────────────── */
  .site-footer {
    display: block;
    padding: 20px 16px;
  }

  .site-footer a {
    display: inline-flex;
    margin-top: 12px;
  }
}
