/* =====================================================================
   力山汽車維修 — Auto Repair one-pager
   Design tokens sourced from Figma (node bQc947dwsIQKHSeXYiADsM:0-1)
   ===================================================================== */

:root {
  /* Brand */
  --brand: #b9f25c;
  --brand-hover: #a9e34e;

  /* Surfaces */
  --bg: #ffffff;
  --bg-raised: #ffffff;
  --bg-sunken: #f5f6fa;
  --bg-inverse: #12131a;

  /* Text */
  --text-strong: rgba(0, 6, 38, 0.9);
  --text-weak: rgba(0, 9, 51, 0.65);
  --text-inverse-strong: #ffffff;
  --text-inverse-weak: rgba(255, 255, 255, 0.78);

  /* Stroke */
  --stroke-weak: rgba(0, 17, 102, 0.1);

  /* Radius / shadow */
  --radius-card: 24px;
  --radius-pill: 360px;
  --shadow-raised: 0 4px 8px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.08);

  /* Layout */
  --max-content: 1084px;
  --top-nav-h: 72px;
  --bottom-nav-h: 72px;

  /* Type */
  --font-sans: "Noto Sans TC", system-ui, -apple-system, "PingFang TC",
    "Microsoft JhengHei", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-strong);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Pad page so sticky mobile bottom nav never covers content */
  padding-bottom: 0;
}

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

h1,
h2,
h3,
h4,
p,
ul {
  margin: 0;
  padding: 0;
}
ul {
  list-style: none;
}

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

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid #4d90fe;
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- a11y skip link ---------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--brand);
  color: var(--text-strong);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 16px;
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--text-strong);
  font-family: inherit;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: var(--shadow-raised);
  transition: background-color 0.15s ease, transform 0.08s ease;
}
.btn:hover {
  background: var(--brand-hover);
}
.btn:active {
  transform: translateY(1px);
}
.btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.icon {
  width: 24px;
  height: 24px;
  flex: none;
}
.icon--sm {
  width: 16px;
  height: 16px;
}

/* =====================================================================
   Top nav (sticky on both breakpoints)
   ===================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--top-nav-h);
  padding: 6px 16px;
  background: var(--bg);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--stroke-weak);
}

.top-nav__logo img {
  width: 106px;
  height: 45px;
  border-radius: 0;
  object-fit: contain;
}

.top-nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--top-nav-h);
}

.nav-link {
  padding: 0 16px;
  height: var(--top-nav-h);
  display: inline-flex;
  align-items: center;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 28px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-link:hover {
  color: #000;
}
.nav-link.is-active {
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.top-nav__cta {
  flex: none;
}

/* =====================================================================
   Hero
   ===================================================================== */
.hero {
  padding: 16px;
}

.hero__card {
  position: relative;
  width: 100%;
  aspect-ratio: 1292 / 772;
  min-height: 420px;
  max-height: 772px;
  border-radius: var(--radius-card);
  overflow: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.5),
    rgba(102, 102, 102, 0.5)
  );
  z-index: 1;
}

.hero__content {
  position: absolute;
  left: clamp(24px, 9vw, 126px);
  top: clamp(64px, 20vw, 261px);
  right: clamp(24px, 9vw, 126px);
  z-index: 2;
  color: #fff;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.08);
  max-width: 920px;
}

.hero__title {
  font-size: clamp(32px, 6vw, 80px);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 24px;
}

.hero__rule {
  display: block;
  width: 120px;
  height: 12px;
  background: #fff;
  margin-bottom: 24px;
}

.hero__sub {
  font-size: clamp(16px, 1.6vw, 24px);
  line-height: 1.4;
  font-weight: 400;
}

/* Stats card */
.stats {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  gap: 40px;
  align-items: center;
  padding: 24px;
  background: var(--brand);
  border-radius: var(--radius-card) 0 var(--radius-card) 0;
  max-width: calc(100% - 32px);
}
.stats__item {
  text-align: center;
  color: var(--text-weak);
}
.stats__value {
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  color: var(--text-strong);
}
.stats__label {
  margin-top: 4px;
  font-size: 22px;
  line-height: 32px;
}

/* =====================================================================
   Generic section
   ===================================================================== */
.section {
  padding: 80px 120px;
}
.section--sunken {
  background: var(--bg-sunken);
}
.section__header {
  max-width: var(--max-content);
  margin: 0 auto 40px;
  text-align: center;
}
.section__eyebrow {
  color: var(--text-weak);
  font-size: 22px;
  line-height: 32px;
  margin-bottom: 0;
}
.section__title {
  color: #1c1b1b;
  font-size: 40px;
  line-height: 1.4;
  font-weight: 700;
}

/* =====================================================================
   Cards (shared)
   ===================================================================== */
.card {
  background: var(--bg-raised);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-raised);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

/* =====================================================================
   Services grid (desktop) / carousel (mobile)
   ===================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  max-width: var(--max-content);
  margin: 0 auto;
  width: 100%;
}

.service-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: #d9d9d9;
}
.service-card__title {
  font-size: 22px;
  line-height: 32px;
  font-weight: 400;
  color: var(--text-strong);
}
.service-card__desc {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-weak);
  min-height: 48px;
}

/* =====================================================================
   Workshop gallery (1 + 2 layout desktop)
   ===================================================================== */
.workshop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: var(--max-content);
  margin: 0 auto;
  height: 606px;
}
.workshop__lead,
.workshop__stack > figure {
  margin: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #d9d9d9;
}
.workshop__lead {
  height: 100%;
}
.workshop__lead img,
.workshop__stack img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.workshop__stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 24px;
  min-height: 0;
}

/* =====================================================================
   Reviews grid (3 cols desktop) / carousel (mobile)
   ===================================================================== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: var(--max-content);
  margin: 0 auto;
  width: 100%;
}
.review-card__stars {
  color: #f4b400;
  font-size: 16px;
  letter-spacing: 2px;
}
.review-card__body {
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  color: var(--text-strong);
}
.review-card__author {
  display: flex;
  gap: 16px;
  align-items: center;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: #e5e2e1;
  font-weight: 700;
  font-size: 16px;
  color: #1c1b1b;
}
.review-card__name {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-strong);
}
.review-card__meta {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-weak);
}

/* =====================================================================
   Advantages
   ===================================================================== */
.advantages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 71px;
  max-width: var(--max-content);
  margin: 0 auto;
  align-items: stretch;
}
.advantages__list {
  display: flex;
  flex-direction: column;
  gap: 62px;
}
.advantage {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.advantage__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--stroke-weak);
  border-radius: 48px;
  color: var(--text-strong);
}
.advantage__icon svg {
  width: 24px;
  height: 24px;
}
.advantage__title {
  font-size: 22px;
  line-height: 32px;
  font-weight: 700;
  color: var(--text-strong);
}
.advantage__desc {
  margin-top: 4px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-weak);
}
.advantages__figure {
  margin: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #d9d9d9;
}
.advantages__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =====================================================================
   Pricing
   ===================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: var(--max-content);
  margin: 0 auto;
}
.pricing-card {
  padding: 0;
  overflow: hidden;
  gap: 0;
  border: 1px solid var(--stroke-weak);
}
.pricing-card__head,
.pricing-card__body {
  width: 100%;
  padding: 24px;
}
.pricing-card__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-bottom: 1px solid var(--stroke-weak);
}
.pricing-card__title {
  font-size: 22px;
  line-height: 32px;
  font-weight: 700;
  color: var(--text-strong);
}
.pricing-card__price {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text-strong);
}
.pricing-card__price span {
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
}
.pricing-card__price--quote {
  font-size: 28px;
  line-height: 40px;
}
.pricing-card__desc,
.pricing-card__body > p {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-weak);
}
.pricing-card__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.pricing-card__list li {
  position: relative;
  padding-left: 28px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-strong);
}
.pricing-card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: var(--brand);
}
.pricing-card__list li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  width: 6px;
  height: 4px;
  border-left: 2px solid var(--text-strong);
  border-bottom: 2px solid var(--text-strong);
  transform: rotate(-45deg);
}

/* =====================================================================
   FAQ
   ===================================================================== */
.faq-card {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 40px;
  background: var(--bg-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
}
.faq-card .section__header {
  margin-bottom: 32px;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq-item {
  border: 1px solid var(--stroke-weak);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  font-size: 22px;
  line-height: 32px;
  font-weight: 700;
  color: var(--text-strong);
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  flex: none;
  font-size: 28px;
  line-height: 1;
  font-weight: 400;
}
.faq-item[open] summary::after {
  content: "−";
}
.faq-item p {
  padding: 0 24px 20px;
  color: var(--text-weak);
  font-size: 16px;
  line-height: 24px;
}

/* =====================================================================
   Contact
   ===================================================================== */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 71px;
  max-width: var(--max-content);
  margin: 0 auto;
  align-items: stretch;
}
.contact__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}
.contact__row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.contact__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--stroke-weak);
  border-radius: 48px;
  color: var(--text-strong);
}
.contact__icon svg {
  width: 24px;
  height: 24px;
}
.contact__link {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-strong);
  transition: color 0.15s ease;
}
.contact__link:hover {
  color: #000;
  text-decoration: underline;
}
.contact__muted {
  color: var(--text-weak);
}
.contact__map {
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #d9d9d9;
  min-height: 320px;
}
.contact__map iframe {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  display: block;
}

/* =====================================================================
   Footer
   ===================================================================== */
.footer {
  background: var(--bg-inverse);
  color: var(--text-inverse-strong);
  padding: 80px 120px;
}
.footer__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.footer__brand {
  font-size: 22px;
  line-height: 32px;
  font-weight: 700;
  color: var(--text-inverse-strong);
}
.footer__tagline {
  margin-top: 4px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-inverse-weak);
}
.footer__heading {
  font-size: 22px;
  line-height: 32px;
  font-weight: 700;
  color: var(--text-inverse-strong);
  margin-bottom: 4px;
}
.footer__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-inverse-weak);
}
.footer__list li {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 16px;
  line-height: 24px;
}
.footer__list a {
  color: var(--text-inverse-weak);
  transition: color 0.15s ease;
}
.footer__list a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer__fb {
  text-decoration: underline;
}
.footer__copy {
  color: var(--text-inverse-weak);
  font-size: 16px;
  line-height: 24px;
}

/* =====================================================================
   Carousel (mobile cards) — silent on desktop
   ===================================================================== */
.carousel {
  position: relative;
}
.carousel__dots {
  display: none;
}

/* =====================================================================
   Bottom nav (mobile only)
   ===================================================================== */
.bottom-nav {
  display: none;
}
.bottom-nav__item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  height: 100%;
  color: var(--text-weak);
  font-size: 12px;
  line-height: 1.4;
  padding: 10px 4px 8px;
  transition: color 0.15s ease;
}
.bottom-nav__icon {
  width: 24px;
  height: 24px;
}
.bottom-nav__item.is-active {
  color: var(--text-strong);
}
.bottom-nav__item.is-active .bottom-nav__icon {
  color: var(--text-strong);
}

/* =====================================================================
   Floating WhatsApp FAB (mobile only)
   ===================================================================== */
.wa-fab {
  display: none;
}

/* =====================================================================
   MOBILE — ≤ 768px
   ===================================================================== */
@media (max-width: 768px) {
  html {
    /* extra room for bottom nav anchor targets */
    scroll-padding-top: calc(var(--top-nav-h) + 12px);
    scroll-padding-bottom: calc(var(--bottom-nav-h) + 12px);
  }

  body {
    padding-bottom: var(--bottom-nav-h);
  }

  /* top nav */
  .top-nav {
    padding: 6px 16px;
  }
  .top-nav__logo img {
    width: 96px;
    height: 41px;
  }
  .top-nav__links {
    display: none;
  }
  .top-nav__cta {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
  }
  .top-nav__cta .icon {
    width: 16px;
    height: 16px;
  }

  /* hero */
  .hero__card {
    aspect-ratio: auto;
    min-height: 520px;
  }
  .hero__content {
    left: 24px;
    right: 24px;
    top: 64px;
  }
  .hero__title {
    font-size: 28px;
    line-height: 40px;
    margin-bottom: 16px;
  }
  .hero__rule {
    width: 80px;
    height: 10px;
    margin-bottom: 16px;
  }
  .hero__sub {
    font-size: 16px;
    line-height: 24px;
  }
  .stats {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-card);
    justify-content: space-around;
  }
  .stats__value {
    font-size: 24px;
  }
  .stats__label {
    font-size: 14px;
    line-height: 20px;
  }

  /* sections */
  .section {
    padding: 48px 16px;
  }
  .section__title {
    font-size: 24px;
    line-height: 34px;
  }
  .section__eyebrow {
    font-size: 18px;
    line-height: 28px;
  }

  /* Services + reviews become carousels: horizontal snap strips */
  .carousel {
    margin: 0 -16px;
    padding: 0 16px;
  }
  .services-grid,
  .reviews-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    grid-template-columns: none;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    padding: 4px 16px 16px;
    margin: 0 -16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .services-grid::-webkit-scrollbar,
  .reviews-grid::-webkit-scrollbar {
    display: none;
  }
  .services-grid > .card,
  .reviews-grid > .card {
    scroll-snap-align: start;
  }
  .carousel__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
  }
  .carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: rgba(0, 9, 51, 0.2);
    border: 0;
    padding: 0;
    transition: background-color 0.2s, width 0.2s;
  }
  .carousel__dot.is-active {
    background: var(--text-strong);
    width: 22px;
  }

  /* workshop: stack everything */
  .workshop {
    grid-template-columns: 1fr;
    height: auto;
    gap: 16px;
  }
  .workshop__lead {
    aspect-ratio: 3 / 4;
  }
  .workshop__stack {
    grid-template-rows: auto auto;
    gap: 16px;
  }
  .workshop__stack figure {
    aspect-ratio: 4 / 3;
  }

  /* advantages */
  .advantages {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .advantages__figure {
    order: -1;
    aspect-ratio: 4 / 3;
  }
  .advantages__list {
    gap: 24px;
  }

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

  /* faq */
  .faq-card {
    padding: 24px 16px;
  }
  .faq-item summary {
    padding: 16px;
    font-size: 18px;
    line-height: 28px;
  }
  .faq-item p {
    padding: 0 16px 16px;
  }

  /* contact */
  .contact {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .contact__map {
    min-height: 260px;
    order: 1;
  }
  .contact__list {
    order: 0;
  }

  /* footer */
  .footer {
    padding: 48px 16px 32px;
  }

  /* bottom nav visible on mobile */
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    display: flex;
    height: var(--bottom-nav-h);
    background: var(--bg);
    border-top: 1px solid var(--stroke-weak);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* WhatsApp floating action button */
  .wa-fab {
    position: fixed;
    right: 16px;
    bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0));
    z-index: 98;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 9999px;
    background: #25d366;
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
    transition: transform 0.15s ease;
  }
  .wa-fab:hover {
    transform: scale(1.05);
  }
  .wa-fab svg {
    width: 28px;
    height: 28px;
  }
}

/* Small phones: tighten up further */
@media (max-width: 380px) {
  .bottom-nav__item span {
    font-size: 11px;
  }
  .stats {
    gap: 4px;
  }
  .stats__value {
    font-size: 20px;
  }
  .stats__label {
    font-size: 12px;
  }
}

/* =====================================================================
   DESKTOP narrow (≤ 1100px but not mobile) — a little breathing room
   ===================================================================== */
@media (min-width: 769px) and (max-width: 1100px) {
  .section,
  .footer {
    padding-left: 48px;
    padding-right: 48px;
  }
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reviews-grid {
    grid-template-columns: 1fr;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}
