:root {
  --bg: #ffffff; --fg: #1b1b1b; --grey: #6b6b6b; --line: #e6e6e6; --card: #f7f7f7;
  --brand: #d81b60; --green: #2e7d32; --red: #c62828; --orange: #e65100; --blue: #1565c0;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: -apple-system, "SF Pro Text", "Segoe UI", Arial, sans-serif; font-size: 16px;
  padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--blue); }
[hidden] { display: none !important; }
.testbar { background: #fff3cd; color: #7a5200; text-align: center; font-weight: 700; padding: 6px; font-size: 14px;
  padding-top: calc(env(safe-area-inset-top) + 6px); }
.hdr { position: sticky; top: 0; z-index: 5; background: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.testbar:not([hidden]) + .hdr { padding-top: 8px; }
.brand img { height: 44px; display: block; }
.cartbtn { position: relative; font-size: 26px; text-decoration: none; padding: 4px 8px; }
.badge { position: absolute; top: -2px; left: -4px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 10px; min-width: 20px; height: 20px; line-height: 20px; text-align: center; padding: 0 5px; }
#app { max-width: 960px; margin: 0 auto; padding: 12px 16px 24px; min-height: 60vh; }
.foot { text-align: center; padding: 20px 16px 30px; font-size: 14px; border-top: 1px solid var(--line); }
.center { text-align: center; } .muted { color: var(--grey); font-size: 14px; }
.err { color: var(--red); font-weight: 700; } .ok { color: var(--green); font-weight: 700; }
button { font: inherit; border: 0; border-radius: 12px; cursor: pointer; }
.btn { display: block; width: 100%; padding: 15px; font-size: 18px; font-weight: 700; color: #fff; background: var(--brand); margin: 10px 0; }
.btn.alt { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.btn:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=search], input[type=tel], input[type=email], textarea, select {
  font: inherit; font-size: 17px; width: 100%; padding: 11px 12px; border: 1px solid #c4c4c4; border-radius: 10px; background: #fff; color: var(--fg); }
textarea { min-height: 70px; resize: vertical; }
label.f { display: block; margin: 10px 0 4px; font-weight: 600; }

.search { position: sticky; top: 61px; z-index: 4; background: #fff; padding: 6px 0 8px; }
.catsel { margin-top: 8px; font-size: 16px; padding: 9px 12px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.chip { flex: none; background: var(--card); color: var(--fg); padding: 8px 14px; border-radius: 20px; font-size: 15px; white-space: nowrap; }
.chip.on { background: var(--brand); color: #fff; }
.count { margin: 4px 0 8px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  text-decoration: none; color: inherit; }
.card .img { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; }
.card img { width: 100%; height: 100%; object-fit: contain; }
.card .b { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .t { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.price { font-weight: 800; font-size: 17px; }
.price s { color: var(--grey); font-weight: 400; font-size: 14px; margin-inline-start: 6px; }
.price .sale { color: var(--brand); }
.stock { font-size: 13px; font-weight: 700; }
.stock.in { color: var(--green); } .stock.out { color: var(--red); }
.card.out .img { opacity: .5; }
.more { margin: 16px auto; max-width: 300px; }

.pd { display: grid; gap: 16px; }
@media (min-width: 720px) { .pd { grid-template-columns: 1fr 1fr; } }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border: 1px solid var(--line); border-radius: 14px; }
.gallery img { flex: none; width: 100%; aspect-ratio: 1; object-fit: contain; scroll-snap-align: center; background: #fff; }
.pd h1 { font-size: 21px; margin: 0 0 8px; }
.pd .price { font-size: 24px; }
.desc { white-space: pre-line; line-height: 1.5; color: #333; }
.qty { display: inline-flex; align-items: center; border: 1px solid #c4c4c4; border-radius: 12px; overflow: hidden; }
.qty button { background: var(--card); width: 42px; height: 42px; font-size: 22px; border-radius: 0; }
.qty span { min-width: 40px; text-align: center; font-weight: 700; }

.line { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; flex: none; background: #fff; }
.line .g { flex: 1; min-width: 0; }
.line .t { font-weight: 600; font-size: 15px; }
.rm { background: none; color: var(--red); font-size: 14px; padding: 4px; }
.sum { margin: 14px 0; font-size: 17px; }
.sum div { display: flex; justify-content: space-between; padding: 3px 0; }
.sum .tot { font-weight: 800; font-size: 20px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; cursor: pointer; }
.opt.on { border-color: var(--brand); background: #fdf0f5; }
.opt input { margin-top: 4px; }
.notice { background: #fff3cd; border-radius: 12px; padding: 12px; margin: 10px 0; }
.box { background: var(--card); border-radius: 14px; padding: 16px; margin: 12px 0; }
h2 { font-size: 20px; margin: 8px 0 12px; }
