/* 水麺商店 v1 — 白地・黒文字・水の青。公式サイト(waterramen.com)とトーンを揃える */
:root {
  --blue: #169fff;
  --blue-on-light: #0a6fc0;
  --red: #e2000a;
  --ink: #111;
  --text: #222;
  --muted: #5e7180;
  --line: #dde6ef;
  --bg-alt: #f3f7fb;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", Meiryo, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.8;
}
a { color: var(--blue-on-light); }
button { font: inherit; cursor: pointer; }

/* ------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: #fff; border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { text-decoration: none; color: var(--ink); display: grid; line-height: 1.3; }
.brand strong { font-size: 20px; letter-spacing: .06em; }
.brand span { font-size: 10px; letter-spacing: .28em; color: var(--muted); }
.header-nav { display: flex; align-items: center; gap: 18px; }
.header-nav a { font-size: 13px; text-decoration: none; color: var(--text); }
.cart-button {
  position: relative; border: 1px solid var(--ink); background: #fff;
  border-radius: 999px; padding: 8px 18px; font-size: 13px; font-weight: 700;
}
.cart-count {
  position: absolute; top: -8px; right: -8px;
  background: var(--red); color: #fff; font-size: 11px;
  min-width: 20px; height: 20px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 5px;
}

/* ------------------------------------------------------------ hero */
.hero { max-width: 1080px; margin: 0 auto; padding: 56px 20px 32px; text-align: center; }
.hero h1 { font-size: clamp(24px, 4.6vw, 40px); color: var(--ink); line-height: 1.5; margin-bottom: 16px; }
.hero p { font-size: 15px; }
.hero-note {
  margin-top: 18px; display: inline-block; background: var(--bg-alt);
  border-radius: 999px; padding: 8px 22px; font-size: 13px;
}
.hero-note strong { color: var(--blue-on-light); }

/* ------------------------------------------------------------ products */
.products { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; display: grid; gap: 72px; }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.main-image { width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb {
  width: 56px; height: 56px; padding: 0; border: 2px solid transparent;
  border-radius: 8px; overflow: hidden; background: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-active { border-color: var(--blue); }
.product-body h2 { font-size: clamp(20px, 2.6vw, 26px); color: var(--ink); line-height: 1.5; }
.price { font-size: 24px; font-weight: 800; color: var(--ink); margin: 10px 0 14px; }
.price span { font-size: 13px; font-weight: 400; color: var(--muted); }
.desc { font-size: 14px; margin-bottom: 22px; }
.opt-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.opt-label { font-size: 12px; color: var(--muted); width: 48px; }
.opt {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 8px 16px; font-size: 13px;
}
.opt.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.opt:disabled { color: #bbb; background: #f5f5f5; text-decoration: line-through; cursor: not-allowed; }
.stock-note { min-height: 24px; font-size: 13px; color: var(--red); }
.buy-row { display: flex; gap: 10px; margin-top: 6px; }
.qty { border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 14px; }
.add-button {
  flex: 1; background: var(--blue-on-light); color: #fff; border: none;
  border-radius: 999px; padding: 14px 20px; font-size: 15px; font-weight: 700;
}
.add-button:hover { background: #085b9f; }

/* ------------------------------------------------------------ craft */
.craft { background: var(--bg-alt); padding: 56px 20px 64px; }
.craft h2 { max-width: 1080px; margin: 0 auto 28px; font-size: clamp(20px, 3vw, 28px); color: var(--ink); }
.craft-grid { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.craft-grid > div { background: #fff; border-radius: 14px; padding: 24px; }
.craft-grid h3 { font-size: 16px; margin-bottom: 10px; color: var(--ink); }
.craft-grid p { font-size: 13px; }

/* ------------------------------------------------------------ cart */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
/* display:flex等がhidden属性に勝ってしまうのを防ぐ */
.cart-panel[hidden], .cart-overlay[hidden], .cart-count[hidden] { display: none; }
.cart-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw);
  background: #fff; z-index: 31; padding: 20px; overflow-y: auto;
  box-shadow: -8px 0 30px rgba(0,0,0,.15); display: flex; flex-direction: column;
}
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cart-head h2 { font-size: 18px; }
.cart-close { border: none; background: none; font-size: 26px; line-height: 1; }
.cart-items { flex: 1; }
.cart-empty { color: var(--muted); font-size: 14px; padding: 24px 0; }
.cart-item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
  border-bottom: 1px solid var(--line); padding: 12px 0; font-size: 13px;
}
.ci-name { grid-column: 1 / -1; font-weight: 700; }
.ci-controls { display: flex; align-items: center; gap: 10px; }
.ci-controls button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  width: 28px; height: 28px;
}
.ci-remove { width: auto !important; padding: 0 10px; font-size: 12px; color: var(--muted); }
.ci-price { text-align: right; font-weight: 700; }
.cart-summary { border-top: 2px solid var(--ink); margin-top: 10px; padding-top: 12px; font-size: 14px; }
.sum-row { display: flex; justify-content: space-between; padding: 3px 0; }
.sum-total { font-size: 17px; font-weight: 800; margin-top: 6px; }
.sum-hint { font-size: 12px; color: var(--blue-on-light); text-align: right; }
.checkout-button {
  margin-top: 14px; background: var(--ink); color: #fff; border: none;
  border-radius: 999px; padding: 15px; font-size: 15px; font-weight: 700;
}
.checkout-button:disabled { background: #ccc; cursor: not-allowed; }
.cart-note { font-size: 11px; color: var(--muted); margin-top: 10px; }
.cart-error { color: var(--red); font-size: 13px; margin-top: 10px; }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 20px 44px; text-align: center; font-size: 13px; }
.site-footer nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.copyright { color: var(--muted); margin-top: 10px; }

/* ------------------------------------------------------------ policies / success / admin */
.doc { max-width: 780px; margin: 0 auto; padding: 48px 20px 80px; }
.doc h1 { font-size: 26px; color: var(--ink); margin-bottom: 28px; }
.doc h2 { font-size: 20px; color: var(--ink); margin: 44px 0 14px; border-bottom: 2px solid var(--blue); padding-bottom: 6px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.doc th { background: var(--bg-alt); width: 32%; font-weight: 700; }
.doc p, .doc li { font-size: 14px; }
.doc ul { padding-left: 22px; }
.success-box { max-width: 560px; margin: 80px auto; padding: 0 20px; text-align: center; }
.success-box h1 { font-size: 24px; color: var(--ink); margin-bottom: 16px; }
.success-box .back { display: inline-block; margin-top: 28px; }

@media (max-width: 760px) {
  .product { grid-template-columns: 1fr; gap: 20px; }
  .craft-grid { grid-template-columns: 1fr; }
  .products { gap: 56px; }
}
