:root { --c: #e11d48; --bg: #fafafa; --card: #fff; --text: #1f2937; --muted: #6b7280; --line: #e5e7eb; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Noto Sans Thai", "Sukhumvit Set", system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.55; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 16px; }
h2 { margin: 0 0 18px; font-size: 1.4rem; }

.announce { background: var(--c); color: #fff; text-align: center; padding: 8px 12px; font-size: .9rem; }
.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand img { height: 34px; width: auto; }
.cart-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 1rem; cursor: pointer; }
.cart-btn span { background: var(--c); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .8rem; margin-left: 4px; }

.btn { display: inline-block; background: var(--c); color: #fff; border: 0; border-radius: 10px; padding: 12px 22px; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { filter: brightness(.93); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { display: block; width: 100%; }
.btn.ghost { background: #fff; color: var(--c); border: 1px solid var(--c); }

.hero { max-width: 1080px; margin: 0 auto; padding: 40px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.2; margin: 0 0 12px; }
.hero p { font-size: 1.1rem; color: var(--muted); margin: 0 0 22px; }
/* full-width banner: image edge-to-edge at its natural ratio (never cropped), text below */
.hero.full { max-width: none; padding: 0 0 28px; display: flex; flex-direction: column; text-align: center; gap: 0; }
.hero.full img { order: -1; width: 100%; height: auto; max-height: none; border-radius: 0; object-fit: initial; }
.hero.full .hero-text { width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px 0; }
.hero.full .hero-btns { justify-content: center; }
.hero.full h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
/* overlay: text sits on the bottom of the banner over a dark gradient (stacks below it on phones) */
.hero.overlay { max-width: none; padding: 0; display: block; position: relative; text-align: center; }
.hero.overlay img { width: 100%; height: auto; max-height: none; border-radius: 0; object-fit: initial; }
.hero.overlay .hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 16px 30px; background: linear-gradient(to top, rgba(0,0,0,.68), rgba(0,0,0,0)); }
.hero.overlay h1, .hero.overlay p { color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.55); }
.hero.overlay h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); } .hero.overlay p { margin-bottom: 16px; }
.hero.overlay .hero-btns { justify-content: center; }
/* reverse: image on the left, text on the right */
.hero.reverse img { order: -1; }
/* no title/subtitle/buttons → show the image only */
.hero.no-text .hero-text { display: none; }
.hero.no-text:not(.full):not(.overlay) { grid-template-columns: 1fr; }
.hero.full.no-text { padding-bottom: 0; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero:has(img[hidden]) .hero-btns, .hero-btns[hidden] { justify-content: center; }
.hero-btns[hidden] { display: none; }
/* never crop the banner: keep its natural ratio at any width */
.hero img { border-radius: 18px; width: 100%; height: auto; max-height: none; object-fit: contain; }
.hero:has(img[hidden]) { grid-template-columns: 1fr; text-align: center; }

.features { max-width: 1080px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.feature .ic { font-size: 1.8rem; } .feature b { display: block; margin: 6px 0 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card .img { aspect-ratio: 1; background: #f3f4f6 center/cover; display: grid; place-items: center; font-size: 3rem; color: #d1d5db; position: relative; }
.card .badge { position: absolute; top: 10px; left: 10px; background: var(--c); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 1.02rem; }
.card .desc { color: var(--muted); font-size: .88rem; white-space: pre-line; flex: 1; }
.price { font-size: 1.25rem; font-weight: 700; color: var(--c); }
.price s { color: var(--muted); font-weight: 400; font-size: .9rem; margin-left: 6px; }

details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; } details p { margin: 8px 0 0; color: var(--muted); white-space: pre-line; }

.foot { text-align: center; padding: 30px 16px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 20px; font-size: .9rem; }
.foot a { color: var(--c); }
.foot #contact { display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.foot a.line-link { display: inline-flex; align-items: center; gap: 8px; color: #06a847; font-weight: 600; text-decoration: none; background: #fff; border: 1px solid #06C755; border-radius: 999px; padding: 4px 14px 4px 5px; }
.foot a.line-link:hover { background: #06C755; color: #fff; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); background: #fff; z-index: 40; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s; }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.x { border: 0; background: none; font-size: 1.2rem; cursor: pointer; padding: 4px 8px; }
.cart-items { flex: 1; overflow: auto; padding: 8px 16px; }
.ci { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ci .thumb { width: 56px; height: 56px; border-radius: 8px; background: #f3f4f6 center/cover; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
.qty button { border: 0; background: none; width: 28px; height: 28px; cursor: pointer; font-size: 1rem; }
.qty span { min-width: 26px; text-align: center; }
.rm { border: 0; background: none; color: var(--muted); cursor: pointer; }
.drawer-foot { padding: 14px 16px; border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; margin: 4px 0; }
.row.total { font-weight: 700; font-size: 1.1rem; margin: 8px 0; }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 12px; overflow: auto; }
.modal[hidden], .overlay[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 16px; width: min(480px, 100%); padding: 0 18px 18px; max-height: 96vh; overflow: auto; }
.modal-card .drawer-head { margin: 0 -18px 12px; }
.modal-card.center { padding: 28px 22px; text-align: center; }
label { display: block; margin: 10px 0; font-size: .9rem; font-weight: 600; }
input, textarea, select { width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--c); outline-offset: -1px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; padding: 8px 12px; }
fieldset label { font-weight: 500; margin: 6px 0; display: flex; gap: 8px; align-items: center; }
fieldset input { width: auto; margin: 0; }
.err { color: #dc2626; font-size: .9rem; min-height: 1.2em; margin: 6px 0; }
.check { width: 64px; height: 64px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 2rem; display: grid; place-items: center; margin: 0 auto 10px; }
.note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 12px; margin: 12px 0; text-align: left; white-space: pre-line; }

.click { cursor: pointer; } .card h3.click:hover { color: var(--c); }
.card .desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.card .btns .btn { padding: 10px 8px; font-size: .92rem; }

.pd-card { width: min(860px, 100%); }
.pd-body { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 4px 0 6px; }
.pd-media { position: relative; background: #f3f4f6; border-radius: 12px; overflow: hidden; align-self: start; aspect-ratio: 1; display: grid; place-items: center; }
.pd-media img { width: 100%; height: 100%; object-fit: contain; }
.pd-ph { font-size: 4rem; color: #d1d5db; }
.pd-media .badge { position: absolute; top: 12px; left: 12px; background: var(--c); color: #fff; font-size: .85rem; padding: 3px 10px; border-radius: 999px; }
.pd-info h3 { margin: 0 0 8px; font-size: 1.3rem; line-height: 1.35; }
.price.big { font-size: 1.7rem; margin-bottom: 4px; }
.pd-desc { margin: 14px 0; white-space: pre-line; color: #374151; max-height: 38vh; overflow: auto; padding-right: 4px; }
.pd-actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; align-items: center; position: sticky; bottom: 0; background: #fff; padding-top: 8px; }
.qty.big { margin: 0; } .qty.big button { width: 36px; height: 40px; font-size: 1.2rem; } .qty.big span { min-width: 32px; }

@media (max-width: 720px) {
  .pd-body { grid-template-columns: 1fr; gap: 14px; }
  .pd-media { aspect-ratio: auto; max-height: 360px; }
  .pd-media img { max-height: 360px; }
  .pd-desc { max-height: none; }
  .pd-actions { grid-template-columns: 1fr 1fr; } .pd-actions .qty { grid-column: 1 / -1; justify-self: start; }
}
[hidden] { display: none !important; } /* .btn / .block set display and would otherwise override the hidden attribute */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }
label.btn { position: relative; cursor: pointer; user-select: none; }
.btn.busy { opacity: .6; pointer-events: none; }
.slip-msg { margin: 8px 0; font-size: .92rem; } .slip-msg.ok { color: #059669; } .slip-msg.bad { color: #dc2626; }
/* ---- member area ---- */
.top-right { display: flex; gap: 8px; align-items: center; }
.acct-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-btn:hover { border-color: var(--c); }
button.link { border: 0; background: none; color: var(--c); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
label.chk { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 8px 0; }
label.chk input { width: auto; margin: 0; }
.acct-hint { background: #f3f4f6; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 10px 0; }
.acct-hint.ok { background: #ecfdf5; color: #065f46; }
.acct-card { width: min(560px, 100%); }
.acct-body { padding-bottom: 6px; }
.tabs { display: flex; gap: 6px; margin: 4px 0 12px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; font: inherit; padding: 10px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--c); border-bottom-color: var(--c); font-weight: 600; }
.acct-who { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 6px; }
.acct-form h4 { margin: 18px 0 0; }
.acct-form label { margin: 8px 0; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.danger, .btn.ghost.danger { color: #dc2626; border-color: #dc2626; }
.ord, .addr { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.ord-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ord ul { margin: 8px 0; padding-left: 18px; }
.ord-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.btns-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pre { white-space: pre-line; }
.center-t { text-align: center; padding: 20px 0; }
.ok-t { color: #059669; min-height: 1.1em; margin: 6px 0; font-size: .9rem; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #e5e7eb; }
.tag.green { background: #dcfce7; color: #166534; } .tag.red { background: #fee2e2; color: #991b1b; }
.tag.amber { background: #fef3c7; color: #92400e; } .tag.blue { background: #dbeafe; color: #1e40af; }
@media (max-width: 480px) { .acct-btn { padding: 8px 10px; max-width: 120px; } .top { padding: 10px 10px; } }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; text-align: center; } .hero-btns { justify-content: center; }
  .hero.overlay { padding-bottom: 24px; }
  .hero.overlay .hero-text { position: static; background: none; padding: 22px 16px 0; }
  .hero.overlay h1 { color: var(--text); text-shadow: none; } .hero.overlay p { color: var(--muted); text-shadow: none; }
}
