/* 公開サイト共通スタイル */
:root {
  --navy: #0F1B2D;
  --navy-2: #1E2D44;
  --navy-3: #0A1320;
  --accent: #F2B705;
  --on-accent: #0F1B2D;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #4B5563;
  --line: #E5E7EB;
  --bg: #F5F5F2;
  --card: #FFFFFF;
  --price: #B91C1C;
  --line-green: #06C755;
  --num: "Barlow Condensed", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--navy); }
a:hover { color: #334155; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.num { font-family: var(--num); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ヘッダー */
.site-header { background: var(--navy); color: #fff; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 40px; height: 40px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 900; font-size: 19px; letter-spacing: 0.04em; }
.brand-sub { font-family: var(--num); font-size: 12px; letter-spacing: 0.2em; color: #CBD5E1; }
.gnav { display: none; gap: 4px; }
.gnav a { color: #fff; text-decoration: none; padding: 12px 14px; font-size: 15px; font-weight: 500; }
.gnav a:hover { color: var(--accent); }
@media (min-width: 960px) { .gnav { display: flex; } }
.header-cta { display: flex; align-items: center; gap: 12px; }
.header-tel { color: #fff; text-decoration: none; display: none; flex-direction: column; line-height: 1.2; }
.header-tel:hover { color: #fff; }
.header-tel small { font-size: 11px; color: #CBD5E1; }
.header-tel span { font-family: var(--num); font-size: 22px; font-weight: 700; letter-spacing: 0.04em; }
@media (min-width: 640px) { .header-tel { display: flex; } }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 8px; font-weight: 700; font-size: 16px; text-decoration: none; border: none; cursor: pointer; font-family: inherit; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { color: var(--on-accent); filter: brightness(1.05); }
.btn-line { background: var(--line-green); color: #fff; }
.btn-line:hover { color: #fff; filter: brightness(1.05); }
.btn-ghost-light { border: 1px solid #fff; color: #fff; }
.btn-ghost-light:hover { color: var(--navy); background: #fff; }
.btn-outline { border: 2px solid var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { color: #fff; background: var(--navy-2); }
.btn-pill { border-radius: 999px; min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }

/* ヒーロー */
.hero { background: var(--navy); color: #fff; border-top: 1px solid var(--navy-2); }
.hero .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; padding-top: 40px; padding-bottom: 80px; }
.hero-body { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.hero-badge { align-self: flex-start; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 4px; }
.hero h1 { margin: 0; font-size: clamp(28px, 5vw, 44px); line-height: 1.35; font-weight: 900; white-space: pre-line; }
.hero p { margin: 0; font-size: 16px; line-height: 1.9; color: #CBD5E1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hero-visual { flex: 1 1 380px; min-width: 0; aspect-ratio: 16 / 10; background: var(--navy-2); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #94A3B8; font-size: 14px; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual svg { width: 64px; height: 64px; }

/* 検索 */
.search-wrap { margin-top: -44px; }
.search { background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 27, 45, 0.12); padding: 16px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
@media (min-width: 640px) { .search { padding: 20px 24px; gap: 16px; } }
.field { flex: 1 1 160px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field select { height: 48px; border: 1px solid #D1D5DB; border-radius: 8px; padding: 0 12px; font-size: 16px; font-family: inherit; background: #fff; color: var(--ink); }
.search .btn { flex: 1 1 160px; }
@media (min-width: 640px) { .search .btn { flex: 0 0 auto; } }

/* セクション見出し */
.section { padding: 56px 0 24px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.eyebrow { display: block; font-family: var(--num); font-weight: 700; font-size: 14px; letter-spacing: 0.2em; color: #6B7280; }
.sec-head h2, .section h2 { margin: 0; font-size: 28px; font-weight: 900; }
.stock-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16A34A; margin-right: 6px; }
.stock-count strong { font-family: var(--num); font-size: 22px; color: var(--ink); }

/* 在庫カード */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.car-card { display: flex; flex-direction: column; background: var(--card); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--ink); border: 1px solid var(--line); transition: box-shadow 0.15s, transform 0.15s; }
.car-card:hover { color: var(--ink); box-shadow: 0 8px 20px rgba(15, 27, 45, 0.12); transform: translateY(-2px); }
.car-photo { position: relative; aspect-ratio: 4 / 3; background: var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #6B7280; font-size: 13px; }
.car-photo img { width: 100%; height: 100%; object-fit: cover; }
.car-photo svg { width: 48px; height: 48px; }
.badge-new { position: absolute; top: 12px; left: 12px; background: var(--accent); color: var(--on-accent); font-family: var(--num); font-weight: 700; font-size: 14px; letter-spacing: 0.1em; padding: 4px 10px; border-radius: 4px; }
.badge-nego { position: absolute; top: 12px; right: 12px; background: var(--navy); color: #fff; font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 4px; }
.sold-cover { position: absolute; inset: 0; background: rgba(15, 27, 45, 0.72); display: flex; align-items: center; justify-content: center; }
.sold-cover span { border: 2px solid #fff; color: #fff; font-weight: 900; font-size: 22px; letter-spacing: 0.2em; padding: 8px 20px; transform: rotate(-8deg); }
.car-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.car-maker { font-size: 12px; color: #6B7280; font-weight: 500; }
.car-name { font-size: 19px; font-weight: 700; line-height: 1.3; }
.car-grade { font-size: 13px; color: var(--muted); }
.spec3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 6px; overflow: hidden; }
.spec3 div { background: #F9FAFB; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.spec3 small { font-size: 11px; color: var(--muted); }
.spec3 b { font-size: 14px; }
.price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price-label { font-size: 12px; font-weight: 700; color: var(--price); }
.price { display: flex; align-items: baseline; gap: 2px; color: var(--price); }
.price .num { font-weight: 700; font-size: 38px; line-height: 1; }
.price .unit { font-size: 14px; font-weight: 700; }
.base-price { font-size: 12px; color: var(--muted); }
.empty { grid-column: 1 / -1; background: #fff; border-radius: 12px; border: 1px dashed #CBD5E1; padding: 40px 16px; text-align: center; color: var(--muted); }
.more { display: flex; justify-content: center; margin-top: 28px; }

/* サービス */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.svc { background: #fff; border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); }
.svc svg { width: 36px; height: 36px; }
.svc h3 { margin: 0; font-size: 20px; }
.svc p { margin: 0; font-size: 15px; line-height: 1.8; color: var(--muted); }

/* 店舗案内 */
.shop-box { background: #fff; border-radius: 12px; border: 1px solid var(--line); display: flex; flex-wrap: wrap; overflow: hidden; }
.shop-info { flex: 1 1 380px; min-width: 0; padding: 32px 24px; display: flex; flex-direction: column; gap: 20px; }
.shop-info dl { margin: 0; display: grid; grid-template-columns: 88px 1fr; row-gap: 14px; column-gap: 16px; font-size: 15px; }
.shop-info dt { font-weight: 700; color: var(--muted); }
.shop-info dd { margin: 0; white-space: pre-line; }
.shop-map { flex: 1 1 380px; min-width: 0; min-height: 300px; background: var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.shop-map iframe { width: 100%; height: 100%; min-height: 300px; border: 0; }

/* お問い合わせ帯・フッター */
.cta-band { background: var(--navy); color: #fff; margin-top: 40px; }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: 48px; padding-bottom: 48px; }
.cta-band h2 { margin: 0 0 6px; font-size: 26px; }
.cta-band p { margin: 0; color: #CBD5E1; font-size: 15px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.site-footer { background: var(--navy-3); color: #94A3B8; font-size: 13px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-top: 20px; padding-bottom: 24px; }
.site-footer a { color: #CBD5E1; }
.site-footer a:hover { color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* スマホ下部の固定ボタン */
.sp-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--line); }
.sp-bar .btn { min-height: 48px; font-size: 15px; padding: 0 8px; }
body.has-sp-bar { padding-bottom: 72px; }
@media (min-width: 960px) { .sp-bar { display: none; } body.has-sp-bar { padding-bottom: 0; } }

/* 車両詳細 */
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0; }
.detail { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; padding-bottom: 56px; }
.detail-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.detail-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 960px) { .detail-side { position: sticky; top: 16px; } }
/* スマホ：写真 → 価格・問い合わせ → 車両情報 の順に並べる */
@media (max-width: 959px) {
  .detail { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 20px; }
  .detail-main { display: contents; }
  .detail-main > .gallery-panel { order: 1; }
  .detail-side { order: 2; flex: none; width: 100%; }
  .detail-main > .panel:not(.gallery-panel) { order: 3; }
}
.panel { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 20px; }
@media (min-width: 640px) { .panel { padding: 28px; } }
.panel h2 { margin: 0 0 16px; font-size: 20px; font-weight: 900; }
.gallery-main { position: relative; aspect-ratio: 4 / 3; background: var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #6B7280; font-size: 14px; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #111; }
.gallery-main svg { width: 72px; height: 72px; }
.gallery-count { position: absolute; right: 12px; bottom: 12px; background: rgba(15, 27, 45, 0.8); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 4px; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.9); color: var(--navy); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.thumbs button { aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; border: 1px solid #D1D5DB; background: var(--line); padding: 0; cursor: pointer; }
.thumbs button[aria-current="true"] { outline: 3px solid var(--navy); outline-offset: -3px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.spec-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); border-top: 1px solid var(--line); margin: 0; }
.spec-table div { display: flex; border-bottom: 1px solid var(--line); font-size: 15px; }
.spec-table dt { flex: 0 0 108px; background: #F9FAFB; padding: 12px 14px; color: var(--muted); font-weight: 700; font-size: 14px; }
.spec-table dd { margin: 0; padding: 12px 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 14px; background: var(--navy); color: #fff; font-weight: 700; }
.comment { margin: 0; font-size: 15px; line-height: 1.9; color: var(--ink-2); white-space: pre-line; }
.side-name small { display: block; font-size: 13px; color: var(--muted); }
.side-name h1 { margin: 2px 0; font-size: 28px; font-weight: 900; line-height: 1.3; }
.price-box { background: #FEF2F2; border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.price-box .price .num { font-size: 56px; }
.price-box .price .unit { font-size: 18px; }
.price-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.price-line.first { border-top: 1px solid #FECACA; padding-top: 8px; }
.side-actions { display: flex; flex-direction: column; gap: 10px; }
.side-note { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 0; }
.status-flag { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 4px; margin-bottom: 8px; }
.status-flag.sold { background: var(--navy); color: #fff; }
.status-flag.nego { background: #FEF3C7; color: #92400E; }

/* 文章ページ（特商法など） */
.doc { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 28px 20px; margin: 24px 0 56px; }
.doc h1 { margin: 0 0 20px; font-size: 24px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--line); }
.doc th { width: 30%; background: #F9FAFB; color: var(--muted); }

.loading { padding: 80px 16px; text-align: center; color: var(--muted); }
.demo-flag { background: #FEF3C7; color: #78350F; font-size: 13px; text-align: center; padding: 6px 12px; }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind="err"] { background: #991B1B; }
