/* ══════════════════════════════════════════════════════
   一括資料請求機能
   - single-machine.php の追加ボタン (.req-btn-lg / .req-btn-go)
   - header.php のカウンター (.header-req-btn / .mn-req-btn)
   - page-templates/request.php のフォーム全体 (.req-*)
══════════════════════════════════════════════════════ */

/* ── ヘッダー「資料請求」ボタン（PC） ────────────── */
.header-req-btn {
  position:relative;
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 14px 6px 12px;
  font-size:11px; letter-spacing:0.08em;
  color:var(--text-2); text-decoration:none;
  border:1px solid var(--border);
  border-radius:3px; background:none;
  transition:all 0.2s;
  font-family:inherit;
}
.header-req-btn:hover {
  border-color:var(--gold); color:var(--gold); background:var(--gold-pale2);
}
.header-req-icon { font-size:13px; line-height:1; }
.header-req-text { white-space:nowrap; }
.header-req-badge {
  position:absolute; top:-6px; right:-6px;
  min-width:18px; height:18px; padding:0 5px;
  background:var(--line-green); color:#fff;
  border-radius:9px; font-size:10px; font-weight:600;
  display:inline-flex; align-items:center; justify-content:center;
  line-height:1; box-shadow:0 1px 4px rgba(0,0,0,0.15);
}

/* ── モバイル資料請求ボタン ────────────── */
.mn-req-btn {
  position:relative;
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 20px;
  background:var(--gold-pale2); color:var(--text-2);
  border:1px solid var(--gold);
  border-radius:4px; text-decoration:none;
  font-size:13px; letter-spacing:0.08em; font-weight:500;
  margin-bottom:0.75rem; transition:all 0.2s;
}
.mn-req-btn:hover { background:var(--gold-pale); color:var(--gold); }
.mn-req-icon { font-size:15px; }
.mn-req-badge {
  min-width:20px; height:20px; padding:0 6px;
  background:var(--line-green); color:#fff;
  border-radius:10px; font-size:11px; font-weight:600;
  display:inline-flex; align-items:center; justify-content:center;
  line-height:1;
}

/* ── single-machine.php「資料請求リストに追加」ボタン ────── */
.req-btn-lg {
  display:flex; align-items:center; justify-content:center; gap:8px;
  width:100%; padding:14px 18px;
  background:var(--line-green); color:#fff;
  border:1px solid var(--line-green);
  border-radius:4px;
  font-size:13px; letter-spacing:0.08em; font-weight:500;
  font-family:inherit; cursor:pointer;
  transition:all 0.2s; margin-bottom:0.6rem;
}
.req-btn-lg:hover { background:var(--line-dark); border-color:var(--line-dark); }
.req-btn-lg[data-req-on="1"] {
  background:#fff; color:var(--line-green);
}
.req-btn-lg[data-req-on="1"]:hover {
  background:#f0fbf4;
}
.req-btn-lg .req-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:20px; height:20px; border-radius:50%;
  background:rgba(255,255,255,0.25); font-size:14px; font-weight:600;
  line-height:1;
}
.req-btn-lg[data-req-on="1"] .req-icon {
  background:#e6f7ec; color:var(--line-green);
}

/* ── single-machine.php「請求リストへ進む」ボタン ────── */
.req-btn-go {
  display:flex; align-items:center; justify-content:center; gap:8px;
  width:100%; padding:11px 18px;
  background:#fff; color:var(--text-2);
  border:1px solid var(--border);
  border-radius:4px; text-decoration:none;
  font-size:12px; letter-spacing:0.08em;
  transition:all 0.2s; margin-bottom:0.6rem;
}
.req-btn-go:hover { border-color:var(--gold); color:var(--gold); background:var(--gold-pale2); }
.req-count-inline {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:22px; height:22px; padding:0 7px;
  background:var(--gold-pale); color:var(--gold);
  border-radius:11px; font-size:11px; font-weight:600;
  line-height:1;
}
.req-count-inline[data-count="0"] { background:var(--bg3); color:var(--text-3); }

/* ══════════════════════════════════════════════════════
   /request/ ページ
══════════════════════════════════════════════════════ */

.req-page-heading { margin-bottom:0.75rem; }
.req-page-sub-note { font-size:12px; color:var(--text-3); }

/* 空リスト時 */
.req-empty {
  text-align:center; padding:3rem 1.5rem;
  background:var(--bg2); border:1px dashed var(--border);
  border-radius:12px; margin-bottom:2rem;
}
.req-empty-icon { font-size:48px; margin-bottom:1rem; opacity:0.5; }
.req-empty-title {
  font-family:'Noto Serif JP',serif; font-size:20px;
  color:var(--text); margin-bottom:0.75rem;
}
.req-empty-text {
  font-size:13px; color:var(--text-3);
  line-height:1.8; margin-bottom:1.5rem;
}
.req-empty-btn {
  display:inline-block; padding:10px 28px;
  background:var(--gold); color:#fff;
  border-radius:4px; text-decoration:none;
  font-size:13px; letter-spacing:0.08em;
  transition:background 0.2s;
}
.req-empty-btn:hover { background:var(--gold-light); }

/* 選択中機器リスト */
.req-machines-list {
  display:flex; flex-direction:column; gap:0.75rem;
  margin-bottom:2rem;
}
.req-item {
  display:flex; align-items:center; gap:1rem;
  padding:0.85rem 1rem;
  background:#fff; border:1px solid var(--border3);
  border-radius:8px; box-shadow:0 1px 3px rgba(0,0,0,0.04);
  position:relative;
}
.req-item--loading { opacity:0.5; }
.req-item-thumb {
  flex-shrink:0; width:60px; height:60px;
  border-radius:6px; overflow:hidden;
  background:var(--bg3);
  display:flex; align-items:center; justify-content:center;
}
.req-item-img { width:100%; height:100%; object-fit:cover; }
.req-item-noimg { font-size:24px; opacity:0.4; }
.req-item-body { flex:1; min-width:0; }
.req-item-meta {
  display:flex; gap:8px; flex-wrap:wrap;
  margin-bottom:4px; font-size:11px;
}
.req-item-maker {
  color:var(--gold); font-weight:500; letter-spacing:0.04em;
}
.req-item-cat {
  color:var(--text-3);
  padding:1px 8px; background:var(--bg2);
  border-radius:10px;
}
.req-item-title {
  display:block; font-size:14px; font-weight:500;
  color:var(--text); text-decoration:none;
  line-height:1.4;
}
.req-item-title:hover { color:var(--gold); text-decoration:underline; }
.req-item-remove {
  flex-shrink:0; width:32px; height:32px;
  background:none; border:1px solid var(--border3);
  border-radius:50%; cursor:pointer;
  color:var(--text-3); font-size:18px; line-height:1;
  transition:all 0.2s;
  font-family:inherit;
}
.req-item-remove:hover {
  border-color:#e05c5c; color:#e05c5c; background:#fef5f5;
}

/* フォーム */
.req-form { padding:2rem 1.75rem; }
.req-form-title {
  font-family:'Noto Serif JP',serif;
  font-size:20px; font-weight:500; color:var(--text);
  margin:0 0 1.5rem; padding-bottom:0.75rem;
  border-bottom:1px solid var(--border3);
}
.req-field { margin-bottom:1.5rem; }
.req-field-row {
  display:grid; grid-template-columns:1fr 1fr; gap:1rem;
}
.req-field-col { min-width:0; }
.req-optional { color:var(--text-3); font-size:12px; font-weight:400; }

.req-input, .req-textarea {
  width:100%; padding:11px 14px;
  border:1px solid var(--border3);
  border-radius:4px; font-size:14px;
  font-family:inherit; color:var(--text);
  background:#fff; transition:border-color 0.15s;
  box-sizing:border-box;
}
.req-input:focus, .req-textarea:focus {
  outline:none; border-color:var(--gold);
}
.req-textarea { resize:vertical; min-height:100px; }

.req-radio-group {
  display:grid; grid-template-columns:repeat(2,1fr); gap:0.5rem;
}
.req-radio {
  display:flex; align-items:center; gap:8px;
  padding:10px 14px; cursor:pointer;
  border:1px solid var(--border3); border-radius:4px;
  font-size:13px; color:var(--text-2);
  transition:all 0.15s; background:#fff;
}
.req-radio:hover { border-color:var(--gold); background:var(--gold-pale2); }
.req-radio input {
  margin:0; accent-color:var(--gold);
}
.req-radio:has(input:checked) {
  border-color:var(--gold); background:var(--gold-pale2); color:var(--gold);
}

/* 同意 */
.req-consent {
  padding:1rem; margin-bottom:1.25rem;
  background:var(--bg2); border-radius:6px;
  border-left:3px solid var(--gold);
}
.req-consent-label {
  display:flex; align-items:flex-start; gap:10px;
  font-size:13px; line-height:1.7; color:var(--text-2);
  cursor:pointer;
}
.req-consent-label input {
  margin-top:3px; flex-shrink:0; accent-color:var(--gold);
  width:16px; height:16px;
}

/* 送信ボタン */
.req-submit-btn {
  display:block; width:100%; padding:16px;
  background:var(--line-green); color:#fff;
  border:none; border-radius:4px;
  font-size:15px; letter-spacing:0.1em; font-weight:500;
  font-family:inherit; cursor:pointer;
  transition:all 0.2s;
}
.req-submit-btn:hover:not(:disabled) {
  background:var(--line-dark); transform:translateY(-1px);
  box-shadow:var(--shadow-md);
}
.req-submit-btn:disabled { opacity:0.6; cursor:wait; }
.req-form-note {
  margin-top:1rem; font-size:12px; color:var(--text-3);
  text-align:center; line-height:1.7;
}

/* 完了メッセージ */
.req-done {
  text-align:center; padding:3rem 1.5rem;
  background:var(--gold-pale2); border:1px solid var(--gold);
  border-radius:12px; margin:2rem 0;
}
.req-done-icon { font-size:56px; margin-bottom:1rem; }
.req-done-title {
  font-family:'Noto Serif JP',serif; font-size:24px;
  color:var(--text); font-weight:500; margin-bottom:1rem;
}
.req-done-text {
  font-size:14px; color:var(--text-2);
  line-height:1.9; margin-bottom:2rem;
}
.req-done-actions {
  display:flex; gap:0.75rem; justify-content:center; flex-wrap:wrap;
}
.req-done-btn {
  display:inline-block; padding:11px 28px;
  background:#fff; color:var(--text-2);
  border:1px solid var(--border);
  border-radius:4px; text-decoration:none;
  font-size:13px; letter-spacing:0.08em;
  transition:all 0.2s;
}
.req-done-btn:hover { border-color:var(--gold); color:var(--gold); }
.req-done-btn--primary {
  background:var(--gold); color:#fff; border-color:var(--gold);
}
.req-done-btn--primary:hover {
  background:var(--gold-light); border-color:var(--gold-light); color:#fff;
}

/* ══════════════════════════════════════════════════════
   マシン一覧カード：ラベル付き「＋ 資料請求リストに追加」ボタン
   （<article> の末尾に自動注入。全カードテンプレ共通）
   カラー：LINE緑（金色主体のカードデザインの中でCTAを視認性高く）
══════════════════════════════════════════════════════ */
.card-req-btn {
  display:flex; align-items:center; justify-content:center; gap:8px;
  width:calc(100% - 0px);
  margin-top:14px;
  padding:11px 16px;
  background:var(--line-green);
  color:#fff;
  border:1px solid var(--line-green);
  border-radius:6px;
  cursor:pointer;
  font-size:13px; font-weight:500; letter-spacing:0.06em;
  font-family:inherit;
  transition:all 0.2s;
  line-height:1;
  position:relative; z-index:2;
}
.card-req-btn:hover {
  background:var(--line-dark);
  border-color:var(--line-dark);
  transform:translateY(-1px);
  box-shadow:0 3px 10px rgba(6,199,85,0.30);
}
.card-req-btn[data-req-on="1"] {
  background:#fff;
  color:var(--line-green);
  border-color:var(--line-green);
}
.card-req-btn[data-req-on="1"]:hover {
  background:#f0fbf4;
}
.card-req-btn .req-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:20px; height:20px; border-radius:50%;
  background:rgba(255,255,255,0.22);
  font-size:14px; font-weight:600; line-height:1;
  transition:background 0.2s;
}
.card-req-btn[data-req-on="1"] .req-icon {
  background:#e6f7ec;
  color:var(--line-green);
}

/* スマホでは少しコンパクトに */
@media (max-width:640px) {
  .card-req-btn { padding:10px 12px; font-size:12px; margin-top:12px; }
  .card-req-btn .req-icon { width:18px; height:18px; font-size:13px; }
}

/* ══════════════════════════════════════════════════════
   Sticky footer bar（画面下部追従）
══════════════════════════════════════════════════════ */
.req-sticky-bar {
  position:fixed; left:50%; bottom:16px;
  transform:translate(-50%, 120%);
  display:flex; align-items:center; gap:14px;
  padding:10px 10px 10px 20px;
  background:#fff;
  border:1px solid var(--line-green);
  border-radius:100px;
  box-shadow:0 8px 30px rgba(6,199,85,0.22), 0 2px 8px rgba(0,0,0,0.08);
  z-index:998;
  opacity:0; pointer-events:none;
  transition:transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.25s;
  max-width:calc(100vw - 32px);
  font-family:inherit;
}
.req-sticky-bar.is-visible {
  transform:translate(-50%, 0);
  opacity:1;
  pointer-events:auto;
}
.req-sticky-info {
  display:flex; align-items:baseline; gap:6px;
  white-space:nowrap;
}
.req-sticky-icon {
  font-size:16px; line-height:1;
}
.req-sticky-label {
  font-size:12px; color:var(--text-3); letter-spacing:0.06em;
}
.req-sticky-num {
  font-size:20px; font-weight:600; color:var(--line-green);
  font-family:'Cormorant Garamond', serif;
  line-height:1;
  transition:color 0.2s;
}
/* 0件状態：カウント色をやや落として控えめに */
.req-sticky-bar.is-empty .req-sticky-num { color:var(--text-3); }
.req-sticky-bar.is-empty .req-sticky-btn { background:#8ac9a1; }
.req-sticky-bar.is-empty .req-sticky-btn:hover { background:var(--line-green); }
.req-sticky-unit {
  font-size:12px; color:var(--text-2);
}
.req-sticky-btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:11px 22px;
  background:var(--line-green); color:#fff;
  border-radius:100px; text-decoration:none;
  font-size:13px; font-weight:500; letter-spacing:0.08em;
  transition:all 0.2s;
  white-space:nowrap;
}
.req-sticky-btn:hover {
  background:var(--line-dark);
  transform:translateY(-1px);
}
.req-sticky-arrow {
  transition:transform 0.2s;
}
.req-sticky-btn:hover .req-sticky-arrow {
  transform:translateX(3px);
}

/* body側：sticky bar表示時に下部余白を確保（フッターがバーに埋まらないよう） */
body.has-req-bar { padding-bottom:80px; }

/* ── スマホ最適化 ────────────── */
@media (max-width:768px) {
  .header-req-text { display:none; }
  .header-req-btn { padding:6px 10px; }
  .req-field-row { grid-template-columns:1fr; }
  .req-radio-group { grid-template-columns:1fr; }
  .req-form { padding:1.5rem 1rem; }
  .req-item { padding:0.75rem; }
  .req-item-thumb { width:50px; height:50px; }
  .req-item-title { font-size:13px; }
  .req-done-actions { flex-direction:column; }
  .req-done-btn { width:100%; }

  /* Sticky bar：スマホでは幅ほぼいっぱいに */
  .req-sticky-bar {
    left:12px; right:12px; bottom:12px;
    transform:translateY(120%);
    max-width:none; width:calc(100% - 24px);
    padding:8px 8px 8px 16px; gap:10px;
  }
  .req-sticky-bar.is-visible { transform:translateY(0); }
  .req-sticky-info { flex:1; }
  .req-sticky-btn { padding:10px 16px; font-size:12px; }
  body.has-req-bar { padding-bottom:72px; }
}
