/* ============================================================
   แป้งร้อยเอ็ด — Pangroiet
   ดีไซน์สดใส ล้อป้ายไวนิลของร้าน
   สีดึงจากป้ายจริง: น้ำเงินสด #2d4993 · เหลือง #fac751
   ============================================================ */

:root {
  --blue:       #2d4993;
  --blue-dark:  #223a7a;
  --blue-deep:  #1a2c5e;
  --yellow:     #fac751;
  --yellow-dark:#e9a92a;
  --pink:       #ff8fa3;
  --mint:       #7bd5b8;
  --cream:      #fdfaf3;
  --paper:      #ffffff;
  --ink:        #21315e;
  --ink-soft:   #5a6b96;
  --line:       #e7e2d6;

  --radius:     22px;
  --radius-sm:  14px;
  --shadow-sm:  0 3px 10px rgba(45, 73, 147, .10);
  --shadow:     0 14px 34px rgba(45, 73, 147, .16);
  --shadow-lg:  0 26px 60px rgba(45, 73, 147, .26);

  --font-body:  "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head:  "Mitr", system-ui, sans-serif;

  --wrap: 1160px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; font-weight: 600; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.2rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.muted { color: var(--ink-soft); font-size: .88rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--blue); color: #fff; padding: .6rem 1rem; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

:where(a, button, input, select):focus-visible {
  outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 8px;
}

/* Pills */
.pill {
  display: inline-block; font-family: var(--font-head); font-weight: 500;
  font-size: .82rem; padding: .35rem 1rem; border-radius: 999px; margin-bottom: 1rem;
}
.pill-yellow { background: var(--yellow); color: var(--blue-deep); }
.pill-blue { background: rgba(45, 73, 147, .1); color: var(--blue); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 500;
  padding: .85rem 1.7rem; border: 2px solid transparent; border-radius: 999px; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn-yellow { background: var(--yellow); color: var(--blue-deep); box-shadow: var(--shadow-sm); }
.btn-yellow:hover { background: #ffd777; transform: translateY(-3px); box-shadow: var(--shadow); }
.btn-outline-light { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.14); transform: translateY(-3px); }
.btn-lg { font-size: 1.3rem; padding: 1rem 2.6rem; }

/* Decorations */
.deco { position: absolute; pointer-events: none; }
.spark { color: var(--yellow); opacity: .9; font-size: 1.4rem; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
.deco-wave {
  width: 120px; height: 40px; opacity: .8;
  background:
    radial-gradient(circle at 10px 26px, transparent 12px, var(--yellow) 12px 15px, transparent 15px),
    radial-gradient(circle at 40px 14px, transparent 12px, var(--yellow) 12px 15px, transparent 15px),
    radial-gradient(circle at 70px 26px, transparent 12px, var(--yellow) 12px 15px, transparent 15px),
    radial-gradient(circle at 100px 14px, transparent 12px, var(--yellow) 12px 15px, transparent 15px);
  -webkit-mask: linear-gradient(#000, #000); mask: linear-gradient(#000, #000);
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s;
}
.nav.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav-inner { display: flex; align-items: center; gap: 1rem; height: 74px; }
.brand { display: inline-flex; align-items: center; margin-right: auto; }
.brand-logo { height: 54px; width: auto; display: block; }
.brand-badge {
  display: grid; place-items: center; width: 42px; height: 42px; font-size: 1.3rem;
  background: var(--blue); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-family: var(--font-head); font-size: 1.15rem; color: var(--blue); font-weight: 600; }
.brand-text small { font-size: .64rem; letter-spacing: .22em; color: var(--yellow-dark); font-weight: 600; }

.nav-links { display: flex; gap: 1.6rem; }
.nav-links a { position: relative; font-size: .95rem; padding: .25rem 0; font-weight: 500; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; width: 100%; height: 3px;
  background: var(--yellow); border-radius: 3px; transform: scaleX(0); transform-origin: right;
  transition: transform .25s ease;
}
.nav-links a:hover::after, .nav-links a.is-current::after { transform: scaleX(1); transform-origin: left; }

.nav-actions { display: flex; align-items: center; gap: .6rem; }
.lang-switch { display: flex; padding: 3px; gap: 2px; background: #fff; border-radius: 999px; border: 1px solid var(--line); }
.lang-switch button {
  border: 0; background: transparent; cursor: pointer; padding: .28rem .8rem; border-radius: 999px;
  font-size: .82rem; color: var(--ink-soft); transition: background .2s, color .2s;
}
.lang-switch button.is-active { background: var(--blue); color: #fff; }
.nav-call {
  display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-head); font-weight: 500;
  font-size: .9rem; background: var(--yellow); color: var(--blue-deep);
  padding: .5rem 1.1rem; border-radius: 999px; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.nav-call:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.burger { display: none; flex-direction: column; gap: 5px; border: 0; background: transparent; cursor: pointer; padding: .4rem; }
.burger span { width: 22px; height: 2.5px; background: var(--blue); border-radius: 3px; transition: transform .25s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff; padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 7rem);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 70px;
  background: var(--cream);
  -webkit-mask: radial-gradient(60px 70px at 50% 0, transparent 68%, #000 70%) repeat-x;
  mask: radial-gradient(60px 70px at 50% 0, transparent 68%, #000 70%) repeat-x;
  -webkit-mask-size: 120px 70px; mask-size: 120px 70px;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero .w1 { top: 12%; right: 30%; }
.hero .w2 { bottom: 24%; left: 2%; transform: rotate(8deg); }
.hero .s1 { top: 16%; left: 46%; font-size: 1.8rem; }
.hero .s2 { bottom: 30%; right: 46%; }
.hero .s3 { top: 60%; left: 3%; font-size: 1.1rem; }
.hero .s4 { top: 6%; right: 8%; font-size: 2rem; }

.hero-title { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1.12; }
.hero-title em { display: block; font-style: normal; color: var(--yellow); }
.hero-lede { color: rgba(255,255,255,.85); max-width: 46ch; margin-top: 1.1rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1.9rem; }
.hero-chips li { font-size: .9rem; color: rgba(255,255,255,.9); }

/* Hero visual — รูปอาหารในกรอบวงกลม เส้นทอง */
.hero-visual { position: relative; height: clamp(300px, 40vw, 460px); }
.hero-photo {
  position: absolute; inset: 0; margin: auto;
  width: min(100%, 440px); aspect-ratio: 1 / 1;
  background: #fff; padding: 12px;
  border: 3px solid var(--yellow-dark);
  border-radius: 50%;
  box-shadow: 0 22px 40px rgba(10, 22, 55, .34), 0 4px 10px rgba(10, 22, 55, .18);
  animation: floaty 6s ease-in-out infinite;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.hero-emoji { position: absolute; filter: drop-shadow(0 10px 16px rgba(26,44,94,.28)); animation: bob 5s ease-in-out infinite; }
.hero-emoji.e2 { font-size: clamp(2.4rem, 5vw, 3.6rem); top: 6%; right: 4%; animation-delay: -2s; z-index: 3; }
.hero-emoji.e3 { font-size: clamp(2rem, 4.4vw, 3rem); bottom: 6%; left: 2%; animation-delay: -3.4s; z-index: 3; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-16px) rotate(4deg); } }

/* Marquee */
.marquee { background: var(--yellow); overflow: hidden; padding: .7rem 0; border-bottom: 3px solid var(--yellow-dark); }
.marquee-track { display: flex; gap: 2.5rem; width: max-content; animation: scroll 22s linear infinite; }
.marquee-track span { font-family: var(--font-head); font-weight: 500; color: var(--blue-deep); font-size: 1rem; white-space: nowrap; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Sections */
.section { position: relative; padding: clamp(3.2rem, 6vw, 5.5rem) 0; }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto clamp(2rem, 4vw, 3rem); }
.section-head h2 { color: var(--blue); }
.section-sub { color: var(--ink-soft); margin-top: .6rem; }
.on-blue { color: #fff !important; }
.on-blue-soft { color: rgba(255,255,255,.82); }

/* Product grid — โปสเตอร์เต็มใบ 2 คอลัมน์ */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow); }
.card-media {
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden;
}
/* contain = ไม่ครอปตัดข้อความ · พื้นการ์ดตั้งเป็นสีน้ำเงินของรูปแต่ละใบ (inline) จึงกลืนไร้ขอบ */
.card-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: 1rem 1.2rem;
}
.price { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; color: var(--blue); }
.price small { font-family: var(--font-body); font-weight: 400; font-size: .7rem; color: var(--ink-soft); }
.card-btn {
  display: inline-flex; align-items: center; gap: .3rem; font-family: var(--font-head); font-weight: 500; font-size: .82rem;
  background: var(--yellow); color: var(--blue-deep); border: 0; border-radius: 999px; padding: .45rem 1rem; cursor: pointer;
  transition: transform .18s, background .18s;
}
.card-btn:hover { background: #ffd777; transform: translateY(-2px); }

/* Why (blue section) */
.section-blue { background: linear-gradient(160deg, var(--blue) 0%, var(--blue-deep) 100%); color: #fff; }
.section-blue .s5 { top: 14%; left: 8%; font-size: 1.6rem; }
.section-blue .s6 { bottom: 18%; right: 10%; font-size: 1.2rem; }

/* Factory video — คลิป TikTok แนวตั้งในกรอบมือถือ ขอบทอง (ล้อกรอบวงกลมใน hero) */
.section-video {
  background: linear-gradient(170deg, #24407f 0%, var(--blue-deep) 100%);
  color: #fff; overflow: hidden;
}
.section-video .s7 { top: 12%; right: 7%; font-size: 1.6rem; }
.section-video .s8 { bottom: 14%; left: 6%; font-size: 1.2rem; }
.video-layout {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.video-copy h2 {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.15; margin: .9rem 0 .8rem;
}
.video-copy > p { max-width: 46ch; }
.video-points { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .6rem; }
.video-points li { position: relative; padding-left: 1.9rem; color: rgba(255,255,255,.92); }
.video-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--yellow); font-weight: 700;
}
.video-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }
.video-frame {
  justify-self: center; width: min(100%, 325px); aspect-ratio: 325 / 740;
  background: #fff; padding: 10px;
  border: 3px solid var(--yellow-dark); border-radius: 34px;
  box-shadow: 0 24px 44px rgba(6, 14, 38, .5), 0 4px 12px rgba(6, 14, 38, .34);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 24px; display: block; }
@media (max-width: 900px) {
  .video-layout { grid-template-columns: 1fr; }
  .video-copy { text-align: center; }
  .video-copy > p { margin-inline: auto; }
  .video-points { max-width: 21rem; margin-inline: auto; justify-items: start; }
  .video-cta { justify-content: center; }
}
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.why-card {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius); padding: 2rem 1.6rem; text-align: center;
  transition: transform .25s, background .25s;
}
.why-card:hover { transform: translateY(-6px); background: rgba(255,255,255,.13); }
.why-emoji { display: inline-grid; place-items: center; width: 66px; height: 66px; font-size: 2rem; background: var(--yellow); border-radius: 20px; margin-bottom: 1rem; }
.why-card h3 { color: #fff; font-size: 1.4rem; }
.why-card p { color: rgba(255,255,255,.8); font-size: .92rem; margin-top: .4rem; }

/* Info cards */
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.info-card { border-radius: var(--radius); padding: 1.9rem 1.6rem; border: 1px solid var(--line); background: #fff; transition: transform .25s, box-shadow .25s; }
.info-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.info-card.tint-blue { background: #eef2ff; border-color: #dbe3ff; }
.info-card.tint-yellow { background: #fff6e2; border-color: #ffe9bd; }
.info-card.tint-pink { background: #ffeef1; border-color: #ffd9df; }
.info-emoji { display: inline-grid; place-items: center; width: 52px; height: 52px; font-size: 1.5rem; background: #fff; border-radius: 15px; box-shadow: var(--shadow-sm); margin-bottom: 1rem; }
.info-card h3 { color: var(--blue); }
.info-card p { color: var(--ink-soft); font-size: .92rem; margin-top: .4rem; }
.info-link { display: inline-block; margin-top: 1rem; font-family: var(--font-head); font-weight: 500; font-size: .9rem; color: var(--blue); border-bottom: 3px solid var(--yellow); }
.info-link:hover { color: var(--yellow-dark); }

/* Map embed */
.map-embed {
  position: relative; margin-top: 1.75rem;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  aspect-ratio: 16 / 8;
}
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-open {
  position: absolute; right: 1rem; bottom: 1rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-head); font-weight: 500; font-size: .85rem;
  background: var(--yellow); color: var(--blue-deep);
  padding: .55rem 1.1rem; border-radius: 999px; box-shadow: var(--shadow);
  transition: transform .18s, background .18s;
}
.map-open:hover { background: #ffd777; transform: translateY(-2px); }
@media (max-width: 620px) { .map-embed { aspect-ratio: 4 / 3; } }

/* CTA */
.section-cta { background: linear-gradient(160deg, var(--blue-dark), var(--blue-deep)); color: #fff; text-align: center; overflow: hidden; }
.section-cta .w3 { top: 18%; left: 8%; transform: rotate(-6deg); }
.section-cta .s7 { top: 22%; right: 12%; font-size: 1.8rem; }
.cta-inner { position: relative; display: grid; justify-items: center; gap: .5rem; }
.cta-emoji { font-size: 3rem; animation: bob 5s ease-in-out infinite; }
.section-cta h2 { color: #fff; margin-top: .5rem; }
.section-cta > .wrap > .cta-inner > p { color: rgba(255,255,255,.8); max-width: 46ch; }
.cta-inner .btn { margin-top: 1rem; }
.cta-hours { font-size: .85rem; color: rgba(255,255,255,.6); margin-top: 1rem; }

/* Footer */
.footer { background: var(--blue-deep); color: #fff; padding: 2.5rem 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: .9rem; }
.footer-brand strong { font-family: var(--font-head); }
.footer-logo-chip { display: grid; place-items: center; background: #fff; border-radius: 16px; padding: 8px 10px; box-shadow: var(--shadow-sm); }
.footer-logo-chip img { height: 46px; width: auto; display: block; }
.footer .muted { color: rgba(255,255,255,.6); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 360px; margin-inline: auto; width: 100%; }
}
@media (min-width: 621px) {
  /* จำนวนสินค้าคี่ -> ใบสุดท้ายอยู่กึ่งกลางแถว ไม่โดดซ้าย */
  .grid .card:last-child:nth-child(odd) {
    grid-column: 1 / -1; justify-self: center;
    width: calc(50% - .875rem);
  }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .burger { display: flex; }
  .nav-call { display: none; }
  .nav-links {
    position: fixed; inset: 74px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1.25rem;
    box-shadow: var(--shadow); display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .nav-links a::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
