/* ร้านเจ้านาง — storefront styles */
:root {
  --maroon: #4a0f1c; --maroon-2: #6b1a2b; --maroon-3: #8a2a3d;
  --gold: #b98a2e; --gold-2: #d9b25a; --gold-3: #f1dca6;
  --ivory: #fbf7f0; --paper: #fff; --ink: #2b1b1b; --muted: #7b6b68; --line: #eadfce; --line-2: #f3ebdf;
  --ok: #1f7a4d; --warn: #9a5b00; --bad: #b3261e;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 6px 24px rgba(74, 15, 28, .10); --shadow-sm: 0 2px 10px rgba(74, 15, 28, .08);
  --font: 'Prompt', 'Noto Sans Thai', 'Leelawadee UI', Tahoma, system-ui, sans-serif;
  --serif: 'Noto Serif Thai', 'Prompt', 'Leelawadee UI', serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--ivory); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.noscroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: .9em; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 999; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 1.5px solid var(--maroon); background: var(--maroon); color: #fff; font-weight: 500; line-height: 1.2; transition: transform .12s, background .15s, box-shadow .15s; text-align: center; }
.btn:hover { background: var(--maroon-2); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--maroon); }
.btn-ghost:hover { background: #f6ece3; }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); color: #2a1604; }
.btn-gold:hover { background: linear-gradient(180deg, #e3bd68, #c4962f); }
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); }
.btn-sm { padding: 7px 14px; font-size: .88rem; }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-block { display: flex; width: 100%; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 50%; color: inherit; display: inline-grid; place-items: center; position: relative; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:hover { background: rgba(0, 0, 0, .05); }

/* topbar + header */
.topbar { background: var(--maroon); color: var(--gold-3); font-size: .82rem; }
.topbar .wrap { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 6px; padding-bottom: 6px; text-align: center; flex-wrap: wrap; }
.topbar svg { width: 16px; height: 16px; }
.topbar i { opacity: .5; font-style: normal; }
.hdr { background: var(--paper); position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0, 0, 0, .02); }
.hdr-row { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.menu-btn { display: none; }
.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo-mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(145deg, var(--maroon), var(--maroon-3)); color: var(--gold-2); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1; box-shadow: inset 0 0 0 1.5px var(--gold-2); }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text b { font-family: var(--serif); font-size: 1.45rem; color: var(--maroon); letter-spacing: .02em; }
.logo-text small { font-size: .68rem; color: var(--muted); letter-spacing: .01em; }
.search { flex: 1; display: flex; max-width: 640px; margin: 0 auto; background: #f6efe5; border: 1.5px solid transparent; border-radius: 999px; overflow: hidden; transition: border-color .15s, background .15s; }
.search:focus-within { background: #fff; border-color: var(--gold); }
.search input { flex: 1; border: 0; background: transparent; padding: 11px 18px; min-width: 0; outline: none; }
.search button { border: 0; background: var(--maroon); color: #fff; padding: 0 18px; display: grid; place-items: center; }
.search button svg { width: 20px; height: 20px; }
.cart-btn { margin-left: auto; }
.cart-badge { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--gold); color: #2a1604; font-size: 11px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
.catnav { border-top: 1px solid var(--line-2); background: #fff; }
.catnav-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 0; padding-bottom: 0; }
.catnav-row::-webkit-scrollbar { display: none; }
.catnav a { flex: none; padding: 10px 14px; font-size: .92rem; color: #4b3a3a; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.catnav a:hover, .catnav a.on { color: var(--maroon); border-bottom-color: var(--gold); }

/* hero */
.hero { color: #fff; background:
  radial-gradient(1000px 500px at 85% -10%, rgba(217, 178, 90, .28), transparent 60%),
  repeating-linear-gradient(45deg, rgba(241, 220, 166, .045) 0 2px, transparent 2px 16px),
  repeating-linear-gradient(-45deg, rgba(241, 220, 166, .045) 0 2px, transparent 2px 16px),
  linear-gradient(135deg, #3b0a16, #5c1526 55%, #7d2336); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, transparent, var(--gold-2), transparent); }
.hero-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; padding-top: 52px; padding-bottom: 56px; }
.eyebrow { color: var(--gold-3); font-size: .85rem; letter-spacing: .04em; margin: 0 0 14px; }
.hero h1 { font-family: var(--serif); font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.22; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero .lead { color: #f0dfe0; max-width: 520px; margin: 18px 0 26px; font-size: 1.02rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-pics { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: end; }
.hero-pic { border-radius: 18px; overflow: hidden; border: 2px solid var(--gold-2); box-shadow: 0 14px 34px rgba(0, 0, 0, .35); background: #2a0810; aspect-ratio: 3/4.2; }
.hero-pic img { width: 100%; height: 100%; object-fit: cover; }
.hp1 { aspect-ratio: 3/4.8; margin-bottom: 18px; }
.values { background: #fff; border-bottom: 1px solid var(--line); }
.values-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 18px; padding-bottom: 18px; }
.values-row > div { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.values-row svg { grid-row: span 2; width: 34px; height: 34px; color: var(--gold); }
.values-row b { font-size: .95rem; }
.values-row span { font-size: .8rem; color: var(--muted); }

/* sections */
.section { padding-top: 38px; padding-bottom: 8px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sec-head h2 { font-family: var(--serif); font-size: 1.5rem; color: var(--maroon); position: relative; padding-left: 16px; }
.sec-head h2::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 5px; border-radius: 3px; background: linear-gradient(var(--gold-2), var(--gold)); }
.more { display: inline-flex; align-items: center; gap: 2px; color: var(--maroon-2); font-weight: 500; font-size: .92rem; white-space: nowrap; }
.more svg { width: 1em; height: 1em; }
.more:hover { color: var(--gold); }
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.cat-tile { position: relative; aspect-ratio: 4/5; border-radius: var(--r); overflow: hidden; background: #e9dfd0; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; display: block; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cat-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 12px 12px; background: linear-gradient(transparent, rgba(40, 8, 16, .88)); color: #fff; font-weight: 600; display: flex; flex-direction: column; }
.cat-name small { font-weight: 400; opacity: .85; font-size: .78rem; }
.brands { background: linear-gradient(180deg, #f6ede0, #f2e6d4); margin-top: 38px; padding: 38px 0 40px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brands .sec-head { margin-bottom: 20px; }
.brand-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.brand-card { background: #fff; border-radius: var(--r); padding: 24px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; transition: transform .2s, box-shadow .2s; }
.brand-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.brand-card h3 { font-family: var(--serif); font-size: 1.25rem; color: var(--maroon); }
.brand-card p { margin: 0; color: #5d4c4a; font-size: .92rem; }
.brand-card .bt { color: var(--gold); font-weight: 500; }
.brand-card .more { margin-top: auto; padding-top: 10px; }
.brand-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--maroon); color: var(--gold-2); display: grid; place-items: center; margin-bottom: 6px; }
.brand-ic svg { width: 26px; height: 26px; }
.steps { padding: 40px 0 44px; }
.steps-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.steps-row li { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; position: relative; }
.steps-row b { width: 34px; height: 34px; border-radius: 50%; background: var(--maroon); color: var(--gold-2); display: grid; place-items: center; font-family: var(--serif); margin-bottom: 10px; }
.steps-row h3 { font-size: 1.02rem; margin-bottom: 4px; }
.steps-row p { margin: 0; color: var(--muted); font-size: .9rem; }

/* product cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-img { position: relative; display: block; aspect-ratio: 3/4; overflow: hidden; background: #eadfd0; }
.ph { position: absolute; inset: -14px; background-size: cover; background-position: center; filter: blur(16px) saturate(1.15); opacity: .9; }
.card-img img, .cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tag { position: absolute; top: 8px; left: 8px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 500; background: #fff; box-shadow: var(--shadow-sm); }
.tag-low { color: var(--warn); }
.tag-out { background: #333; color: #fff; }
.card.is-out .card-img img { opacity: .55; }
.card-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .code { font-size: .76rem; color: var(--gold); font-weight: 500; letter-spacing: .02em; }
.card .name { font-size: .92rem; font-weight: 500; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .name a:hover { color: var(--maroon-2); }
.price { font-size: 1.2rem; font-weight: 600; color: var(--maroon); }
.card .btn { margin-top: auto; width: 100%; }
.card .price { margin: 2px 0 8px; }
.stock { font-size: .85rem; font-weight: 500; }
.stock.ok { color: var(--ok); } .stock.low { color: var(--warn); } .stock.out { color: var(--bad); }

/* shop */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); padding: 16px 0 6px; }
.crumbs i { font-style: normal; opacity: .5; }
.crumbs a:hover { color: var(--maroon); }
.crumbs span { color: var(--ink); }
.shop-grid { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; padding-bottom: 40px; }
.shop-side { position: sticky; top: 116px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 18px 12px; }
.fp-sec { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.fp-sec:last-child { border-bottom: 0; }
.fp h4 { font-size: .95rem; margin-bottom: 8px; color: var(--maroon); }
.fp-list { list-style: none; margin: 0; padding: 0; }
.fp-list a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; margin: 0 -8px; border-radius: 8px; font-size: .92rem; }
.fp-list a small { color: var(--muted); }
.fp-list a:hover { background: #f8f1e6; }
.fp-list a.on { background: #f3e5c9; color: var(--maroon); font-weight: 600; }
.price-form { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.price-form input { width: 100%; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.chk input { margin-top: 5px; accent-color: var(--maroon); width: 16px; height: 16px; flex: none; }
.shop-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.shop-bar h1 { font-family: var(--serif); font-size: 1.5rem; color: var(--maroon); margin-right: auto; }
.shop-bar .count { color: var(--muted); font-size: .9rem; margin-right: auto; }
.shop-bar h1 + .count { margin-right: 0; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.sort select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.filter-btn { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 14px; border-radius: 999px; background: #f3e5c9; color: var(--maroon); font-size: .85rem; }
.chip svg { width: 14px; height: 14px; }
.chip-clear { font-size: .85rem; color: var(--muted); text-decoration: underline; }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.pager a, .pager .gap { min-width: 40px; height: 40px; padding: 0 12px; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.pager a:hover { border-color: var(--gold); }
.pager a.on { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.pager .gap { border: 0; background: none; }
.brand-banner { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--maroon), var(--maroon-3)); color: #fff; padding: 20px 24px; border-radius: var(--r); margin: 8px 0 18px; }
.brand-banner h1 { font-family: var(--serif); font-size: 1.6rem; }
.brand-banner p { margin: 4px 0 0; color: #f0dfe0; }
.brand-banner .brand-ic { background: rgba(255, 255, 255, .12); margin: 0; flex: none; }
.empty { text-align: center; padding: 56px 16px; background: #fff; border: 1px dashed var(--line); border-radius: var(--r); }
.empty h2 { font-family: var(--serif); color: var(--maroon); margin-bottom: 8px; }
.empty p { color: var(--muted); margin: 0 0 18px; }
.empty.sm { border: 0; padding: 30px 8px; }
.empty-ic svg { width: 56px; height: 56px; color: var(--gold); }

/* product page */
.pdp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 10px 0 20px; align-items: start; }
.pdp-gallery { position: sticky; top: 120px; }
.pdp-img { position: relative; display: block; width: 100%; aspect-ratio: 4/5; max-height: 640px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #eadfd0; padding: 0; cursor: zoom-in; }
.pdp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.img-note { font-size: .8rem; color: var(--muted); margin: 8px 2px 0; }
.pdp-info .code { color: var(--gold); font-weight: 600; letter-spacing: .03em; font-size: .9rem; }
.pdp-info h1 { font-family: var(--serif); font-size: 1.7rem; margin: 4px 0 10px; color: var(--maroon); }
.pdp-price { font-size: 2rem; font-weight: 600; color: var(--maroon); line-height: 1.2; }
.pdp-stock { margin: 4px 0 16px; }
.opt { margin: 16px 0; }
.opt-label { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.opt-label b { color: var(--ink); }
.opt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vchip input { position: absolute; opacity: 0; pointer-events: none; }
.vchip span { display: inline-block; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.vchip input:checked + span { border-color: var(--maroon); background: var(--maroon); color: #fff; }
.vchip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.vchip.dis span { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden; }
.stepper button { width: 42px; height: 42px; border: 0; background: transparent; display: grid; place-items: center; }
.stepper button:hover:not(:disabled) { background: #f6ece3; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper input { width: 56px; text-align: center; border: 0; background: transparent; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper.sm button { width: 32px; height: 32px; }
.stepper.sm svg { width: 16px; height: 16px; }
.stepper .qv { min-width: 30px; text-align: center; font-weight: 500; }
.pdp-cta { display: flex; gap: 12px; margin: 22px 0 18px; }
.pdp-cta .btn { flex: 1; }
.perks { list-style: none; margin: 0 0 20px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); display: grid; gap: 8px; font-size: .9rem; }
.perks li { display: flex; align-items: center; gap: 10px; }
.perks svg { color: var(--gold); }
.pdp-tabs details { border-top: 1px solid var(--line); padding: 4px 0; }
.pdp-tabs details:last-child { border-bottom: 1px solid var(--line); }
.pdp-tabs summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--maroon); list-style: none; display: flex; justify-content: space-between; }
.pdp-tabs summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--gold); }
.pdp-tabs details[open] summary::after { content: '–'; }
.pdp-tabs summary::-webkit-details-marker { display: none; }
.pdp-tabs details > p, .pdp-tabs details > table { margin: 0 0 14px; }
.spec { width: 100%; border-collapse: collapse; font-size: .92rem; }
.spec th { text-align: left; font-weight: 400; color: var(--muted); width: 32%; padding: 6px 0; vertical-align: top; }
.spec td { padding: 6px 0; }
.pdp-bar { display: none; }

/* cart */
.page-h { font-family: var(--serif); font-size: 1.7rem; color: var(--maroon); margin: 6px 0 18px; }
.page-h small { font-family: var(--font); font-size: .95rem; color: var(--muted); font-weight: 400; }
.cart-grid { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; padding-bottom: 44px; }
.cart-lines { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 4px 18px 14px; }
.line { position: relative; display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 14px 30px 14px 0; border-bottom: 1px solid var(--line-2); }
.line:last-of-type { border-bottom: 0; }
.line-img { position: relative; width: 84px; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: #eadfd0; }
.line-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.line-name { font-weight: 500; line-height: 1.35; display: block; }
.line-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.line-total { color: var(--maroon); font-size: 1.05rem; }
.line-del { position: absolute; top: 12px; right: 0; background: none; border: 0; color: var(--muted); padding: 4px; border-radius: 8px; }
.line-del:hover { color: var(--bad); background: #fdeeee; }
.line-del svg { width: 20px; height: 20px; }
.back-link { display: inline-block; margin-top: 12px; color: var(--maroon-2); font-weight: 500; }
.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.summary.sticky { position: sticky; top: 120px; }
.summary h3 { font-family: var(--serif); font-size: 1.15rem; color: var(--maroon); margin-bottom: 12px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: .95rem; }
.sum-row.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; font-size: 1.1rem; font-weight: 600; }
.sum-row.total b { color: var(--maroon); font-size: 1.4rem; }
.summary .btn-block { margin-top: 14px; }
.free-bar { background: #fbf3e0; border: 1px solid #f0e0b6; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: .88rem; }
.free-track { height: 6px; background: #efe0b8; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.free-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-radius: 3px; }

/* checkout */
.co-grid { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; padding-bottom: 50px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.box h2 { font-size: 1.08rem; color: var(--maroon); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.box h2 b { width: 28px; height: 28px; border-radius: 50%; background: var(--maroon); color: var(--gold-2); display: grid; place-items: center; font-size: .9rem; font-family: var(--serif); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f.full { grid-column: 1 / -1; }
.f label { font-size: .88rem; color: #5d4c4a; }
.f label i { color: var(--bad); font-style: normal; }
.f input, .f select, .f textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fffdfa; outline: none; transition: border-color .15s, box-shadow .15s; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185, 138, 46, .18); background: #fff; }
.f.bad input, .f.bad select, .f.bad textarea { border-color: var(--bad); background: #fffafa; }
.err { color: var(--bad); font-size: .82rem; font-style: normal; min-height: 0; }
.err:empty { display: none; }
.pay-opts { display: grid; gap: 10px; }
.pay-opt { display: block; cursor: pointer; }
.pay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pay-in { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fffdfa; transition: border-color .15s, background .15s; }
.pay-opt input:checked + .pay-in { border-color: var(--maroon); background: #fbf1ef; box-shadow: inset 0 0 0 1px var(--maroon); }
.pay-opt input:focus-visible + .pay-in { outline: 2px solid var(--gold); outline-offset: 2px; }
.pay-ic { width: 42px; height: 42px; border-radius: 50%; background: #f3e5c9; color: var(--maroon); display: grid; place-items: center; flex: none; }
.pay-in small { display: block; color: var(--muted); font-size: .84rem; line-height: 1.4; }
#paybox { margin-top: 14px; }
.notice { padding: 12px 14px; border-radius: 10px; background: #eef6f1; border: 1px solid #cfe5d8; color: #1c4d34; font-size: .92rem; }
.notice.warn { background: #fff6e4; border-color: #f1dca6; color: #6b4300; }
.notice.bad { background: #fdeeee; border-color: #f3c4c1; color: #8c1d18; margin-bottom: 10px; }
.notice a { text-decoration: underline; font-weight: 500; }
.checkout > .notice { margin-bottom: 16px; }
.qrbox { display: flex; gap: 18px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 12px; flex-wrap: wrap; }
.qr { width: 180px; flex: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qr svg { width: 100%; height: auto; display: block; stroke: none; }
.qr svg * { stroke: none; }
.qr-amt { font-size: 1.3rem; font-weight: 600; color: var(--maroon); margin: 4px 0; }
.banks { display: grid; gap: 10px; margin-bottom: 12px; }
.bank { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; flex-wrap: wrap; align-items: center; }
.bank-no { display: flex; align-items: center; gap: 10px; }
.bank-no code { font-size: 1.05rem; font-weight: 600; letter-spacing: .04em; font-family: var(--font); }
.slip { margin-top: 12px; }
.slip-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: 1.5px dashed var(--maroon-3); color: var(--maroon); border-radius: 999px; cursor: pointer; font-weight: 500; background: #fff; }
.slip-btn:hover { background: #fbf1ef; }
#slip-prev img { max-width: 180px; max-height: 240px; margin-top: 10px; border-radius: 10px; border: 1px solid var(--line); }
.co-items { max-height: 300px; overflow: auto; margin-bottom: 8px; }
.co-item { position: relative; display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; font-size: .88rem; border-bottom: 1px solid var(--line-2); }
.co-item .ph { position: relative; inset: auto; width: 48px; height: 60px; border-radius: 8px; filter: blur(0); grid-column: 1; grid-row: 1; }
.co-item img { grid-column: 1; grid-row: 1; width: 48px; height: 60px; object-fit: contain; z-index: 1; }
.co-item small { display: block; color: var(--muted); }
.terms { margin: 14px 0 4px; font-size: .86rem; }
.terms a { text-decoration: underline; }
#co-error { margin-top: 10px; }
.done-card { max-width: 620px; margin: 28px auto 50px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; text-align: center; box-shadow: var(--shadow); }
.done-ic { width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 50%; background: #e4f3ea; color: var(--ok); display: grid; place-items: center; }
.done-ic svg { width: 36px; height: 36px; stroke-width: 2.2; }
.done-card h1 { font-family: var(--serif); color: var(--maroon); font-size: 1.7rem; }
.ono { margin: 8px 0 14px; } .ono b { font-size: 1.15rem; letter-spacing: .03em; color: var(--maroon); }
.done-card .notice { text-align: left; margin: 12px 0; }
.done-sum { text-align: left; border: 1px solid var(--line-2); background: #fffdfa; border-radius: 12px; padding: 10px 16px; margin: 16px 0; }
.done-actions { display: flex; flex-direction: column; gap: 10px; }

/* docs */
.doc-body { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 24px 28px; max-width: 820px; margin-bottom: 44px; }
.doc-body h3 { color: var(--maroon); margin: 18px 0 6px; font-size: 1.05rem; }
.doc-list { padding-left: 1.3em; display: grid; gap: 6px; }

/* footer */
.ftr { background: var(--maroon); color: #e9d4d7; margin-top: 30px; }
.ftr-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 28px; padding-top: 38px; padding-bottom: 28px; }
.ftr-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ftr-brand b { font-family: var(--serif); font-size: 1.4rem; color: #fff; }
.ftr h4 { color: var(--gold-2); margin-bottom: 10px; font-size: .98rem; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.ftr p { margin: 0; font-size: .92rem; }
.ftr a:hover { color: #fff; text-decoration: underline; }
/* QR เพิ่มเพื่อน LINE */
.line-qr { display: flex; align-items: center; gap: 12px; margin-top: 14px; width: fit-content; max-width: 100%; text-decoration: none; }
.line-qr img { width: 112px; height: 112px; border-radius: 12px; background: #fff; padding: 6px; display: block; flex: none; }
.line-qr span { font-size: .85rem; line-height: 1.5; color: var(--gold-3); }
.doc .line-qr span, .doc-card .line-qr span, main .line-qr span { color: var(--ink, #2b2b2b); }
.line-qr:hover { text-decoration: none !important; }
.pay-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pay-chips span { padding: 4px 12px; border: 1px solid rgba(241, 220, 166, .4); border-radius: 999px; font-size: .8rem; color: var(--gold-3); }
.ftr-copy { border-top: 1px solid rgba(255, 255, 255, .12); font-size: .82rem; color: #c9aeb2; padding: 14px 0 18px; }

/* overlay / drawer / toast / lightbox */
.overlay { position: fixed; inset: 0; background: rgba(30, 8, 14, .5); z-index: 60; }
.drawer { position: fixed; top: 0; bottom: 0; width: min(420px, 92vw); background: #fff; z-index: 70; display: flex; flex-direction: column; transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
.drawer.right { right: 0; transform: translateX(100%); }
.drawer.left { left: 0; transform: translateX(-100%); }
.drawer.open { transform: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dr-head h3 { font-family: var(--serif); color: var(--maroon); }
.dr-body { flex: 1; overflow: auto; padding: 4px 16px 16px; }
.dr-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; background: #fffdfa; }
.dr-body.menu { padding-top: 8px; }
.dr-body.menu h4 { color: var(--gold); margin: 16px 0 4px; font-size: .85rem; letter-spacing: .04em; }
.dr-body.menu a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line-2); }
.drawer .line { grid-template-columns: 64px 1fr; padding-right: 28px; }
.drawer .line-img { width: 64px; }
.drawer .fp { padding: 0; }
.toast { position: fixed; left: 50%; bottom: 86px; transform: translate(-50%, 20px); background: #2b1b1b; color: #fff; padding: 10px 20px; border-radius: 999px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; max-width: 92vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lightbox { position: fixed; inset: 0; background: rgba(20, 5, 10, .92); z-index: 100; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lightbox .icon-btn { position: absolute; top: 14px; right: 14px; color: #fff; }

/* responsive */
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
  .grid.g4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1180px) { .grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 999px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 34px; padding-bottom: 38px; }
  .hero-pics { max-width: 520px; }
  .values-row { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .brand-grid { grid-template-columns: 1fr; }
  .steps-row { grid-template-columns: repeat(2, 1fr); }
  .shop-grid { grid-template-columns: 1fr; }
  .shop-side { display: none; }
  .filter-btn { display: inline-flex; }
  .shop-bar h1, .shop-bar .count { margin-right: 0; }
  .shop-bar .sort { margin-left: auto; }
  .pdp-grid { grid-template-columns: 1fr; gap: 20px; }
  .pdp-gallery { position: static; }
  .pdp-img { max-height: 560px; }
  .cart-grid, .co-grid { grid-template-columns: 1fr; }
  .summary.sticky { position: static; }
  .ftr-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 719px) {
  body { font-size: 14.5px; }
  .menu-btn { display: inline-grid; margin-left: -8px; }
  .hdr-row { flex-wrap: wrap; gap: 8px 6px; }
  .logo { order: 1; }
  .logo-text small { display: none; }
  .logo-mark { width: 36px; height: 36px; font-size: 20px; }
  .logo-text b { font-size: 1.25rem; }
  .menu-btn { order: 0; }
  .cart-btn { order: 2; margin-left: auto; }
  .search { order: 3; flex: 1 0 100%; max-width: none; }
  .search input { padding: 9px 14px; font-size: 16px; }
  .catnav a { padding: 9px 12px; font-size: .88rem; }
  .hide-sm { display: none; }
  .topbar .wrap { flex-wrap: nowrap; gap: 8px; font-size: .76rem; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
  .hero-in { padding-top: 26px; padding-bottom: 30px; gap: 22px; }
  .hero .lead { font-size: .95rem; }
  .hero-cta .btn { flex: 1; padding: 12px 14px; }
  .hero-pics { gap: 8px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sec-head h2 { font-size: 1.25rem; }
  .section { padding-top: 28px; }
  .values-row > div { grid-template-columns: 30px 1fr; }
  .values-row svg { width: 28px; height: 28px; }
  .values-row b { font-size: .85rem; } .values-row span { font-size: .74rem; }
  .steps-row { grid-template-columns: 1fr; }
  .grid { gap: 10px; }
  .card-body { padding: 8px 10px 12px; }
  .card .name { font-size: .86rem; }
  .price { font-size: 1.1rem; }
  .pdp-info h1 { font-size: 1.4rem; }
  .pdp-price { font-size: 1.7rem; }
  .pdp-cta { display: none; }
  .pdp { padding-bottom: 76px; }
  .pdp-bar { display: flex; align-items: center; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: #fff; border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(74, 15, 28, .10); }
  .pdp-bar > div { margin-right: auto; line-height: 1.2; }
  .pdp-bar small { color: var(--muted); display: block; font-size: .72rem; }
  .pdp-bar b { color: var(--maroon); font-size: 1.2rem; }
  .pdp-bar .btn { padding: 11px 18px; }
  .toast { bottom: 24px; }
  .fgrid { grid-template-columns: 1fr; }
  .f.full { grid-column: auto; }
  .box { padding: 16px; }
  .qr { width: 160px; margin: 0 auto; }
  .qrbox { justify-content: center; text-align: center; }
  .ftr-grid { grid-template-columns: 1fr; gap: 20px; }
  .doc-body { padding: 18px; }
  .done-card { padding: 26px 18px; margin-top: 12px; }
  .shop-bar { gap: 8px; }
  .shop-bar .sort span { display: none; }
}
/* มือถือ: ปุ่ม/ลิงก์กดง่ายขึ้น ตัวอักษรอ่านง่ายขึ้น และหัวเว็บซ่อนตอนเลื่อนลง */
@media (max-width: 719px) {
  body { font-size: 15px; }
  .hdr { transition: transform .25s ease; }
  .hdr.hdr-hide { transform: translateY(-100%); }
  .btn-sm { padding: 10px 14px; min-height: 40px; }
  .card .name { font-size: .92rem; }
  .card .name a { display: block; padding: 2px 0; }
  .card .code { font-size: .82rem; }
  .tag { font-size: .8rem; }
  .crumbs { gap: 2px 6px; padding-top: 8px; }
  .crumbs a { display: inline-block; padding: 8px 0; }
  .more { padding: 10px 0; }
  .back-link { padding: 10px 0; margin-top: 4px; }
  .stepper.sm button { width: 40px; height: 40px; }
  .stepper input { height: 42px; }
  .line-del { padding: 9px; top: 6px; }
  .ftr ul { gap: 0; }
  .ftr ul a { display: inline-block; padding: 9px 0; min-width: 44px; }
  .catnav a { min-width: 44px; text-align: center; }
  .shop-bar select { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
