/* Site typeface: IBM Plex Sans Thai for headings and body (overrides site.css tokens) */
:root {
  --font-heading: "IBM Plex Sans Thai", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", ui-sans-serif, system-ui, sans-serif;
  --font-display: "IBM Plex Sans Thai", ui-sans-serif, system-ui, sans-serif;
}

/* ---------- Type system (Impeccable typeset) ----------
   One family, four roles: display (h1), section (h2), item (h3), body.
   Thai stacks tone marks above and vowels below the line, so headings get 1.3 and body ~1.7
   instead of the Latin-tuned 1.2 / 1.5 the utility classes default to. */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
h1[class], h2[class], h1, h2 { line-height: 1.3; letter-spacing: -0.005em; }   /* [class] outranks Tailwind leading-* */
h3[class], h3 { line-height: 1.45; }
.font-extrabold { font-weight: 700; }            /* the face tops out at 700; say so instead of hoping */
:is(main, section, article) p.leading-relaxed { line-height: 1.7; }
:is(main, section, article) p[class*="leading-8"], .leading-loose { line-height: 1.75; }
:is(main, section, article) .text-xs { font-size: .8125rem; line-height: 1.55; }
article :is(p, li).text-sm { font-size: .9375rem; line-height: 1.7; }
a[href^="tel:"], .tabular-nums { font-variant-numeric: tabular-nums; }
::selection { background: #fecaca; color: #7f1d1d; }

@media (max-width: 639px) {
  h1 { font-size: 1.75rem !important; }                         /* 28px everywhere (was 26 on home, 30 elsewhere) */
  section h2.text-3xl, section h2[class*="sm:text-4xl"] { font-size: 1.5rem; }   /* section titles 24px */
  section h3.text-lg, section h3[class*="text-[15px]"] { font-size: 1rem; }
  :is(main, section, article) :is(p, li).text-sm { font-size: .9375rem; line-height: 1.65; }
  :is(main, section) p.text-base, :is(main, section) p.text-lg { font-size: 1rem; line-height: 1.7; }
  section a[href="/"].inline-flex.text-sm { min-height: 2.75rem; }   /* "กลับหน้าแรก" on every inner page */
}

/* Scroll-reveal (replaces the original framer-motion fade-up) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s cubic-bezier(.22, 1, .36, 1), transform .65s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}
[data-portfolio-extra][hidden] { display: none !important; }

/* ---------- Portfolio: swipe rows on phones ---------- */
.aj-swipe-hint { display: none; }
@media (max-width: 639px) {
  #portfolio .aj-swipe {
    display: flex; gap: .75rem; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-left: 1rem;
    margin: 0 -1rem; padding: 0 1rem .75rem; scrollbar-width: none;
  }
  #portfolio .aj-swipe::-webkit-scrollbar { display: none; }
  #portfolio .aj-swipe > * { flex: 0 0 82%; scroll-snap-align: start; }
  #portfolio .aj-swipe > [data-portfolio-extra][hidden] { display: block !important; }
  #portfolio .aj-more { display: none; }
  #portfolio .aj-swipe-hint {
    display: flex; align-items: center; gap: .25rem; margin-top: .25rem;
    font-size: .875rem; font-weight: 600; color: #475569;
  }
  #portfolio .aj-swipe > * h3 { font-size: 1rem; }
}

/* ---------- Mobile / touch polish ---------- */
a, button, select, input, label, summary { touch-action: manipulation; -webkit-tap-highlight-color: rgba(220, 38, 38, .12); }
html { scroll-padding-top: 5.5rem; }

/* ---------- Homepage (Impeccable critique fixes) ---------- */
/* F4: one service-label colour instead of four unrelated ones */
#services [data-pick-service] { background-color: #1e293b !important; }
#services [data-pick-service]:hover { background-color: #b91c1c !important; opacity: 1; }

/* F6: no gradient strip along the bottom of the step cards */
#process .grid > div > div > .absolute.bottom-0 { display: none; }

@media (max-width: 639px) {
  /* F1: contact channels as compact rows */
  #contact > div > div > div { padding: 1.5rem 1rem; }
  #contact .grid { gap: .625rem; margin-top: 1.5rem; }
  #contact .grid > div > div {
    display: grid; grid-template-columns: 2.75rem 1fr; column-gap: .875rem; align-items: center;
    padding: .875rem 1rem; text-align: left;
  }
  #contact .grid > div > div > span { grid-row: 1 / span 2; width: 2.75rem; height: 2.75rem; margin: 0; border-radius: .875rem; }
  #contact .grid > div > div > h3 { margin-top: 0; font-size: 1rem; }
  #contact .grid > div > div > p.flex-1 { display: none; }
  #contact .grid > div > div > a { margin-top: .375rem; justify-self: start; min-height: 2.75rem; padding: 0 1rem; }

  /* F2: vehicle types as one swipe row */
  #vehicles .grid {
    display: flex; gap: .75rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    margin: 1rem -1rem 0; padding: 0 1rem .5rem; scrollbar-width: none;
  }
  #vehicles .grid::-webkit-scrollbar { display: none; }
  #vehicles .grid > * { flex: 0 0 62%; scroll-snap-align: start; }
  #vehicles .aj-swipe-hint { display: flex; align-items: center; justify-content: center; gap: .25rem; margin-top: 1.25rem; font-size: .875rem; font-weight: 600; color: #475569; }

  /* F3: coverage reassurance points as a checked list */
  #coverage .md\:grid-cols-3 { gap: 0; margin-top: 1.5rem; }
  #coverage .md\:grid-cols-3 > div > div {
    display: grid; grid-template-columns: 2rem 1fr; column-gap: .75rem; align-items: start;
    border: 0; border-bottom: 1px solid #e2e8f0; border-radius: 0; box-shadow: none; background: none; padding: 1rem 0;
  }
  #coverage .md\:grid-cols-3 > div:last-child > div { border-bottom: 0; }
  #coverage .md\:grid-cols-3 > div > div > svg { grid-row: 1 / span 2; width: 1.75rem; height: 1.75rem; }
  #coverage .md\:grid-cols-3 > div > div > h3 { margin-top: 0; font-size: 1rem; }
  #coverage .md\:grid-cols-3 > div > div > p { margin-top: .25rem; }

  /* F6: steps as the same compact numbered timeline as the service pages */
  #process .grid { grid-template-columns: 1fr !important; gap: 0; margin-top: 1.5rem; }
  #process .grid > div > div {
    display: grid; grid-template-columns: 2.5rem 1fr; column-gap: .75rem; align-items: start;
    border: 0; border-radius: 0; background: none; padding: .75rem 0; overflow: visible;
  }
  #process .grid > div:not(:last-child) > div::after {
    content: ""; position: absolute; left: 1.25rem; top: 3.25rem; bottom: -.25rem; width: 2px; background: #fecaca;
  }
  #process .grid > div > div > div:first-child { grid-row: 1 / span 2; }
  #process .grid > div > div > div:first-child > span:first-child { display: none; }
  #process .grid > div > div > div:first-child > span:last-child {
    display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 999px;
    background: #fff; border: 2px solid #dc2626; color: #b91c1c; font-size: 1rem; line-height: 1;
  }
  #process .grid > div > div > h3 { margin-top: 0; padding-top: .2rem; font-size: 1rem; }
  #process .grid > div > div > p { margin-top: .25rem; font-size: .9375rem; line-height: 1.6; }
}

/* ---------- Service pages (moving / motorcycle / goods / pet) ---------- */
.aj-svc-hero a[href="/"] { min-height: 2.75rem; }
.aj-svc-work a[href="/#portfolio"] { min-height: 2.75rem; }

/* mid-page quote prompts */
.aj-svc-cta {
  margin: 2rem auto 0; max-width: 40rem; display: flex; flex-direction: column; align-items: center; gap: .875rem;
  padding: 1.25rem 1.25rem 1.375rem; border-radius: 1rem; background: #fef2f2; text-align: center;
}
.aj-svc-cta-text { font-weight: 600; font-size: 1rem; line-height: 1.6; color: #7f1d1d; }
.aj-svc-cta a { min-height: 3rem; }
@media (max-width: 639px) { .aj-svc-cta a { width: 100%; } }

/* collapsible "items we don't carry" + terms */
.aj-terms > summary { list-style: none; cursor: pointer; min-height: 2.75rem; }
.aj-terms > summary::-webkit-details-marker { display: none; }
.aj-terms > summary h3 { flex: 1; }
.aj-terms-chev {
  width: 1.75rem; height: 1.75rem; flex-shrink: 0; border-radius: 999px; background: #f1f5f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 1rem no-repeat;
  transition: transform .2s ease;
}
.aj-terms[open] .aj-terms-chev { transform: rotate(180deg); }
.aj-terms:not([open]) { height: auto; }
.aj-svc-terms { padding-top: 3rem; padding-bottom: 3rem; }
.aj-svc-terms .mt-12 { margin-top: 1.75rem; }
.aj-svc-terms .grid { align-items: start; }

@media (max-width: 639px) {
  /* hero photos + gallery: one swipe row each */
  .aj-svc-hero-photos, .aj-svc-work .grid {
    display: flex; gap: .75rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    margin-left: -1rem; margin-right: -1rem; padding: 0 1rem .5rem; scrollbar-width: none;
  }
  .aj-svc-hero-photos::-webkit-scrollbar, .aj-svc-work .grid::-webkit-scrollbar { display: none; }
  .aj-svc-hero-photos > * { flex: 0 0 78%; scroll-snap-align: start; }
  .aj-svc-work .grid > * { flex: 0 0 82%; scroll-snap-align: start; }
  .aj-svc-work .grid { margin-top: 1rem; }
  .aj-svc-work .aj-swipe-hint { display: flex; align-items: center; justify-content: center; gap: .25rem; margin-top: 1.25rem; font-size: .875rem; font-weight: 600; color: #475569; }

  /* service details: a checked list instead of five same-size cards */
  .aj-svc-details .grid { gap: 0; margin-top: 1.5rem; }
  .aj-svc-details .grid > div > div {
    position: relative; border: 0; border-bottom: 1px solid #e2e8f0; border-radius: 0; background: none;
    padding: 1rem 0 1rem 2.25rem;
  }
  .aj-svc-details .grid > div:last-child > div { border-bottom: 0; }
  .aj-svc-details .grid > div > div::before {
    content: ""; position: absolute; left: 0; top: 1.2rem; width: 1.375rem; height: 1.375rem; border-radius: 999px;
    background: #dc2626 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 62% no-repeat;
  }

  /* steps: compact numbered timeline */
  .aj-svc-steps .grid { gap: 0; margin-top: 1.5rem; }
  .aj-svc-steps .grid > div {
    display: grid; grid-template-columns: 2.5rem 1fr; align-items: start; column-gap: .75rem;
    border: 0; border-radius: 0; background: none; padding: .75rem 0; position: relative;
  }
  .aj-svc-steps .grid > div:not(:last-child)::after {
    content: ""; position: absolute; left: 1.25rem; top: 3.25rem; bottom: -.25rem; width: 2px; background: #fecaca;
  }
  .aj-svc-steps .grid > div > span {
    display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 999px;
    background: #fff; border: 2px solid #dc2626; color: #b91c1c; font-size: 1rem; line-height: 1;
  }
  .aj-svc-steps .grid > div > p { margin-top: 0; padding-top: .45rem; }
}

/* ---------- Promo bar: one compact row on phones ---------- */
.aj-promo-short { display: none; }
@media (max-width: 639px) {
  #promo-wrap .bg-primary > div { flex-wrap: nowrap; justify-content: space-between; gap: .5rem; padding: .25rem 0 .25rem .875rem; }
  #promo-wrap .bg-primary p { min-width: 0; font-size: .8125rem; }
  #promo-wrap .bg-primary p > svg, #promo-wrap .aj-promo-quote { display: none; }
  #promo-wrap .bg-primary > div > div { flex-shrink: 0; gap: 0; }
  #promo-wrap .bg-primary button { margin: 0; width: 2.75rem; height: 2.75rem; }
  .aj-promo-long { display: none; }
  .aj-promo-short { display: inline; }
}
@media (max-width: 1023px) { #promo-wrap a { min-height: 2.75rem; } }

/* ---------- Hero: let the real team photo show above the card on phones ---------- */
@media (max-width: 639px) {
  /* square photo: team + truck sit in its lower half, so keep the photo to the top band */
  #home > .absolute { bottom: auto; height: calc(var(--site-header-h, 9.5rem) + 14rem); }
  #home > .absolute img { object-position: 62% 70% !important; }
  #home > .absolute > .bg-gradient-to-t { height: 22%; }
  #home > .mx-auto { padding-top: calc(var(--site-header-h, 9.5rem) + 11.5rem); }
}

/* ---------- Touch targets: 44px minimum ---------- */
#contact a[class="font-semibold text-primary hover:underline"],
footer a[class="transition-colors hover:text-primary"] { display: inline-flex; align-items: center; min-height: 2.75rem; }
#contact a.mt-5.rounded-full, #portfolio .aj-more button { min-height: 2.75rem; }
footer a[aria-label].h-10 { width: 2.75rem; height: 2.75rem; }

/* ---------- Readable Thai text sizes ---------- */
.text-\[10px\] { font-size: .75rem; }
.text-\[11px\] { font-size: .8125rem; }
main .text-xs, footer .text-xs { font-size: .8125rem; line-height: 1.5; }
@media (max-width: 639px) { section p.text-sm, section li.text-sm { font-size: .9375rem; line-height: 1.65; } }

/* ---------- Contrast: small red labels on light sections, Facebook button ---------- */
.section-light p.text-primary, .section-light span.text-primary { color: #b91c1c; }
#facebook a.text-white[href*="facebook.com"] { background-color: #1565d8; }

/* ---------- Facebook page section ---------- */
.aj-fb-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 1024px) { .aj-fb-grid { grid-template-columns: 1fr 500px; gap: 3rem; } }
.aj-fb-points { margin-top: 1.25rem; display: grid; gap: .625rem; }
.aj-fb-points li { position: relative; padding-left: 1.75rem; color: #334155; font-size: 1rem; line-height: 1.6; }
.aj-fb-points li::before {
  content: ""; position: absolute; left: 0; top: .3rem; width: 1.125rem; height: 1.125rem; border-radius: 999px;
  background: #1877f2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.aj-fb-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.aj-fb-actions a { min-height: 3rem; }
@media (max-width: 639px) { .aj-fb-actions a { flex: 1 1 100%; } }
.aj-fb-embed-wrap { width: 100%; max-width: 500px; margin: 0 auto; }
.aj-fb-embed {
  position: relative; width: 100%; height: 560px; border-radius: 1rem; overflow: hidden;
  border: 1px solid #e2e8f0; background: #fff; box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .35);
}
@media (max-width: 639px) { .aj-fb-embed { height: 500px; } }
.aj-fb-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.aj-fb-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  padding: 1.5rem; text-align: center; background: linear-gradient(180deg, #eff6ff, #fff); color: #1877f2;
}
.aj-fb-fallback span { font-weight: 700; font-size: 1.0625rem; }
.aj-fb-fallback small { color: #475569; font-size: .875rem; }

/* ---------- Quote form additions ---------- */
.aj-draft {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af;
  border-radius: .75rem; padding: .625rem .875rem; font-size: .875rem; font-weight: 600;
}
.aj-draft button {
  min-height: 2.75rem; padding: 0 .875rem; border-radius: 999px; border: 1px solid #93c5fd;
  background: #fff; color: #1d4ed8; font-weight: 600; font-size: .875rem;
}

/* item quantity steppers */
.aj-steppers:empty { display: none; }
.aj-steppers { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.aj-stepper-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  border: 1px solid #e2e8f0; border-radius: .75rem; padding: .375rem .375rem .375rem .875rem; background: #fff;
}
.aj-stepper-name { font-weight: 600; font-size: .9375rem; color: #111827; min-width: 0; overflow-wrap: anywhere; }
.aj-stepper { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.aj-stepper button {
  width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 1px solid #e2e8f0; background: #f8fafc;
  font-size: 1.375rem; line-height: 1; font-weight: 700; color: #111827;
}
.aj-stepper button:active { background: #fee2e2; border-color: #fca5a5; }
.aj-stepper output { min-width: 2rem; text-align: center; font-weight: 700; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }

/* quick date / time chips */
.aj-quick { display: flex; flex-wrap: wrap; gap: .375rem; padding-top: .375rem; }
.aj-quick button {
  min-height: 2.75rem; padding: 0 .875rem; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff;
  font-size: .875rem; font-weight: 600; color: #334155;
}
.aj-quick button[aria-pressed="true"] { background: #dc2626; border-color: #dc2626; color: #fff; }

/* inline validation */
.aj-invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, .18) !important; }
.aj-inline-err { margin-top: .375rem; color: #dc2626; font-size: .875rem; font-weight: 600; line-height: 1.45; }

/* tablets: province search gets its own row so the placeholder isn't cut off */
@media (min-width: 640px) and (max-width: 1023px) {
  #quote-app [data-geo] { grid-template-columns: 1fr 1fr !important; }
  #quote-app [data-geo] > [data-combo] { grid-column: 1 / -1; }
}

/* date/time inputs: same height as the other fields on iOS */
#quote-app input[type="date"], #quote-app input[type="time"] { min-height: 3rem; -webkit-appearance: none; appearance: none; background: #fff; }

/* ---------- Mobile bottom progress bar ---------- */
.aj-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem 1rem calc(.625rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97); border-top: 1px solid #e2e8f0;
  box-shadow: 0 -8px 24px -12px rgba(15, 23, 42, .25);
  transform: translateY(110%); transition: transform .25s ease; pointer-events: none;
}
.aj-bar.is-on { transform: none; pointer-events: auto; }
.aj-bar-info { flex: 1; min-width: 0; display: grid; gap: .375rem; }
.aj-bar-info span[data-bar-label] { font-size: .875rem; font-weight: 700; color: #1e40af; }
.aj-bar-track { display: block; height: .375rem; border-radius: 999px; background: #dbeafe; overflow: hidden; }
.aj-bar-track i { display: block; height: 100%; width: 0; background: #1d4ed8; border-radius: inherit; transition: width .3s ease; }
.aj-bar button {
  flex-shrink: 0; min-height: 3rem; padding: 0 1.25rem; border-radius: 999px;
  border: 1px solid #1d4ed8; background: #fff; color: #1d4ed8; font-weight: 700; font-size: .9375rem;
}
.aj-bar button.is-ready { background: #dc2626; border-color: #dc2626; color: #fff; }
@media (min-width: 1024px) { .aj-bar { display: none; } }
@media (max-width: 1023px) { #quote { padding-bottom: 5.5rem; } }
