:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #2b2a28;
  --muted: #77736c;
  --line: #e6e1d8;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --danger: #b4432f;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b19;
    --surface: #262522;
    --text: #ece8e1;
    --muted: #a39e95;
    --line: #3a3833;
    --accent: #7fb8a4;
    --accent-text: #14211d;
    --danger: #e98a77;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }

/* ヘッダー */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: .04em; }
.cart-button {
  font: inherit; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; display: flex; align-items: center; gap: 8px;
}
.badge {
  background: var(--accent); color: var(--accent-text);
  border-radius: 999px; min-width: 22px; padding: 0 6px;
  font-size: .8rem; text-align: center;
}

/* ヒーロー */
.hero { padding: 40px 0 24px; }
.hero h1 { font-size: clamp(1.4rem, 4vw, 2rem); margin: 0 0 6px; font-weight: 700; }
.shipping-note { margin: 0; color: var(--muted); }

.notice {
  margin-top: 16px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.notice.error { border-color: var(--danger); color: var(--danger); }

/* 商品一覧 */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding-bottom: 56px;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.card img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; height: auto; background: var(--line); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 1rem; }
.card p { margin: 0; font-size: .88rem; color: var(--muted); flex: 1; }
.price { font-weight: 700; font-size: 1.05rem; }
.price small { font-weight: 400; color: var(--muted); font-size: .75rem; }

button.primary {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent); color: var(--accent-text);
  border: none; border-radius: 8px; padding: 10px 14px; width: 100%;
}
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.primary:focus-visible, .cart-button:focus-visible, .icon-button:focus-visible, .qty button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px;
}

/* カート */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(400px, 100%);
  background: var(--surface); z-index: 30;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
  border-left: 1px solid var(--line);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.1rem; }
.icon-button { font-size: 1.5rem; line-height: 1; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px 8px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 16px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 14px 16px 20px; display: grid; gap: 10px; }

.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.line-name { font-size: .9rem; }
.line-price { font-size: .85rem; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button {
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
.qty span { min-width: 22px; text-align: center; }
.remove { background: none; border: none; color: var(--muted); font-size: .75rem; cursor: pointer; padding: 0; text-decoration: underline; }

.totals { margin: 0; display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; }
.totals dt, .totals dd { margin: 0; }
.totals .total { font-weight: 700; font-size: 1.1rem; border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 4px; }

/* 固定ページ */
.page { padding: 40px 0 64px; max-width: 760px; }
.page h1 { font-size: 1.5rem; }
.legal { width: 100%; border-collapse: collapse; background: var(--surface); }
.legal th, .legal td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; font-size: .92rem; }
.legal th { width: 32%; background: color-mix(in srgb, var(--line) 40%, var(--surface)); font-weight: 500; }
@media (max-width: 560px) {
  .legal th, .legal td { display: block; width: 100%; }
  .legal th { border-bottom: none; }
}

/* フッター */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 32px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 16px; font-size: .88rem; }
