/* ============================================================
   SPC Sport Floor — Design System
   บริษัท ศุภรภัทร์ คอนสตรัคชั่น จำกัด
   ============================================================ */

:root {
  /* Colors — drawn from real project photography, not a generic SaaS palette */
  --ink: #17181a;
  --ink-soft: #3a3c40;
  --paper: #ffffff;
  --paper-alt: #f3f1ec;
  --line: #e1ddd3;
  --line-strong: #c9c3b4;

  --red: #c8202f;       /* running-track rubber red */
  --red-dark: #8e1620;
  --blue: #1c5fd6;      /* court blue */
  --green: #1c8a4c;     /* futsal green */
  --yellow: #f2ab0c;    /* court yellow / hazard */

  --radius: 2px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --maxw: 1240px;

  --font-head: "Kanit", "Sarabun", sans-serif;
  --font-body: "Sarabun", "Noto Sans Thai", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }

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

a, button { -webkit-tap-highlight-color: transparent; }

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.75em;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 3px;
  background: var(--red);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9em 1.6em;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  touch-action: manipulation;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--red); border-color: var(--red); transform: translateY(-2px); }
.btn.btn-outline { background: transparent; color: var(--ink); }
.btn.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn.btn-red { background: var(--red); border-color: var(--red); }
.btn.btn-red:hover { background: var(--ink); border-color: var(--ink); }
.btn.btn-on-dark { border-color: var(--paper); color: var(--paper); background: transparent; }
.btn.btn-on-dark:hover { background: var(--paper); color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  border-bottom: 3px solid var(--ink);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7em;
  text-decoration: none;
  color: var(--ink);
}
.brand img { height: 46px; width: auto; }
.brand-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.brand-text span {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: none;
}
@media (max-width: 400px) {
  .brand img { height: 36px; }
  .brand-text { font-size: 0.95rem; }
  .brand-text span { display: none; }
}

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] { border-color: var(--red); color: var(--red); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  touch-action: manipulation;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--ink); display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 86vh;
  min-height: 86svh;
  display: flex;
  align-items: flex-end;
  color: var(--paper);
  overflow: hidden;
  background: var(--ink);
}
.hero img.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23,24,26,0.15) 0%, rgba(23,24,26,0.85) 90%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
  padding-top: 6rem;
}
.hero-content .eyebrow { color: var(--yellow); }
.hero-content .eyebrow::before { background: var(--yellow); }
.hero h1 { color: var(--paper); max-width: 16ch; }
.hero-lead { color: #d8d6d0; max-width: 46ch; font-size: 1.1rem; }
.hero-actions { display: flex; gap: 1rem; margin-top: 1.75rem; flex-wrap: wrap; }

.hero-page {
  min-height: 46vh;
  min-height: 46svh;
  align-items: center;
}
.hero-page .hero-content { padding-top: 3rem; }

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-alt { background: var(--paper-alt); }
.section-dark { background: var(--ink); color: var(--paper); }
.section-dark p { color: #c7c5bf; }
.section-dark .eyebrow { color: var(--yellow); }
.section-dark .eyebrow::before { background: var(--yellow); }

.section-head { max-width: 62ch; margin-bottom: 2.5rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Stat strip ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.stat {
  padding: 1.75rem 1rem;
  text-align: center;
  border-left: 1px solid var(--line-strong);
}
.stat:first-child { border-left: none; }
.stat-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2.4rem;
  color: var(--red);
  line-height: 1;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Service cards ---------- */
.grid {
  display: grid;
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.service-card {
  background: var(--paper);
  padding: 2rem 1.75rem;
  position: relative;
}
.service-card .num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--line-strong);
  margin-bottom: 1rem;
}
.service-card h3 { margin-bottom: 0.5em; }
.service-card p { font-size: 0.94rem; margin-bottom: 0; }
.service-card ul { padding-left: 1.1em; margin: 0.9em 0 0; }
.service-card li { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.55em; }
.service-card li b { color: var(--ink); font-weight: 600; }
.service-card li:last-child { margin-bottom: 0; }
.service-card .tag {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--red);
  text-decoration: none;
  text-transform: uppercase;
}

/* ---------- Grouped sub-systems (dense catalogs like industrial flooring) ---------- */
.system-group { margin-bottom: 2.5rem; }
.system-group:last-child { margin-bottom: 0; }
.system-group-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 0.4rem;
}
.system-group-head .g-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--blue);
}
.system-group-head h3 { margin: 0; }
.system-group > p.group-intro { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1.25rem; max-width: 70ch; }
.variant-card {
  border: 1px solid var(--line-strong);
  padding: 1.5rem;
  background: var(--paper);
}
.variant-card h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  margin: 0 0 0.7em;
  text-transform: none;
}
.variant-card dl { margin: 0; font-size: 0.88rem; }
.variant-card dt {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--red);
  margin-top: 0.8em;
}
.variant-card dt:first-child { margin-top: 0; }
.variant-card dd { margin: 0.2em 0 0; color: var(--ink-soft); line-height: 1.55; }

/* ---------- Service card with image (services page) ---------- */
.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-bottom: 1px solid var(--line);
}
.service-block:last-child { border-bottom: none; }
.service-block.reverse .service-media { order: 2; }
.service-media { border: 1px solid var(--line-strong); overflow: hidden; aspect-ratio: 4/3; }
.service-media img { width: 100%; height: 100%; object-fit: cover; }
.service-copy .kicker {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}
.service-copy ul { padding-left: 1.1em; color: var(--ink-soft); margin: 1em 0; }
.service-copy li { margin-bottom: 0.4em; }
@media (max-width: 760px) {
  .service-block, .service-block.reverse { grid-template-columns: 1fr; }
  .service-block.reverse .service-media { order: 0; }
}

/* ---------- Portfolio gallery ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}
.filter-btn {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: transparent;
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 0.55em 1.2em;
  border-radius: var(--radius);
  cursor: pointer;
}
.filter-btn.active, .filter-btn:hover { background: var(--ink); color: var(--paper); }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: pointer;
  background: var(--ink);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease, opacity 0.2s ease;
}
.gallery-item:hover img { transform: scale(1.06); opacity: 0.85; }
.gallery-item .cat-label {
  position: absolute;
  left: 0; bottom: 0;
  background: rgba(23,24,26,0.82);
  color: var(--paper);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4em 0.7em;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,10,10,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; border: 1px solid rgba(255,255,255,0.15); }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.2rem;
  cursor: pointer;
  width: 44px; height: 44px;
  border-radius: 50%;
}
.lightbox-close { top: 5vh; right: 4vw; }
.lightbox-prev { left: 3vw; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 3vw; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { border-color: #fff; }

/* ---------- Process steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.step .num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--line-strong);
}
.step h4 { font-family: var(--font-head); font-size: 1.02rem; margin: 0.3em 0 0.3em; text-transform: none; }
.step p { font-size: 0.92rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--red);
  color: var(--paper);
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { color: var(--paper); margin: 0; max-width: 22ch; }

/* ---------- About / values ---------- */
.value-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.4rem; }
.value-list li { display: flex; gap: 1rem; align-items: flex-start; }
.value-list .mark {
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--paper);
  background: var(--red);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  border: 1px solid var(--line-strong);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.contact-card h3 { margin-bottom: 0.6em; font-size: 1.05rem; }
.contact-card .label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--red); font-family: var(--font-head); font-weight: 600; }
.map-embed { border: 1px solid var(--line-strong); overflow: hidden; }
.map-embed iframe { width: 100%; height: 320px; border: 0; display: block; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #c7c5bf;
  padding: 3.5rem 0 2rem;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 0.7em; margin-bottom: 1em; }
.footer-brand img { height: 40px; }
.footer-brand span { font-family: var(--font-head); font-weight: 800; color: var(--paper); font-size: 1.05rem; }
.site-footer h4 {
  color: var(--paper);
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-bottom: 1em;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6em; }
.site-footer a { text-decoration: none; color: #c7c5bf; }
.site-footer a:hover { color: var(--paper); }
.footer-bottom {
  border-top: 1px solid #34363a;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: #8b8a86;
}

/* ---------- Floating contact ---------- */
.floating-contact {
  position: fixed;
  right: calc(clamp(1rem, 3vw, 1.75rem) + env(safe-area-inset-right, 0px));
  bottom: calc(clamp(1rem, 3vw, 1.75rem) + env(safe-area-inset-bottom, 0px));
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
}
.fc-btn {
  display: flex;
  align-items: center;
  gap: 0.6em;
  height: 48px;
  padding: 0 1.1em 0 0.9em;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fc-btn:active { transform: scale(0.96); }
.fc-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.fc-btn .fc-label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.fc-btn:hover,
.fc-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.34);
}
.fc-line { background: #06c755; }
.fc-fb { background: #1877f2; }
.fc-tel { background: var(--red); }

@media (max-width: 560px) {
  .fc-btn { height: 44px; padding: 0 0.9em 0 0.75em; }
  .fc-btn svg { width: 20px; height: 20px; }
  .fc-btn .fc-label { font-size: 0.76rem; }
}

/* ---------- Mobile nav ---------- */
@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: 76px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 3px solid var(--ink);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem var(--gutter) 1.5rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.18s ease;
  }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav ul li { border-bottom: 1px solid var(--line); }
  .main-nav ul li a { display: block; padding: 0.9em 0; }
  .main-nav .btn { margin-top: 1rem; align-self: flex-start; }
}
