@charset "utf-8";

/* ============================================================
   RASH WETSUITS COLOR SIMULATION — prototype
   トーン: 本体サイト準拠のモノクローム（白・黒・グレー）＋シグナルレッド
   ============================================================ */

:root {
  --ink: #0d0d0d;
  --ink-soft: #3a3a3a;
  --grey: #8a8a8a;
  --hairline: #e4e4e4;
  --paper: #ffffff;
  --paper-dim: #f6f6f5;
  --gold: #9d8a4d;        /* RASHマークのゴールド（ブランドアクセント） */
  --gold-soft: #c9b483;   /* デザート */
  --accent: #c0392b;      /* 警告・エラー用 */
  --font-jp: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --bar-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; /* iOSズーム防止 */ }

/* ---------- ヘッダー ----------
   狭い画面（〜599px）を既定値とし、600px以上で本来のサイズに戻す。
   デスクトップ寸法のままだと iPhone 幅でヘッダーが横にはみ出し、
   ページ全体に横スクロールが出てしまうため */
.site-header {
  background: var(--ink);
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 2px solid var(--gold);
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.wing-mark {
  display: block;
  width: 56px;
  height: 11px;
  background: var(--gold);
  -webkit-mask: url('../assets/marks/wing.svg') center / contain no-repeat;
  mask: url('../assets/marks/wing.svg') center / contain no-repeat;
  flex: none;
}
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.site-header .tagline {
  display: none;   /* 装飾。狭い画面では出さない */
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .38em;
  color: var(--gold-soft);
  text-transform: uppercase;
  white-space: nowrap;
}
.site-header .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .10em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-header .brand small {
  display: block;
  font-size: 9px;
  letter-spacing: .22em;
  color: #b5b5b5;
  font-weight: 400;
}
.site-header .proto-badge {
  font-size: 9px;
  letter-spacing: .12em;
  border: 1px solid #4d4d4d;
  color: #b5b5b5;
  padding: 2px 6px;
  white-space: nowrap;
}

@media (min-width: 600px) {
  .site-header { padding: 10px 16px; gap: 12px; }
  .brand-wrap { gap: 12px; }
  .wing-mark { width: 78px; height: 15px; }
  .site-header .tagline { display: block; }
  .site-header .brand { font-size: 20px; letter-spacing: .16em; }
  .site-header .brand small { font-size: 10px; letter-spacing: .34em; }
  .site-header .proto-badge { font-size: 10px; letter-spacing: .2em; padding: 2px 8px; }
}

/* ---------- レイアウト ---------- */
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: calc(var(--bar-h) + 24px);
}

/* ---------- プレビュー ---------- */
.stage {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}
.stage-inner {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}
.preview {
  position: relative;
  width: min(46vh, 78vw, 340px);
  aspect-ratio: 1600 / 1995;   /* .ai のアートボード実寸。従来の 400/455 は絵型の比率と違い横に伸びていた */
  transition: width .25s ease;
}
.preview.zoomed { width: min(72vh, 96vw, 520px); }
.preview .layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* 単色パーツは「型（マスク）＋背景色」で描く。画像は形だけを持ち、色はCSSで与える */
.layer.tint {
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
/* モデル名はプレビューの上に通常フローで配置（スーツと重ならない） */
.stage-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;   /* KID'S-HALIBUT など長いモデル名は2行に折り返す */
  gap: 4px 14px;
  padding: 12px 60px 0 16px;   /* 右は拡大ボタン（.zoom-btn）の逃げ */
}
.stage-head .series {
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--grey);
  text-transform: uppercase;
}
.stage-head .model {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1;
  letter-spacing: .04em;
  color: var(--ink);
}
.stage-head .model::after {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transform: skewX(-20deg);
}
.zoom-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 6;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.9);
  font-size: 17px;
  color: var(--ink-soft);
}
/* 選択サマリー（プレビュー下の帯） */
.sum-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline);
}
.sum-strip .cell {
  padding: 6px 4px 8px;
  text-align: center;
  border-right: 1px solid var(--hairline);
  min-width: 0;
}
.sum-strip .cell:last-child { border-right: 0; }
.sum-strip .k {
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--grey);
  display: block;
}
.sum-strip .v {
  font-size: 11px;
  font-weight: 700;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- パーツタブ ---------- */
.part-tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--ink);
}
.part-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #9a9a9a;
  padding: 12px 2px 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  position: relative;
}
.part-tab.active { color: #fff; }
.part-tab.active::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 3px;
  background: var(--gold);
}
.part-tab:disabled { color: #555; }

/* ---------- カラーピッカー ---------- */
.picker-pane { padding: 18px 16px 8px; min-height: 320px; }
.pane-note {
  font-size: 12px;
  color: var(--grey);
  border: 1px solid var(--hairline);
  background: var(--paper-dim);
  padding: 8px 12px;
  margin-bottom: 16px;
}
.pane-note.warn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, #fff); background: #fdf3f3; }
.mat-group { margin-bottom: 26px; }
.mat-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 5px;
  margin-bottom: 12px;
}
.mat-head .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.mat-head .note { font-size: 11px; color: var(--grey); }
.mat-group.disabled { opacity: .38; }
.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px 8px;
}
.chip {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.chip .swatch {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  border: 1px solid var(--hairline);
  background: #fff center / cover no-repeat;
  transition: transform .12s ease;
}
.chip:active .swatch { transform: scale(.94); }
.chip .name {
  display: block;
  font-size: 10px;
  line-height: 1.3;
  color: var(--ink-soft);
  margin-top: 4px;
  min-height: 2.6em;
}
.chip.selected .swatch {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.chip.selected .swatch::after {
  content: "✓";
  position: absolute;
  right: -7px;
  top: -9px;
  width: 18px;
  height: 18px;
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
}
.chip.blocked { opacity: .28; }
.chip.blocked .swatch { outline: none; }

/* ---------- 下部アクションバー ---------- */
.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: var(--bar-h);
  display: flex;
  gap: 1px;
  background: var(--hairline);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom);
}
.action-bar button, .action-bar a {
  flex: 1;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
}
.action-bar .icon { font-size: 18px; line-height: 1; }
.action-bar .primary {
  background: var(--ink);
  color: #fff;
  flex: 1.6;
}
.action-bar .primary .icon { color: var(--gold-soft); }

/* 他モデルへの移動（現行サイトの「Go To Other Wetsuits page」に相当）。
   見た目を共有・画像保存ボタンに揃えるため、ネイティブのselectは透明にして
   同じ形のラベルに重ねる。タップ時の挙動は端末標準のまま */
.action-bar .bar-select {
  position: relative;
  flex: 1;
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.action-bar .bar-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
.action-bar .bar-select:focus-within { outline: 2px solid var(--gold); outline-offset: -2px; }

/* ---------- トースト ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bar-h) + 18px);
  transform: translateX(-50%) translateY(8px);
  z-index: 90;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  max-width: 92vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.warn { background: var(--accent); }

/* ---------- デスクトップ ---------- */
@media (min-width: 900px) {
  .app.simulator {
    display: grid;
    grid-template-columns: 440px 1fr;
    gap: 0 40px;
    padding: 0 24px calc(var(--bar-h) + 40px);
  }
  .stage {
    border: 0;
    height: fit-content;
    top: 24px;
  }
  .stage-inner { padding-top: 24px; }
  .preview { width: 380px; }
  .preview.zoomed { width: 440px; }
  .right-col { padding-top: 24px; min-width: 0; }
  .part-tabs { top: 0; }
  .picker-pane { padding: 22px 4px; }
  .chip-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .action-bar {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 420px;
    border: 1px solid var(--hairline);
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
  }
}

/* ============================================================
   オーダーフォーム
   ============================================================ */
.order-app { max-width: 760px; margin: 0 auto; padding: 0 16px 120px; }

.stepper {
  display: flex;
  gap: 4px;
  margin: 18px 0 26px;
}
.step-dot {
  flex: 1;
  height: 4px;
  background: var(--hairline);
  position: relative;
}
.step-dot.done { background: var(--ink); }
.step-dot.now { background: var(--gold); }
.step-caption { font-size: 11px; letter-spacing: .2em; color: var(--grey); }
.step-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.step-title .num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  margin-right: 8px;
}
.step-lead { font-size: 12px; color: var(--grey); margin-bottom: 22px; }

.f-sec { margin-bottom: 26px; }
.f-row { margin-bottom: 16px; }
.f-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.f-label .opt { font-weight: 400; color: var(--grey); font-size: 11px; margin-left: 6px; }
.f-label .req { color: var(--accent); font-size: 11px; margin-left: 6px; }
input[type="text"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid #c9c9c9;
  border-radius: 0;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}
input[readonly] { background: var(--paper-dim); color: var(--ink-soft); }
.f-inline { display: flex; gap: 10px; }
.f-inline > * { flex: 1; }

/* ラジオ／セグメント */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.seg label {
  border: 1px solid #c9c9c9;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
}
.seg input { position: absolute; opacity: 0; width: 0; }
.seg label:has(input:checked) {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* 仕様サマリーカード */
.spec-card {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 16px;
  border: 1px solid var(--hairline);
  background: var(--paper-dim);
  padding: 14px;
  margin-bottom: 24px;
}
.spec-card .thumb { position: relative; aspect-ratio: 1600/1995; }
.spec-card .thumb .layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.spec-list { font-size: 12px; }
.spec-list dt { color: var(--grey); font-size: 10px; letter-spacing: .14em; margin-top: 6px; }
.spec-list dd { font-weight: 700; }
.spec-list dt:first-child { margin-top: 0; }

/* マークプレビュー */
.mark-preview {
  display: flex;
  justify-content: center;
  border: 1px solid var(--hairline);
  background: var(--paper-dim);
  padding: 10px 0;
  margin-bottom: 16px;
}
.mark-preview .suit {
  position: relative;
  width: min(320px, 86%);
  aspect-ratio: 1600 / 1995;
}
.mark-preview .suit .layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mark-overlay {
  position: absolute;
  display: block;
  pointer-events: none;
  z-index: 5;
}
.mark-overlay.fallback {
  border: 2px dashed var(--accent);
  border-radius: 50%;
  background: transparent !important;
}

/* マーク行 */
.mark-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid var(--hairline);
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
}
.mark-row select, .mark-row input { font-size: 14px; padding: 8px 10px; }
.mark-row .del {
  position: absolute;
  right: 8px;
  top: 8px;
  border: 0;
  background: transparent;
  color: var(--grey);
  font-size: 16px;
  line-height: 1;
}
.add-btn {
  border: 1px dashed #b0b0b0;
  background: transparent;
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* 採寸グリッド */
.meas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.meas-item .f-label { display: flex; justify-content: space-between; margin-bottom: 4px; }
.meas-item .f-label .no {
  font-family: var(--font-display);
  color: var(--grey);
  font-weight: 600;
}
.meas-item .unit-wrap { position: relative; }
.meas-item .unit-wrap::after {
  content: attr(data-unit);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--grey);
}
.meas-item input { padding-right: 36px; }
.meas-warn {
  font-size: 11px;
  line-height: 1.5;
  color: var(--accent);
  margin-top: 3px;
}
.meas-warn:empty { display: none; }
.meas-item.has-warn input { border-color: var(--accent); }
@media (min-width: 640px) { .meas-grid { grid-template-columns: repeat(3, 1fr); } }

/* 確認テーブル */
.confirm-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
.confirm-table th, .confirm-table td {
  border: 1px solid var(--hairline);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.confirm-table th {
  width: 34%;
  background: var(--paper-dim);
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 700;
}
/* 必須項目が未入力の行（出力はできるようにせず、ここで気づけるようにする） */
.confirm-table .req { color: var(--accent); font-size: 10px; font-weight: 400; margin-left: 6px; }
.confirm-table tr.is-missing th, .confirm-table tr.is-missing td { color: var(--accent); }
.confirm-table tr.is-missing td { font-weight: 700; }

/* フォームナビ */
.form-nav {
  display: flex;
  gap: 10px;
  margin-top: 30px;
}
.btn {
  flex: 1;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  text-decoration: none;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:disabled { opacity: .4; }
.btn.ghost { border-color: #c9c9c9; color: var(--grey); flex: .6; }
.danger-link {
  display: block;
  margin: 26px auto 0;
  border: 0;
  background: none;
  color: var(--grey);
  font-size: 11px;
  text-decoration: underline;
}

/* ============================================================
   印刷用オーダーシート（A4横・プロトタイプ簡易版）
   ============================================================ */
#printsheet { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body * { visibility: hidden; }
  body { background: #fff; }
  #printsheet, #printsheet * { visibility: visible; }
  #printsheet {
    display: block;
    position: absolute;
    inset: 0;
    font-size: 9pt;
    color: #000;
  }
  .ps-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: 6mm;
    margin-bottom: 3mm;
  }
  .ps-title { text-align: center; }
  .ps-title h1 { font-size: 16pt; font-family: var(--font-display); letter-spacing: .06em; }
  .ps-title p { font-size: 8pt; }
  .ps-box { border: 1.2pt solid #000; padding: 2mm; }
  .ps-box .lbl { font-size: 7pt; color: #333; }
  .ps-cols {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 3mm;
    align-items: start;
  }
  table.ps { width: 100%; border-collapse: collapse; }
  table.ps th, table.ps td { border: .6pt solid #000; padding: 1mm 1.5mm; font-size: 7.5pt; text-align: left; }
  table.ps th { background: #eee; font-weight: 700; white-space: nowrap; }
  .ps-suit { text-align: center; }
  .ps-suit img { width: 52mm; margin: 0 auto; }
  .ps-note { font-size: 6.5pt; color: #333; margin-top: 1mm; }
  .ps-footer { margin-top: 2mm; display: flex; gap: 3mm; }
  .ps-footer .ps-box { flex: 1; min-height: 10mm; }
}
