/* AMS インプレッション 専用スタイル
   既存 style.css のデザイン言語（白基調・細字セリフ・抑制されたアクセント）を継承。
   ジェネリックAI美学（紫グラデ・ネオン）を一切使わない。
*/

/* ----- メイン画面 複数選択フィルタ ----- */
.ams-compat-hidden { display: none !important; }

.ams-fgroup {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.ams-fgroup-label {
  flex: 0 0 auto;
  min-width: 64px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #6e6450;
}
.ams-fchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}
.ams-fchip {
  padding: 5px 12px;
  font-size: 12px;
  color: #2a2418;
  background: #fff;
  border: 1px solid #d8d2bf;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ams-fchip:hover { background: #fbf8ee; }
.ams-fchip.selected {
  background: #2a2418;
  color: #fbf8ee;
  border-color: #2a2418;
}

/* カテゴリタグの複数選択（既存 .category-tag.active を流用しつつ複数許容） */
.category-tag.active {
  background: #2a2418;
  color: #fbf8ee;
  border-color: #2a2418;
}

/* サイズボタン選択中 */
.filter-pill.active {
  background: #2a2418;
  color: #fbf8ee;
  border-color: #2a2418;
}
.filter-pill.active .filter-pill-label,
.filter-pill.active .filter-pill-value { color: #fbf8ee; }

/* 件数バー（AIおすすめの hitbar と同系統） */
.ams-hitbar {
  margin: 6px 12px 0;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #6e6450;
  background: #f6f1e0;
  border-radius: 6px;
}
.ams-hitbar.ok { color: #496a3b; background: #ecf3df; }
.ams-hitbar.warn { color: #aa6432; background: #fbeede; }
.ams-hitbar strong { font-weight: 600; color: #2a2418; }

/* ----- 上部のAMSバッジ ----- */
.ams-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #6e6450;
  border: 1px solid #c8b98c;
  border-radius: 999px;
  background: #fbf8ee;
}

/* ----- トップバー右側のボタン ----- */
.ai-recommend-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 13px;
  color: #2a2418;
  background: #fbf8ee;
  border: 1px solid #c8b98c;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.ai-recommend-btn:hover { background: #f3eed9; }
.ai-recommend-icon { font-size: 14px; line-height: 1; }
.ai-recommend-label { font-weight: 500; }

.ams-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 16px;
  background: transparent;
  border: 1px solid #d8d2bf;
  border-radius: 50%;
  color: #6e6450;
  cursor: pointer;
}
.ams-settings-btn:hover { background: #fbf8ee; }

@media (max-width: 480px) {
  .ai-recommend-label { display: none; }
  .ai-recommend-btn { padding: 6px 9px; }
}

/* ----- AIおすすめモーダル ----- */
.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(20, 18, 14, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ai-modal.hidden { display: none; }
.ai-modal-inner {
  background: #fffdf6;
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.ai-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #ebe5cf;
  background: #fbf8ee;
}
.ai-modal-title { font-size: 15px; font-weight: 500; letter-spacing: 0.04em; color: #2a2418; }
.ai-modal-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: #6e6450;
  cursor: pointer;
  padding: 4px;
}
.ai-modal-body {
  padding: 16px 18px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ai-section { margin-bottom: 14px; }

/* AIおすすめ条件のアコーディオン（スマホ一覧性向上・ワンタップ開閉） */
.ai-acc {
  border: 1px solid #ebe5cf;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.ai-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  background: #fbf8ee;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.ai-acc-head:hover { background: #f3eed9; }
.ai-acc-label { font-size: 12px; color: #2a2418; letter-spacing: 0.04em; }
.ai-acc-badge {
  display: none;
  font-size: 11px;
  color: #fbf8ee;
  background: #2a2418;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}
.ai-acc-badge.on { display: inline-block; }
.ai-acc-arrow {
  margin-left: auto;
  font-size: 11px;
  color: #6e6450;
  transition: transform 0.2s ease;
}
.ai-acc.open .ai-acc-arrow { transform: rotate(180deg); }
.ai-acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.ai-acc.open .ai-acc-body {
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ai-acc-body .ai-chip-row { padding: 10px 12px 12px; }
.ai-section-label {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #6e6450;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.ai-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-chip {
  padding: 6px 12px;
  font-size: 12px;
  color: #2a2418;
  background: #fff;
  border: 1px solid #d8d2bf;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.ai-chip:hover { background: #fbf8ee; }
.ai-chip.selected {
  background: #2a2418;
  color: #fbf8ee;
  border-color: #2a2418;
}
.ai-note {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #2a2418;
  background: #fff;
  border: 1px solid #d8d2bf;
  border-radius: 8px;
  resize: vertical;
  box-sizing: border-box;
}
.ai-hitbar {
  padding: 8px 10px;
  font-size: 12px;
  color: #6e6450;
  background: #f6f1e0;
  border-radius: 6px;
  margin-bottom: 12px;
}
.ai-hitbar.warn { color: #aa6432; background: #fbeede; }
.ai-hitbar.ok { color: #496a3b; background: #ecf3df; }
.ai-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}
.ai-results { display: flex; flex-direction: column; gap: 12px; }
.ai-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid #ebe5cf;
  border-radius: 10px;
}
.ai-card-thumb {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 6px;
  overflow: hidden;
  background: #f6f1e0;
}
.ai-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ai-card-noimg {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 10px; color: #8c8266;
}
.ai-card-rank {
  position: absolute; top: 4px; left: 4px;
  padding: 1px 6px;
  font-size: 10px;
  color: #fbf8ee;
  background: rgba(42, 36, 24, 0.84);
  border-radius: 999px;
}
.ai-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-card-brand { font-size: 11px; letter-spacing: 0.06em; color: #6e6450; }
.ai-card-name { font-size: 13px; color: #2a2418; line-height: 1.3; }
.ai-card-meta { font-size: 11px; color: #6e6450; line-height: 1.4; }
.ai-card-price { font-size: 14px; color: #2a2418; font-weight: 500; margin-top: 2px; }
.ai-card-point {
  margin-top: 6px;
  padding: 8px 10px;
  background: #fbf8ee;
  border-left: 2px solid #c8b98c;
  border-radius: 4px;
}
.ai-card-point-label {
  font-size: 10px;
  color: #6e6450;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.ai-card-point-list {
  margin: 0; padding-left: 14px;
  font-size: 12px;
  color: #2a2418;
  line-height: 1.5;
}
.ai-card-actions { display: flex; gap: 6px; margin-top: 6px; }
.ai-card-add-btn,
.ai-card-detail-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  background: #fff;
  color: #2a2418;
  border: 1px solid #c8b98c;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.ai-card-add-btn { background: #2a2418; color: #fbf8ee; border-color: #2a2418; }
.ai-card-add-btn.added { background: #496a3b; border-color: #496a3b; }

.ai-banner {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.ai-banner-info { color: #2a2418; background: #fbf8ee; border: 1px solid #ebe5cf; }
.ai-banner-warn { color: #aa6432; background: #fbeede; border: 1px solid #f0d6b6; }
.ai-banner-ok { color: #496a3b; background: #ecf3df; border: 1px solid #cbd7b0; }
.ai-banner-error { color: #a23434; background: #fbe5e0; border: 1px solid #f0c0b6; }

/* ----- 設定ドロワー ----- */
.ams-settings-drawer {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(20, 18, 14, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ams-settings-drawer.hidden { display: none; }
.ams-settings-inner {
  background: #fffdf6;
  border-radius: 14px 14px 0 0;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ams-settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #ebe5cf;
  background: #fbf8ee;
  border-radius: 14px 14px 0 0;
  position: sticky; top: 0;
}
.ams-settings-title { font-size: 15px; color: #2a2418; }
.ams-settings-close {
  background: transparent; border: 0;
  font-size: 22px; color: #6e6450; cursor: pointer;
}
.ams-settings-body { padding: 16px 18px; }
.ams-settings-field { display: block; margin-bottom: 12px; }
.ams-settings-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #6e6450;
  margin-bottom: 4px;
}
.ams-settings-field input {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #2a2418;
  border: 1px solid #d8d2bf;
  border-radius: 6px;
  box-sizing: border-box;
}
.ams-settings-note {
  font-size: 11px;
  color: #6e6450;
  line-height: 1.6;
  margin: 10px 0 14px;
}
.ams-settings-actions {
  display: flex;
  justify-content: flex-end;
}

/* デスクトップでは中央表示 */
@media (min-width: 600px) {
  .ams-settings-drawer { align-items: center; }
  .ams-settings-inner { border-radius: 14px; max-height: 80vh; }
  .ams-settings-head { border-radius: 14px 14px 0 0; }
}

/* ----- 商品詳細モーダルの「おすすめポイント」 ----- */
.modal-ai-point {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fbf8ee;
  border-left: 2px solid #c8b98c;
  border-radius: 4px;
  display: none;
}
.modal-ai-point.visible { display: block; }
.modal-ai-point-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #6e6450;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.modal-ai-point-list {
  margin: 0; padding-left: 14px;
  font-size: 13px;
  color: #2a2418;
  line-height: 1.55;
}

/* ----- カート送信中・完了表示 ----- */
.cart-send-status {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 6px;
}
.cart-send-status.sending { color: #6e6450; background: #fbf8ee; border: 1px solid #ebe5cf; }
.cart-send-status.ok { color: #496a3b; background: #ecf3df; border: 1px solid #cbd7b0; }
.cart-send-status.error { color: #a23434; background: #fbe5e0; border: 1px solid #f0c0b6; }
.cart-send-status pre {
  margin-top: 8px;
  padding: 8px;
  font-size: 12px;
  background: #fff;
  border: 1px solid #ebe5cf;
  border-radius: 4px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #2a2418;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ===== P2: 価格暗号(PC150MR) ===== */
/* スタッフ解読用。お客様には控えめ・スタッフには確実に読める（#bbb 薄すぎ→#8a8a8a） */
.cipher-code { color: #8a8a8a; font-size: 11px; text-align: right; letter-spacing: .08em; }
#modal-cipher { color: #8a8a8a; font-size: 11px; }

/* ===== P8: 初回ガイド（解錠後に1回だけ表示） ===== */
.ams-guide {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(20,20,20,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ams-guide-card {
  background: #fff; border-radius: 14px;
  max-width: 360px; width: 100%; padding: 22px 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.ams-guide-title { font-size: 16px; font-weight: 700; color: #1a1a1a; margin-bottom: 12px; text-align: center; }
.ams-guide-steps { margin: 0 0 16px; padding-left: 1.2em; font-size: 14px; line-height: 1.9; color: #333; }
.ams-guide-steps b { color: #1a1a1a; }
.ams-guide-close {
  display: block; width: 100%; padding: 12px;
  border: 0; border-radius: 10px;
  background: #1a1a1a; color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
