/* ============================================================
   共通メールフォーム スタイル（.afmf にスコープ）
   ・どのサイトに貼っても同じ見た目。サイト差は下のテーマ変数だけ。
   ・<form class="afmf afmf--corp"> … コーポレート（白基調・赤）
   ・<form class="afmf afmf--lp">   … LP（赤背景に白カード・金ボタン）
   ============================================================ */
.afmf{
  /* ▼ サイトごとに切り替えるのはこの変数群だけ ▼ */
  --afmf-card-bg:#f5f6f8;
  --afmf-field-bg:#ffffff;
  --afmf-border:#e6e8eb;
  --afmf-text:#1a1c1f;
  --afmf-muted:#6b7280;
  --afmf-accent:#d6291f;
  --afmf-req-bg:#d6291f;
  --afmf-opt-bg:#cfd4da;
  --afmf-submit-bg:#d6291f;
  --afmf-submit-ink:#ffffff;
  --afmf-radius:14px;
  --afmf-field-radius:10px;
  /* ▲ ここまで ▲ */
  font:inherit;
  color:var(--afmf-text);
  text-align:left;            /* ページ側の中央寄せ等を継承しない（LP対策） */
}
.afmf *,.afmf *::before,.afmf *::after{box-sizing:border-box}

/* テーマ：LP（赤背景に白カード・送信ボタンは金） */
.afmf--lp{
  --afmf-card-bg:#ffffff;
  --afmf-border:#f1cccc;
  --afmf-accent:#CC0000;
  --afmf-req-bg:#CC0000;
  --afmf-submit-bg:#FFD700;
  --afmf-submit-ink:#7a1300;
  --afmf-radius:16px;
  /* LPは横幅いっぱいの暗色セクション直下に置かれるため、幅を制限して中央寄せ
     （ページ他セクションの max-width:720px に合わせる） */
  max-width:720px;
  margin-left:auto;
  margin-right:auto;
}

.afmf-card{background:var(--afmf-card-bg);border:1px solid var(--afmf-border);border-radius:var(--afmf-radius);padding:26px}
.afmf-sec{font-size:1.05rem;font-weight:800;margin:6px 0 16px;padding-bottom:8px;border-bottom:2px solid var(--afmf-accent);color:var(--afmf-text)}
.afmf-sec:not(:first-child){margin-top:30px}

.afmf-field{margin-bottom:18px}
.afmf-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.afmf-row--wide-left{grid-template-columns:1fr auto}
@media(max-width:560px){.afmf-row,.afmf-row--wide-left{grid-template-columns:1fr}}
.afmf-field > label,.afmf-grouplabel{display:block;font-weight:700;font-size:.92rem;margin-bottom:7px}

.afmf input[type=text],.afmf input[type=email],.afmf input[type=tel],.afmf textarea,.afmf select{
  width:100%;padding:.75em .9em;border:1px solid var(--afmf-border);border-radius:var(--afmf-field-radius);
  font-size:1rem;font-family:inherit;background:var(--afmf-field-bg);color:var(--afmf-text)}
.afmf .afmf-zip{max-width:260px}
.afmf select{appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,var(--afmf-muted) 50%),linear-gradient(135deg,var(--afmf-muted) 50%,transparent 50%);
  background-position:calc(100% - 18px) 1.1em,calc(100% - 13px) 1.1em;background-size:5px 5px,5px 5px;background-repeat:no-repeat}
.afmf input:focus,.afmf textarea:focus,.afmf select:focus{outline:none;border-color:var(--afmf-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--afmf-accent) 18%,transparent)}
.afmf textarea{resize:vertical}
.afmf input[type=file]{width:100%;font-size:.9rem;padding:8px;border:1px dashed var(--afmf-border);border-radius:var(--afmf-field-radius);background:var(--afmf-field-bg)}

.afmf-req{background:var(--afmf-req-bg);color:#fff;font-size:.66rem;padding:.15em .55em;border-radius:5px;margin-left:6px;vertical-align:middle}
.afmf-opt{background:var(--afmf-opt-bg);color:#fff;font-size:.66rem;padding:.15em .55em;border-radius:5px;margin-left:6px;vertical-align:middle}

.afmf-radios{display:flex;flex-wrap:wrap;gap:14px}
.afmf-radios label{font-weight:600;display:flex;align-items:center;gap:6px;margin:0}

.afmf-hint{font-size:.82rem;color:var(--afmf-muted);margin:7px 0 0}
.afmf-hint a,.afmf-check a{color:var(--afmf-accent);text-decoration:underline}
.afmf-check label{font-weight:600;display:flex;align-items:flex-start;gap:8px;font-size:.92rem}
.afmf-check input{margin-top:.2em}
/* 同意行（プライバシーポリシーに同意する 必須）は中央揃え。直下の「内容を確認する」リンクと位置を揃える。
   [data-check] で限定し、明細内の「元箱あり」チェック（同じ .afmf-check）には効かせない（2026-09-04） */
.afmf-check[data-check] label{justify-content:center}
/* 同意文の下に置くプライバシーポリシーへのリンク。
   以前はリンクをラベル内に入れていたが、ラベル全体がチェック領域のため
   チェックしようとしてリンクを踏む誤タップが起きていた（2026-09-04にラベル外へ分離）。 */
.afmf-check__link{margin:10px 0 0;text-align:center;font-size:.84rem;line-height:1.6}
/* 中央揃え＋縦10pxは誤タップ対策。チェックボックスは左端にあるため、
   リンクを中央へ離して重なりを避ける（2026-09-04） */
.afmf-check__link a{color:var(--afmf-accent);text-decoration:underline;text-underline-offset:2px}

/* エラー表示（JS/PHPで .has-error を付与） */
.afmf .has-error input,.afmf .has-error select,.afmf .has-error textarea{border-color:var(--afmf-accent);background:#fff6f5}
.afmf-error{display:none;color:var(--afmf-accent);font-size:.82rem;font-weight:700;margin:6px 0 0}
.afmf .has-error .afmf-error{display:block}

/* 商品ブロック */
.afmf-item{border:1px solid var(--afmf-border);border-radius:12px;padding:16px;margin-bottom:14px;background:rgba(255,255,255,.55)}
.afmf-item__head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.afmf-item__no{font-weight:800;font-size:.95rem;background:var(--afmf-accent);color:#fff;border-radius:999px;padding:.15em .9em}
.afmf-item__del{border:1px solid var(--afmf-border);background:var(--afmf-field-bg);color:var(--afmf-muted);border-radius:8px;font-size:.8rem;padding:.35em .8em;cursor:pointer}
.afmf-item__del:hover{color:var(--afmf-accent);border-color:var(--afmf-accent)}
.afmf-additem{border:1px dashed var(--afmf-accent);background:transparent;color:var(--afmf-accent);font-weight:700;border-radius:var(--afmf-field-radius);padding:.7em 1.2em;cursor:pointer;font-family:inherit;font-size:.95rem;margin-bottom:4px}

/* ハニーポット（人間には見えない。ボット対策） */
.afmf-hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}

/* 角丸12px = コーポレートサイトの .btn と揃えた値（2026-09-03）。ピル型(999px)から変更。
   フォームは全ページ共通パーツなので、価格表(.cta-btn は 2px)とは意図的に別系統。
   戻す場合は施主に確認のこと。 */
.afmf-submit{width:100%;border:0;border-radius:12px;cursor:pointer;font-family:inherit;font-weight:800;font-size:1.08rem;padding:1.05em 1.4em;margin-top:18px;
  background:var(--afmf-submit-bg);color:var(--afmf-submit-ink);box-shadow:0 6px 16px color-mix(in srgb,var(--afmf-submit-bg) 35%,transparent);transition:transform .1s}
.afmf-submit:hover{transform:translateY(-2px)}
.afmf-submit:disabled{opacity:.6;cursor:default;transform:none}
.afmf-note{margin-top:12px;font-size:.8rem;color:var(--afmf-muted);text-align:center}
.afmf-formerror{display:none;margin-top:12px;padding:.8em 1em;border-radius:10px;background:#fff6f5;border:1px solid var(--afmf-accent);color:var(--afmf-accent);font-size:.9rem;font-weight:700}

/* ============================================================
   価格表 → 見積りカート（form.js の initPricelistCart が生成）
   ※価格表ページ（.pl-table がある）でのみ表示される。他ページには影響しない。
   ============================================================ */
/* 表の上の使い方バナー */
.afmf-cart-howto{margin:0 0 14px;padding:.8em 1em;border-radius:10px;background:#fff7e6;border:1px solid #e9b949;color:#7a5a00;font-size:.9rem;font-weight:700;line-height:1.7}
/* 操作列とボタン */
.pl-add-th{width:1%;white-space:nowrap}
.pl-add-cell{text-align:right;white-space:nowrap}
.afmf-cart-btn{display:inline-flex;align-items:center;gap:.35em;padding:.45em .85em;border-radius:8px;border:1px solid #d8a200;background:#f5c542;color:#3a2c00;font-weight:700;font-size:.82rem;line-height:1;white-space:nowrap;cursor:pointer;font-family:inherit;transition:filter .12s}
.afmf-cart-btn:hover{filter:brightness(1.06)}
.afmf-cart-btn:focus-visible{outline:2px solid #7a5a00;outline-offset:2px}
.afmf-cart-btn.is-added{background:#e7f6e9;border-color:#4caf50;color:#1f7a32}
.afmf-cart-btn.is-added:hover{background:#fdecea;border-color:#e0554a;color:#b3261e}   /* 追加済みは押すと取り消し（PCはホバーで赤く＝削除を示唆） */
.afmf-cart-ico{font-size:1.05em;font-weight:800}
/* 追加時のハイライト（商品ブロックなどに付与） */
@keyframes afmfCartFlash{0%{background:#fff3c4;box-shadow:0 0 0 3px #f5c542 inset}100%{background:transparent;box-shadow:none}}
.afmf-cart-flash{animation:afmfCartFlash 1.4s ease-out}
/* 画面下のミニカートバー（パネル＝展開リスト／行＝常時表示） */
.afmf-cart-bar{position:fixed;left:0;right:0;bottom:0;z-index:9999;background:#1c1c1c;color:#fff;box-shadow:0 -4px 18px rgba(0,0,0,.35);transform:translateY(120%);transition:transform .25s ease;font-weight:700}
.afmf-cart-bar.is-open{transform:none}
.afmf-cart-bar__row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 16px}
.afmf-cart-bar__count{display:inline-flex;align-items:center;background:none;border:0;color:#fff;font-family:inherit;font-weight:700;font-size:1rem;padding:0;cursor:default}
.afmf-cart-bar.has-items .afmf-cart-bar__count{cursor:pointer}
.afmf-cart-bar__count b{color:#f5c542;font-size:1.3rem;margin:0 .15em}
.afmf-cart-bar__caret{display:none;margin-left:.25em;transition:transform .2s}
.afmf-cart-bar.has-items .afmf-cart-bar__caret{display:inline}
.afmf-cart-bar.is-expanded .afmf-cart-bar__caret{transform:rotate(180deg)}
.afmf-cart-bar__go{flex:0 0 auto;padding:.7em 1.2em;border-radius:10px;border:0;background:#f5c542;color:#3a2c00;font-weight:800;font-size:.95rem;cursor:pointer;font-family:inherit;white-space:nowrap}
.afmf-cart-bar__go:hover{filter:brightness(1.06)}
.afmf-cart-bar__panel{display:none;flex-wrap:wrap;gap:8px;max-height:40vh;overflow-y:auto;padding:12px 16px;border-bottom:1px solid #3a3a3a}
.afmf-cart-bar.is-expanded .afmf-cart-bar__panel{display:flex}
/* 型番チップ（✕で取り消し） */
.afmf-cart-chip{display:inline-flex;align-items:center;gap:.4em;background:#2c2c2c;border:1px solid #4a4a4a;border-radius:999px;padding:.3em .35em .3em .75em;font-size:.85rem;font-weight:700;white-space:nowrap}
.afmf-cart-chip__t{color:#fff}
.afmf-cart-chip__x{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:0;border-radius:50%;background:#4a4a4a;color:#fff;font-size:.66rem;line-height:1;cursor:pointer;font-family:inherit;padding:0}
.afmf-cart-chip__x:hover{background:#e0554a}
/* スマホ：カテゴリ列を隠して余白を確保（カテゴリは絞り込みチップで代替可）。
   ボタンはPCと同一のテキスト入りのまま（測定上360px幅に収まる）。 */
@media(max-width:560px){
  .pl-col-cat{display:none}
  /* 狭い画面では左右26pxの余白が効いて入力欄が窮屈になり、
     同意チェックの一文が「プライバシーポリ／シー」で割れていたため詰める（2026-09-04） */
  .afmf-card{padding:20px 13px}
  /* リンク・本文・必須バッジが別々のフレックス要素になって分断されるのを防ぎ、
     ひと続きの文章として折り返させる */
  .afmf-check label{display:block}
  .afmf-check[data-check] label{text-align:center}
  .afmf-check input{margin-right:5px;vertical-align:-.12em}
  .afmf-check .afmf-req{margin-left:3px}
  .afmf-cart-bar__row{padding:9px 12px;gap:10px}
  .afmf-cart-bar__go{padding:.6em 1em;font-size:.9rem}
}
