/* PBM AUTO PARTS — dense modern layout */
:root {
  --navy: #1a2e44;
  --navy-2: #243b55;
  --ink: #142433;
  --muted: #5a6572;
  --line: #d8dee6;
  --bg: #f7f8fa;
  --bg-2: #eef1f5;
  --white: #fff;
  --accent: #c45c26;
  --accent-2: #a84c1e;
  --ok: #2d6a4f;
  --font: "Anuphan", system-ui, sans-serif;
  --display: "Bai Jamjuree", "Anuphan", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header: 64px;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 8px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }
a:hover { color: var(--accent); }

h1, h2, h3 {
  font-family: var(--display);
  margin: 0 0 0.35em;
  line-height: 1.2;
  color: var(--navy);
}

p { margin: 0 0 0.75em; color: var(--muted); }

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header.is-scrolled {
  box-shadow: 0 6px 20px rgba(20, 36, 51, 0.06);
}

.nav {
  height: 100%;
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand img {
  height: 44px;
  width: auto;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.nav-menu a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}

.nav-menu a:hover { color: var(--navy); }

.nav-phone {
  padding: 0.45rem 0.85rem;
  background: var(--navy);
  color: var(--white) !important;
  border-radius: 3px;
  font-weight: 600 !important;
}

.nav-phone:hover { background: var(--accent); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.nav-toggle span { transition: 0.2s; }

/* Hero — compact, brand-first */
.hero {
  position: relative;
  min-height: min(72vh, 620px);
  display: grid;
  align-items: end;
  color: var(--white);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url("../assets/hero.jpg") center / cover no-repeat;
  transform: scale(1.03);
  animation: zoom 20s var(--ease) infinite alternate;
}

@keyframes zoom {
  from { transform: scale(1.03); }
  to { transform: scale(1.08); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(15, 28, 42, 0.92) 0%, rgba(15, 28, 42, 0.72) 48%, rgba(15, 28, 42, 0.45) 100%),
    linear-gradient(0deg, rgba(15, 28, 42, 0.75), transparent 55%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.5rem 0 3rem;
  animation: rise 0.8s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.hero-logo {
  width: min(280px, 70vw);
  height: auto;
  margin-bottom: 1rem;
  /* โลโก้โปร่งใสสี navy → ขาวบนพื้นมืด อ่านง่าย ไม่มีกล่องพื้นหลัง */
  filter:
    brightness(0) invert(1)
    drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
}

.hero h1 {
  color: var(--white);
  font-style: italic;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  max-width: 16ch;
  margin-bottom: 0.4em;
}

.hero-lead {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
  max-width: 40ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  border: 1.5px solid transparent;
  transition: 0.2s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-2);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.45);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-color: #fff;
}

/* Trust strip */
.strip {
  background: var(--navy);
  color: var(--white);
  padding: 1rem 0;
}

.strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.strip-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  border-left: 2px solid var(--accent);
}

.strip-grid strong {
  font-family: var(--display);
  font-size: 0.95rem;
}

.strip-grid span {
  font-size: 0.82rem;
  opacity: 0.75;
}

/* Sections */
.section {
  padding: 3.25rem 0;
}

.section-alt {
  background: var(--bg);
}

.section-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid var(--navy);
}

.section-bar h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-style: italic;
  margin-bottom: 0.2em;
}

.section-bar p {
  margin: 0;
  font-size: 0.92rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-btn {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  border-radius: 3px;
  cursor: pointer;
}

.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* Products — dense 4-col */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.product {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.25s var(--ease);
}

.product:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
}

.product.is-hidden { display: none; }

.product > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg-2);
  transition: transform 0.45s var(--ease);
}

.product:hover > img { transform: scale(1.04); }

.product-body {
  padding: 0.85rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.35rem;
  overflow: hidden;
}

.product-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sku {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.grade {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  background: var(--bg-2);
  color: var(--navy);
  border-radius: 2px;
}

.product h3 {
  font-size: 1rem;
  margin: 0;
}

.product-body > p {
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.4;
}

.product dl {
  margin: 0.25rem 0 0.5rem;
  padding: 0;
  font-size: 0.8rem;
}

.product dl div {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.35rem;
  padding: 0.28rem 0;
  border-top: 1px solid var(--line);
}

.product dt {
  color: var(--muted);
  font-weight: 500;
}

.product dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.inquire {
  margin-top: auto;
  display: block;
  text-align: center;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem;
  background: var(--navy);
  color: #fff;
  border-radius: 3px;
}

.inquire:hover {
  background: var(--accent);
  color: #fff;
}

/* Standards */
.std-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.std-grid article {
  padding: 1rem 0 0;
  border-top: 3px solid var(--accent);
}

.std-grid h3 {
  font-size: 1rem;
  margin-bottom: 0.4em;
}

.std-grid p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Guide dense */
.guide-dense {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
}

.guide-dense article {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem;
}

.guide-dense .guide-wide {
  grid-column: 1 / -1;
}

.guide-dense h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.guide-dense ul,
.guide-dense ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.guide-dense li + li { margin-top: 0.35rem; }

.dense-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.dense-table th,
.dense-table td {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.dense-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.ga { color: var(--ok); }
.gb { color: var(--navy); }
.gc { color: var(--muted); }

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.steps > div {
  display: grid;
  gap: 0.4rem;
}

.steps span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
}

.steps p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* FAQ */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

.faq-grid details {
  border-bottom: 1px solid var(--line);
  padding: 0.15rem 0;
}

.faq-grid summary {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  padding: 0.85rem 0;
  list-style: none;
  color: var(--navy);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.faq-grid summary::-webkit-details-marker { display: none; }
.faq-grid summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 400;
  font-size: 1.2rem;
}
.faq-grid details[open] summary::after { content: "–"; }

.faq-grid details p {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  padding-right: 1.5rem;
}

/* Contact — no form */
.contact {
  background:
    linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  padding: 3rem 0;
}

.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: center;
}

.contact h2 {
  color: #fff;
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.contact p { color: rgba(255, 255, 255, 0.8); }
.contact .hours {
  font-size: 0.88rem;
  opacity: 0.7;
  margin: 0;
}

.contact-actions {
  display: grid;
  gap: 0.75rem;
}

.contact-big {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  border-radius: 3px;
  transition: transform 0.2s, background 0.2s;
}

.contact-big:hover { transform: translateY(-2px); }

.contact-big.phone {
  background: var(--accent);
  color: #fff;
}
.contact-big.phone:hover { background: var(--accent-2); color: #fff; }

.contact-big.fb {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}
.contact-big.fb:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.contact-big .label {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contact-big .value {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
}

/* Footer */
.site-footer {
  background: #0f1c2a;
  color: rgba(255, 255, 255, 0.7);
  padding: 1.75rem 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-footer img {
  height: 40px;
  width: auto;
}

.site-footer p { margin: 0; font-size: 0.88rem; color: inherit; }

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover { color: #e8a070; }

.copyright { font-size: 0.8rem !important; opacity: 0.55; }

/* Responsive */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .std-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .strip-grid { grid-template-columns: 1fr 1fr; }
  .guide-dense { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .contact-panel { grid-template-columns: 1fr; gap: 1.25rem; }
  .footer-row { flex-direction: column; text-align: center; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    inset: var(--header) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s var(--ease);
  }

  .nav-menu.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-menu a {
    display: block;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-phone {
    margin-top: 0.5rem;
    text-align: center;
    border: 0 !important;
  }

  .product-grid { grid-template-columns: 1fr; }
  .std-grid { grid-template-columns: 1fr; }
  .strip-grid { grid-template-columns: 1fr; gap: 0.65rem; }
  .steps { grid-template-columns: 1fr; }
  .hero { min-height: 68vh; }
  .section { padding: 2.5rem 0; }
  .contact-big .value { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg { animation: none; }
  .product > img { transition: none; }
}
