/* YHDEV STORE — 共通スタイル（焙煎所トーンのライトテーマ） */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Zen+Old+Mincho:wght@600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f2ea;
  --bg-card: #fffdf9;
  --ink: #322a21;
  --muted: #8b7d6a;
  --line: #e5dbc9;
  --brand: #57402c;        /* エスプレッソ */
  --brand-fg: #fbf7f0;
  --accent: #a06a35;       /* キャラメル */
  --danger: #b04a35;
  --ok: #5f7a4f;
  --shadow: 0 1px 2px rgba(60, 44, 24, 0.06), 0 8px 24px -12px rgba(60, 44, 24, 0.18);
  --serif: "Zen Old Mincho", "Hiragino Mincho ProN", serif;
  --sans: "Noto Sans JP", -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.92em;
  color: var(--brand);
  background: rgba(87, 64, 44, 0.07);
  padding: 1px 6px;
  border-radius: 5px;
}

/* ---- header / footer ---- */
#site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brand);
}
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }

.header-inner nav {
  display: flex;
  gap: 26px;
  align-items: center;
  font-size: 13.5px;
  font-weight: 500;
}
.header-inner nav a { color: var(--ink); }
.header-inner nav a:hover { color: var(--accent); text-decoration: none; }
.nav-settings { color: var(--muted) !important; font-size: 12.5px; }

.cart-badge {
  display: inline-block;
  min-width: 19px;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.7;
  vertical-align: 1px;
}

#site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-card);
  padding: 26px 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.04em;
}
#site-footer .footer-logo {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--brand);
  margin-bottom: 4px;
}
#site-footer p { margin: 0; }

/* ---- layout ---- */
main { width: min(100%, 1040px); margin: 0 auto; padding: 40px 24px 80px; }

h1 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}
h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 44px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.lead { color: var(--muted); font-size: 13.5px; margin: 0 0 30px; }
.step-label { color: var(--muted); font-size: 13px; font-family: var(--sans); letter-spacing: 0.05em; }

/* ---- hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 48px;
  border-radius: 16px;
  background:
    radial-gradient(120% 160% at 100% 0%, #efe0c8 0%, rgba(239, 224, 200, 0) 55%),
    linear-gradient(135deg, #5a4430 0%, #3d2d1e 100%);
  color: #f5eee2;
  margin-bottom: 52px;
  box-shadow: var(--shadow);
}
.hero .eyebrow {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: #cbb38e;
  margin: 0 0 14px;
  font-weight: 500;
}
.hero h1 {
  font-size: 34px;
  color: #faf5ea;
  margin-bottom: 14px;
  line-height: 1.5;
}
.hero p { margin: 0 0 26px; color: #d9cbb4; font-size: 14px; max-width: 34em; }
.hero .btn-primary { background: #f5eee2; border-color: #f5eee2; color: var(--brand); }
.hero .btn-primary:hover { opacity: 0.92; }

/* ---- product grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(60, 44, 24, 0.06), 0 16px 32px -12px rgba(60, 44, 24, 0.24);
}

.card .thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.card .body { padding: 16px 18px 18px; }
.card .name { font-size: 14px; font-weight: 500; margin: 0 0 3px; line-height: 1.6; }
.card .brand { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; margin: 0 0 10px; }
.card .price { font-family: var(--serif); font-size: 17px; font-weight: 700; margin: 0; color: var(--brand); }
.card .price small { font-size: 11px; color: var(--muted); font-family: var(--sans); font-weight: 400; }

/* ---- product detail ---- */
.detail { display: grid; grid-template-columns: 1fr 1.2fr; gap: 44px; align-items: start; }
@media (max-width: 680px) { .detail { grid-template-columns: 1fr; } }

.detail .thumb {
  display: block;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.detail .price {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
  margin: 12px 0 18px;
}
.detail .price small { font-size: 12px; color: var(--muted); font-family: var(--sans); font-weight: 400; }
.detail .meta { font-size: 13px; color: var(--muted); margin: 22px 0; border-top: 1px solid var(--line); padding-top: 16px; }
.detail .meta dt { float: left; clear: left; width: 110px; }
.detail .meta dd { margin: 0 0 6px 110px; color: var(--ink); }

/* ---- buttons / forms ---- */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: transparent;
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.btn:hover { background: rgba(87, 64, 44, 0.06); text-decoration: none; }

.btn-primary { background: var(--brand); color: var(--brand-fg); }
.btn-primary:hover { background: #6a5138; }

.btn-danger { border-color: rgba(176, 74, 53, 0.5); color: var(--danger); }
.btn-danger:hover { background: rgba(176, 74, 53, 0.07); }

.btn-sm { padding: 4px 14px; font-size: 12.5px; }

.qty-control { display: inline-flex; align-items: center; gap: 10px; }
.qty-control .qty { min-width: 2em; text-align: center; font-weight: 700; }

form.stack { display: grid; gap: 18px; max-width: 480px; }
label.field { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
select, textarea {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(160, 106, 53, 0.35);
  outline-offset: 1px;
  border-color: var(--accent);
}
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 16px 20px;
  margin: 0;
}
legend { font-size: 12.5px; color: var(--muted); padding: 0 8px; letter-spacing: 0.04em; }
fieldset label { display: block; font-size: 14px; margin: 6px 0; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--brand); }

/* ---- tables ---- */
table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.list th, table.list td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.list tr:last-child td { border-bottom: none; }
table.list th {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  background: rgba(87, 64, 44, 0.04);
}
table.list td.num, table.list th.num { text-align: right; }

.item-thumb {
  width: 52px;
  height: 39px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  vertical-align: middle;
  margin-right: 10px;
}

.summary-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  max-width: 380px;
  font-size: 14px;
}
.summary-box .row { display: flex; justify-content: space-between; margin: 5px 0; }
.summary-box .row span:first-child { color: var(--muted); }
.summary-box .total {
  font-weight: 700;
  font-size: 17px;
  font-family: var(--serif);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}
.summary-box .total span:first-child { color: var(--ink); }

/* ---- misc ---- */
.notice {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-card);
  font-size: 13.5px;
  margin: 18px 0;
}
.notice.ok { border-left-color: var(--ok); }
.notice.warn { border-left-color: var(--danger); }

.tag-pill {
  display: inline-block;
  padding: 2px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.muted { color: var(--muted); }
.actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; align-items: center; }

/* ---- debug panel ---- */
#yhdbg {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: min(400px, calc(100vw - 32px));
  max-height: 45vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 8px 32px rgba(60, 44, 24, 0.25);
  font-size: 12px;
  z-index: 9999;
}

.yhdbg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(87, 64, 44, 0.05);
  border-radius: 12px 12px 0 0;
  font-weight: 700;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--brand);
  cursor: default;
}

.yhdbg-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 11px;
  text-align: center;
}

.yhdbg-actions button {
  margin-left: 6px;
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.yhdbg-actions button:hover { color: var(--brand); border-color: var(--brand); }

.yhdbg-list { overflow-y: auto; padding: 6px 12px; }

.yhdbg-entry { border-bottom: 1px dashed var(--line); padding: 6px 0; }
.yhdbg-entry:last-child { border-bottom: none; }
.yhdbg-entry-head { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.yhdbg-entry-head strong { color: var(--accent); }

.yhdbg-repush {
  margin-left: auto;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  cursor: pointer;
}
.yhdbg-repush:hover { color: var(--brand); border-color: var(--brand); }
.yhdbg-entry pre {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
}

#yhdbg.yhdbg-min { max-height: none; }
#yhdbg.yhdbg-min .yhdbg-list { display: none; }
#yhdbg.yhdbg-min .yhdbg-head { border-bottom: none; border-radius: 12px; }
