@charset "UTF-8";
/* ============================================================
   注文サイト 共通スタイル
   ============================================================ */

:root {
  --color-bg:        #f4f6f8;
  --color-surface:   #ffffff;
  --color-text:      #1f2933;
  --color-muted:     #6b7784;
  --color-border:    #d8dee5;
  --color-primary:   #1f5fa8;
  --color-primary-d: #17477d;
  --color-text-cat:  #1f5fa8;
  --color-goods-cat: #1d7a5f;
  --color-error:     #b3261e;
  --color-error-bg:  #fdecea;
  --color-info:      #1f5fa8;
  --color-info-bg:   #e8f0fa;
  --color-success:   #1d7a5f;
  --color-success-bg:#e6f4ef;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(31, 41, 51, .08), 0 1px 2px rgba(31, 41, 51, .06);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  /* 内容が短いページでもフッタが画面下に来るようにする */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

.site-header, .site-footer { flex: 0 0 auto; }

a { color: var(--color-primary); }
a:hover { text-decoration: none; }

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- ヘッダ / フッタ ---------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; min-height: 60px;
}
.site-title { margin: 0; font-size: 1.15rem; font-weight: 700; }
.site-title a { color: var(--color-text); text-decoration: none; }
.header-nav {
  display: flex; align-items: center; gap: 16px;
  font-size: .9rem; flex-wrap: wrap;
}
.header-user { color: var(--color-muted); }
.link-logout { color: var(--color-muted); }

.main-content { flex: 1 0 auto; padding: 28px 16px 64px; }

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 16px 0;
}
.footer-text { margin: 0; font-size: .82rem; color: var(--color-muted); text-align: center; }

/* ---------- 見出し / テキスト ---------- */
.page-title { margin: 0 0 16px; font-size: 1.5rem; line-height: 1.4; }
.section-title { margin: 0 0 8px; font-size: 1.05rem; }
.lead { margin: 0 0 20px; }
.note { margin: 12px 0 0; font-size: .88rem; color: var(--color-muted); }
.hint { margin: 6px 0 0; font-size: .82rem; color: var(--color-muted); }
.breadcrumb { margin: 0 0 12px; font-size: .85rem; color: var(--color-muted); }
.req {
  margin-left: 6px; padding: 1px 6px; border-radius: 3px;
  font-size: .7rem; font-weight: 700;
  color: #fff; background: var(--color-error); vertical-align: 2px;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }

/* ---------- カード ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-narrow { max-width: 520px; margin-inline: auto; }
.card-center { text-align: center; }
.card-center .form-actions { justify-content: center; }
.card-payment { background: #fbfcfd; }

/* ---------- お知らせ ---------- */
.alert {
  margin: 0 0 16px; padding: 12px 16px;
  border-radius: var(--radius); font-size: .92rem;
  border: 1px solid transparent;
}
.alert-error   { color: var(--color-error);   background: var(--color-error-bg);   border-color: #f5c6c2; }
.alert-info    { color: var(--color-info);    background: var(--color-info-bg);    border-color: #c3d8f0; }
.alert-success { color: var(--color-success); background: var(--color-success-bg); border-color: #bfe3d6; }

/* ---------- フォーム ---------- */
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block; margin-bottom: 6px;
  font-size: .9rem; font-weight: 600;
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="password"] {
  width: 100%; padding: 11px 12px;
  font-size: 1rem; font-family: inherit;
  color: var(--color-text); background: #fff;
  border: 1px solid var(--color-border); border-radius: 6px;
}
.form-row input:focus-visible,
.qty-input:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.form-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center; margin-top: 24px;
}
.form-links {
  margin: 20px 0 0; font-size: .88rem; text-align: center;
}
.form-links .sep { margin: 0 8px; color: var(--color-border); }

.btn {
  display: inline-block; padding: 11px 22px;
  font-size: 1rem; font-family: inherit; font-weight: 600;
  line-height: 1.4; text-align: center; text-decoration: none;
  border: 1px solid transparent; border-radius: 6px;
  cursor: pointer;
}
.btn-primary { color: #fff; background: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-d); }
.btn-plain {
  color: var(--color-text); background: #fff;
  border-color: var(--color-border);
}
.btn-plain:hover { background: #f0f3f6; }
.btn-large { padding: 14px 32px; font-size: 1.05rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- バナー(テキスト / 物販) ---------- */
.banner-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 28px;
}
.banner {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 36px 28px;
  color: #fff; text-decoration: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 41, 51, .16);
}
.banner-text  { background: linear-gradient(135deg, #2a6fbd, #1f5fa8); }
.banner-goods { background: linear-gradient(135deg, #228b6c, #1d7a5f); }
.banner-label { font-size: 1.6rem; font-weight: 700; line-height: 1.3; }
.banner-desc  { font-size: .92rem; opacity: .9; }
.banner-arrow {
  position: absolute; right: 24px; bottom: 24px;
  font-size: 1.4rem; opacity: .8;
}
.home-note { font-size: .9rem; color: var(--color-muted); }

/* ---------- 商品テーブル ---------- */
.order-form { margin-bottom: 24px; }

.product-table,
.confirm-table,
.history-table {
  width: 100%; border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: .95rem;
}
.product-table th,
.product-table td,
.confirm-table th,
.confirm-table td,
.history-table th,
.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left; vertical-align: middle;
}
.product-table thead th,
.confirm-table thead th,
.history-table thead th {
  background: #eef2f6; font-size: .85rem; font-weight: 600;
  color: var(--color-muted); white-space: nowrap;
}
.product-table tbody tr:last-child td,
.product-table tbody tr:last-child th { border-bottom: none; }

.col-price { text-align: right; white-space: nowrap; }
.col-qty   { text-align: center; white-space: nowrap; }
.col-price-incl { font-weight: 600; }

.product-name { display: block; font-weight: 600; }
.product-desc { display: block; font-size: .82rem; color: var(--color-muted); }
.product-code {
  display: block; font-size: .75rem; color: var(--color-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.qty-input {
  width: 5.5em; padding: 9px 8px;
  font-size: 1rem; font-family: inherit; text-align: right;
  border: 1px solid var(--color-border); border-radius: 6px;
}
.qty-input.is-filled {
  border-color: var(--color-primary);
  background: #f5f9fe;
  font-weight: 700;
}
.qty-unit { margin-left: 4px; font-size: .85rem; color: var(--color-muted); }

/* ---------- 合計 ---------- */
.order-summary {
  margin-top: 16px; padding: 14px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.summary-lines { margin: 0; }
.summary-row {
  display: flex; align-items: baseline; justify-content: flex-end;
  gap: 16px; padding: 3px 0;
}
.summary-row dt { font-size: .9rem; color: var(--color-muted); }
.summary-row dd { margin: 0; min-width: 7em; text-align: right; font-variant-numeric: tabular-nums; }
.summary-row.is-discount dd { color: var(--color-success); }
.summary-row.is-total {
  margin-top: 8px; padding-top: 10px;
  border-top: 1px solid var(--color-border);
}
.summary-row.is-total dt { font-size: 1rem; color: var(--color-text); font-weight: 600; }
.summary-row.is-total dd { font-size: 1.4rem; font-weight: 700; }

.confirm-table .row-discount td { color: var(--color-success); }
.row-note {
  display: inline-block; margin-left: 8px;
  font-size: .78rem; font-weight: 400; color: var(--color-muted);
}
.campaign { font-size: .92rem; }
.address-block { margin: 0; line-height: 1.9; }
.input-short { max-width: 12em; }
.history-amounts {
  margin: 10px 0 0; padding-top: 8px;
  border-top: 1px dashed var(--color-border); font-size: .85rem;
}
.history-amounts > div { display: flex; justify-content: space-between; gap: 12px; }
.history-amounts dt { color: var(--color-muted); }
.history-amounts dd { margin: 0; font-variant-numeric: tabular-nums; }
.badge-review { color: #8a6100; background: #fdf2dc; }

.confirm-table tfoot th {
  text-align: right; font-weight: 600; background: #fbfcfd;
}
.confirm-table tfoot td { background: #fbfcfd; }
.confirm-table tfoot .row-tax th,
.confirm-table tfoot .row-tax td {
  font-weight: 400; font-size: .88rem; color: var(--color-muted);
}
.confirm-table tfoot .row-total th,
.confirm-table tfoot .row-total td {
  font-size: 1.15rem; font-weight: 700;
  background: #eef2f6; border-bottom: none;
}

.payment-method {
  margin: 0; padding: 12px 16px;
  font-weight: 600;
  background: var(--color-info-bg);
  border-radius: 6px;
}

.form-actions-sticky {
  position: sticky; bottom: 0; z-index: 10;
  justify-content: flex-end;
  margin-top: 20px; padding: 14px 0;
  background: var(--color-bg);
  box-shadow: 0 -8px 12px -8px rgba(31, 41, 51, .18);
}

/* ---------- 注文情報 ---------- */
.order-meta {
  display: grid; grid-template-columns: auto 1fr;
  gap: 6px 20px; margin: 0 0 24px;
  text-align: left; font-size: .95rem;
}
.order-meta dt { color: var(--color-muted); }
.order-meta dd { margin: 0; font-weight: 600; }
.order-meta .amount { font-size: 1.2rem; }
.amount-tax {
  display: block; font-size: .82rem; font-weight: 400;
  color: var(--color-muted);
}

/* ---------- 履歴 ---------- */
.badge {
  display: inline-block; padding: 2px 10px;
  font-size: .78rem; font-weight: 700; border-radius: 999px;
  white-space: nowrap;
}
.badge-paid     { color: var(--color-success); background: var(--color-success-bg); }
.badge-pending  { color: #8a6100; background: #fdf2dc; }
.badge-canceled,
.badge-failed   { color: var(--color-error); background: var(--color-error-bg); }
.history-items { margin: 8px 0 0; padding-left: 1.2em; font-size: .85rem; }

/* ---------- スマートフォン ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .card { padding: 18px; }
  .page-title { font-size: 1.3rem; }

  /* 商品テーブルをカード状に積み替える */
  .product-table,
  .product-table tbody,
  .product-table tr,
  .product-table th,
  .product-table td { display: block; width: 100%; }
  .product-table thead { display: none; }
  .product-table tbody tr {
    padding: 14px; border-bottom: 1px solid var(--color-border);
  }
  .product-table th,
  .product-table td { padding: 2px 0; border-bottom: none; }
  .product-table .col-price { text-align: left; }
  .product-table .col-price-incl { color: var(--color-text); font-size: 1rem; }
  .product-table .col-price-incl::before {
    content: "単価(税込) "; font-size: .88rem; color: var(--color-muted);
  }
  .product-table .col-ship::before {
    content: "送料 "; font-size: .88rem; color: var(--color-muted);
  }
  .summary-row dd { min-width: 6em; }
  .product-table .col-qty { margin-top: 8px; text-align: left; }

  /* 追従ボタンバーの下に商品行が隠れないよう余白を足す */
  .order-form { padding-bottom: 8px; }
  .form-actions-sticky {
    margin-inline: -16px; padding: 12px 16px;
    border-top: 1px solid var(--color-border);
  }

  .confirm-table,
  .history-table { display: block; overflow-x: auto; white-space: nowrap; }

  .form-actions .btn { flex: 1 1 auto; }
  .banner { padding: 28px 22px; }
  .banner-label { font-size: 1.35rem; }
}

/* ---------- ログアウト(POST フォームをリンク風に見せる) ---------- */
.logout-form { margin: 0; display: inline; }
.link-logout {
  padding: 0; font-family: inherit; font-size: inherit;
  color: var(--color-muted); background: none; border: none;
  text-decoration: underline; cursor: pointer;
}
.link-logout:hover { color: var(--color-text); }

/* ---------- 消費税の注記 ---------- */
.tax-note { margin-top: 12px; }

/* ---------- 診断ツール / 開発用表示 ---------- */
.log-box {
  margin: 0; padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem; line-height: 1.6;
  color: var(--color-text); background: #f4f6f8;
  border: 1px solid var(--color-border); border-radius: 6px;
  overflow-x: auto; white-space: pre;
}
.debug-link { word-break: break-all; text-align: left; }
.debug-link a { display: inline-block; margin: 6px 0; }
.form-row select {
  width: 100%; padding: 11px 12px;
  font-size: 1rem; font-family: inherit;
  color: var(--color-text); background: #fff;
  border: 1px solid var(--color-border); border-radius: 6px;
}

.missing-col { margin: 18px 0 6px; display: flex; align-items: center; gap: 10px; }
.missing-col .mono { font-weight: 600; }

/* ---------- フッターの運営者情報 ---------- */
.site-footer { padding: 24px 0; }
.footer-company { text-align: center; margin-bottom: 12px; }
.footer-name { margin: 0 0 4px; font-size: .92rem; font-weight: 600; color: var(--color-text); }
.footer-addr { margin: 0; font-size: .82rem; line-height: 1.8; color: var(--color-muted); }
.footer-links {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 8px 20px; margin-bottom: 12px; font-size: .82rem;
}
.footer-text { margin: 0; font-size: .78rem; color: var(--color-muted); text-align: center; }

/* ---------- ログイン前の説明 ---------- */
.site-intro { background: #eef2f6; border-color: #d3dce5; padding: 18px 22px; }
.intro-text { margin: 0 0 8px; font-size: .92rem; line-height: 1.8; }
.intro-contact { margin: 0; font-size: .85rem; color: var(--color-muted); }

/* ---------- 法務ページ ---------- */
.legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.legal-table th, .legal-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--color-border);
  text-align: left; vertical-align: top;
}
.legal-table th {
  width: 12em; font-weight: 600; color: var(--color-muted);
  background: #f7f9fb; white-space: normal;
}
.legal-table tr:last-child th, .legal-table tr:last-child td { border-bottom: none; }
.legal-list { margin: 0 0 16px; padding-left: 1.4em; font-size: .92rem; line-height: 1.9; }
.unset { color: var(--color-error); font-size: .85rem; }
.page-legal .section-title { margin-top: 24px; }

@media (max-width: 640px) {
  .legal-table, .legal-table tbody, .legal-table tr,
  .legal-table th, .legal-table td { display: block; width: 100%; }
  .legal-table th { background: none; padding-bottom: 2px; font-size: .82rem; }
  .legal-table td { padding-top: 0; padding-bottom: 14px; }
}

/* ---------- 注文履歴の絞り込み ---------- */
.history-filter {
  margin: 0 0 14px; padding: 10px 14px;
  font-size: .85rem; color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: 6px;
}
.history-filter a { margin-left: 6px; }
