/* ===== CSS Reset (一部簡略) ===== */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; height: auto; }
ul, ol { margin: 0; padding-left: 1.2rem; }
h1, h2, h3, p { margin: 0 0 .6rem; }

/* ===== Design Tokens ===== */
:root{
  --bg: #ffffff;
  --ink: #14161a;
  --muted: #5f6672;
  --brand: #ec6b2d;
  --brand-ink: #ffffff;
  --surface: #f6f8fb;
  --border: #e5e8ee;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(0,0,0,.06);
  --container: 1100px;
  --speed: .25s;
  --lead: clamp(18px, 2vw, 20px);
}

/* ===== Base ===== */
body{
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
}

/* ===== Layout ===== */
.container{ width: min(100% - 32px, var(--container)); margin-inline: auto; }
.section{ padding: 72px 0; }
.section.alt{ background: var(--surface); }
.section-header{ text-align: center; margin-bottom: 32px; }
.section-header h2{ font-size: clamp(24px, 2.8vw, 32px); margin-bottom: .2rem; }

/* スマホ時：Policies セクション見出しは折り返さず横スクロールで崩れ防止 */
@media (max-width: 640px){
  #policies .section-header h2{
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin-inline: auto;
  }
}

/* ===== Header ===== */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner{ display: flex; align-items: center; min-height: 64px; gap: 12px; }

/* Brand（ロゴ＋サイト名） */
.brand{
  display: inline-flex; align-items: center; gap: 8px;
  line-height: 1; white-space: nowrap; flex: 0 0 auto;
  font-weight: 700; color: var(--ink); text-decoration: none;
}
.brand-mark{ display: block; width: 30px; height: 30px; object-fit: cover; border-radius: 50%; }
.brand-text{ display: block; line-height: 1; letter-spacing: .02em; }
@media (max-width: 1120px) and (min-width: 861px){
  .brand-mark{ width: 26px; height: 26px; } .brand-text{ font-size: 15px; }
}
@media (max-width: 860px){
  .brand-mark{ width: 24px; height: 24px; } .brand-text{ font-size: 15px; }
}

/* Header SNS（円背景なし／YouTubeのみ角丸） */
.sns-header{ display: inline-flex; align-items: center; gap: 12px; margin: 0 6px 0 8px; padding: 0; list-style: none; }
.sns-link{ display: inline-flex; align-items: center; justify-content: center; line-height: 1; background: transparent; border: 0; padding: 0; }
.sns-img{ width: 28px; height: 28px; display: block; object-fit: contain; background: transparent; border-radius: 0; box-shadow: none; }
.sns-img.youtube{ border-radius: 6px; }
.sns-link:hover .sns-img{ transform: translateY(-1px); transition: transform .2s ease; }
@media (max-width: 860px){
  .sns-header{ gap: 10px; margin-left: 6px; }
  .sns-img{ width: 22px; height: 22px; }
}

/* ===== Nav ===== */
.global-nav{ margin-left: auto; }
.global-nav ul{ display: flex; gap: 16px; align-items: center; list-style: none; padding: 0; margin: 0; flex-wrap: nowrap; }
.global-nav li{ flex: 0 0 auto; }
.global-nav a{ text-decoration: none; color: var(--ink); padding: 8px 10px; border-radius: 8px; transition: background var(--speed); white-space: nowrap; word-break: keep-all; }
.global-nav a:hover{ background: var(--surface); }
.btn{ display: inline-block; border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; }
.btn-primary{ background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover{ filter: brightness(.98); }
.btn-ghost{ background: transparent; color: var(--ink); }
.btn-lg{ padding: 14px 22px; font-weight: 700; }

/* モバイルナビ（ハンバーガー） */
.nav-toggle{ display: none; }
.nav-toggle-btn{ display: none; cursor: pointer; }
.nav-toggle-btn span{ display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform var(--speed); }
@media (max-width: 860px){
  .nav-toggle-btn{ display: inline-block; margin-left: auto; }
  .global-nav{
    position: fixed; left: 0; right: 0; top: 64px; background: #fff; border-bottom: 1px solid var(--border);
    transform: translateY(-120%); transition: transform var(--speed); padding: 12px 16px;
  }
  .global-nav ul{ flex-direction: column; align-items: flex-start; gap: 8px; }
  .nav-toggle:checked ~ .nav-toggle-btn span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-toggle-btn span:nth-child(2){ opacity: 0; }
  .nav-toggle:checked ~ .nav-toggle-btn span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }
  .nav-toggle:checked ~ .global-nav{ transform: translateY(0%); }
}
@media (max-width: 1120px) and (min-width: 861px){
  .sns-img{ width: 24px; height: 24px; }
  .global-nav ul{ gap: 8px; }
  .global-nav a{ padding: 6px 8px; font-size: 14px; }
}

/* ===== Hero ===== */
.hero{ background: linear-gradient(180deg, rgba(236,107,45,.08), transparent 60%); }
.hero-inner{ display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; padding: 48px 0 24px; align-items: center; }
.hero-copy h1{ font-size: clamp(28px, 3.6vw, 42px); line-height: 1.25; margin-bottom: 12px; }
.lead{ font-size: var(--lead); color: var(--muted); }
.hero-cta{ display: flex; gap: 12px; margin: 16px 0 10px; }
.hero-badges{ display: flex; gap: 10px; padding-left: 0; list-style: none; color: var(--muted); flex-wrap: wrap; }
.hero-badges li{ border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; background: #fff; white-space: nowrap; word-break: keep-all; overflow-wrap: normal; display: inline-flex; align-items: center; }
.hero-visual img{ border-radius: var(--radius); box-shadow: var(--shadow); object-fit: cover; width: 100%; height: 100%; min-height: 240px; }
@media (max-width: 430px){ .hero-badges li{ padding: 6px 12px; font-size: 14px; } }
@media (max-width: 860px){ .hero-inner{ grid-template-columns: 1fr; padding-top: 24px; } }

/* ===== Cards ===== */
.cards{ margin-top: 16px; }
.grid-3{ display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px){ .grid-3{ grid-template-columns: 1fr; } }
.card{ background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card img{ width: 100%; height: 180px; object-fit: cover; }
.card-body{ padding: 16px; }
.card h3{ font-size: 18px; margin-bottom: 6px; }
.list-check{ color: var(--muted); }
.list-check li{ margin: .2rem 0; }

/* ===== Feature Strip ===== */
.feature-strip{ background: linear-gradient(90deg, #fff, var(--surface)); padding: 28px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature{ background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.feature h3{ font-size: 16px; margin-bottom: 4px; }
@media (max-width: 860px){
  .feature-grid{ grid-template-columns: 1fr; gap: 12px; }
  .feature{ padding: 14px; }
}

/* ===== Flow ===== */
.flow{ list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.flow li{ display: grid; grid-template-columns: auto 1fr; gap: 12px; border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px; background: #fff; }
.flow-num{ width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 700; }
@media (max-width: 900px){ .flow{ grid-template-columns: 1fr; } }

/* ===== About ===== */
.about-grid{ display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; }
.about-copy p{ color: var(--muted); }
.list-dot li{ margin: .25rem 0; }
.about-visual img{ border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 860px){ .about-grid{ grid-template-columns: 1fr; } }

/* ===== Partners（取扱会社） ===== */
.brand-groups{ display: grid; gap: 26px; }
.brand-head{ font-size: 18px; margin: 0 0 10px; color: var(--muted); }
.brands-grid{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1024px){ .brands-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px){  .brands-grid{ grid-template-columns: repeat(2, 1fr); } }

/* 取扱会社ボタン */
.brand-link{
  --bg: #f3f6fb; --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  padding: 14px 12px; min-height: 56px; border-radius: 14px; text-decoration: none;
  font-weight: 700; letter-spacing: .02em; line-height: 1.3;
  background: var(--bg); color: var(--fg);
  box-shadow: 0 4px 14px rgba(0,0,0,.06), inset 0 -2px 0 rgba(255,255,255,.15);
  border: 1px solid rgba(0,0,0,.04);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  will-change: transform;
}
.brand-link:focus{ outline: none; }
.brand-link:focus-visible{ box-shadow: 0 6px 18px rgba(0,0,0,.10), 0 0 0 3px rgba(14,122,196,.25); }
.brand-link:hover, .brand-link:active{ transform: scale(1.06); box-shadow: 0 10px 24px rgba(0,0,0,.14); }
@media (prefers-reduced-motion: reduce){
  .brand-link{ transition: none; } .brand-link:hover,.brand-link:active{ transform: none; }
}
/* Brand color (data-brand) */
.brand-link[data-brand="rakuten-life"]  { --bg:#BF0000; }
.brand-link[data-brand="axa"]           { --bg:#003C71; }
.brand-link[data-brand="msal"]          { --bg:#006E3A; }
.brand-link[data-brand="rakuten-sonpo"] { --bg:#BF0000; }
.brand-link[data-brand="rakuten-mobile"]{ --bg:#E30077; }
.brand-link[data-brand="iijmio"]        { --bg:#0068B7; }

/* ===== Policies（PDF再現＋アコーディオン） ===== */
.policy-panels{ display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 960px){ .policy-panels{ grid-template-columns: 1fr; } }

.policy-card{ background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.policy-card > summary::-webkit-details-marker{ display:none; }

.policy-head{
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px;
  padding: 14px 16px; background: linear-gradient(180deg, #fafbfe, #f0f3f9);
  border-bottom: 1px solid var(--border);
}
.policy-title{ font-weight: 700; }
.policy-sub{ color: var(--muted); font-size: 14px; }
.policy-card[open] .policy-head{ background: #fff; }
.policy-body{ padding: 16px; }
.policy-body p{ margin-bottom: .6rem; }
.policy-body .num{ padding-left: 1.4rem; margin: .4rem 0 .8rem; }
.policy-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
@media (max-width: 640px){ .policy-grid{ grid-template-columns: 1fr; } }

/* モバイル：summary を2行レイアウト（タイトル→サブタイトル） */
@media (max-width: 640px){
  .policy-head{ grid-template-columns: 1fr; row-gap: 4px; text-align: left; }
  .policy-head .policy-title{ display:block; }
  .policy-head .policy-sub{ display:block; font-size: 14px; color: var(--muted); }
}

/* (6) 当店に対するご照会：定義リストのモバイル最適化（枠なし／住所は折返し不可） */
@media (max-width: 640px){
  .policy-box .def{ grid-template-columns: 1fr; gap: 4px 0; }
  .policy-box .def dt{ font-weight: 700; color: var(--muted); margin-top: 10px; }
  .policy-box .def dd{
    margin: 0 0 10px; padding: 0; border: 0; background: transparent;
    word-break: normal; overflow-wrap: normal;
  }
  .policy-box .def dd:nth-of-type(2){ /* 住所 */
    white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
}

/* ===== FAQ ===== */
.faq{ background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; box-shadow: var(--shadow); }
.faq summary{ cursor: pointer; font-weight: 700; }
.faq p{ margin: 8px 0 0; color: var(--muted); }

/* ===== CTA（右下にマップ固定） ===== */
.cta{ background: radial-gradient(1200px 400px at 20% -10%, rgba(236,107,45,.25), transparent 40%), var(--ink); color: #fff; }
.cta-grid{ display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: stretch; padding: 40px 0; }
.cta-inner{ background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 24px; }
.cta .btn-primary{ background: #fff; color: var(--ink); border-color: #fff; }
.cta .btn-primary:hover{ filter: brightness(.98); }
.cta-tel a{ color: #fff; text-decoration: underline; }
.cta-map .map-wrap{ position: relative; height: 100%; min-height: 280px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); overflow: hidden; }
.cta-map iframe{ width: 100%; height: 100%; min-height: 280px; border: 0; display: block; filter: saturate(1.05) contrast(1.05); }
.open-map{ position: absolute; right: 12px; bottom: 12px; padding: 8px 12px; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; border: 1px solid var(--border); }
.open-map:hover{ filter: brightness(.96); }
@media (max-width: 900px){ .cta-grid{ grid-template-columns: 1fr; } }

/* ===== Footer ===== */
.site-footer{ background: #0f1114; color: #cbd1dc; padding-top: 28px; }
.footer-grid{ display: grid; gap: 20px; grid-template-columns: 1.2fr 1fr 1fr; }
.footer-links{ list-style: none; padding: 0; margin: 0; }
.footer-links a{ color: #cbd1dc; text-decoration: none; }
.footer-links a:hover{ text-decoration: underline; }
.brand-foot .brand-mark{ background: #fff; }
.copy{ text-align: center; color: #8e98a7; border-top: 1px solid #212631; margin-top: 18px; padding: 12px 0 22px; }
@media (max-width: 900px){ .footer-grid{ grid-template-columns: 1fr; } }

/* === Policies 見出し：モバイルは折り返し不可（横スクロール可） === */
@media (max-width: 640px){
  #policies .section-header h2{
    white-space: nowrap;          /* 折り返しなし */
    overflow-x: auto;             /* はみ出たら横スクロール */
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin-inline: auto;          /* 中央配置のまま */
  }
}

/* === details のサマリー：モバイルは縦2行表示にする === */
@media (max-width: 640px){
  .policy-head{
    grid-template-columns: 1fr;   /* 1列レイアウト */
    row-gap: 4px;
    text-align: left;
  }
  .policy-head .policy-title{
    display: block;               /* 1行目：タイトル */
    font-weight: 700;
  }
  .policy-head .policy-sub{
    display: block;               /* 2行目：サブタイトル */
    font-size: 14px;
    color: var(--muted);
  }
}

/* === モバイル版：横スライドせず1行に収める === */
@media (max-width: 640px) {
  /* セクションタイトルをスライドなしで中央表示 */
  #policies .section-header h2 {
    white-space: normal;           /* 折り返しOKに変更 */
    overflow: visible;             /* はみ出し部分を隠さない */
    text-align: center;
    font-size: clamp(18px, 5vw, 24px);
    margin: 0 auto 8px;
  }

  /* 説明文「クリックで開き、全文をご確認いただけます」 */
  #policies .section-header p {
    white-space: nowrap;           /* 折り返しなし */
    text-align: center;
    font-size: 14px;
    margin: 0 auto 16px;
  }

  /* summary部分のレイアウト調整 */
  .policy-head {
    grid-template-columns: 1fr;    /* 縦並びにする */
    text-align: center;
    row-gap: 4px;
  }
  .policy-head .policy-title {
    display: block;
    font-weight: 700;
  }
  .policy-head .policy-sub {
    display: block;
    font-size: 14px;
    color: var(--muted);
  }
}
