/* =========================================================
   品番ナビ — style.css
   方針: シンプル / Google検索風 / 白ベース / 青アクセント
   対応: スマホ・PC（レスポンシブ）
   ========================================================= */

:root {
  --blue:        #1a73e8;
  --blue-dark:   #1557b0;
  --blue-soft:   #e8f0fe;
  --text:        #202124;
  --muted:       #5f6368;
  --line:        #dadce0;
  --line-soft:   #ecedef;
  --bg:          #ffffff;
  --card-bg:     #ffffff;

  --ok-fg:       #137333;
  --ok-bg:       #e6f4ea;
  --disc-fg:     #c5221f;
  --disc-bg:     #fce8e6;

  --radius:      12px;
  --shadow:      0 1px 6px rgba(32,33,36,.18);
  --shadow-hover:0 2px 10px rgba(32,33,36,.22);

  --font-jp: "Zen Kaku Gothic New", system-ui, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-jp);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  flex: 1 0 auto;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== TOP / ヒーロー ===== */
.hero {
  text-align: center;
  padding: 56px 0 28px;
}

.logo {
  font-size: clamp(40px, 9vw, 64px);
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0;
  line-height: 1;
}
.logo-mark { color: var(--blue); }
.logo-rest { color: var(--text); }

.lead {
  color: var(--muted);
  font-size: clamp(14px, 3.6vw, 17px);
  margin: 14px 0 28px;
}

/* ===== 検索フォーム ===== */
.search {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 580px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 16px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.search-box:focus-within {
  border-color: transparent;
  box-shadow: var(--shadow);
}

.search-icon { display: none; } /* 虫眼鏡アイコンは廃止 */

.search-input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  font-family: var(--font-jp);
  font-size: 16px; /* 16px以上でiOSの自動ズームを防止 */
  color: var(--text);
  background: transparent;
  padding: 12px 8px;
  min-width: 0;
}
.search-input::placeholder { color: #9aa0a6; }

.clear-btn {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.clear-btn:hover { color: var(--text); }

.search-btn {
  font-family: var(--font-jp);
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 11px 32px;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}
.search-btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: var(--shadow); }
.search-btn:active { transform: translateY(1px); }

/* 入力例（補助説明） */
.search-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.maker-tag {
  margin: 26px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.maker-tag strong { color: var(--blue); font-weight: 700; }

/* ===== 検索結果エリア ===== */
.results-area {
  padding: 8px 0 40px;
}

.status-line {
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
  margin: 0 0 20px;
  min-height: 1em;
}
.status-line:empty { display: none; }
.status-line.is-empty { color: var(--disc-fg); }
.status-line.is-error { color: var(--disc-fg); }

/* カードグリッド */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  transition: box-shadow .15s ease, border-color .15s ease;
  animation: rise .22s ease both;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #c9ced4;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* カード右上のまとまり（図面アイコン＋状態バッジ） */
.card-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* 図面PDFアイコン（小ボタン風・Google風UI） */
.drawing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.drawing-btn:hover {
  background: var(--blue-soft);
  border-color: #c6dafc;
  box-shadow: var(--shadow);
}
.drawing-btn:active { transform: translateY(1px); }

.product-no {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text);
  word-break: break-all;
}

.badge {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.active { color: var(--ok-fg); background: var(--ok-bg); }
.badge.discontinued { color: var(--disc-fg); background: var(--disc-bg); }

.card-name {
  font-size: 15px;
  font-weight: 500;
  margin: 8px 0 14px;
  color: var(--text);
}

/* 製品情報の行 */
.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 13px;
}
.meta dt { color: var(--muted); white-space: nowrap; }
.meta dd { margin: 0; color: var(--text); }

/* 後継機種 */
.successor {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
}
.successor-label {
  color: var(--disc-fg);
  font-weight: 700;
  margin-right: 6px;
}
.successor-btn {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #d2e3fc;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .15s ease;
}
.successor-btn:hover { background: #d2e3fc; }
.successor-name { color: var(--muted); margin-left: 8px; font-family: var(--font-jp); }

/* 0件・エラー時の大きめメッセージ */
.notice {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.notice strong { display: block; font-size: 17px; color: var(--text); margin-bottom: 6px; }

/* ===== 図面URL登録パネル ===== */
.reg-panel {
  margin: 8px 0 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.reg-summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  user-select: none;
}
.reg-summary::-webkit-details-marker { display: none; }
.reg-summary:hover { color: var(--blue); }
.reg-panel[open] .reg-summary { border-bottom: 1px solid var(--line-soft); }

.reg-body { padding: 16px; }
.reg-note {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.reg-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.reg-input {
  flex: 1 1 200px;
  min-width: 0;
  font-family: var(--font-jp);
  font-size: 15px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.reg-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
}
.reg-btn {
  flex: 0 0 auto;
  font-family: var(--font-jp);
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 11px 28px;
  cursor: pointer;
  transition: background .15s ease;
}
.reg-btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.reg-btn:active { transform: translateY(1px); }

.reg-msg {
  margin: 12px 0 0;
  font-size: 13px;
  min-height: 1em;
}
.reg-msg:empty { display: none; }
.reg-msg.ok  { color: var(--ok-fg); }
.reg-msg.err { color: var(--disc-fg); }

/* ===== フッター ===== */
.site-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line-soft);
  background: #f8f9fa;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 16px;
}
.site-footer p { margin: 0; }