/* Siam Delicious — โทนอบอุ่นแบบ themalamarket.com แต่ใช้สีแบรนด์เรา */
:root{
  --brown:#3D2314; --red:#D4342A; --yellow:#F5C518; --green:#2D8B4E;
  --cream:#FFF8F0; --line:#E8DCCB; --muted:#8A7461; --ink:#2B1A0F;
  --wrap:1200px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:'Sarabun',system-ui,sans-serif; color:var(--ink); background:#fff;
  font-size:16px; line-height:1.7; -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4,.logo-text{font-family:'Kanit',sans-serif; font-weight:600; line-height:1.25; color:var(--brown)}
a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}
.wrap{max-width:var(--wrap); margin:0 auto; padding:0 20px}

/* ── header ─────────────────────────────────────────── */
.announce{background:var(--brown); color:var(--cream); text-align:center; font-size:13px; padding:9px 16px}
.site-header{position:sticky; top:0; z-index:50; background:#fff; border-bottom:1px solid var(--line)}
.header-inner{display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:16px; padding:14px 20px}
.logo{display:flex; flex-direction:column; align-items:center; gap:4px}
.logo img{height:52px; width:auto}
.logo-text{font-size:15px; letter-spacing:2.5px; color:var(--brown)}
.nav{display:flex; align-items:center; gap:20px; font-size:14px}
.nav-right{justify-content:flex-end}
.nav a{padding:6px 0; border-bottom:1.5px solid transparent; transition:.15s; white-space:nowrap}
.nav a:hover{border-color:var(--red); color:var(--red)}
.has-sub{position:relative}
.submenu{
  position:absolute; top:100%; left:-14px; background:#fff; border:1px solid var(--line);
  border-radius:10px; padding:8px 0; min-width:210px; display:none; box-shadow:0 12px 30px rgba(61,35,20,.12)
}
.has-sub:hover .submenu{display:block}
.submenu a{display:block; padding:9px 18px; border:0}
.submenu a:hover{background:var(--cream)}
.cart-link{font-weight:600}
.cart-count{
  display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 6px;
  background:var(--red); color:#fff; border-radius:999px; font-size:12px; margin-left:2px
}
.burger{display:none; background:none; border:0; font-size:22px; cursor:pointer; color:var(--brown)}

/* ── ปุ่ม / ฟอร์ม ────────────────────────────────────── */
.btn,.btn-ghost,.btn-dark{
  display:inline-block; border:0; border-radius:999px; padding:13px 30px; cursor:pointer;
  font-family:'Kanit',sans-serif; font-size:15px; font-weight:500; text-align:center; transition:.15s
}
.btn{background:var(--red); color:#fff}
.btn:hover{background:#b52b22}
.btn-dark{background:var(--brown); color:var(--yellow)}
.btn-dark:hover{background:#291609}
.btn-ghost{background:#fff; color:var(--brown); border:1.5px solid var(--brown)}
.btn-ghost:hover{background:var(--cream)}
.btn-full{width:100%}
input,select,textarea{
  width:100%; font-family:'Sarabun',sans-serif; font-size:15px; padding:12px 14px;
  border:1.5px solid var(--line); border-radius:10px; background:#fff; color:var(--ink)
}
input:focus,select:focus,textarea:focus{outline:0; border-color:var(--brown)}
label{display:block; font-size:14px; font-weight:500; margin:0 0 6px; color:var(--brown)}
.field{margin-bottom:16px}
.field-row{display:grid; grid-template-columns:1fr 1fr; gap:16px}
.hint{font-size:13px; color:var(--muted); margin:6px 0 0}

/* ── flash ──────────────────────────────────────────── */
.flashes{padding-top:16px}
.flash{padding:12px 16px; border-radius:10px; font-size:14px; margin-bottom:10px}
.flash-ok{background:#E9F6EE; color:#1c6b39; border:1px solid #BFE4CD}
.flash-error{background:#FDECEB; color:#9c241c; border:1px solid #F5C4C0}

/* ── hero ───────────────────────────────────────────── */
.hero{background:var(--cream); border-bottom:1px solid var(--line)}
.hero-inner{display:grid; grid-template-columns:1.05fr .95fr; gap:48px; align-items:center; padding:64px 20px}
.hero .eyebrow{font-family:'Kanit',sans-serif; font-size:13px; letter-spacing:2px; color:var(--red); text-transform:uppercase; margin:0 0 14px}
.hero h1{font-size:44px; margin:0 0 16px}
.hero p{font-size:17px; color:#5a4536; margin:0 0 26px; max-width:46ch}
.hero-img{border-radius:18px; overflow:hidden; box-shadow:0 20px 50px rgba(61,35,20,.18)}

/* ── section ────────────────────────────────────────── */
section{padding:60px 0}
.section-head{text-align:center; max-width:720px; margin:0 auto 36px}
.section-head h2{font-size:30px; margin:0 0 10px}
.section-head p{color:var(--muted); margin:0}

/* ── grid หมวดหมู่ ──────────────────────────────────── */
.cat-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:20px}
.cat-card{position:relative; border-radius:16px; overflow:hidden; aspect-ratio:3/4; background:var(--cream)}
.cat-card img{width:100%; height:100%; object-fit:cover; transition:.4s}
.cat-card:hover img{transform:scale(1.05)}
.cat-card span{
  position:absolute; left:0; right:0; bottom:0; padding:34px 16px 16px; color:#fff;
  font-family:'Kanit',sans-serif; font-weight:500; font-size:16px;
  background:linear-gradient(transparent,rgba(43,26,15,.85))
}

/* ── การ์ดสินค้า ────────────────────────────────────── */
.product-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:28px}
.product-card{display:flex; flex-direction:column}
.product-card .thumb{position:relative; border-radius:14px; overflow:hidden; background:var(--cream); aspect-ratio:1}
.product-card .thumb img{width:100%; height:100%; object-fit:cover; transition:.4s}
.product-card:hover .thumb img{transform:scale(1.04)}
.badge{
  position:absolute; top:12px; left:12px; background:var(--yellow); color:var(--brown);
  font-family:'Kanit',sans-serif; font-size:12px; font-weight:500; padding:5px 12px; border-radius:999px
}
.product-card h3{font-size:17px; margin:14px 0 4px}
.product-card .sub{font-size:14px; color:var(--muted); margin:0 0 8px; min-height:42px}
.price{font-family:'Kanit',sans-serif; font-weight:600; color:var(--brown)}
.price s{color:var(--muted); font-weight:400; margin-right:8px}
.price .sale{color:var(--red)}

/* ── หน้าสินค้า ─────────────────────────────────────── */
.pdp{display:grid; grid-template-columns:1fr 1fr; gap:56px; padding:44px 0}
.pdp-img{border-radius:18px; overflow:hidden; background:var(--cream)}
.pdp h1{font-size:34px; margin:6px 0 10px}
.pdp .sub{font-size:17px; color:var(--muted); margin:0 0 18px}
.pdp .price{font-size:26px; margin:0 0 22px}
.qty-row{display:flex; gap:12px; align-items:center; margin-bottom:20px}
.qty-row input{width:88px; text-align:center}
.spec{border-top:1px solid var(--line); margin-top:26px; padding-top:20px; font-size:15px}
.spec dt{font-weight:600; color:var(--brown); font-size:14px}
.spec dd{margin:0 0 14px; color:#5a4536}
.crumb{font-size:13px; color:var(--muted); padding:18px 0 0}
.crumb a:hover{color:var(--red)}

/* ── ตะกร้า / checkout ──────────────────────────────── */
.two-col{display:grid; grid-template-columns:1.6fr .9fr; gap:40px; align-items:start; padding:36px 0 70px}
.panel{border:1px solid var(--line); border-radius:16px; padding:24px; background:#fff}
.panel h2{font-size:20px; margin:0 0 18px}
.summary{background:var(--cream); position:sticky; top:96px}
.line{display:flex; justify-content:space-between; gap:12px; padding:8px 0; font-size:15px}
.line.total{border-top:1px solid var(--line); margin-top:8px; padding-top:14px; font-size:19px; font-weight:600}
.line.total .amt{color:var(--red); font-family:'Kanit',sans-serif}
.cart-row{display:grid; grid-template-columns:96px 1fr auto; gap:18px; padding:18px 0; border-bottom:1px solid var(--line)}
.cart-row img{width:96px; height:96px; object-fit:cover; border-radius:12px}
.cart-row .title{font-family:'Kanit',sans-serif; font-weight:500}
.mini-form{display:flex; gap:8px; align-items:center; margin-top:8px}
.mini-form input{width:70px; padding:7px 8px; text-align:center}
.mini-form button{background:none; border:0; color:var(--muted); font-size:13px; cursor:pointer; text-decoration:underline; padding:0}
.mini-form button:hover{color:var(--red)}
.empty{text-align:center; padding:70px 20px}
.empty h2{font-size:26px}

/* ── บล็อกเนื้อหา ───────────────────────────────────── */
.story{background:var(--cream)}
.story-inner{display:grid; grid-template-columns:1fr 1fr; gap:48px; align-items:center}
.story h2{font-size:30px; margin:0 0 14px}
.story p{color:#5a4536; margin:0 0 14px}
.quote{border-left:3px solid var(--yellow); padding:6px 0 6px 20px; font-size:17px; color:var(--brown); font-style:italic}
.prose{max-width:760px; margin:0 auto; padding:46px 20px 70px}
.prose h1{font-size:34px; margin:0 0 8px}
.prose h2{font-size:22px; margin:34px 0 10px}
.prose p,.prose li{color:#3f2e22}
.prose .updated{color:var(--muted); font-size:14px; margin:0 0 26px}
.prose .placeholder{background:#FFF6D8; border:1px dashed var(--yellow); padding:2px 8px; border-radius:6px; font-size:14px}
.note-box{background:var(--cream); border:1px solid var(--line); border-radius:14px; padding:18px 20px; margin:26px 0; font-size:15px}

/* ── news / recipes ─────────────────────────────────── */
.post-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:28px}
.post-card .thumb{border-radius:14px; overflow:hidden; aspect-ratio:4/3; background:var(--cream)}
.post-card h3{font-size:18px; margin:14px 0 6px}
.post-card p{font-size:14px; color:var(--muted); margin:0 0 8px}
.post-card .more{font-size:14px; color:var(--red); font-weight:600}

/* ── auth / account ─────────────────────────────────── */
.auth{max-width:440px; margin:0 auto; padding:52px 20px 80px}
.auth h1{font-size:30px; margin:0 0 8px; text-align:center}
.auth .lede{text-align:center; color:var(--muted); margin:0 0 28px}
.auth .alt{text-align:center; margin-top:20px; font-size:14px; color:var(--muted)}
.auth .alt a{color:var(--red); font-weight:600}
.account-grid{display:grid; grid-template-columns:1fr 1.25fr; gap:32px; align-items:start; padding:36px 0 80px}
.order-card{border:1px solid var(--line); border-radius:14px; padding:18px; margin-bottom:16px}
.order-card .head{display:flex; justify-content:space-between; gap:12px; align-items:baseline; margin-bottom:10px}
.order-card .no{font-family:'Kanit',sans-serif; font-weight:600}
.status{font-size:12px; padding:4px 12px; border-radius:999px; font-weight:600}
.status-paid{background:#E9F6EE; color:#1c6b39}
.status-pending{background:#FFF3D6; color:#8a6100}
.status-failed{background:#FDECEB; color:#9c241c}
.order-items{font-size:14px; color:#5a4536}

/* ── thank you ──────────────────────────────────────── */
.thanks{max-width:640px; margin:0 auto; padding:60px 20px 90px; text-align:center}
.thanks .tick{width:64px; height:64px; border-radius:50%; background:var(--green); color:#fff; display:grid; place-items:center; font-size:32px; margin:0 auto 20px}
.thanks h1{font-size:32px; margin:0 0 10px}
.thanks .box{text-align:left; border:1px solid var(--line); border-radius:16px; padding:24px; margin:28px 0}

/* ── footer ─────────────────────────────────────────── */
.site-footer{background:var(--brown); color:#E6D9C9; margin-top:20px; padding:56px 0 26px; font-size:14px}
.site-footer h3,.site-footer h4{color:#fff}
.newsletter{text-align:center; max-width:520px; margin:0 auto 46px}
.newsletter h3{font-size:23px; margin:0 0 8px}
.newsletter p{margin:0 0 18px; color:#C9B7A3}
.news-form{display:flex; gap:10px}
.news-form input{border:0; border-radius:999px; padding:13px 20px}
.news-form button{
  background:var(--yellow); color:var(--brown); border:0; border-radius:999px; padding:13px 26px;
  font-family:'Kanit',sans-serif; font-weight:500; cursor:pointer; white-space:nowrap
}
.foot-cols{display:grid; grid-template-columns:repeat(4,1fr); gap:28px; border-top:1px solid rgba(255,255,255,.15); padding-top:36px}
.foot-cols h4{font-size:15px; margin:0 0 14px}
.foot-cols a{display:block; padding:5px 0; color:#C9B7A3}
.foot-cols a:hover{color:var(--yellow)}
.foot-cols p{margin:0; color:#C9B7A3}
.foot-bottom{
  display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap;
  border-top:1px solid rgba(255,255,255,.15); margin-top:34px; padding-top:20px; color:#A08D79; font-size:13px
}

/* ── cookie banner ──────────────────────────────────── */
.cookie-banner{
  position:fixed; left:16px; right:16px; bottom:16px; z-index:100; background:#fff;
  border:1px solid var(--line); border-radius:16px; padding:20px 24px; display:flex; gap:24px;
  align-items:center; justify-content:space-between; box-shadow:0 18px 50px rgba(61,35,20,.22); flex-wrap:wrap
}
/* ต้องมีบรรทัดนี้: display:flex ด้านบนมีน้ำหนักมากกว่ากฎ [hidden] ของเบราว์เซอร์
   ถ้าไม่มี แบนเนอร์จะไม่ยอมหายตอน JS ใส่ attribute hidden */
.cookie-banner[hidden]{display:none}
.cookie-banner p{margin:6px 0 0; font-size:14px; color:#5a4536; max-width:70ch}
.cookie-banner a{color:var(--red); text-decoration:underline}
.cookie-actions{display:flex; gap:10px; flex-wrap:wrap}
.cookie-actions .btn,.cookie-actions .btn-ghost{padding:11px 22px; font-size:14px}

/* ── mobile ─────────────────────────────────────────── */
@media (max-width:900px){
  .hero-inner,.pdp,.two-col,.story-inner,.account-grid{grid-template-columns:1fr; gap:28px}
  .hero h1{font-size:32px}
  .cat-grid{grid-template-columns:repeat(2,1fr)}
  .product-grid,.post-grid{grid-template-columns:repeat(2,1fr)}
  .header-inner{grid-template-columns:auto 1fr auto; padding:12px 16px}
  .burger{display:block}
  .nav-left{display:none}
  .nav-right a:not(.cart-link){display:none}
  .logo{align-items:flex-start}
  body.nav-open .nav-left{
    display:flex; flex-direction:column; align-items:flex-start; gap:6px; position:absolute;
    top:100%; left:0; right:0; background:#fff; border-bottom:1px solid var(--line); padding:14px 20px
  }
  body.nav-open .submenu{display:block; position:static; border:0; box-shadow:none; padding:0 0 0 14px}
  .foot-cols{grid-template-columns:repeat(2,1fr)}
  .summary{position:static}
}
@media (max-width:560px){
  .product-grid,.post-grid,.field-row{grid-template-columns:1fr}
  .cart-row{grid-template-columns:72px 1fr}
  .cart-row img{width:72px; height:72px}
  section{padding:42px 0}
}
