/* ================================
   ご成約内容 共通スタイル（整形版）
   ================================ */

/* ---- トークン ---- */
:root {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --fg: #1a202c;
  --fg-muted: #6b7280;
  --border: #e2e8f0;
  --primary: #6b46c1; /* 江戸紫系 */
  --edo-purple: #6d3c9e; /* 既存プロジェクトの江戸紫 */
  --radius: 12px;
  --gap: 24px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
  --page-gutter: 16px; /* 画面端の最小ガター */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a202c;
    --bg-card: #1f2937;
    --fg: #f7fafc;
    --fg-muted: #94a3b8;
    --border: #4a5568;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.35);
  }
}

/* ---- ベース ---- */
html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family:
    "Noto Sans JP",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    Meiryo,
    sans-serif;
}

/* ---- コンテナ（フルワイド＋最小ガター） ---- */
.ce-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px var(--page-gutter) 64px;
  box-sizing: border-box;
}

/* 端末幅に応じてガターを微調整 */
@media (min-width: 480px) {
  .ce-wrap {
    --page-gutter: 10px;
  }
}
@media (min-width: 768px) {
  .ce-wrap {
    --page-gutter: 12px;
  }
}
@media (min-width: 1024px) {
  .ce-wrap {
    --page-gutter: 14px;
  }
}

/* テーマ側パディングの打ち消し（安全） */
.site-main,
#primary.site-main {
  margin-top: 0 !important;
  padding-top: 8px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ---- ヘッダー（名前行） ---- */
.ce-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  margin: 0;
  padding: 12px 0 10px; /* 標準余白（過剰な 88px 指定は撤去） */
}

.ce-header__icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  color: var(--edo-purple);
  flex: 0 0 24px;
  margin-right: 12px;
}

.ce-header__name {
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
}

/* Material Icons（CDNフォント使用時の体裁） */
.mi {
  font-family: "Material Icons";
  font-weight: normal;
  font-style: normal;
  font-size: 28px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* ヘッダー直下のカードはやや詰める */
.ce-header + .ce-card {
  margin-top: 8px;
}

/* ---- カード ---- */
.ce-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.ce-card + .ce-card {
  margin-top: 20px;
}

/* 既存タイトルは使わない（メモ見出しを採用） */
.ce-card__title {
  display: none;
}

/* ---- グリッド（定義リスト） ---- */
.ce-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 14px;
}
.ce-grid dt {
  color: var(--fg-muted);
  font-weight: 700;
}
.ce-grid dd {
  margin: 0;
}

/* ---- 行（ラベル＋右側ボタンなど） ---- */
.ce-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  margin-top: 12px;
}
.ce-row__label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
}
.ce-row__sub {
  color: var(--fg-muted);
  font-weight: 600;
}

/* ---- テキスト補助 ---- */
.ce-muted {
  color: var(--fg-muted);
  font-weight: 600;
}
.ce-note {
  color: var(--fg-muted);
  font-size: 12px;
  margin-top: 8px;
}

/* ---- ボタン ---- */
.ce-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--fg);
  transition:
    transform 0.08s ease,
    box-shadow 0.18s ease,
    background 0.2s ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}
.ce-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.ce-btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---- 確認ブロック ---- */
.ce-confirm {
  text-align: center;
  padding: 16px 0 24px;
}
.ce-confirm__title {
  font-weight: 800;
  margin: 0 0 10px;
}
.ce-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 14px;
}
.ce-check__input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.ce-check__label {
  font-size: 14px;
  color: var(--fg);
}

/* ---- メモ見出し（江戸紫バー＋下線） ---- */
.memo-wrap {
  margin-bottom: 10px;
}
.memo-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  border-bottom: 1px solid var(--edo-purple);
  padding-bottom: 4px;
  margin: 0 0 8px 0;
}
.memo-bar {
  width: 4px;
  background: var(--edo-purple);
  min-height: 16px;
}
.memo-title {
  margin: 0;
  font-weight: 700;
  line-height: 1.4;
  font-size: 0.98rem;
}

/* ---- レスポンシブ微調整 ---- */
@media (max-width: 480px) {
  .ce-wrap {
    padding: 24px var(--page-gutter) 56px;
  }
  .ce-card {
    padding: 14px;
  }
  .ce-grid {
    font-size: 13px;
    gap: 6px 12px;
  }
  .ce-btn {
    min-height: 38px;
    padding: 9px 12px;
    font-size: 13px;
  }
}
/* ===== 名前ヘッダー上の余白を広めに（見切れ防止） ===== */
:root {
  /* 好みで調整。72px → もう少し広げたいなら 88px などに */
  --name-top-gap: 72px;
}

/* 基本：名前ヘッダーの上にしっかりスペース */
.ce-header,
.ce-header.ce-header--withicon {
  padding-top: var(--name-top-gap) !important;
}

/* WP管理バーが出ている時（ログイン中）はその分も足す */
@media (min-width: 782px) {
  /* デスクトップ管理バーは 32px */
  body.admin-bar .ce-header,
  body.admin-bar .ce-header.ce-header--withicon {
    padding-top: calc(var(--name-top-gap) + 32px) !important;
  }
}
@media (max-width: 781.98px) {
  /* モバイル管理バーは 46px */
  body.admin-bar .ce-header,
  body.admin-bar .ce-header.ce-header--withicon {
    padding-top: calc(var(--name-top-gap) + 46px) !important;
  }
}

/* ヘッダー直下のカードは詰め気味のまま */
.ce-header + .ce-card {
  margin-top: 8px !important;
}
/* 人型アイコンを黒に */
.ce-header__icon {
  color: #000 !important; /* SVGのfill/strokeはcurrentColorなので黒になります */
}
/* 既存の .mi ルールは削除 or 下で上書き */
.ce-wrap .mi {
  font-family: "Material Icons";
  font-weight: normal;
  font-style: normal;
  font-size: 28px;
  line-height: 1;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* 念のためグローバルはリセット */
.mi {
  font-size: inherit;
  line-height: inherit;
}
.ce-header__icon svg {
  display: block;
  width: 24px !important;
  height: 24px !important;
}
/* ===== 修正: .mi をページ内にだけ適用し、ヘッダーは元サイズに戻す ===== */

/* ページ内（ご成約内容）だけで Material Icons の見た目を指定 */
body.page-template-customer-edit .ce-wrap .mi {
  font-family: "Material Icons";
  font-weight: normal;
  font-style: normal;
  font-size: 28px;
  line-height: 1;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* グローバルに効いていた .mi をリセット（ヘッダー側に優先） */
.mi {
  font-size: inherit;
  line-height: inherit;
}

/* ヘッダー内の Material Icons/Outlined を明示的に“元サイズ”へ */
body.page-template-customer-edit header .mi,
body.page-template-customer-edit header .material-icons,
body.page-template-customer-edit header .material-icons-outlined {
  font-size: inherit !important;
  line-height: inherit !important;
}

/* ヘッダーがSVGアイコンの場合の保険（ロゴには当てないよう横幅24前提の汎用） */
body.page-template-customer-edit header .menu-toggle svg,
body.page-template-customer-edit header .nav-icon svg,
body.page-template-customer-edit header .icon svg {
  width: 24px !important;
  height: 24px !important;
}
/* ===== 名前ヘッダーの“名前だけ”を大きく ===== */
body.page-template-customer-edit .ce-header__name {
  font-size: 24px; /* 好みで 22〜26px くらいに調整 */
  line-height: 1.3;
}
/* ===== 人アイコンを少し大きく ===== */
body.page-template-customer-edit .ce-header__icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px; /* アイコン分の横幅も広げる */
}

/* SVGアイコンの場合のサイズ調整 */
body.page-template-customer-edit .ce-header__icon svg {
  width: 32px !important;
  height: 32px !important;
}
/* ---- スマホ時は左右の余白を少し広げて、枠を細めに見せる ---- */
@media (max-width: 480px) {
  body.page-template-customer-edit .ce-wrap {
    --page-gutter: 22px; /* 16px → 22px くらいにして少し細く */
    padding: 20px var(--page-gutter) 56px; /* 既存のpaddingにそのまま上書き */
  }
}
/* ---- カード同士の間隔を少し広げる ---- */
body.page-template-customer-edit .ce-card {
  margin-top: 10px; /* 元: 16px → 少しだけゆとり */
}

body.page-template-customer-edit .ce-card + .ce-card {
  margin-top: 28px; /* 元: 20px → ブロック間はさらにゆとり */
}
/* ===== ご成約内容ページ：ボタンを枠内右端に寄せる ===== */
body.page-template-customer-edit .ce-card .ce-btn {
  display: block; /* インライン→ブロックに */
  width: fit-content; /* ボタン分の幅だけ */
  margin-left: auto; /* 右端に寄せる */
}
/* フォトプラン行だけ縦並びにする */
.ce-row.ce-row--column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px; /* ラベルとボタンの間の余白 */
}

/* ボタンを横幅いっぱいに */
.ce-row.ce-row--column .ce-btn {
  width: 100%;
  text-align: center;
}
