:root {
  --bg: #f6f4ef;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #d8d4cb;
  --accent: #1a1a1a;
  --staff: #b34a2c;
  --card-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  background: var(--bg); color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  font-size: 15px;
}

/* ヘッダー＋フィルターをまとめて画面上部に固定する外枠 (タスク①) */
.sticky-head {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: rgba(246,244,239,.96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  font-family: "Didot", "Bodoni MT", serif;
  font-size: 24px; letter-spacing: 0.18em; font-weight: 400;
}
.brand-sub {
  margin-left: 10px; font-size: 11px; color: var(--muted); letter-spacing: 0.15em;
}
@media (max-width: 420px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar .brand-mark { font-size: 16px; letter-spacing: 0.12em; }
  .topbar .brand-sub { margin-left: 6px; font-size: 10px; letter-spacing: 0.1em; }
  .topbar .proto-badge { margin-left: 6px; padding: 2px 6px; font-size: 9px; }
  .topbar-right { gap: 8px; }
  .count-badge { font-size: 11px; }
}
.proto-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  background: #CC0000;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}
.brand { display: inline-flex; align-items: center; flex-wrap: wrap; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.count-badge {
  font-size: 13px; color: var(--muted);
}

.filters {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 20px;
}
.filter-row {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.filter-select, .filter-input {
  padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--fg);
  border-radius: 6px; min-width: 140px;
  font-family: inherit;
}
.filter-input { flex: 1 1 220px; }

/* サイズフィルタボタン (ボトムシート起動) */
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--fg);
  border-radius: 6px; min-width: 100px;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: border-color .15s, background .15s;
}
.filter-pill::after {
  content: "▾"; color: var(--muted); font-size: 11px; margin-left: auto;
}
.filter-pill.active {
  border-color: var(--staff); background: #fff7f3;
}
.filter-pill-label {
  color: var(--muted); font-size: 12px; letter-spacing: 0.05em;
}
.filter-pill.active .filter-pill-label {
  color: var(--staff);
}
.filter-pill-value {
  font-weight: 600; color: var(--staff);
}
.filter-pill-value:empty { display: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding: 20px;
}
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; padding: 24px; }
}

.card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  display: flex; flex-direction: column;
}
.card:active { transform: scale(0.98); }
.card-img {
  width: 100%; height: 260px; object-fit: contain;
  background: #111;
  display: flex; align-items: center; justify-content: center;
}
@media (min-width: 600px) {
  .card-img { height: 320px; }
}
@media (min-width: 1024px) {
  .card-img { height: 360px; }
}
.card-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #aaa; font-size: 11px; letter-spacing: 0.1em;
}
.card-body {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.card-brand {
  font-size: 11px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase;
}
.card-item {
  font-size: 14px; line-height: 1.3; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-price {
  margin-top: 6px;
  font-size: 15px; font-weight: 600; color: var(--staff);
  line-height: 1.2;
}
.card-price.hidden-fg { display: none; }
.card-price-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}
.card-price-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.card-price-note {
  font-size: 10px; color: var(--muted);
  letter-spacing: 0.03em;
  margin-top: 2px;
}
.card-measure {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 3px;
  margin-bottom: 1px;
}
.card-price-monthly {
  font-size: 12px;
  font-weight: 600;
  color: var(--staff);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
  letter-spacing: 0.02em;
}
.card-monthly-note {
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
  display: block;
  margin-top: 1px;
}
.card-stock {
  font-size: 11px; color: var(--muted);
}
.card-stock.hidden-fg { display: none; }
.card-lead {
  font-size: 11px; color: #2a8c4a; font-weight: 600; letter-spacing: 0.05em;
}
/* お客様用 (/catalog) では LT(納期) を非表示にする */
body:not(.staff-mode) .card-lead { display: none; }
.src-tag {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.05em;
  margin-left: 4px;
}
.src-PASCHERE { background: #e6f0fa; color: #1a5a8a; }
.src-SANEI    { background: #fdeee2; color: #b34a2c; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.loading {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.hidden { display: none !important; }

/* モーダル */
/* z-index は AI接客アシスト(.copilot-overlay=1000) より上に置く。
   /staff のカンペから「商品詳細を開く」を押した時、モーダルがカンペの裏に
   隠れて反応がないように見える事故を防ぐ(/catalog 単独利用には影響なし)。 */
.modal {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-inner {
  background: #fff; border-radius: 12px;
  max-width: 560px; width: 100%; max-height: 90vh;
  overflow-y: auto; position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 16px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.9);
  font-size: 22px; cursor: pointer;
}
.modal-image {
  width: 100%; aspect-ratio: 4/3; background: #f0ede5;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.modal-image > img {
  width: 100%; height: 100%; object-fit: contain;
}
.modal-img-empty {
  color: #aaa; font-size: 12px; letter-spacing: 0.1em;
}
.modal-slides {
  width: 100%; height: 100%;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.modal-slides::-webkit-scrollbar { display: none; }
.modal-slide {
  flex: 0 0 100%; width: 100%; height: 100%;
  scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
  background: #f0ede5;
}
.modal-slide img {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.modal-dots {
  position: absolute; bottom: 8px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
  pointer-events: none;
}
.modal-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.6); border: 1px solid rgba(0,0,0,.2);
  pointer-events: auto; cursor: pointer; transition: background .15s;
}
.modal-dot.active { background: rgba(26,26,26,.85); }
.modal-counter {
  position: absolute; top: 10px; left: 12px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  letter-spacing: 0.05em;
}
.modal-body { padding: 20px 24px 28px; }
.modal-brand {
  font-size: 12px; color: var(--muted); letter-spacing: 0.15em;
  margin-bottom: 6px;
}
.modal-item {
  font-size: 18px; font-weight: 500; line-height: 1.4;
  margin-bottom: 12px;
}
.modal-meta {
  font-size: 13px; color: var(--muted); line-height: 1.7;
  margin-bottom: 16px;
}
.modal-meta dt {
  display: inline-block; width: 80px; color: #aaa;
}
.modal-variants {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
}
/* 修正E: バリアントチップは <button> 化。タップで選択(.selected)。 */
.variant-chip {
  display: inline-flex; align-items: center;
  min-height: 40px;
  border: 1.5px solid var(--line);
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-family: inherit;
  background: #fafafa; color: var(--fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s, border-color .12s, color .12s;
}
.variant-chip.has-stock { border-color: #2a8c4a; color: #2a8c4a; }
.variant-chip.no-stock { color: #aaa; }
.variant-chip.selected {
  background: #1a3a5c; color: #fff; border-color: #1a3a5c;
  font-weight: 600;
}
.variant-chip:active { opacity: .75; }
.modal-public-price {
  margin: 18px 0 16px;
  padding: 14px 16px;
  background: #fff7f3;
  border-left: 4px solid var(--staff);
  border-radius: 6px;
}
.modal-public-price .public-price-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.modal-public-price .public-price-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--staff);
  line-height: 1.2;
}
.modal-public-price .public-price-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}
.modal-public-price .public-price-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.modal-public-price .public-price-note {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-top: 6px;
}
.modal-public-price .public-price-monthly {
  font-size: 14px;
  font-weight: 600;
  color: var(--staff);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.modal-public-price .monthly-note {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-left: 4px;
}

/* 60回無金利分割払い - カードバッジ */
.card-loan-badge {
  background: #1a3a5c;
  color: #d4af37;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

/* 60回無金利分割払い - モーダル ヒーロー */
.modal-public-price .loan-hero {
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1a3a5c 0%, #234870 100%);
  border-radius: 6px;
  text-align: center;
  color: #d4af37;
}
.modal-public-price .loan-hero-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.modal-public-price .loan-hero-amount {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}
.modal-public-price .loan-hero-amount strong {
  font-size: 22px;
  font-weight: 700;
  color: #d4af37;
  margin: 0 4px;
}

/* 60回無金利分割払い - モーダル 明細 */
.modal-public-price .loan-detail {
  margin-top: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg);
}
.modal-public-price .loan-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.modal-public-price .loan-row strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--staff);
}
.modal-public-price .loan-total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-weight: 600;
  color: var(--fg);
}

/* 60回無金利分割払い - モーダル ベネフィット */
.modal-public-price .loan-benefits {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.modal-public-price .loan-benefits li::before {
  content: "✓ ";
  color: #2a8c4a;
  font-weight: 700;
  margin-right: 4px;
}
.modal-staff {
  border-top: 1px solid var(--line);
  padding-top: 16px; font-size: 13px; color: var(--muted);
}
.suggested-note-inline {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.modal-staff.hidden-fg { display: none; }
.modal-staff .price-large {
  font-size: 22px; font-weight: 600; color: var(--staff);
}
.modal-staff .suggested {
  background: #fff7f3;
  border-left: 3px solid var(--staff);
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 4px;
}
.modal-staff .suggested-note {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* 価格情報暗号コード (/staff 専用・覗き見対策) — カード/詳細で共通スタイル */
.price-cipher {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.85rem;
  color: #888;
  letter-spacing: 0.1em;
  user-select: none;
}

/* ITALMODERN価格暗号コード (/catalog /staff 共通・覗き見対策)
   お客様には目立たない薄グレー、スタッフモードのみ僅かに視認性を上げる */
.cipher-code {
  font-size: 10px;
  color: #bbb;
  letter-spacing: 0.05em;
  font-family: monospace;
  margin-top: 2px;
  user-select: none;
  -webkit-user-select: none;
}
body.staff-mode .cipher-code { color: #9a9a9a; }
#modal-cipher { margin: 8px 0 2px; }

/* 取り寄せ注文ボタン */
.order-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.order-btn:active { opacity: 0.7; }

/* 注文フォームモーダル */
.order-modal-inner {
  max-width: 640px;
}
.order-title {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
}
.order-product {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 12px;
  background: #f6f4ef;
  border-radius: 6px;
  margin-bottom: 18px;
}
.order-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) {
  .order-form .form-grid { grid-template-columns: 1fr; }
}
.order-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.order-form label.full { grid-column: 1 / -1; }
.order-form .req { color: var(--staff); margin-left: 4px; }
.order-form input,
.order-form select,
.order-form textarea {
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--fg);
  font-family: inherit;
  width: 100%;
}
.order-form textarea { resize: vertical; min-height: 60px; }
.order-form .field-hint {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.03em;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: flex-end;
}
.btn-primary, .btn-secondary {
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}
.btn-primary {
  background: var(--staff);
  color: #fff;
  border-color: var(--staff);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: #fff;
  color: var(--fg);
  border-color: var(--line);
}
.order-status {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  min-height: 18px;
}
.order-status.ok { color: #2a8c4a; font-weight: 600; }
.order-status.err { color: #c54a2c; font-weight: 600; }

/* パスワードロック画面 */
.lock-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.lock-overlay.hidden { display: none; }
.lock-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 32px;
  max-width: 360px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 16px;
  align-items: stretch; text-align: center;
}
.lock-brand {
  margin-bottom: 8px;
}
.lock-brand .brand-mark {
  font-family: "Didot", "Bodoni MT", serif;
  font-size: 24px; letter-spacing: 0.18em;
  display: block;
  white-space: nowrap;
}
.lock-brand .brand-sub {
  font-size: 13px; letter-spacing: 0.3em;
  color: var(--muted);
  margin-left: 0; margin-top: 4px;
  display: block;
}
@media (max-width: 420px) {
  .lock-card { padding: 32px 22px; }
  .lock-brand .brand-mark { font-size: 19px; letter-spacing: 0.15em; }
  .lock-brand .brand-sub  { font-size: 11px; letter-spacing: 0.25em; }
}
.lock-headline {
  font-size: 15px; font-weight: 600; color: var(--fg);
  letter-spacing: 0.08em;
  margin-top: 14px;
}
.lock-prompt {
  font-size: 13px; color: var(--muted);
  letter-spacing: 0.05em;
  margin-top: 4px;
}
#lock-input {
  padding: 14px 16px; font-size: 18px;
  border: 1px solid var(--line); border-radius: 6px;
  text-align: center; letter-spacing: 0.3em;
  font-family: inherit;
}
.lock-submit {
  padding: 12px 24px; font-size: 14px; font-weight: 600;
  background: var(--accent); color: #fff;
  border: none; border-radius: 6px;
  cursor: pointer; letter-spacing: 0.1em;
  font-family: inherit;
}
.lock-submit:active { opacity: 0.7; }
.lock-error {
  color: var(--staff); font-size: 12px; min-height: 16px;
}

/* スタッフ名カスタム入力欄 */
.staff-custom { margin-top: 8px; }

/* 郵便番号検索ステータス */
.postal-status {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  min-height: 16px;
  letter-spacing: 0.03em;
}
.postal-status.searching { color: var(--muted); }
.postal-status.ok { color: #2a8c4a; }
.postal-status.err { color: var(--staff); }

/* 配送希望日 + 時間帯 横並び */
.ship-datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) {
  .ship-datetime-row { grid-template-columns: 1fr; }
}
.ship-datetime-row label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--muted); letter-spacing: 0.05em;
}

/* スタッフモード時の背景アクセント */
body.staff-mode .topbar {
  border-bottom-color: var(--staff);
}
body.staff-mode .brand-sub::after {
  content: " · STAFF";
  color: var(--staff); font-weight: 600;
}

/* ==========================================================
   サイズ選択ボトムシート
   - モバイル縦: 画面下からスライドアップ
   - iPad横以上: 中央モーダルにフェードイン
   ========================================================== */
.size-sheet {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0, 0, 0, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.size-sheet.hidden { display: none; }
.size-sheet-inner {
  background: #fff;
  width: 100%;
  border-radius: 16px 16px 0 0;
  max-height: 85vh;
  display: flex; flex-direction: column;
  animation: sheet-slide .25s ease-out;
}
@keyframes sheet-slide {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.size-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.size-sheet-title {
  font-size: 15px; font-weight: 600; letter-spacing: 0.05em;
}
.size-sheet-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: #f3f0e8;
  font-size: 20px; cursor: pointer; color: var(--fg);
  display: flex; align-items: center; justify-content: center;
}
.size-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 18px 20px;
  -webkit-overflow-scrolling: touch;
}
.size-section { margin-top: 16px; }
.size-section:first-child { margin-top: 8px; }
.size-section-title {
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.1em; font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.size-chip-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.size-chip {
  padding: 10px 16px; min-width: 56px;
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  color: var(--fg);
  transition: background .15s, border-color .15s, color .15s;
}
.size-chip:active { background: #f3f0e8; }
.size-chip.selected {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.size-sheet-actions {
  display: flex; gap: 12px; padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  position: sticky; bottom: 0;
}
.size-sheet-actions .btn-secondary,
.size-sheet-actions .btn-primary {
  flex: 1; padding: 12px; font-size: 14px;
}

/* iPad 横 / デスクトップ: 中央モーダル化 */
@media (min-width: 768px) {
  .size-sheet { align-items: center; }
  .size-sheet-inner {
    border-radius: 12px;
    max-width: 640px;
    width: 92%;
    max-height: 75vh;
    animation: sheet-fade .2s ease-out;
  }
  @keyframes sheet-fade {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
  }
}

/* ==========================================================
   タスク① ヘッダーフィルター固定化
   - PC (769px以上): 全フィルターをヘッダー直下に常時表示
   - スマホ (768px以下): 上部はブランド+フリーワードのみ。
     カテゴリ/性別/サイズは「絞り込み」アコーディオンに格納
   ========================================================== */

/* フィルター行: PC は2行とも常時表示 */
.filter-row + .filter-row { margin-top: 10px; }
.filter-row-advanced { display: flex; }

/* 絞り込みトグル (スマホ専用・PC では非表示) */
.filter-toggle {
  display: none;
  align-items: center; gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--line); background: #fff; color: var(--fg);
  border-radius: 6px;
  font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  white-space: nowrap;
}
.filter-toggle-arrow {
  font-size: 10px; color: var(--muted);
  transition: transform .2s ease;
}
.filter-toggle.open { border-color: var(--accent); }
.filter-toggle.open .filter-toggle-arrow { transform: rotate(180deg); }

/* スマホ版 (768px以下): 上部固定2項目 + アコーディオン */
@media (max-width: 768px) {
  .filters { padding: 8px 12px; }
  .filter-row { gap: 8px; }
  .filter-row + .filter-row { margin-top: 8px; }
  .filter-toggle { display: inline-flex; }

  /* 1行目: 全ブランド + 絞り込みボタン / 2行目: フリーワード */
  .filter-row-primary .filter-select { flex: 1 1 auto; min-width: 0; }
  .filter-row-primary .filter-input  { flex: 1 1 100%; min-width: 0; }
  .filter-row-primary .filter-toggle { flex: 0 0 auto; }

  /* 残りフィルターはアコーディオン開閉 */
  .filter-row-advanced { display: none; }
  .filter-row-advanced.open { display: flex; }
  .filter-row-advanced .filter-select,
  .filter-row-advanced .filter-pill { flex: 1 1 30%; min-width: 0; }

  .filter-select, .filter-input, .filter-pill {
    padding: 9px 10px; font-size: 13px;
  }
}

/* ==========================================================
   タスク② カート機能 (/catalog 専用)
   ========================================================== */

/* ヘッダー右のカートアイコン */
.cart-icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  font-size: 22px; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.cart-icon:active { opacity: .6; }
.cart-badge {
  position: absolute; top: 0; right: -2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #CC0000; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Hiragino Sans", sans-serif;
}
.cart-badge.empty { display: none; }
@media (max-width: 420px) {
  .cart-icon { width: 34px; height: 34px; font-size: 19px; }
}

/* 商品カードの「カートに追加」ボタン */
.card-cart-btn {
  margin: 0 14px 14px;
  padding: 9px 10px;
  background: #1a3a5c; color: #fff;
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background .15s, opacity .15s;
}
.card-cart-btn:active { opacity: .7; }
.card-cart-btn.added { background: #2a8c4a; }

/* 詳細モーダルの「カートに追加」ボタン */
.modal-cart-btn {
  display: block; width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  background: #1a3a5c; color: #fff;
  border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: .05em;
  cursor: pointer; font-family: inherit;
  transition: background .15s, opacity .15s;
}
.modal-cart-btn:active { opacity: .7; }
.modal-cart-btn.added { background: #2a8c4a; }

/* 追加トースト */
.cart-toast {
  position: fixed; left: 50%; bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(26,26,26,.95); color: #fff;
  padding: 12px 22px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .03em;
  z-index: 500; opacity: 0; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  transition: opacity .2s ease, transform .2s ease;
}
.cart-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ---- カートページ (cart.html) ---- */
.cart-page {
  max-width: 720px; margin: 0 auto;
  padding: 24px 20px 60px;
}
.cart-h1 {
  font-size: 20px; font-weight: 600; letter-spacing: .05em;
  margin-bottom: 20px;
}
.cart-list { list-style: none; }
.cart-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff; border-radius: 8px;
  padding: 14px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-brand {
  font-size: 11px; letter-spacing: .12em; color: var(--muted);
  text-transform: uppercase; margin-bottom: 2px;
}
.cart-item-name {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  margin-bottom: 6px;
}
.cart-item-meta {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  word-break: break-word;
}
.cart-item-price {
  margin-top: 6px;
  font-size: 16px; font-weight: 700; color: var(--staff);
}
.cart-item-tax {
  font-size: 11px; font-weight: 500; color: var(--muted);
  margin-left: 3px;
}
.cart-item-remove {
  flex: 0 0 auto;
  padding: 7px 12px;
  background: #fff; color: var(--staff);
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.cart-item-remove:active { background: #f3f0e8; }

.cart-total {
  text-align: right;
  font-size: 16px; font-weight: 600;
  margin: 18px 4px 22px;
}
.cart-total span {
  font-size: 24px; font-weight: 700; color: var(--staff);
  margin-left: 8px;
}
.cart-submit-btn {
  display: block; width: 100%;
  padding: 18px 20px;
  background: #1a3a5c; color: #fff;
  border: none; border-radius: 10px;
  font-size: 17px; font-weight: 700; letter-spacing: .06em;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 16px rgba(26,58,92,.3);
  transition: opacity .15s;
}
.cart-submit-btn:active { opacity: .8; }
.cart-note {
  margin: 14px 2px 24px;
  font-size: 12px; color: var(--fg); line-height: 1.9;
  background: #fff7f3;
  border-left: 3px solid var(--staff);
  padding: 12px 14px; border-radius: 6px;
}
.cart-clear-btn {
  display: block; width: 100%;
  padding: 12px;
  background: #fff; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.cart-clear-btn:active { background: #f3f0e8; }
.cart-back {
  display: inline-block;
  margin-top: 22px;
  color: var(--muted); font-size: 13px;
  text-decoration: none;
}
.cart-back:active { opacity: .6; }
.cart-back-link {
  color: var(--muted); font-size: 13px; text-decoration: none;
}
.cart-empty {
  text-align: center; padding: 60px 20px;
  color: var(--muted);
}
.cart-empty p { margin-bottom: 20px; font-size: 15px; }
.cart-link-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent); color: #fff;
  border-radius: 8px; text-decoration: none;
  font-size: 14px; font-weight: 600;
}

/* ==========================================================
   カテゴリ表示最適化 — カテゴリタグUI (2026-05-22 Phase 0 検証済み)
   filter-category セレクトを廃し、大カテゴリ10種+「すべて」「その他」の
   タグボタン12個を常時表示。横スクロールで全タグにアクセス可能。
   ========================================================== */
.category-tag-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding: 8px 0 2px;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge */
  -webkit-overflow-scrolling: touch;
}
.category-tag-container::-webkit-scrollbar { display: none; }

.category-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;             /* iOS HIG: タップターゲット 44px 確保 */
  padding: 5px 16px;
  border-radius: 22px;
  border: 1.5px solid #ccc;
  background: #fff;
  color: var(--fg);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.category-tag:hover { border-color: #888; }
.category-tag.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.category-tag:active { opacity: .7; }

@media (max-width: 768px) {
  .category-tag-container { padding: 6px 0 2px; }
}

/* ==========================================================
   名古屋催事対応アップデート (2026-05-22)
   修正F / 新機能① バーコード / 新機能② TagID
   ========================================================== */

/* 修正F: ヘッダー「ATELIER SELECT」トップリンク */
.brand-home {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  -webkit-tap-highlight-color: transparent;
}
.brand-home:active { opacity: .6; }

/* 新機能①: バーコードスキャン 📷 ボタン */
.barcode-btn {
  flex: 0 0 auto;
  min-width: 44px; min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line); background: #fff;
  border-radius: 6px; font-size: 18px;
  cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.barcode-btn:active { opacity: .6; }

/* 新機能①: バーコードスキャン 全画面オーバーレイ */
.barcode-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: #000;
  display: flex; flex-direction: column;
}
.barcode-overlay.hidden { display: none; }
.barcode-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: #111; color: #fff;
}
.barcode-title { font-size: 15px; font-weight: 600; }
.barcode-close {
  width: 40px; height: 40px;
  background: transparent; border: none; color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer;
}
.barcode-reader {
  flex: 1 1 auto; width: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.barcode-reader video { max-width: 100%; }
.barcode-msg {
  padding: 16px 18px 28px;
  background: #111; color: #fff;
  font-size: 13px; text-align: center; line-height: 1.6;
}

/* 新機能②: TagID（PC番号）サイズ別表示 */
.modal-tagid {
  margin: 14px 0;
  padding: 12px 14px;
  background: #f4f6f8;
  border-radius: 8px;
  font-size: 13px;
}
.modal-tagid:empty { display: none; }
.modal-tagid-title {
  font-size: 12px; color: var(--muted);
  letter-spacing: .05em; margin-bottom: 6px;
}
.modal-tagid-single {
  font-size: 15px; font-weight: 600;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.modal-tagid-row {
  display: flex; justify-content: space-between;
  padding: 5px 0;
  border-top: 1px solid #e3e7ea;
}
.modal-tagid-row:first-of-type { border-top: none; }
.modal-tagid-size { color: var(--muted); }
.modal-tagid-val {
  font-weight: 600;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

/* Phase1 (案D): 色違い variant が並ぶ時のみカードに出す注釈 */
.card-color-note {
  margin: 4px 0 6px;
  padding: 4px 7px;
  font-size: 10.5px;
  line-height: 1.35;
  color: #8a6d3b;
  background: #fcf6e6;
  border-left: 3px solid #d6b56b;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

/* ============================================================================
   AI接客アシスト(カンペ) — 暗所向けダークUI (/staff 専用)
   ============================================================================ */
/* topbar の起動ボタン */
.copilot-trigger {
  border: 1px solid #2b2b2b;
  background: linear-gradient(135deg, #1f1f1f 0%, #353535 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.copilot-trigger:active { transform: translateY(1px); }

/* 全画面オーバーレイ */
.copilot-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8,8,10,.78);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.copilot-overlay.hidden { display: none; }
body.copilot-open { overflow: hidden; }

/* ダークパネル */
.copilot-panel {
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #15161a;
  color: #ececf0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.5);
  overflow: hidden;
}
@media (min-width: 760px) {
  .copilot-overlay { align-items: center; }
  .copilot-panel { border-radius: 16px; }
}

.copilot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #26272d;
  background: #101115;
}
.copilot-title { font-size: 16px; font-weight: 800; letter-spacing: 0.03em; }
.copilot-close {
  border: none;
  background: transparent;
  color: #c9c9d2;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.copilot-body {
  padding: 14px 16px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.copilot-section { margin-bottom: 14px; }
.copilot-section-label {
  font-size: 12px;
  font-weight: 700;
  color: #9a9aa6;
  margin-bottom: 7px;
  letter-spacing: 0.04em;
}
.copilot-chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.copilot-chip {
  border: 1px solid #34353d;
  background: #1f2027;
  color: #d8d8e0;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.copilot-chip:active { transform: translateY(1px); }
.copilot-chip.selected {
  background: #c9a24b;
  border-color: #c9a24b;
  color: #1a1305;
}

.copilot-note {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #34353d;
  background: #1f2027;
  color: #f0f0f4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}
.copilot-note::placeholder { color: #6f6f7c; }

.copilot-actions {
  display: flex;
  gap: 10px;
  margin: 4px 0 8px;
}
.copilot-btn-primary, .copilot-btn-secondary {
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
}
.copilot-btn-primary {
  flex: 1;
  background: linear-gradient(135deg, #c9a24b 0%, #e0bd6a 100%);
  color: #1a1305;
}
.copilot-btn-primary:disabled { opacity: .6; cursor: progress; }
.copilot-btn-secondary {
  flex: 0 0 96px;
  background: #23242b;
  color: #cfcfd8;
  border-color: #34353d;
}

/* 該当件数バー(粗フィルタ後のヒット件数を実行ボタン直前に提示) */
.copilot-hitbar {
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  margin: 6px 0 10px;
  line-height: 1.4;
  background: #1f2027;
  color: #b6b6c2;
  border: 1px solid #2a2b33;
}
.copilot-hitbar-ok   { background: #16291d; color: #9fe6b6; border-color: #1f3a28; }
.copilot-hitbar-warn { background: #2c2412; color: #eccf86; border-color: #3a2f17; }
.copilot-hitbar-info { background: #1c2530; color: #acd0f0; border-color: #233246; }

/* 提示件数(5/10)トグル: 既存の copilot-chip を流用 */
.copilot-resultcount-row .copilot-chip { min-width: 56px; text-align: center; }

/* バナー(状態表示) */
.copilot-banner {
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  margin: 10px 0;
  line-height: 1.5;
}
.copilot-banner-info { background: #1c2530; color: #acd0f0; }
.copilot-banner-ok   { background: #16291d; color: #9fe6b6; }
.copilot-banner-warn { background: #2c2412; color: #eccf86; }
.copilot-banner-error{ background: #2c1717; color: #f0a3a3; }

/* 結果カード */
.copilot-results { display: flex; flex-direction: column; gap: 14px; }
.copilot-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-areas: "thumb info" "talk talk" "detail detail";
  gap: 10px 12px;
  background: #1b1c22;
  border: 1px solid #2a2b33;
  border-radius: 12px;
  padding: 12px;
}
.copilot-card-thumb {
  grid-area: thumb;
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: #0e0f12;
}
.copilot-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.copilot-noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #6f6f7c; letter-spacing: 0.08em;
}
.copilot-rank {
  position: absolute;
  top: 4px; left: 4px;
  background: #c9a24b;
  color: #1a1305;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
}
.copilot-card-info { grid-area: info; min-width: 0; }
.copilot-card-brand { font-size: 11px; font-weight: 700; color: #9a9aa6; letter-spacing: 0.06em; text-transform: uppercase; }
.copilot-card-name { font-size: 15px; font-weight: 700; color: #f2f2f6; margin: 2px 0 5px; line-height: 1.3; }
.copilot-card-meta { font-size: 11.5px; color: #b6b6c2; line-height: 1.5; }
.copilot-card-price { font-size: 15px; font-weight: 800; color: #e8c878; margin-top: 5px; }
.copilot-card-cipher {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #707078;
  margin-top: 3px;
  letter-spacing: 0.05em;
}
.copilot-talk { grid-area: talk; }
.copilot-talk-label { font-size: 12px; font-weight: 700; color: #c9a24b; margin-bottom: 5px; }
.copilot-talk-list { margin: 0; padding-left: 18px; }
.copilot-talk-list li { font-size: 13.5px; line-height: 1.6; color: #e2e2e8; margin-bottom: 4px; }
.copilot-card-detail {
  grid-area: detail;
  width: 100%;
  border: 1px solid #34353d;
  background: #23242b;
  color: #cfcfd8;
  border-radius: 9px;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.copilot-card-detail:active { transform: translateY(1px); }
