@charset "utf-8";

/* ===== SFC design tokens ===== */
:root {
  --red: #c8102e;
  --red-dark: #99091f;
  --red-tint: #fdf2f4;
  --navy: #10275a;
  --navy-dark: #0a1a3d;
  --navy-tint: #f1f4fb;
  --ink: #1c2430;
  --muted: #66727f;
  --line: #dde2e8;
  --bg: #f5f7fa;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 39, 90, .06), 0 8px 24px rgba(16, 39, 90, .08);
  --maxw: 900px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a { color: var(--navy); }
img { max-width: 100%; height: auto; }

/* ===== header / footer ===== */
.site-header {
  background: var(--navy);
  color: var(--white);
  border-bottom: 4px solid var(--red);
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__logo { width: 34px; height: 38px; object-fit: contain; flex: 0 0 auto; }
.site-header__title { font-size: 15px; font-weight: 700; margin: 0; line-height: 1.4; }
.site-header__sub { font-size: 12px; opacity: .78; margin: 0; line-height: 1.4; }

.site-footer {
  max-width: var(--maxw);
  margin: 40px auto 0;
  padding: 20px 18px 32px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

/* 送信完了パネル */
.result {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 5px solid var(--red);
  padding: 26px 24px;
  margin: 22px 0;
}

.result h2 { margin: 0 0 10px; font-size: 19px; }
.result p { margin: 0 0 8px; font-size: 14px; line-height: 1.9; }
.result__summary { margin: 20px 0 6px; }
.result__summary h3 { font-size: 14px; margin: 22px 0 8px; }

.summary { width: 100%; border-collapse: collapse; font-size: 14px; }
.summary th, .summary td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.summary tbody th { background: var(--navy-tint); font-weight: 700; width: 38%; white-space: nowrap; }
.summary--order thead th { background: var(--navy-tint); }
.summary--order td:nth-child(3),
.summary--order td:nth-child(4),
.summary--order thead th:nth-child(3),
.summary--order thead th:nth-child(4) { text-align: right; white-space: nowrap; }
.summary--order tfoot th { background: var(--navy-tint); text-align: right; }
.summary--order tfoot td { text-align: right; font-weight: 700; font-size: 16px; }

/* メールアドレスと電話番号の「どちらか一方は必須」の案内 */
.notice--contact {
  background: #fff8e1;
  border: 1px solid #f0d68a;
  color: #6b5300;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.8;
  margin: 0 0 18px;
}

/* 印刷時は控えだけを出す */
@media print {
  .site-header, .site-footer, .back, .page-head p, .actions, .mock-note { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .result { box-shadow: none; border-top: 3px solid var(--red); padding: 0; }
  .wrap { padding: 0; max-width: none; }
}

/* 送信中などの状態表示 */
.status { font-size: 13px; color: var(--muted); margin: 0; }

/* Turnstile（自動投稿よけ）の表示枠。未設定のときは空のまま */
.turnstile-slot:not(:empty) { margin: 24px 0 0; }

/* ハニーポット（自動投稿よけ。画面には出さない） */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.mock-note {
  background: #fff8e1;
  border: 1px solid #f0d68a;
  color: #6b5300;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 22px;
}

/* ===== top page ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 55%, var(--red-dark) 100%);
  color: var(--white);
  padding: 32px 20px 52px;
  text-align: center;
}

.hero__logo {
  width: 54px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
}

.hero h1 { margin: 0 0 8px; font-size: 25px; letter-spacing: .02em; line-height: 1.45; }
.hero p { margin: 0; opacity: .85; font-size: 14px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 26px 18px 0; }
.wrap--narrow { max-width: 740px; }

.menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: -30px 0 0;
  padding: 0;
  list-style: none;
}

.card {
  display: block;
  height: 100%;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  border-top: 5px solid var(--navy);
  transition: transform .12s ease, box-shadow .12s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(16, 39, 90, .16); }
.card--red { border-top-color: var(--red); }

.card__icon { font-size: 24px; line-height: 1; }
.card__title { margin: 10px 0 4px; font-size: 17px; font-weight: 700; }
.card__desc { margin: 0; font-size: 13px; color: var(--muted); }

.card__tag {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--navy-tint);
  color: var(--navy);
}

.card--red .card__tag { background: var(--red-tint); color: var(--red); }
.card--admin { border-top-color: var(--muted); }
.card--admin .card__tag { background: #eceff3; color: var(--muted); }

/* ===== form pages ===== */
.page-head {
  border-left: 6px solid var(--navy);
  padding: 4px 0 4px 14px;
  margin: 0 0 8px;
}

.page-head--red { border-left-color: var(--red); }
.page-head h1 { margin: 0; font-size: 22px; line-height: 1.4; }
.page-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.back {
  display: inline-block;
  margin: 16px 0 14px;
  font-size: 13px;
  text-decoration: none;
  color: var(--muted);
}

.back:hover { color: var(--navy); text-decoration: underline; }

.panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 22px 0;
}

.panel__legend {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
  margin: 0 0 18px;
}

.panel--red .panel__legend { color: var(--red); }

.notice {
  background: var(--navy-tint);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.9;
  margin: 0 0 22px;
}

.notice--red { background: var(--red-tint); }
.notice p { margin: 0 0 10px; }
.notice p:last-child { margin-bottom: 0; }

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.field > label,
.field__label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.req {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  background: var(--red);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: 1px;
}

.opt {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: #eceff3;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: 1px;
}

.hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 16px; /* iOS でのズーム防止のため 16px 以上 */
  background: var(--white);
  color: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
  border-color: var(--navy);
}

textarea { min-height: 86px; resize: vertical; }

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.radios { display: flex; gap: 18px; flex-wrap: wrap; }

.radios label,
.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 400;
  cursor: pointer;
}

.check {
  background: var(--red-tint);
  border: 1px solid #f0c9d0;
  border-radius: 10px;
  padding: 14px 16px;
  font-weight: 700;
}

input[type="radio"], input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--navy);
  flex: 0 0 20px;
}

/* ===== uniform order table ===== */
.order { width: 100%; border-collapse: collapse; font-size: 14px; }
.order th, .order td { border-bottom: 1px solid var(--line); padding: 12px 8px; text-align: left; vertical-align: middle; }

.order thead th {
  position: sticky;
  top: var(--total-h, 74px); /* 合計バーの真下に固定（高さは JS で実測） */
  z-index: 4;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  letter-spacing: .04em;
  border-bottom: none;
}

.order--red thead th { background: var(--red); }
.order td.c-qty, .order td.c-sub,
.order th.c-qty, .order th.c-sub { text-align: right; white-space: nowrap; }
.order .c-item { font-weight: 700; }
.order .c-photo { width: 72px; }
.order select { padding: 8px 8px; font-size: 14px; }
.order input[type="number"] { width: 66px; padding: 8px 6px; font-size: 15px; text-align: center; }
.order tbody tr.is-picked { background: #fbfcfe; }
.order .c-sub { font-variant-numeric: tabular-nums; }

.thumb {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
}

/* 合計金額バー: 商品表の上部に固定表示 */
.total-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 14px;
  background: var(--navy);
  color: var(--white);
  border-radius: 10px;
  padding: 12px 20px;
  margin: 0 0 16px;
  box-shadow: 0 4px 14px rgba(16, 39, 90, .25);
}

.total-bar--red { background: var(--red); box-shadow: 0 4px 14px rgba(200, 16, 46, .25); }
.total-bar span { font-size: 13px; opacity: .9; }
.total-bar strong { font-size: 25px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }

/* ===== admin ===== */
.signed-in {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--navy-tint);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 22px;
}

.avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: grid; place-items: center;
  font-weight: 700;
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.admins { width: 100%; border-collapse: collapse; font-size: 14px; }
.admins th, .admins td { border-bottom: 1px solid var(--line); padding: 11px 8px; text-align: left; white-space: nowrap; }
.admins thead th { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.admins td.mail { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--red-tint);
  color: var(--red);
}

.badge--view { background: #eceff3; color: var(--muted); }

.link-danger {
  background: none; border: none; padding: 0;
  color: var(--red); font: inherit; font-size: 13px;
  cursor: pointer; text-decoration: underline;
}

.add-row { display: grid; grid-template-columns: 1fr 160px auto; gap: 10px; align-items: end; margin-top: 18px; }

/* ===== buttons ===== */
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 26px 0 8px; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  background: var(--navy);
  color: var(--white);
}

.btn:hover { background: var(--navy-dark); }
.btn--red { background: var(--red); }
.btn--red:hover { background: var(--red-dark); }
.btn--ghost { background: transparent; color: var(--muted); padding: 14px 18px; }
.btn--ghost:hover { background: #eceff3; color: var(--ink); }
.btn--outline {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 13px 24px;
}
.btn--outline:hover { background: #eceff3; color: var(--ink); }
.btn--sm { padding: 11px 20px; font-size: 14px; }

/* ===== スマートフォン最適化 ===== */
@media (max-width: 640px) {
  body { font-size: 15px; }

  .hero { padding: 26px 16px 46px; }
  .hero__logo { width: 46px; }
  .hero h1 { font-size: 20px; }

  .wrap { padding: 20px 14px 0; }
  .menu { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 16px; }

  .page-head h1 { font-size: 18px; }
  .panel { padding: 16px 14px; border-radius: 10px; }
  .notice { padding: 14px; font-size: 13px; }

  /* 商品表を1商品＝1カードのレイアウトに切り替え */
  .order, .order tbody, .order tr, .order td { display: block; width: 100%; }
  .order thead { display: none; }

  .order tr {
    display: grid;
    grid-template-columns: 76px 1fr auto;
    grid-template-areas:
      "photo item item"
      "photo size size"
      "photo qty  sub";
    align-items: center;
    gap: 8px 12px;
    padding: 14px 2px;
    border-bottom: 1px solid var(--line);
  }

  .order td { border: none; padding: 0; }
  .order td.c-photo { grid-area: photo; align-self: start; width: auto; }
  .order td.c-item  { grid-area: item; font-size: 15px; }
  .order td.c-size  { grid-area: size; }
  .order td.c-qty   { grid-area: qty; display: flex; align-items: center; text-align: left; }
  .order td.c-sub   { grid-area: sub; text-align: right; font-weight: 700; font-size: 15px; }

  .order td.c-qty::before {
    content: "枚数";
    font-size: 12px;
    color: var(--muted);
    margin-right: 8px;
  }

  .thumb { width: 74px; height: 74px; }
  .order select { font-size: 16px; padding: 10px 8px; }
  .order input[type="number"] { font-size: 16px; width: 62px; }

  .total-bar { padding: 11px 16px; border-radius: 8px; }
  .total-bar strong { font-size: 22px; }

  .add-row { grid-template-columns: 1fr; }

  .actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .btn { width: 100%; padding: 15px 20px; }
}
