/* ─── SERVER PRICE PAGE ───────────────────────────────────────
   server/css/price.css
   横断スペック比較テーブル専用スタイル
   ──────────────────────────────────────────────────────────── */

/* ── レイアウト: サイドバー＋メイン ── */
.price-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 24px auto 64px;
  padding: 0 24px;
  align-items: start;
}

/* ── サイドバー ── */
.price-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: sticky;
  top: 104px; /* header(56px) + subnav(~48px) */
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.sidebar-reset {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--body);
  transition: color .15s, border-color .15s;
}
.sidebar-reset:hover { color: var(--accent); border-color: var(--accent); }

.filter-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.filter-section:last-child { border-bottom: none; }

.filter-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.filter-checks {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.filter-checks label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text);
  line-height: 1.4;
}
.filter-checks input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.filter-select {
  width: 100%;
  font-size: 12.5px;
  font-family: var(--body);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--surface);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--accent); }

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text);
}
.filter-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.range-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.range-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.range-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-align: right;
}

/* ── スマホ用フィルターバー ── */
.sp-filter-bar {
  display: none;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 104px;
  z-index: 80;
}
.sp-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-family: var(--body);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.sp-filter-btn.open,
.sp-filter-btn:hover { border-color: var(--accent); color: var(--accent); }

.active-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 5px;
}

/* ── メインエリア ── */
.price-main { min-width: 0; }

.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.result-count {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ── テーブルラッパー ── */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── 比較テーブル ── */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 780px;
}

.price-table thead {
  background: var(--surface2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.price-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.price-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color .15s;
}
.price-table th.sortable:hover { color: var(--accent); }

.sort-icon {
  margin-left: 4px;
  font-size: 10px;
  color: var(--text-muted);
}
.sort-icon.active-sort { color: var(--accent); }

.price-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.price-table tbody tr:last-child { border-bottom: none; }
.price-table tbody tr:hover { background: var(--surface2); }

.price-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

/* カラム幅 */
.col-service  { min-width: 160px; }
.col-plan     { min-width: 110px; color: var(--text-muted); font-size: 12px; }
.col-cat      { white-space: nowrap; }
.col-price    { white-space: nowrap; }
.col-cpu      { white-space: nowrap; text-align: right; }
.col-mem      { white-space: nowrap; text-align: right; }
.col-storage  { white-space: nowrap; text-align: right; }
.col-disk     { white-space: nowrap; }
.col-trial    { white-space: nowrap; text-align: center; }
.col-link     { white-space: nowrap; text-align: right; }

/* ── サービスリンク ── */
.service-link {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  transition: color .15s;
}
.service-link:hover { color: var(--accent); }
.service-favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: contain;
}

/* ── 月額価格 ── */
.price-val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

/* ── カテゴリバッジ ── */
.cat-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.cat-shared    { background: #e8f4e8; color: #0d6e3f; }
.cat-vps       { background: var(--accent-light); color: var(--accent); }
.cat-cloud     { background: #fff0e6; color: #b85c00; }
.cat-dedicated { background: #f3eeff; color: #6b3fa0; }

/* ── ディスクバッジ ── */
.disk-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  white-space: nowrap;
}
.disk-nvme  { background: #fde8e8; color: var(--red); }
.disk-ssd   { background: var(--accent-light); color: var(--accent); }
.disk-hdd   { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.disk-cloud { background: #fff0e6; color: #b85c00; }

/* ── 試用バッジ ── */
.trial-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--green-light);
  color: var(--green);
  white-space: nowrap;
}

/* ── N/A 値 ── */
.val-na { color: var(--text-muted); font-size: 12px; }

/* ── 公式リンクボタン ── */
.goto-btn {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.goto-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── ローディングセル ── */
.loading-cell {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── テーブル下注釈 ── */
.table-note {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.7;
  padding: 0 2px;
}

/* ─── レスポンシブ ─── */
@media (max-width: 960px) {
  .price-layout {
    grid-template-columns: 1fr;
    padding: 0 16px;
    margin-top: 0;
  }
  .price-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    border-radius: 0;
    max-height: 100vh;
    overflow-y: auto;
  }
  .price-sidebar.sp-open { display: block; }
  .sp-filter-bar { display: flex; }
}

@media (max-width: 660px) {
  .price-layout { gap: 16px; }
  .table-meta { flex-direction: row; }
  .price-table th, .price-table td { padding: 8px 8px; }
  .col-service { min-width: 120px; }
}
