/* Sand&sun — หน้าร้าน */
:root {
  --ink: #222;
  --body: #3a3a3a;
  --muted: #6b6b6b;
  --subtle: #767676;
  --line: #eee;
  --line-strong: #ddd;
  --brand: #980000;
  --brand-dark: #7a0000;
  --brand-soft: #fbeeee;
  --topbar: #daf5f5;
  --photo: #f4efea;
  --discount: #e60012;
  --tag-new: #1fae3a;
  --tag-best: #f5a200;
  --line-green: #06c755;
  --fb-blue: #1877f2;
  --font: "Prompt", "Noto Sans Thai", system-ui, sans-serif;
  --display: "Montserrat", "Prompt", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--body); background: #fff; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 50; background: #fff; padding: 8px 16px; border-radius: 4px; }
.container { width: 100%; max-width: 75rem; margin-inline: auto; padding-inline: 1rem; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.bi { width: 28px; height: 28px; flex-shrink: 0; }
@media (min-width: 768px) { .container { padding-inline: 1.5rem; } }

/* ---------- Header ---------- */
.topbar { background: var(--topbar); color: var(--ink); }
.topbar-in { display: flex; align-items: center; justify-content: center; gap: 6px 24px; min-height: 48px; padding-block: 6px; font-size: 13px; text-align: center; }
.topbar-msg { display: flex; align-items: center; gap: 8px; }
.topbar-spacer { display: none; }
.social { display: flex; align-items: center; gap: 10px; }
.social a { display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; transition: transform .15s; }
.social a:hover { transform: scale(1.1); }
@media (min-width: 768px) {
  .topbar-in { justify-content: space-between; font-size: 14px; }
  .topbar-spacer { display: block; width: 138px; }
}

.brandbar { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding-block: 8px; position: relative; }
.logo { justify-self: center; }
.logo img { height: 44px; width: auto; }
.brandbar-line { justify-self: end; display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; }
.mnav summary { display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; }
.mnav .ic { width: 24px; height: 24px; }
.mnav .ic-close, .mnav[open] .ic-open { display: none; }
.mnav[open] .ic-close { display: block; }
.mnav-panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border-block: 1px solid var(--line); box-shadow: 0 8px 16px rgba(0,0,0,.06); }
.mnav-list { display: flex; flex-direction: column; padding-block: 8px; }
.mnav-list a { display: block; padding-block: 12px; font-size: 15px; }
.mnav-list a[aria-current], .dnav-list a[aria-current] { color: var(--brand); }
.mnav-social { border-top: 1px solid var(--line); padding-block: 12px; }
.dnav { display: none; }
@media (min-width: 768px) {
  .brandbar { display: flex; justify-content: center; padding-block: 16px; }
  .mnav, .brandbar-line { display: none; }
  .logo img { height: 76px; }
  .dnav { display: block; }
  .dnav-list { display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 12px; font-size: 15px; }
  .dnav-list li + li { border-left: 1px solid rgba(34,34,34,.8); }
  .dnav-list a { display: block; padding-inline: 16px; line-height: 36px; }
  .dnav-list a:hover { color: var(--brand); }
}
@media (min-width: 1024px) { .dnav-list a { padding-inline: 20px; } }

/* ---------- Home ---------- */
.hero { padding-inline: 0; }
@media (min-width: 768px) { .hero { padding-inline: 1.5rem; } }
.slider { position: relative; overflow: hidden; background: var(--photo); }
.slide { display: none; }
.slide.is-active { display: block; animation: fade .5s; }
@keyframes fade { from { opacity: .4; } to { opacity: 1; } }
.banner img { width: 100%; height: auto; }
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.85); font-size: 26px; line-height: 1; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.slide-nav.prev { left: 12px; } .slide-nav.next { right: 12px; }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.dots button { width: 10px; height: 10px; border-radius: 50%; background: rgba(0,0,0,.35); }
.dots button.on { background: #000; }

.intro { padding-block: 32px 24px; text-align: center; }
.intro h1 { font-size: 18px; font-weight: 400; color: #000; }
.intro p { margin-top: 12px; font-size: 12px; font-weight: 300; line-height: 1.9; color: var(--muted); }
@media (min-width: 768px) { .intro { padding-top: 48px; } .intro h1 { font-size: 22px; } .intro p { font-size: 13px; } }

.section { padding-block: 40px; }
.sec-head { margin-bottom: 32px; text-align: center; }
.sec-head h2 { font-family: var(--display); font-weight: 500; font-size: 26px; color: #000; line-height: 1.2; }
.sec-head p { margin-top: 8px; font-size: 14px; font-weight: 300; color: var(--muted); }
@media (min-width: 768px) { .section { padding-block: 48px; } .sec-head { margin-bottom: 48px; } .sec-head h2 { font-size: 40px; } }
.more { margin-top: 40px; display: flex; justify-content: center; }
.empty { text-align: center; color: var(--muted); }

.btn-dark { display: inline-flex; align-items: center; height: 44px; padding-inline: 40px; background: #000; color: #fff; font-size: 14px; transition: background .15s; }
.btn-dark:hover { background: var(--brand); }
.btn-outline { display: inline-flex; align-items: center; height: 44px; padding-inline: 24px; border: 1px solid var(--body); border-radius: 6px; font-size: 14px; margin-top: 20px; }
.link { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; font-size: 14px; }
.link.center { align-self: center; padding: 8px; color: var(--muted); }

/* ---------- Product grid / card ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 12px; }
@media (min-width: 768px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 30px; } }
.card { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.card-img { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 4px; background: var(--photo); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.card:hover .card-img img { opacity: .9; }
.badges { position: absolute; top: 12px; left: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.badges.row { position: static; flex-direction: row; }
.card-badges { margin-top: 12px; justify-content: center; flex-wrap: wrap; gap: 4px; }
.card-badges + .card-name { margin-top: 8px; }
.badges li { padding: 1px 8px; font-size: 13px; line-height: 20px; color: #fff; }
.b-new { background: var(--tag-new); } .b-best { background: var(--tag-best); } .b-sale { background: var(--discount); }
.card-name { margin-top: 20px; width: 100%; padding-inline: 4px; font-size: 15px; font-weight: 400; color: #000; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-name a::after { content: ""; position: absolute; inset: 0; }
.card-sum { margin-top: 8px; width: 100%; padding-inline: 4px; min-height: 3.2rem; font-size: 12px; line-height: 1.6rem; font-weight: 300; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .price { margin-top: 8px; }
.card-btn { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding-inline: 12px; background: #000; color: #fff; font-size: 13px; transition: background .15s; }
.card-btn .ic { width: 16px; height: 16px; }
.card:hover .card-btn { background: var(--brand); }
.card-out { margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; height: 32px; font-size: 13px; color: var(--discount); }
.card-out .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.card-note { margin-top: 12px; font-size: 12px; color: var(--muted); }
.card-sold { margin-top: 4px; font-size: 12px; color: var(--subtle); }
@media (min-width: 768px) {
  .card-name { margin-top: 32px; font-size: 20px; }
  .card-badges { margin-top: 16px; }
  .card-badges + .card-name { margin-top: 12px; }
  .card-sum { padding-inline: 12px; font-size: 13px; }
  .card-btn { font-size: 14px; }
  .card-note { font-size: 14px; }
}

.price { display: flex; flex-direction: column; align-items: center; }
.price s { font-size: 15px; line-height: 24px; color: #a9a9a9; }
.price p { display: flex; align-items: center; gap: 8px; }
.price strong { font-size: 18px; font-weight: 500; color: #000; }
.price .pct { background: var(--discount); color: #fff; font-size: 11px; font-weight: 600; line-height: 16px; padding-inline: 4px; border-radius: 2px; }
.card .price.no-sale { padding-top: 24px; }
.price-lg { align-items: flex-start; }
.price-lg strong { font-size: 26px; }
@media (min-width: 768px) { .price strong { font-size: 20px; } .price-lg strong { font-size: 28px; } }

/* ---------- Pages ---------- */
.page { padding-block: 24px 80px; }
.page.narrow { max-width: 48rem; }
.page-title { margin-top: 20px; font-size: 24px; font-weight: 500; color: var(--ink); }
@media (min-width: 768px) { .page-title { font-size: 28px; } }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--subtle); }
.crumbs li + li::before { content: "/"; margin-right: 4px; }
.crumbs a:hover { color: var(--brand); }
.crumbs [aria-current] { color: var(--ink); }
.prose { margin-top: 24px; font-size: 15px; font-weight: 300; line-height: 2; color: var(--body); display: flex; flex-direction: column; gap: 20px; }
.prose h2 { margin-top: 12px; font-size: 18px; font-weight: 500; color: var(--ink); }
.prose ol { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.todo { border: 1px dashed rgba(152,0,0,.5); background: var(--brand-soft); color: var(--brand-dark); border-radius: 6px; padding: 12px 16px; font-size: 14px; line-height: 1.6; }
.contact-list { display: flex; flex-direction: column; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 12px; }
.contact-list .dot { width: 28px; text-align: center; font-size: 20px; }
.notfound { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; padding-block: 80px; }
.admin-note { margin-top: 16px; background: #fff7e0; border: 1px solid #f5d77a; color: #7a5a00; padding: 10px 14px; border-radius: 6px; font-size: 14px; }

/* products list */
.list-head { margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.list-head .page-title { margin-top: 0; }
.sort { display: flex; align-items: center; gap: 8px; overflow-x: auto; }
.sort span { flex-shrink: 0; font-size: 13px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding-inline: 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; white-space: nowrap; background: #fff; }
.pill:hover { border-color: var(--body); }
.pill.on { background: var(--body); border-color: var(--body); color: #fff; }
.pill.sq { min-width: 44px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.list-body { margin-top: 24px; display: grid; gap: 32px; }
.filters { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.filters h2 { margin-bottom: 8px; font-size: 15px; font-weight: 500; color: var(--ink); }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.cats li { flex-shrink: 0; }
.cats a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding-inline: 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.cats a.on { background: var(--brand-soft); color: var(--brand); font-weight: 500; border-color: transparent; }
.cats .n { font-weight: 300; color: var(--subtle); }
.help-box { display: none; flex-direction: column; gap: 8px; background: var(--brand-soft); border-radius: 8px; padding: 16px; font-size: 13px; font-weight: 300; }
.help-title { font-size: 14px; font-weight: 500; color: var(--brand-dark); }
.btn-line, .btn-fb { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 6px; color: #fff; font-size: 14px; font-weight: 500; }
.btn-line { background: var(--line-green); } .btn-fb { background: var(--fb-blue); }
.btn-line .bi, .btn-fb .bi { width: 22px; height: 22px; }
.btn-line .bi circle, .btn-fb .bi circle { fill: transparent; }
.btn-line .bi path { fill: #fff; } .btn-line .bi text { fill: var(--line-green); }
.empty-box { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 80px 20px; text-align: center; }
.empty-box .big { font-size: 16px; color: var(--ink); }
.pager { margin-top: 48px; display: flex; justify-content: center; gap: 8px; }
.pager a { display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 14px; }
.pager a.on { background: var(--body); color: #fff; border-color: var(--body); }
@media (min-width: 768px) {
  .list-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .list-body { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }
  .cats { flex-direction: column; gap: 4px; overflow: visible; }
  .cats a { border: 0; }
  .cats a:not(.on):hover { background: #f7f7f7; }
  .help-box { display: flex; }
}

/* product detail */
.product-page { padding-bottom: 140px; }
.pd { margin-top: 24px; display: grid; gap: 32px; align-items: start; }
.gallery { display: flex; flex-direction: column-reverse; gap: 12px; align-items: flex-start; min-width: 0; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
.thumbs button { display: block; width: 64px; aspect-ratio: 1 / 1; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--photo); }
.thumbs button[aria-pressed="true"] { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.main-col { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; width: 100%; min-width: 0; }
.pd-badges { gap: 6px; flex-wrap: wrap; }
.main-img { width: 100%; flex-shrink: 0; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: var(--photo); }
.main-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pd-name { font-size: 22px; font-weight: 500; line-height: 1.35; color: var(--ink); }
.pd-meta { display: flex; gap: 16px; font-size: 13px; color: var(--subtle); }
.pd-desc { font-size: 15px; font-weight: 300; line-height: 1.85; color: #555; }
@media (min-width: 768px) {
  .product-page { padding-bottom: 80px; }
  .pd { grid-template-columns: auto minmax(0, 1fr); gap: 48px; }
  .gallery { flex-direction: row; gap: 16px; }
  .thumbs { flex-direction: column; width: 88px; gap: 12px; overflow: visible; }
  .thumbs button { width: 100%; }
  .main-col { width: auto; flex-shrink: 0; }
  .main-img { width: 560px; max-width: 48vw; }
  .pd-info { max-width: 28rem; }
  .pd-name { font-size: 26px; }
}

.order { display: flex; flex-direction: column; gap: 16px; }
.sizes { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 16px 0 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sizes-head { display: flex; align-items: center; justify-content: space-between; }
.sizes legend { float: left; padding: 0; font-size: 14px; font-weight: 500; }
.sizes .link { min-height: 44px; font-size: 13px; }
.size-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.size-btn { height: 46px; border: 1.5px solid var(--line-strong); border-radius: 6px; font-size: 15px; font-weight: 500; background: #fff; transition: border-color .15s; }
.size-btn:hover:not(:disabled) { border-color: var(--body); }
.size-btn[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.size-btn:disabled { cursor: not-allowed; border-color: var(--line); color: var(--subtle); text-decoration: line-through; }
.size-chart { overflow-x: auto; }
.size-chart table { width: 100%; border-collapse: collapse; font-size: 13px; }
.size-chart th, .size-chart td { padding: 8px 10px; text-align: left; }
.size-chart thead tr { border-bottom: 1px solid var(--line-strong); }
.size-chart th { font-weight: 500; }
.size-chart tbody tr { border-top: 1px solid var(--line); }
.size-chart tr.on { background: var(--brand-soft); font-weight: 500; }
.qty-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 14px; }
.qty-row > span:first-child { font-weight: 500; }
.qty { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 6px; }
.qty button { width: 44px; height: 44px; font-size: 18px; }
.qty output { width: 36px; text-align: center; font-size: 15px; }
.qty-row strong { color: var(--ink); font-weight: 600; }
.msg-box { border: 1px solid var(--line); background: #fafafa; border-radius: 8px; padding: 14px 16px; }
.msg-title { font-size: 12px; font-weight: 500; color: #2f7a4a; }
.msg { margin-top: 6px; font-size: 14px; line-height: 1.7; white-space: pre-line; color: var(--subtle); }
.msg.filled { color: var(--body); }
.order-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; background: #fff; border-top: 1px solid var(--line); padding: 10px 12px max(14px, env(safe-area-inset-bottom)); }
.btn-order { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 6px; color: #fff; font-size: 15px; font-weight: 500; transition: filter .15s, opacity .15s; }
.btn-order .bi { width: 24px; height: 24px; }
.btn-order.line { background: var(--line-green); }
.btn-order.line .bi circle { fill: #fff; } .btn-order.line .bi path { fill: var(--line-green); } .btn-order.line .bi text { fill: #fff; }
.btn-order.fb { background: var(--fb-blue); }
.btn-order.fb .bi circle { fill: #fff; } .btn-order.fb .bi path { fill: var(--fb-blue); }
.btn-order:hover { filter: brightness(.94); }
.btn-order.is-off { opacity: .45; }
.btn-disabled { flex: 1; display: flex; align-items: center; justify-content: center; height: 50px; border-radius: 6px; background: var(--line); color: var(--muted); font-weight: 500; }
.order-hint { text-align: center; font-size: 13px; color: var(--brand); min-height: 1em; }
.order-hint:empty { display: none; }
@media (max-width: 380px) { .btn-order { font-size: 13px; gap: 6px; } }
@media (min-width: 768px) { .order-bar { position: static; border: 0; padding: 0; } }
.acc { border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-size: 15px; font-weight: 500; }
.acc summary span { font-size: 18px; color: var(--subtle); }
.acc ul { margin-bottom: 16px; font-size: 14px; font-weight: 300; line-height: 1.9; color: #555; }
.related { margin-top: 32px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px); background: rgba(20,20,20,.92); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
@media (min-width: 768px) { .toast { bottom: 32px; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: #fafafa; }
.footer-grid { display: grid; gap: 36px; padding-block: 48px; font-size: 14px; }
.footer-brand img { height: 44px; width: auto; }
.footer-brand p { margin-top: 12px; max-width: 240px; font-weight: 300; line-height: 1.7; color: var(--muted); }
.site-footer h2 { margin-bottom: 16px; font-family: var(--display); font-size: 16px; font-weight: 500; color: #000; }
.site-footer ul:not(.social) { display: flex; flex-direction: column; gap: 10px; font-weight: 300; }
.site-footer ul a:hover { color: var(--brand); }
.footer-social { margin-top: 14px; }
.copy { border-top: 1px solid var(--line); padding-block: 20px; text-align: center; font-size: 12px; color: var(--subtle); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr 1.3fr; padding-block: 56px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- เมนูหมวดหมู่ ---------- */
.caret { width: 14px; height: 14px; margin-left: 2px; vertical-align: -2px; }
.sub a { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sub .n { font-size: 12px; color: var(--subtle); }
.sub a[aria-current] { color: var(--brand); }
/* มือถือ: หมวดเป็นรายการย่อยเยื้องเข้าไป */
.mnav-list .caret { display: none; }
.mnav-list .sub { margin: -4px 0 6px; padding-left: 14px; border-left: 2px solid var(--line); }
.mnav-list .sub a { padding-block: 9px; font-size: 14px; color: var(--muted); }
.mnav-panel { max-height: calc(100dvh - 120px); overflow-y: auto; }
/* คอม: ดรอปดาวน์เมื่อชี้/โฟกัส */
@media (min-width: 768px) {
  .dnav-list .has-sub { position: relative; }
  .dnav-list .sub { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); z-index: 40; min-width: 200px; padding: 8px 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
  .dnav-list .sub li { border: 0 !important; }
  .dnav-list .sub a { padding: 0 18px; line-height: 40px; font-size: 14px; white-space: nowrap; }
  .dnav-list .sub a:hover { background: var(--brand-soft); color: var(--brand); }
  .dnav-list .has-sub:hover > .sub, .dnav-list .has-sub:focus-within > .sub { display: block; }
  .dnav-list .has-sub:hover .caret { transform: rotate(180deg); }
}

/* ---------- ช้อปตามหมวดหมู่ (หน้าแรก) ---------- */
.cats-section { padding-top: 16px; }
.cat-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: 42%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.cat-tiles::-webkit-scrollbar { display: none; }
.cat-tiles li { scroll-snap-align: start; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.cat-tile-img { width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; background: var(--photo); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s; }
.cat-tile-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile:hover .cat-tile-img { box-shadow: 0 0 0 3px var(--brand); transform: translateY(-2px); }
.cat-tile-name { margin-top: 8px; font-size: 15px; font-weight: 500; color: var(--ink); }
.cat-tile-n { font-size: 12px; color: var(--subtle); }
@media (min-width: 560px) { .cat-tiles { grid-auto-columns: 28%; } }
@media (min-width: 768px) {
  .cat-tiles { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(160px, 200px)); justify-content: center; gap: 32px; overflow: visible; }
  .cat-tile-name { font-size: 17px; }
}

/* หน้ารายการสินค้า มือถือ: แถบหมวดติดด้านบนขณะเลื่อน */
@media (max-width: 767px) {
  .filters nav[aria-label="หมวดหมู่"] { position: sticky; top: 0; z-index: 15; background: #fff; margin-inline: -1rem; padding: 8px 1rem 4px; border-bottom: 1px solid var(--line); }
  .filters nav[aria-label="หมวดหมู่"] h2 { display: none; }
  .cats { scrollbar-width: none; }
  .cats::-webkit-scrollbar { display: none; }
  .cats a { border-radius: 999px; min-height: 38px; }
}

/* ---------- ปุ่มแชตบนการ์ดสินค้า (อยู่เหนือลิงก์การ์ด) ---------- */
.card-order { position: relative; z-index: 2; margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
.card-chat { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 500; transition: filter .15s, transform .1s; }
.card-chat:hover { filter: brightness(.93); }
.card-chat:active { transform: scale(.97); }
.card-chat .bi { width: 18px; height: 18px; }
.card-chat.line { background: var(--line-green); }
.card-chat.line .bi circle { fill: #fff; } .card-chat.line .bi path { fill: var(--line-green); } .card-chat.line .bi text { fill: #fff; }
.card-chat.fb { background: var(--fb-blue); }
.card-chat.fb .bi circle { fill: #fff; } .card-chat.fb .bi path { fill: var(--fb-blue); }
@media (max-width: 400px) { .card-chat { padding: 0 9px; font-size: 12px; gap: 4px; } .card-chat .bi { width: 16px; height: 16px; } }
@media (min-width: 768px) { .card-chat { height: 36px; padding: 0 16px; font-size: 14px; } }
.msg { word-break: break-word; }

/* ---------- Lightbox ---------- */
button.main-img { position: relative; display: block; padding: 0; border: 0; cursor: zoom-in; }
.zoom-hint { position: absolute; right: 12px; bottom: 12px; display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: transform .2s; }
.zoom-hint svg { width: 20px; height: 20px; }
button.main-img:hover .zoom-hint { transform: scale(1.1); }
.lb-open, .lb-open body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(10,10,10,.92); animation: lbIn .2s ease-out; }
.lb.out { animation: lbOut .18s ease-in forwards; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbOut { to { opacity: 0; } }
.lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 100%; padding: 56px 12px 24px; }
.lb-img { max-width: min(100%, 1100px); max-height: calc(100dvh - 120px); object-fit: contain; border-radius: 4px; opacity: 0; transform: scale(.97); transition: opacity .25s, transform .25s; user-select: none; -webkit-user-drag: none; }
.lb-img.in { opacity: 1; transform: none; }
.lb-count { color: rgba(255,255,255,.8); font-size: 14px; min-height: 1em; }
.lb-close, .lb-nav { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(255,255,255,.12); border-radius: 50%; transition: background .15s; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 12px; right: 12px; width: 44px; height: 44px; font-size: 30px; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 34px; line-height: 1; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
@media (max-width: 767px) {
  .lb-nav { top: auto; bottom: 18px; transform: none; width: 44px; height: 44px; }
  .lb-prev { left: calc(50% - 90px); } .lb-next { right: calc(50% - 90px); }
  .lb-fig { padding-bottom: 80px; }
  .lb-img { max-height: calc(100dvh - 160px); }
}

/* ---------- ผีเสื้อบินรอบแบนเนอร์ (มุมมองด้านข้าง) ---------- */
.hero { position: relative; }
.bflies { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.bf { position: absolute; width: 64px; height: 56px; margin: -28px 0 0 -32px; will-change: left, top; filter: drop-shadow(0 4px 5px rgba(110, 60, 80, .2)); }
.bf-face, .bf-bob { display: block; width: 100%; height: 100%; }
.bf-bob { animation: bob 1.6s ease-in-out infinite; }
.bf svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* กระพือปีก: ปีกพับขึ้น-ลงรอบโคนปีก (มุมมองด้านข้าง) */
.bf .w { transform-box: view-box; transform-origin: 31px 38.5px; }
.bf .near { animation: flapNear .3s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
.bf .far { animation: flapFar .3s cubic-bezier(.45, 0, .55, 1) infinite alternate; animation-delay: -.04s; }
@keyframes flapNear { 0% { transform: rotate(4deg) scaleY(1); } 100% { transform: rotate(10deg) scaleY(.18); } }
@keyframes flapFar { 0% { transform: rotate(-16deg) scaleY(.96); } 100% { transform: rotate(-4deg) scaleY(.14); } }
.bf .near .fw { fill: var(--c1); }
.bf .near .hw { fill: var(--c1); filter: brightness(1.06); }
.bf .far .fw, .bf .far .hw { fill: var(--c2); }
.bf .fw, .bf .hw { stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
.bf .spot { fill: #fff; opacity: .9; }
.bf .blot { fill: var(--c2); opacity: .9; }
.bf .body { fill: #5b3d45; }
.bf .stripe { stroke: #8a6570; stroke-width: 1.2; stroke-linecap: round; }
.bf .eye { fill: #fff; }
.bf .knob { fill: #5b3d45; }
.bf .ant { fill: none; stroke: #5b3d45; stroke-width: 1.2; stroke-linecap: round; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-7px) rotate(4deg); } }
/* หันหน้าตามทิศที่บิน: ครึ่งแรกบินไปขวา ครึ่งหลังบินกลับซ้าย */
@keyframes face { 0%, 49.9% { transform: scaleX(1); } 50%, 100% { transform: scaleX(-1); } }

.bf1 { animation: fly1 20s ease-in-out infinite; }
.bf1 .bf-face { animation: face 20s linear infinite; }
.bf2 { animation: fly2 24s ease-in-out infinite; width: 54px; height: 44px; margin: -22px 0 0 -27px; }
.bf2 .bf-face { animation: face 24s linear infinite; }
.bf3 { animation: fly3 17s ease-in-out infinite; width: 44px; height: 36px; margin: -18px 0 0 -22px; }
.bf3 .bf-face { animation: face 17s linear infinite; }
.bf4 { animation: fly4 27s ease-in-out infinite; width: 56px; height: 46px; }
.bf4 .bf-face { animation: face 27s linear infinite; }
.bf2 .w { animation-duration: .27s; }
.bf3 .w { animation-duration: .24s; }
.bf4 .w { animation-duration: .34s; }
.bf2 .bf-bob { animation-duration: 1.4s; animation-delay: -.4s; }
.bf3 .bf-bob { animation-duration: 1.2s; animation-delay: -.8s; }
.bf4 .bf-bob { animation-duration: 1.9s; animation-delay: -1.1s; }
/* เส้นทางบิน: ครึ่งแรก x เพิ่มขึ้น (บินไปขวา) ครึ่งหลัง x ลดลง (บินกลับ) */
@keyframes fly1 {
  0% { left: 4%; top: 62%; } 12% { left: 12%; top: 28%; } 25% { left: 22%; top: 52%; } 38% { left: 32%; top: 22%; } 50% { left: 40%; top: 42%; }
  62% { left: 31%; top: 70%; } 75% { left: 20%; top: 36%; } 88% { left: 10%; top: 56%; } 100% { left: 4%; top: 62%; }
}
@keyframes fly2 {
  0% { left: 60%; top: 30%; } 16% { left: 69%; top: 12%; } 33% { left: 79%; top: 44%; } 50% { left: 93%; top: 24%; }
  66% { left: 85%; top: 62%; } 83% { left: 72%; top: 42%; } 100% { left: 60%; top: 30%; }
}
@keyframes fly3 {
  0% { left: 38%; top: 14%; } 25% { left: 47%; top: 30%; } 50% { left: 58%; top: 12%; } 75% { left: 49%; top: 26%; } 100% { left: 38%; top: 14%; }
}
@keyframes fly4 {
  0% { left: 55%; top: 80%; } 25% { left: 66%; top: 62%; } 50% { left: 80%; top: 78%; } 75% { left: 68%; top: 64%; } 100% { left: 55%; top: 80%; }
}
@media (max-width: 767px) {
  .bf, .bf2 { width: 44px; height: 36px; margin: -18px 0 0 -22px; }
  .bf3, .bf4 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bf, .bf-face, .bf-bob, .bf .w { animation: none !important; }
  .bf1 { left: 8%; top: 30%; } .bf2 { left: 88%; top: 60%; } .bf3 { left: 55%; top: 16%; } .bf4 { left: 70%; top: 75%; }
}

/* ---------- หน้า 404 ---------- */
.notfound { padding-block: 56px 24px; }
.nf-code { font-family: var(--display); font-size: 72px; line-height: 1; color: var(--brand-soft); -webkit-text-stroke: 2px var(--brand); letter-spacing: .05em; }
.nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.nf-actions .btn-outline { margin-top: 0; }
.nf-cats { justify-content: center; margin-top: 8px; }
.nf-suggest { padding-top: 16px; }
@media (min-width: 768px) { .nf-code { font-size: 104px; } }

/* ---------- หน้าต่างสั่งซื้อผ่าน Facebook ---------- */
.fbm { position: fixed; inset: 0; z-index: 110; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 20, 20, .55); animation: lbIn .18s ease-out; }
.fbm.out { animation: lbOut .16s ease-in forwards; }
.fbm-card { position: relative; width: 100%; max-width: 440px; max-height: 92dvh; overflow-y: auto; background: #fff; border-radius: 20px 20px 0 0; padding: 28px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -8px 40px rgba(0,0,0,.2); animation: fbmUp .24s cubic-bezier(.2, .8, .2, 1); }
@keyframes fbmUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 560px) { .fbm { align-items: center; } .fbm-card { border-radius: 20px; padding-bottom: 24px; } }
.fbm-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; font-size: 26px; line-height: 1; color: var(--muted); }
.fbm-close:hover { background: #f3f3f3; }
.fbm-icon { align-self: center; width: 52px; height: 52px; }
.fbm-icon svg { width: 100%; height: 100%; }
.fbm-title { text-align: center; font-size: 18px; font-weight: 600; color: #1a8f3c; }
.fbm-failed .fbm-title { color: var(--brand); }
.fbm-steps { list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 8px; background: #f5f8ff; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.fbm-steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; }
.fbm-steps li::before { content: counter(s); flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--fb-blue); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.fbm-steps b { font-weight: 600; color: var(--ink); }
.fbm-label { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: -6px; }
.fbm-text { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13.5px; line-height: 1.6; color: var(--body); background: #fafafa; resize: none; }
.fbm-failed .fbm-text { border-color: var(--brand); background: #fff; }
.fbm-go { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 12px; background: var(--fb-blue); color: #fff; font-size: 16px; font-weight: 600; transition: filter .15s; }
.fbm-go:hover { filter: brightness(.94); }
.fbm-go svg { width: 24px; height: 24px; }
.fbm-copy { height: 40px; font-size: 14px; color: var(--fb-blue); font-weight: 500; border-radius: 10px; }
.fbm-copy:hover { background: #f0f5ff; }

/* ---------- ปุ่มติดต่อลอย (โทร / LINE / Facebook) ---------- */
.fab { position: fixed; right: 14px; bottom: 18px; z-index: 45; display: flex; flex-direction: column; gap: 10px; }
.fab-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.22); transition: transform .15s, box-shadow .15s; }
.fab-btn:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 8px 20px rgba(0,0,0,.26); }
.fab-btn:active { transform: scale(.95); }
.fab-btn svg { width: 26px; height: 26px; }
.fab-phone { background: var(--brand); }
.fab-line { background: var(--line-green); }
.fab-fb { background: var(--fb-blue); }
/* ไอคอนแบรนด์ในปุ่ม: สลับสีให้เป็นโลโก้ขาวบนพื้นสี */
.fab-bi { width: 30px !important; height: 30px !important; }
.fab-line .fab-bi circle { fill: transparent; } .fab-line .fab-bi path { fill: #fff; } .fab-line .fab-bi text { fill: var(--line-green); }
.fab-fb .fab-bi circle { fill: transparent; } .fab-fb .fab-bi path { fill: #fff; }
/* ปุ่ม LINE มีวงแสงกระเพื่อมเบาๆ ชวนกด */
.fab-line::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(6, 199, 85, .5); animation: fabPulse 2.4s ease-out infinite; }
@keyframes fabPulse { 0% { box-shadow: 0 0 0 0 rgba(6, 199, 85, .45); } 70%, 100% { box-shadow: 0 0 0 14px rgba(6, 199, 85, 0); } }
/* ป้ายชื่อ (คอม: ชี้เมาส์) */
.fab-tip { position: absolute; right: calc(100% + 10px); top: 50%; transform: translate(6px, -50%); white-space: nowrap; background: rgba(20,20,20,.88); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
@media (hover: hover) { .fab-btn:hover .fab-tip, .fab-btn:focus-visible .fab-tip { opacity: 1; transform: translate(0, -50%); } }
@media (min-width: 768px) { .fab { right: 20px; bottom: 24px; gap: 12px; } .fab-btn { width: 56px; height: 56px; } }
@media (max-width: 767px) {
  .fab { right: 10px; bottom: 14px; gap: 8px; }
  .fab-btn { width: 46px; height: 46px; }
  .fab-btn svg { width: 22px; height: 22px; }
  .fab-bi { width: 27px !important; height: 27px !important; }
  /* หน้าสินค้า: เลื่อนขึ้นเหนือแถบปุ่มสั่งซื้อ */
  body:has(.order-bar) .fab { bottom: 92px; }
  /* แจ้งเตือนไม่ให้ทับปุ่มลอย */
  .toast { max-width: calc(100% - 90px); }
}
/* ซ่อนตอนเปิด lightbox / หน้าต่าง Facebook */
.lb-open .fab { display: none; }
@media (prefers-reduced-motion: reduce) { .fab-line::after { animation: none; } }
@media print { .fab { display: none; } }

/* รายการจุดในข้อความจากหลังบ้าน */
.prose ul.dots { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- ปรับให้ใช้งานบนมือถือสบายขึ้น ---------- */
.price .pct { font-size: 12px; line-height: 18px; padding-inline: 5px; }
@media (max-width: 767px) {
  /* ชื่อสินค้าบนการ์ดแสดงได้ 2 บรรทัด (ไม่ตัดกลางคำ) */
  .card-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.7em; line-height: 1.35; }
  .card-sum { font-size: 12.5px; }
  .card-chat { height: 40px; }
  /* แถบประกาศบรรทัดเดียว — ไอคอนติดต่ออยู่ที่ปุ่มลอยและเมนูแล้ว */
  .topbar-social { display: none; }
  .topbar-in { min-height: 40px; font-size: 12.5px; }
  /* หน้าสินค้า: มีปุ่มสั่งซื้อ LINE/Facebook ด้านล่างแล้ว เหลือปุ่มโทรปุ่มเดียว */
  body:has(.order-bar) .fab-line, body:has(.order-bar) .fab-fb { display: none; }
  /* ลิงก์เล็กๆ ให้พื้นที่กดใหญ่ขึ้น */
  .crumbs a { display: inline-block; padding-block: 6px; }
  .link.center { padding: 12px; }
  .sort .pill, .pills .pill { min-height: 40px; }
}
