:root {
  /* Garage signage vernacular: shop purple + banner gold */
  --bg: #f3f0f6;
  --bg-2: #ffffff;
  --bg-3: #e9e2f0;
  --ink: #1a1224;
  --muted: #5a5168;
  --line: rgba(26, 18, 36, 0.12);
  --brand: #4f2175;
  --brand-2: #6a2f9a;
  --amber: #ffd000;
  --amber-2: #4f2175;
  --on-accent: #1a1224;
  --steel: #6b6280;
  --danger: #c84b31;
  --radius: 12px;
  --radius-sm: 8px;
  --wrap: min(1120px, calc(100% - 2rem));
  --font: "Noto Sans Thai", system-ui, sans-serif;
  --display: "Oswald", "Noto Sans Thai", sans-serif;
  --shadow-photo: 0 18px 40px rgba(79, 33, 117, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--amber);
  color: var(--on-accent);
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

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

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  background: var(--brand);
  color: var(--amber);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 208, 0, 0.4);
  line-height: 1;
}

.brand__mark-ko,
.brand__mark-year {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__text strong {
  font-size: 1.05rem;
}

.brand__text small {
  color: var(--muted);
  font-size: 0.75rem;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-nav__link,
.header-cart {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  font-size: inherit;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.header-nav__link:hover,
.header-cart:hover {
  text-decoration: underline;
}

.header-nav__link.is-active,
.header-cart.is-active {
  text-decoration: underline;
}

.header-cart__count {
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--amber);
  color: var(--on-accent);
  font-size: 0.8rem;
  display: inline-grid;
  place-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 46px;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

a.btn,
button.btn {
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  cursor: pointer;
}

.btn--primary {
  background: var(--amber);
  color: var(--on-accent);
  box-shadow: 0 1px 0 rgba(26, 18, 36, 0.08);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 33, 117, 0.16);
}

.btn--ghost {
  border-color: rgba(79, 33, 117, 0.28);
  color: var(--brand);
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(79, 33, 117, 0.06);
}

.btn--sm {
  min-height: 40px;
  padding: 0.4rem 0.95rem;
  font-size: 0.9rem;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 2.8rem 0 3.2rem;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 12%, rgba(106, 47, 154, 0.14), transparent 42%),
    radial-gradient(circle at 8% 88%, rgba(255, 208, 0, 0.12), transparent 34%),
    linear-gradient(165deg, #efe8f6 0%, #f3f0f6 52%, #ebe4f2 100%);
}

.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -18deg,
    transparent,
    transparent 14px,
    rgba(79, 33, 117, 0.025) 14px,
    rgba(79, 33, 117, 0.025) 15px
  );
}

.hero__inner {
  position: relative;
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

.hero__copy {
  min-width: 0;
}

.hero__media {
  margin: 0;
  min-width: 0;
}

.hero__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-3);
  display: block;
  box-shadow: var(--shadow-photo);
}

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.5rem;
  }
}

@keyframes koparts-hero-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__copy,
.hero__media {
  animation: koparts-hero-in 0.7s ease both;
}

.hero__media {
  animation-delay: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
  .hero__copy,
  .hero__media {
    animation: none;
  }

  .btn {
    transition: none;
  }

  .btn--primary:hover {
    transform: none;
  }
}

.eyebrow {
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 0.55rem;
}

.hero h1,
.page-hero h1,
.hero__title {
  font-family: var(--display);
  font-size: clamp(2.15rem, 6.8vw, 3.55rem);
  line-height: 1.12;
  margin: 0 0 0.9rem;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.01em;
  word-break: keep-all;
  overflow-wrap: normal;
}

.hero__title .nowrap {
  white-space: nowrap;
}

.hero-break {
  display: none;
}

@media (max-width: 900px) {
  .hero-break {
    display: inline;
  }
}

.lede {
  color: var(--muted);
  max-width: 38rem;
  margin: 0 0 1.4rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero__meta > li:not(.contact-row):not(.social-link):not(.hero__contacts) {
  padding-left: 0;
  max-width: 36rem;
  line-height: 1.55;
}

.hero__location {
  color: var(--muted);
}

.hero__contacts {
  list-style: none;
  width: max-content;
  max-width: 100%;
  margin: 0.25rem 0;
  padding: 0;
}

/* Shared 4-column tabs: equal gap length, columns align across both people */
.contact-list {
  display: grid;
  grid-template-columns: max-content max-content max-content max-content;
  column-gap: 1rem;
  row-gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
  width: max-content;
  max-width: 100%;
}

.contact-list > .contact-row {
  display: contents;
}

.contact-row__name {
  color: var(--ink);
}

.contact-row__phone,
.contact-row__line {
  color: var(--amber-2);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.contact-row__phone:hover,
.contact-row__line:hover {
  text-decoration: underline;
}

.contact-row__line-label {
  color: var(--muted);
}

.social-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  list-style: none;
  margin: 0.25rem 0;
  width: 100%;
  max-width: 100%;
}

.social-link__label {
  color: var(--ink);
  flex: 0 0 auto;
}

.social-link a {
  color: var(--amber-2);
  text-decoration: none;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.social-link a:hover {
  text-decoration: underline;
}

.hero__meta a {
  color: var(--amber-2);
  text-decoration: none;
}

.hero__meta a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .site-header__inner {
    gap: 0.65rem;
  }

  .brand {
    min-width: 0;
  }

  .brand__text small {
    display: none;
  }

  .header-actions,
  .header-nav {
    gap: 0.75rem;
  }
}

@media (max-width: 520px) {
  .contact-list {
    grid-template-columns: max-content 1fr;
    column-gap: 1rem;
  }
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 2.8rem 0 0.85rem;
}

.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.page-hero h1 + .lede {
  margin-top: 0;
}

.card-grid {
  display: grid;
  gap: 1.25rem;
}

.card {
  background: transparent;
  border: 0;
  border-left: 3px solid var(--brand);
  border-radius: 0;
  padding: 0.25rem 0 0.25rem 1.05rem;
}

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

.card p {
  margin: 0;
  color: var(--muted);
}

.featured-shop {
  padding-bottom: 2.5rem;
}

.featured-shop__more {
  margin: 1.5rem 0 0;
  text-align: center;
}

.services-preview {
  padding-bottom: 0.5rem;
}

.services-stock {
  margin-top: 2rem;
  padding-top: 0.25rem;
}

.services-stock__caption {
  margin: 0 0 1rem;
  max-width: none;
}

.services-stock__grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

.services-stock__shot {
  margin: 0;
  min-width: 0;
}

.services-stock__shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-3);
}

@media (max-width: 699px) {
  .services-stock__grid {
    grid-template-columns: 1fr;
  }
}

.page-hero {
  padding: 2.4rem 0 1.5rem;
  background: linear-gradient(180deg, #ebe4f2, var(--bg));
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  text-transform: none;
}

.content-block {
  padding: 1.5rem 0 3rem;
}

.prose :where(h2, h3) {
  font-family: var(--display);
  text-transform: none;
}

.prose {
  color: var(--muted);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.92rem;
  color: var(--ink);
}

.prose th {
  background: var(--brand);
  color: #fff;
  text-align: left;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
}

.prose td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

#services,
#shop,
#contact,
#top {
  scroll-margin-top: 5.5rem;
}

.inquiry-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

@media (min-width: 700px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Modifier must win over the 3-col default */
  .card-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large desktops / ~27" monitors — widen layout only; leave laptop+mobile alone */
@media (min-width: 1440px) {
  :root {
    --wrap: min(1320px, calc(100% - 3rem));
  }

  .hero {
    padding: 3.4rem 0 3.8rem;
  }

  .hero__inner {
    gap: 3rem;
  }

  .card-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.35rem;
  }

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

  .content-block {
    padding: 2rem 0 3.5rem;
  }
}

@media (min-width: 1800px) {
  :root {
    --wrap: min(1480px, calc(100% - 4rem));
  }

  .hero {
    padding: 4rem 0 4.25rem;
  }

  .hero h1,
  .page-hero h1,
  .hero__title {
    font-size: clamp(2.15rem, 6.8vw, 3.9rem);
  }
}
