:root {
  --red: #e60012;
  --red-dark: #b8000e;
  --red-soft: #fff1f1;
  --cream: #fffaf0;
  --ink: #1f1f1f;
  --muted: #666;
  --line: #e9e4dc;
  --bg: #ffffff;
  --ok: #0a7f3f;
  --warn-bg: #fff4d6;
  --warn-ink: #7a5200;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 14px rgba(0, 0, 0, .05);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  --round: "M PLUS Rounded 1c", var(--font);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  word-break: auto-phrase;   /* 日本語を文節で改行（対応していないブラウザは通常の改行） */
  line-break: strict;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-dark); }
a:hover { color: var(--red); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(230, 0, 18, .35); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.sp { display: none; }
.small { font-size: 13px; color: var(--muted); }
.center { text-align: center; }

/* 名店街の帯（ロゴは名店街logo_RGB.ai から書き出したSVG） */
.mall-bar { background: #fff; border-bottom: 1px solid var(--line); }
.mall-inner { display: flex; align-items: center; gap: 10px; height: 44px; }
.mall-inner img { height: 30px; width: auto; display: block; }
.mall-inner span { font-size: 12px; color: var(--muted); }
.mall-inner b { color: var(--ink); font-weight: 700; }

/* ヘッダー */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 112px; height: auto; }
.brand-sub { font-family: var(--round); font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; }
.brand-sub b { display: block; color: var(--ink); font-size: 14px; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; background: var(--red); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px;
}
.cart-btn:hover { background: var(--red-dark); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.member-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.member-btn:hover { border-color: #cfc8bd; color: var(--ink); }
.member-btn svg { width: 18px; height: 18px; }
.cart-btn svg { width: 20px; height: 20px; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #fff; color: var(--red); font-size: 12px; font-weight: 800; line-height: 20px; text-align: center;
}
.test-banner { background: var(--warn-bg); color: var(--warn-ink); text-align: center; font-size: 13px; padding: 6px 16px; font-weight: 700; }

main { padding-top: 20px; padding-bottom: 48px; min-height: 60vh; }

/* お知らせ */
.notice { background: var(--cream); border: 1px solid #f1e3c4; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.notice-stop { background: var(--red-soft); border-color: #f5c2c5; color: var(--red-dark); font-weight: 700; }

/* ヒーロー */
.hero { border-radius: var(--radius); overflow: hidden; background: var(--red-soft); margin-bottom: 16px; }
.hero-img { width: 100%; aspect-ratio: 900 / 129; object-fit: cover; object-position: right center; }
.hero-text { padding: 16px 20px 18px; }
.hero h1 { font-family: var(--round); font-weight: 800; font-size: 22px; line-height: 1.45; margin: 0 0 6px; color: var(--red-dark); }
.hero p { margin: 0; font-size: 14px; color: #4a4a4a; }

.perks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.perks li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; text-align: center; }
.perks b { color: var(--red-dark); }

/* カテゴリ */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 商品一覧 */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-img { display: block; background: #fff; aspect-ratio: 4 / 3; padding: 8px; border-bottom: 1px solid #f3efe9; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; flex: 1; }
.card-name { font-size: 14px; font-weight: 700; line-height: 1.5; margin: 0; flex: 1; }
.card-name a { color: var(--ink); text-decoration: none; }
.card-name a:hover { color: var(--red); }
.price { font-family: var(--round); font-weight: 800; font-size: 20px; margin: 0; color: var(--ink); }
.price span { font-family: var(--font); font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 2px; }
.price-lg { font-size: 30px; }
.low { display: inline-block; margin-left: 8px; font-style: normal; font-family: var(--font); font-size: 11px; font-weight: 700; color: #b45309; background: #fdf3e2; border-radius: 999px; padding: 1px 8px; vertical-align: 3px; }
.loading, .empty { color: var(--muted); text-align: center; padding: 32px 0; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: #cfc8bd; color: var(--ink); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn:disabled, .btn.is-disabled { background: #eee; border-color: #eee; color: #999; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 4px; }
.link-back { font-size: 14px; }

/* 数量 */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; border: 0; background: #faf8f5; font-size: 18px; cursor: pointer; }
.stepper button:hover { background: var(--red-soft); color: var(--red); }
.stepper input { width: 52px; border: 0; text-align: center; font-weight: 700; -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; font-size: 16px; }
.stepper-sm input { width: 40px; font-size: 14px; }

/* 商品詳細 */
.crumb { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.detail-img { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.detail-img img { max-width: 100%; max-height: 100%; min-width: 0; object-fit: contain; }
.detail h1 { font-family: var(--round); font-weight: 800; font-size: 24px; line-height: 1.45; margin: 0 0 8px; }
.desc { white-space: normal; color: #3d3d3d; }
.buy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.buy-row .btn { flex: 1; min-width: 180px; min-height: 48px; }
.qty-label { font-size: 13px; color: var(--muted); }
.soldout { display: inline-block; background: #eee; color: #666; font-weight: 700; padding: 6px 14px; border-radius: 8px; }
.detail-notes { font-size: 13px; color: var(--muted); padding-left: 1.2em; }

/* 商品ページ下部の紹介ブロック */
.sections { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); display: grid; gap: 28px; }
.sec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.sec:nth-child(even) .sec-img { order: 2; }
.sec-noimg { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
.sec-img img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.sec-body h2 { font-family: var(--round); font-weight: 800; font-size: 18px; line-height: 1.5; margin: 0 0 8px; color: var(--red-dark); }
.sec-body p { margin: 0; color: #3d3d3d; }
.sec-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.sec-gallery img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* カート・手続き */
.page-title { font-family: var(--round); font-weight: 800; font-size: 24px; margin: 4px 0 16px; }
.page-narrow { max-width: 640px; margin: 0 auto; }
.lead { margin-top: -6px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; background: #fcfbf9; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.side-title { font-size: 15px; margin: 0; }
.lines { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.line { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line img { width: 76px; height: 76px; object-fit: contain; border: 1px solid #f0ebe4; border-radius: 10px; background: #fff; padding: 4px; }
.line-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.line-price { font-size: 13px; color: var(--muted); }
.line-ctrl { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.line-sub { font-weight: 800; font-family: var(--round); white-space: nowrap; }
.line.is-soldout { opacity: .7; }
.tag { display: inline-block; margin-left: 8px; font-size: 11px; background: #eee; color: #555; border-radius: 6px; padding: 0 6px; }
.free-meter { font-size: 13px; }
.free-meter b { color: var(--red-dark); }
.bar { height: 8px; background: #efe9e1; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; background: var(--red); border-radius: 999px; }
.summary { margin: 0; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.summary dt { color: #444; }
.summary dd { margin: 0; text-align: right; }
.summary small { display: block; font-size: 11px; color: var(--muted); }
.summary .free { color: var(--ok); }
.sum-total { border-bottom: 0 !important; padding-top: 10px !important; }
.sum-total dt { font-weight: 700; color: var(--ink); }
.sum-total dd { font-family: var(--round); font-weight: 800; font-size: 24px; color: var(--red-dark); }
.mini-lines { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.mini-lines li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.mini-lines b { white-space: nowrap; }
.alert { background: var(--red-soft); border: 1px solid #f5c2c5; color: var(--red-dark); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 12px; font-size: 12px; counter-reset: s; }
.steps li { flex: 1; text-align: center; padding: 6px 4px; background: #f5f2ee; color: var(--muted); border-radius: 8px; counter-increment: s; }
.steps li::before { content: counter(s) ". "; }
.steps li.on { background: var(--red); color: #fff; font-weight: 700; }

/* フォーム */
.form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.form legend { font-weight: 800; font-size: 16px; margin-bottom: 8px; padding: 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.req, .opt { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 0 6px; margin-left: 6px; vertical-align: 1px; }
.req { background: var(--red); color: #fff; }
.opt { background: #eee; color: #666; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #d9d2c7; border-radius: 10px; background: #fff; font-size: 16px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--red); background: #fffafa; }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.err { font-size: 13px; color: var(--red-dark); margin: 4px 0 0; font-weight: 700; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.w-zip input { max-width: 200px; }
.w-pref select { max-width: 240px; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 3px; accent-color: var(--red); flex: none; }
.ship-choice { display: grid; gap: 10px; margin-bottom: 12px; }
.ship-choice .check { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.ship-choice .check:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.ship-note { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 0 0 12px; }
.agree { background: #fcfbf9; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 8px; }
.actions .btn-primary { flex: 1; max-width: 360px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 確認画面 */
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.box h2 { font-size: 16px; margin: 0 0 10px; }
.kv { margin: 0; }
.kv div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-weight: 400; color: #444; }
.tbl-lines th { font-size: 12px; color: var(--muted); }
.tbl-lines td:nth-child(n+2), .tbl-lines th:nth-child(n+2) { text-align: right; white-space: nowrap; }

/* 完了 */
.done { text-align: left; }
.order-no { background: var(--red-soft); border-radius: var(--radius); padding: 16px; text-align: center; margin: 12px 0 18px; font-size: 13px; color: var(--muted); }
.order-no b { display: block; font-family: var(--round); font-size: 26px; color: var(--red-dark); letter-spacing: .04em; }

/* ガイド */
.guide { margin-top: 40px; padding: 24px 20px; background: #fcfbf9; border: 1px solid var(--line); border-radius: var(--radius); }
.guide h2 { font-family: var(--round); font-weight: 800; font-size: 20px; margin: 0 0 12px; }
.guide h3 { font-size: 15px; margin: 0 0 6px; color: var(--red-dark); }
.guide p { margin: 0 0 6px; font-size: 14px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 28px; margin-bottom: 12px; }
.guide .tbl th { font-size: 13px; }
.guide .tbl td { text-align: right; white-space: nowrap; }

/* フッター */
.site-footer { border-top: 1px solid var(--line); background: #faf8f5; padding: 24px 0 32px; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.foot-links a { color: var(--ink); }
.site-footer p { margin: 0 0 4px; }

/* トースト */
#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; max-width: calc(100% - 32px); width: max-content;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow);
  transition: transform .25s ease, opacity .25s ease, visibility .25s; z-index: 50;
  opacity: 0; visibility: hidden;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
#toast span { opacity: .8; font-size: 13px; }
#toast a { color: #fff; font-weight: 700; }

/* 静的ページ（特商法・プライバシー） */
.doc { max-width: 760px; margin: 0 auto; }
.doc h1 { font-family: var(--round); font-weight: 800; font-size: 24px; }
.doc h2 { font-size: 17px; margin: 28px 0 8px; border-left: 4px solid var(--red); padding-left: 10px; }
.doc .tbl th { width: 30%; background: #faf8f5; font-weight: 700; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .sp { display: inline; }
  .header-inner { height: 56px; }
  .brand img { width: 92px; }
  .brand-sub { font-size: 11px; padding-left: 8px; }
  .brand-sub b { font-size: 12px; }
  .cart-btn { padding: 8px 12px; }
  .cart-btn .cart-label { display: none; }
  .member-btn { flex-direction: column; gap: 0; padding: 2px 6px; border: 0; background: none; font-size: 10px; line-height: 1.2; }
  .member-btn svg { width: 22px; height: 22px; }
  .hero-img { aspect-ratio: 16 / 5; }
  .hero h1 { font-size: 18px; }
  .perks { grid-template-columns: 1fr; gap: 6px; }
  .perks li { text-align: left; padding: 8px 12px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 8px 10px 10px; }
  .card-name { font-size: 13px; }
  .price { font-size: 18px; }
  .card .btn { min-height: 38px; font-size: 13px; padding: 6px 8px; }
  .detail { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .detail h1 { font-size: 20px; }
  .sections { gap: 22px; margin-top: 24px; padding-top: 22px; }
  .sec { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sec:nth-child(even) .sec-img { order: 0; }
  .sec-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mall-inner { height: 38px; }
  .mall-inner img { height: 26px; }
  .mall-inner span { font-size: 11px; }
  .price-lg { font-size: 26px; }
  .row2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kv div { grid-template-columns: 1fr; gap: 2px; }
  .guide-grid { grid-template-columns: 1fr; }
  .steps { font-size: 10px; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions .btn-primary { max-width: none; }
  .line { grid-template-columns: 64px minmax(0, 1fr); }
  .line img { width: 64px; height: 64px; }
  .line-sub { grid-column: 2; }
  .tbl-lines th:nth-child(2), .tbl-lines td:nth-child(2) { display: none; }
}

/* 会員（ログイン・会員登録・マイページ） */
.login-hint, .member-note { background: var(--cream); border: 1px solid #f1e3c4; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 0 0 16px; }
.member-box { background: var(--cream); border: 1px solid #f1e3c4; border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.member-box p { margin: 6px 0 10px; font-size: 14px; }
.auth .box { margin-top: 12px; }
.auth .field input { width: 100%; }
.auth-links { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; }
.auth-links .small { margin-left: 6px; }
.member-points { padding-left: 1.2em; color: var(--muted); }
.w-code { max-width: 10em; letter-spacing: .3em; font-size: 20px; }
.mypage .box h2 { font-size: 17px; }
.hist { border-top: 1px solid var(--line); padding: 12px 0; }
.hist:first-of-type { border-top: 0; padding-top: 0; }
.hist header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.hist p { margin: 4px 0 0; }
.hist ul { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; }
.hist li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.hist footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hist-status { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 10px; background: #f1f1f1; color: #555; }
.hist-status.st-new, .hist-status.st-preparing { background: var(--red-soft); color: var(--red-dark); }
.hist-status.st-shipped { background: #e8f6ed; color: var(--ok); }
.mypage-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
