:root{
  --bg:#ffffff;
  --text:#141414;
  --muted:#666;
  --brand:#7A0F1B;      /* แดงเลือดหมู */
  --brand2:#5b0b14;
  --line:#eee;
  --card:#fbfbfb;
  --shadow: 0 14px 34px rgba(0,0,0,.10);
  --shadow2: 0 10px 20px rgba(0,0,0,.08);
  --radius:18px;
  --radius2:26px;
  --max:1180px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans Thai", sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.55;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
.container{max-width:var(--max);margin:0 auto;padding:0 20px}

.topbar{
  background:linear-gradient(90deg, var(--brand), var(--brand2));
  color:#fff;
  font-size:14px;
}
.topbar .wrap{
  display:flex;gap:14px;align-items:center;justify-content:space-between;
  padding:10px 0;
}
.topbar .left, .topbar .right{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.pill{
  display:inline-flex;align-items:center;gap:8px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.18);
  padding:6px 10px;border-radius:999px;
}
.pill strong{font-weight:800}

.header{
  position:sticky;top:0;z-index:50;
  background:rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.nav{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 0;
  position:relative;
}
.brand{
  display:flex;align-items:center;gap:12px;
}
.brand img{width:44px;height:44px;object-fit:contain}
.brand .name{display:flex;flex-direction:column;line-height:1.1}
.brand .name b{letter-spacing:.2px}
.brand .name span{font-size:12px;color:var(--muted)}

.menu{
  display:flex;align-items:center;gap:18px;
}
.menu a{
  font-weight:700;font-size:14px;
  padding:10px 10px;border-radius:12px;
}
.menu a:hover{background:#f4f4f4}
.menu a.active{background:rgba(122,15,27,.08);color:var(--brand)}

.cta{display:flex;gap:10px;align-items:center}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  padding:12px 16px;border-radius:14px;
  font-weight:900;font-size:14px;
  border:1px solid transparent;
  cursor:pointer;
  transition:.18s ease;
}
.btn-primary{
  background:linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff;
  box-shadow:var(--shadow2);
}
.btn-primary:hover{transform:translateY(-1px);filter:saturate(1.02)}
.btn-ghost{
  background:#fff;border:1px solid var(--line);
}
.btn-ghost:hover{background:#fafafa}

.hamburger{
  display:none;
  border:1px solid var(--line);
  background:#fff;border-radius:14px;
  padding:10px 12px;
}

/* HERO */
.hero{
  position:relative;
  min-height:78vh;
  display:flex;align-items:center;
  overflow:hidden;
}
.hero::before{
  content:"";
  position:absolute;inset:0;
  background:url("../assets/hero.jpg") center/cover no-repeat;
  transform:scale(1.02);
}
.hero::after{
  content:"";
  position:absolute;inset:0;
  background:linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.25) 55%, rgba(0,0,0,.20) 100%);
}
.hero .content{
  position:relative;z-index:2;
  padding:78px 0;
  color:#fff;
}
.hero h1{
  font-size:48px;
  line-height:1.06;
  margin:0 0 12px;
  letter-spacing:-.4px;
}
.hero p{
  max-width:700px;
  font-size:16px;
  margin:0 0 22px;
  color:rgba(255,255,255,.90);
}
.hero .badges{
  display:flex;gap:10px;flex-wrap:wrap;
  margin:18px 0 26px;
}
.badge{
  display:inline-flex;align-items:center;gap:10px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.16);
  padding:10px 12px;border-radius:999px;
  font-weight:900;font-size:13px;
}
.hero .actions{display:flex;gap:12px;flex-wrap:wrap}

.section{padding:64px 0}
.section .head{
  display:flex;justify-content:space-between;align-items:flex-end;gap:18px;flex-wrap:wrap;
  margin-bottom:22px;
}
.kicker{
  color:var(--brand);
  font-weight:900;
  letter-spacing:.18em;
  font-size:20px;
  text-transform:uppercase;
}
.kicker2{
  color:var(--brand);
  font-weight:900;
  letter-spacing:.1em;
  font-size:20px;
  text-transform:uppercase;
}

.kicker3{
  color:var(--brand);
  font-weight:900;
  letter-spacing:.1em;
  font-size:16px;
  text-transform:uppercase;
}

.h2{
  font-size:30px;line-height:1.15;margin:6px 0 0;
  letter-spacing:-.2px;
}
.sub{
  margin:10px 0 0;color:var(--muted);max-width:760px;
}

.grid{display:grid;gap:18px}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-4{grid-template-columns:repeat(4,1fr)}
.grid.cols-2{grid-template-columns:repeat(2,1fr)}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
}
.card .pad{padding:18px}
.card h3{margin:0 0 6px;font-size:18px}
.card p{margin:0;color:var(--muted);font-size:14px}

.iconline{display:flex;gap:12px;align-items:flex-start}
.dot{
  width:10px;height:10px;border-radius:999px;
  background:var(--brand);margin-top:6px;flex:0 0 auto;
}

.product img{aspect-ratio: 16/10;object-fit:cover}
.tagrow{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.tag{
  font-size:12px;font-weight:900;
  color:var(--brand);
  background:rgba(122,15,27,.08);
  border:1px solid rgba(122,15,27,.14);
  padding:6px 10px;border-radius:999px;
}

.split{
  display:grid;gap:18px;
  grid-template-columns: 1.2fr .8fr;
  align-items:stretch;
}
.panel{
  border-radius:var(--radius2);
  background:linear-gradient(180deg, #fff, #fbf7f7);
  border:1px solid rgba(122,15,27,.12);
  padding:22px;
  box-shadow:var(--shadow2);
}
.panel h3{margin:0 0 10px}
.panel ul{margin:0;padding-left:18px;color:var(--muted)}
.panel li{margin:6px 0}

/* Projects gallery */
.gallery{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:14px;
}
.gitem{
  grid-column:span 4;
  border-radius:18px;overflow:hidden;
  border:1px solid var(--line);
  background:#fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
.gitem img{width:100%;height:220px;object-fit:cover}
.gmeta{padding:14px}
.gmeta b{display:block}
.gmeta span{display:block;color:var(--muted);font-size:13px;margin-top:4px}

.filters{
  display:flex;gap:10px;flex-wrap:wrap;
  margin: 14px 0 22px;
}
.fbtn{
  border:1px solid var(--line);
  background:#fff;
  padding:10px 12px;border-radius:999px;
  font-weight:900;font-size:13px;
  cursor:pointer;
}
.fbtn.active{
  border-color:rgba(122,15,27,.22);
  background:rgba(122,15,27,.08);
  color:var(--brand);
}

/* Forms */
.form{display:grid;gap:14px}
.input{
  width:100%;
  padding:14px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  font-size:14px;
  outline:none;
}
.input:focus{border-color:rgba(122,15,27,.35);box-shadow:0 0 0 5px rgba(122,15,27,.08)}
textarea.input{min-height:140px;resize:vertical}

/* Footer */
.footer{
  border-top:1px solid var(--line);
  background:#fff;
  padding:26px 0;
}
.footer .wrap{
  display:flex;justify-content:space-between;align-items:flex-start;gap:18px;flex-wrap:wrap;
}
.footer small{color:var(--muted)}
.footer .links{display:flex;gap:12px;flex-wrap:wrap}
.footer .links a{color:var(--muted);font-weight:900;font-size:13px}
.footer .links a:hover{color:var(--brand)}

/* --- Product Spec Layout (1:1 images) --- */
.spec-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:18px;
}
.product-spec{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:18px;
  align-items:stretch;
}
.square{
  width:100%;
  aspect-ratio: 1 / 1;         /* ✅ รูป 1:1 */
  object-fit: cover;
  border-radius:18px;
  border:1px solid var(--line);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  background:#fff;
}
.spec-box{
  border:1px solid rgba(122,15,27,.12);
  border-radius:var(--radius2);
  background:linear-gradient(180deg, #fff, #fbf7f7);
  padding:18px;
  box-shadow: var(--shadow2);
}
.spec-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.spec-title{
  margin:0;
  font-size:22px;
  letter-spacing:-.2px;
}
.spec-sub{
  margin:6px 0 0;
  color:var(--muted);
  font-weight:800;
}
.mini-tags{display:flex;gap:8px;flex-wrap:wrap}
.mini-tag{
  font-size:12px;font-weight:900;
  color:var(--brand);
  background:rgba(122,15,27,.08);
  border:1px solid rgba(122,15,27,.14);
  padding:6px 10px;border-radius:999px;
}

.spec-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
}
.spec-table td{
  padding:12px 12px;
  border-bottom:1px solid var(--line);
  font-size:14px;
}
.spec-table tr:last-child td{border-bottom:none}
.spec-table td:first-child{
  width:40%;
  color:#333;
  font-weight:900;
  background:#fcfcfc;
}
.spec-actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Responsive */
@media (max-width: 980px){
  .grid.cols-4{grid-template-columns:repeat(2,1fr)}
  .grid.cols-3{grid-template-columns:repeat(2,1fr)}
  .split{grid-template-columns:1fr}
  .hero h1{font-size:40px}
  .gitem{grid-column:span 6}
  .product-spec{grid-template-columns:1fr}
}
@media (max-width: 720px){
  .menu{display:none}
  .hamburger{display:inline-flex}
  .menu.open{
    display:flex;flex-direction:column;align-items:flex-start;
    position:absolute;left:0;right:0;top:62px;
    background:#fff;border:1px solid var(--line);
    border-radius:18px;padding:12px;
    box-shadow:var(--shadow);
  }
  .hero{min-height:76vh}
  .hero h1{font-size:34px}
  .grid.cols-3{grid-template-columns:1fr}
  .grid.cols-2{grid-template-columns:1fr}
  .gitem{grid-column:span 12}
}
/* ===== HERO FIX ===== */
.hero .kicker{
  margin-bottom:14px;
  letter-spacing:.22em;
}
.hero h1{
  line-height:1.2;
  margin-bottom:14px;
}

/* Hero buttons */
.btn-hero-outline{
  background:rgba(255,255,255,.12);
  color:#fff;
  border:1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(6px);
}
.btn-hero-outline:hover{
  background:rgba(255,255,255,.22);
}

/* ===== HERO FEATURE ICONS ===== */
.hero-features{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:22px 0 28px;
}
.hero-feature{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(122,15,27,.75);
  color:#fff;
  font-weight:700;
  font-size:14px;
}
.hero-feature span{
  display:inline-flex;
  width:26px;height:26px;
  border-radius:50%;
  background:#fff;
  color:var(--brand);
  align-items:center;
  justify-content:center;
  font-weight:900;
}

/* ===== WHY BEAVER FLOOR (IMAGE CARD) ===== */
.why-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:22px;
}
@media(max-width:980px){
  .why-grid{grid-template-columns:1fr}
}
.why-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  overflow:hidden;
  box-shadow:0 10px 26px rgba(0,0,0,.06);
}
.why-card img{
  width:100%;
  height:200px;
  object-fit:cover;
}
.why-card .pad{
  padding:18px 18px 22px;
}
.why-card h3{
  margin:0 0 6px;
  font-size:18px;
}
.why-card p{
  margin:0;
  color:var(--muted);
}

/* ===== SERIES IMAGE FIX (1:1, NO CROP) ===== */
.series-img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:contain;      /* 🔑 ไม่ตัดสินค้า */
  background:#fff;
  padding:12px;
}

/* ===== Product Catalog ===== */
.catalog-toolbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; flex-wrap:wrap;
  margin:14px 0 22px;
}
.searchbox{
  display:flex; gap:10px; align-items:center;
  border:1px solid var(--line);
  background:#fff;
  padding:10px 12px;
  border-radius:999px;
}
.searchbox input{
  border:0; outline:0; font-size:14px;
  width:min(420px, 70vw);
}
.catalog-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
}
@media(max-width:980px){ .catalog-grid{grid-template-columns:repeat(2,1fr)} }
@media(max-width:680px){ .catalog-grid{grid-template-columns:1fr} }

.pcard{
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  overflow:hidden;
  box-shadow:0 10px 26px rgba(0,0,0,.06);
}
.pmedia{
  padding:14px;
  background:linear-gradient(180deg,#fff,#fafafa);
  border-bottom:1px solid var(--line);
}
.square-frame{
  width:100%;
  aspect-ratio:1/1;
  border-radius:16px;
  border:1px solid #f0f0f0;
  background:#fff;
  overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.square-frame img{
  width:100%; height:100%;
  object-fit:contain !important;   /* ✅ ไม่ตัด */
  display:block;
}
.pbody{ padding:16px 18px 18px; }
.pname{ margin:0 0 6px; font-size:20px; letter-spacing:-.2px; }
.pdesc{ margin:0; color:var(--muted); }
.pmeta{ margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
.pmeta .tag{ margin-top:0; }

.pactions{
  padding:16px 18px 18px;
  display:flex; gap:10px; flex-wrap:wrap;
  border-top:1px solid var(--line);
  background:#fff;
}

/* ===== Series Spec Layout (เดิม) ปรับภาพโปสเตอร์ให้ไม่โดน crop ===== */
.product-spec .square{
  object-fit:contain; /* ✅ โปสเตอร์ 1:1 เห็นครบ */
  background:#fff;
  padding:10px;
}

/* ===== Service section ===== */
.service-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:18px;
}
@media(max-width:980px){ .service-grid{grid-template-columns:1fr} }

.service-card{
  background:linear-gradient(180deg,#fff,#fbf7f7);
  border:1px solid rgba(122,15,27,.12);
  border-radius:var(--radius2);
  padding:20px;
  box-shadow:var(--shadow2);
}
.service-card h3{ margin:0 0 10px; }
.service-list{ margin:0; padding-left:18px; color:var(--muted); }
.service-list li{ margin:6px 0; }


/* ===============================
   projects.css
   Add a new Before/After section UNDER existing gallery
   (does not touch the original gallery cards)
   =============================== */

/* spacing section */
.ba-section{
  margin-top:28px;
  padding:22px;
  border-radius:22px;
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(122,15,27,.04), rgba(122,15,27,0));
}

.ba-head .sub{
  margin:6px 0 0;
  color:var(--muted);
}

/* grid */
.ba-grid{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
}
@media(max-width:980px){
  .ba-grid{ grid-template-columns:repeat(2,1fr); }
}
@media(max-width:680px){
  .ba-grid{ grid-template-columns:1fr; }
}

.ba-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  overflow:hidden;
  box-shadow:0 10px 26px rgba(0,0,0,.06);
}

.ba-meta{
  padding:14px 16px 16px;
}
.ba-meta b{
  display:block;
  margin-bottom:6px;
}
.ba-meta span{
  display:block;
  color:var(--muted);
  font-size:14px;
  line-height:1.55;
}

/* ===== Before/After widget ===== */
.ba{
  position:relative;
  width:100%;
  height:240px;
  background:#f2f2f2;
  overflow:hidden;
  cursor:ew-resize;
}
.ba img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.ba img.after{
  clip-path: inset(0 0 0 50%);
}

/* labels */
.ba .label{
  position:absolute;
  top:12px;
  padding:6px 10px;
  font-size:12px;
  font-weight:900;
  border-radius:999px;
  color:#fff;
  background:rgba(0,0,0,.60);
  letter-spacing:.08em;
  z-index:5;
}
.ba .label.before{ left:12px; }
.ba .label.after{ right:12px; }

/* slider input */
.ba input[type="range"]{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:ew-resize;
  z-index:6;
}

/* handle */
.ba .handle{
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:3px;
  height:100%;
  background:#fff;
  z-index:7;
}
.ba .handle::before{
  content:"↔";
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:44px;
  height:44px;
  border-radius:50%;
  background:var(--brand);
  color:#fff;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 22px rgba(0,0,0,.25);
}

/* ===== Lightbox ===== */
.lightbox{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.86);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:20px;
}
.lightbox.open{ display:flex; }
.lightbox img{
  max-width:92vw;
  max-height:92vh;
  object-fit:contain;
  border-radius:14px;
  background:#111;
}
.lightbox .close{
  position:absolute;
  top:18px;
  right:18px;
  width:44px;
  height:44px;
  border-radius:50%;
  border:0;
  cursor:pointer;
  font-size:22px;
  font-weight:900;
  background:#fff;
}
