/* ECトップ・検索結果ページ用(ランキングと共通のパーツは ec_ranking.css) */

/* 検索フォーム */
.rk-form { margin-top: 20px; }
.rk-form form { display: grid; gap: 16px; }
.rk-fields { display: grid; gap: 14px 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.rk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rk-field--wide { grid-column: 1 / -1; }
.rk-field > label, .rk-field > .rk-label { font-size: 12px; font-weight: 700; color: var(--rk-muted); }
.rk-field select, .rk-field input[type="text"], .rk-field input[type="number"] {
  width: 100%; height: 40px; padding: 0 12px; font-size: 14px; color: var(--rk-ink);
  background: #fff; border: 1px solid #d5d9e0; border-radius: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.rk-field select:focus, .rk-field input:focus { border-color: var(--rk-accent); box-shadow: 0 0 0 3px rgba(191, 0, 0, 0.12); }
.rk-genres { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-genres > div { min-width: 0; }
.rk-genres > div:empty { display: none; }
.rk-genres select { width: auto; max-width: 100%; min-width: 150px; }
.rk-price-range { display: flex; align-items: center; gap: 8px; }
.rk-price-range span { color: var(--rk-muted); font-size: 13px; }
.rk-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-checks input { position: absolute; opacity: 0; pointer-events: none; }
.rk-checks label {
  display: inline-block; padding: 8px 14px; font-size: 13px; cursor: pointer; user-select: none;
  border: 1px solid #d5d9e0; border-radius: 999px; background: #fff; color: var(--rk-ink);
  transition: background .15s, border-color .15s, color .15s;
}
.rk-checks label::before { content: "＋ "; color: var(--rk-muted); }
.rk-checks input:checked + label { background: #fff1f0; border-color: var(--rk-accent); color: var(--rk-accent); font-weight: 700; }
.rk-checks input:checked + label::before { content: "✓ "; color: var(--rk-accent); }
.rk-checks input:focus-visible + label { box-shadow: 0 0 0 3px rgba(191, 0, 0, 0.18); }
.rk-submit {
  justify-self: start; height: 44px; padding: 0 32px; font-size: 15px; font-weight: 700; color: #fff; cursor: pointer;
  border: 0; border-radius: 999px; background: linear-gradient(135deg, #bf0000, #e4572e);
  box-shadow: 0 6px 14px rgba(191, 0, 0, 0.25); transition: transform .15s, box-shadow .15s;
}
.rk-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(191, 0, 0, 0.28); }

/* 検索結果のツールバー */
.rk-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin-top: 24px; padding: 12px 16px; background: var(--rk-card); border: 1px solid var(--rk-line); border-radius: 14px;
}
.rk-count { font-size: 14px; }
.rk-count strong { font-size: 20px; color: var(--rk-accent); font-weight: 800; margin: 0 2px; }
.rk-count small { color: var(--rk-muted); margin-left: 8px; font-size: 12px; }
.rk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.rk-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--rk-bg); border-radius: 999px; }
.rk-seg a, .rk-seg span { padding: 6px 14px; font-size: 13px; border-radius: 999px; color: var(--rk-muted); }
.rk-seg a:hover { color: var(--rk-accent); }
.rk-seg span { background: #fff; color: var(--rk-accent); font-weight: 700; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.rk-toggle { padding: 7px 14px; font-size: 13px; border: 1px solid var(--rk-line); border-radius: 999px; background: #fff; }
.rk-toggle:hover { border-color: var(--rk-accent); color: var(--rk-accent); }

/* ページ送り */
.rk-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 28px 0 0; padding: 0; list-style: none; }
.rk-pager a, .rk-pager span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px;
  font-size: 14px; border: 1px solid var(--rk-line); border-radius: 10px; background: #fff; color: var(--rk-ink);
}
.rk-pager a:hover { border-color: var(--rk-accent); color: var(--rk-accent); }
.rk-pager span { background: var(--rk-accent); border-color: var(--rk-accent); color: #fff; font-weight: 700; }

/* 検索結果のカード(順位バッジなし) */
.rk-card--plain .rk-body { padding-top: 14px; }

/* ECトップ: 分類別ランキングのカード */
.rk-section-title { display: flex; align-items: baseline; gap: 12px; margin: 36px 0 4px; font-size: 22px; font-weight: 800; }
.rk-section-title small { font-size: 13px; font-weight: 400; color: var(--rk-muted); }
.rk-cats { display: grid; gap: 16px; margin-top: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rk-cat {
  --h: 0;
  display: flex; flex-direction: column; overflow: hidden; background: var(--rk-card);
  border: 1px solid hsl(var(--h) 45% 88%); border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: transform .18s ease, box-shadow .18s ease;
}
.rk-cat:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1); }
.rk-cat-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: linear-gradient(135deg, hsl(var(--h) 75% 96%), hsl(var(--h) 70% 91%)); border-bottom: 1px solid hsl(var(--h) 45% 88%);
}
.rk-cat-icon {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px;
  background: #fff; border-radius: 12px; box-shadow: 0 2px 6px hsl(var(--h) 60% 60% / 0.3);
}
.rk-cat-head h3 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; color: hsl(var(--h) 55% 22%); }
.rk-cat-head small { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: hsl(var(--h) 25% 40%); }
.rk-cat-head a:hover h3 { text-decoration: underline; }
.rk-cat-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 12px 14px 14px; list-style: none; }
.rk-cat-links a {
  display: inline-block; padding: 4px 10px; font-size: 12px; border-radius: 999px; color: var(--rk-ink);
  background: var(--rk-bg); transition: background .15s, color .15s;
}
.rk-cat-links a:hover { background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 60% 28%); }
.rk-cat details summary {
  cursor: pointer; list-style: none; padding: 0 14px 12px; font-size: 12px; font-weight: 700; color: hsl(var(--h) 50% 35%);
}
.rk-cat details summary::-webkit-details-marker { display: none; }
.rk-cat details[open] summary { display: none; }
.rk-cat details .rk-cat-links { padding-top: 0; }

/* ランキングのカテゴリタグのアイコン */
.rk-chips .rk-ico { margin-right: 4px; }

@media (max-width: 560px) {
  .rk-toolbar { padding: 12px; }
  .rk-cats { grid-template-columns: 1fr; }
  .rk-submit { justify-self: stretch; }
}

/* ---- サイト共通CSS(style.css)の副作用を、ECページのフォーム内だけ打ち消す ---- */
/* 共通CSSは input を全て非表示にし、label に自作チェックボックスの四角を付けている */
.rk .rk-field input[type="text"],
.rk .rk-field input[type="number"] { display: block; }
.rk .rk-checks input { display: block; }
.rk label { padding-left: 0; margin: 0; }
.rk label::before,
.rk label::after,
.rk input:checked + label::after {
  content: none; position: static; display: inline; width: auto; height: auto;
  border: 0; background: none; transform: none;
}
.rk .rk-checks label::before { content: "＋ "; color: var(--rk-muted); }
.rk .rk-checks input:checked + label::before { content: "✓ "; color: var(--rk-accent); }
.rk-price-range input { min-width: 0; }
