/* =========================================================
   BESMA Plans List Page
   対象：plans.php のみ
   方針：body.besma-plans-page 配下だけに適用し、他ページへ干渉させない
========================================================= */
.besma-plans-page {
  --plans-green: #34CFA3;
  --plans-green-dark: #18A982;
  --plans-blue: #5AB8FF;
  --plans-orange: #F59E0B;
  --plans-gradient: linear-gradient(135deg, var(--plans-green), var(--plans-blue));
  --plans-text: #111827;
  --plans-muted: #64748b;
  --plans-border: #e5e7eb;
  --plans-soft: #f8fafc;
  --plans-shadow: 0 10px 28px rgba(15, 23, 42, .055);
  background: #fff !important;
  color: var(--plans-text);
}

.besma-plans-page main,
.besma-plans-page .section,
.besma-plans-page .list-search-section {
  background: #fff !important;
  background-image: none !important;
}

.besma-plans-page .container,
.besma-plans-page .besma-container {
  max-width: 1120px !important;
}

.besma-plans-page .site-header {
  background: rgba(255,255,255,.96) !important;
  border-bottom: 1px solid var(--plans-border) !important;
  backdrop-filter: blur(10px);
}

.besma-plans-page .header-inner {
  max-width: 1120px !important;
  min-height: 64px;
  padding: 0 20px !important;
}

.besma-plans-page .brand-mark {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  background: var(--plans-gradient) !important;
  box-shadow: none !important;
}

.besma-plans-page .brand strong {
  font-size: 21px !important;
  letter-spacing: -.035em !important;
  color: var(--plans-green-dark) !important;
}

.besma-plans-page .brand small {
  font-size: 10px !important;
  color: var(--plans-muted) !important;
}

.besma-plans-page .header-nav a {
  color: var(--plans-muted) !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  padding: 8px 10px !important;
  border-radius: 999px !important;
}

.besma-plans-page .header-nav a:hover {
  background: #ecfdf5 !important;
  color: var(--plans-green-dark) !important;
}

.besma-plans-page .besma-search-hero {
  padding: 24px 0 14px !important;
  border-bottom: 1px solid #eef2f7;
}

.besma-plans-page .besma-search-panel-lite {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(52, 207, 163, .24) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(52,207,163,.13), transparent 34%),
    radial-gradient(circle at 100% 8%, rgba(90,184,255,.10), transparent 30%),
    #fff !important;
  box-shadow: var(--plans-shadow) !important;
  padding: 18px !important;
}

.besma-plans-page .besma-search-title-wrap strong {
  display: block;
  color: var(--plans-text) !important;
  font-size: clamp(24px, 4vw, 36px) !important;
  line-height: 1.18 !important;
  letter-spacing: -.045em !important;
}

.besma-plans-page .besma-search-title-wrap span {
  display: block;
  margin-top: 6px;
  color: var(--plans-muted) !important;
  font-size: 13px !important;
  line-height: 1.75 !important;
  font-weight: 750 !important;
}

.besma-plans-page .list-search-form {
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) 180px auto !important;
  gap: 10px !important;
  margin-top: 14px !important;
}

.besma-plans-page .besma-input,
.besma-plans-page .besma-select {
  min-height: 44px !important;
  border-radius: 14px !important;
  border: 1px solid var(--plans-border) !important;
  background: #fff !important;
  color: var(--plans-text) !important;
  font-size: 14px !important;
  font-weight: 750 !important;
}

.besma-plans-page .besma-input:focus,
.besma-plans-page .besma-select:focus {
  border-color: rgba(52,207,163,.78) !important;
  box-shadow: 0 0 0 4px rgba(52,207,163,.13) !important;
  outline: none !important;
}

.besma-plans-page .list-action-summary-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 14px !important;
}

.besma-plans-page .list-sub-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.besma-plans-page .besma-btn {
  min-height: 40px !important;
  border-radius: 12px !important;
  font-weight: 950 !important;
}

.besma-plans-page .besma-btn-primary {
  background: var(--plans-gradient) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 10px 22px rgba(52,207,163,.20) !important;
}

.besma-plans-page .besma-btn-outline {
  background: #fff !important;
  color: var(--plans-green-dark) !important;
  border: 1px solid rgba(52,207,163,.42) !important;
}

.besma-plans-page .besma-result-pill {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  min-height: 36px !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  background: #ecfdf5 !important;
  border: 1px solid #bbf7d0 !important;
}

.besma-plans-page .besma-result-pill strong {
  color: var(--plans-green-dark) !important;
  font-size: 20px !important;
  line-height: 1 !important;
}

.besma-plans-page .besma-result-pill span {
  color: #047857 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.besma-plans-page .list-page-section {
  padding: 22px 0 96px !important;
}

.besma-plans-page .dense-list-grid {
  display: grid !important;
  gap: 12px !important;
}

.besma-plans-page .besma-product-card {
  display: grid !important;
  grid-template-columns: 86px minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: stretch !important;
  border: 1px solid var(--plans-border) !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 8px 22px rgba(15,23,42,.045) !important;
  padding: 15px !important;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}

.besma-plans-page .besma-product-card:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(52,207,163,.46) !important;
  box-shadow: 0 14px 34px rgba(15,23,42,.075) !important;
}

.besma-plans-page .besma-product-card.is-selected {
  border-color: rgba(52,207,163,.75) !important;
  box-shadow: 0 16px 38px rgba(52,207,163,.16) !important;
  background: linear-gradient(135deg, rgba(236,253,245,.78), rgba(239,246,255,.56)), #fff !important;
}

.besma-plans-page .besma-product-visual {
  width: 86px !important;
  min-height: 86px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 20px !important;
  border: 1px solid #eef2f7 !important;
  background: linear-gradient(135deg, rgba(52,207,163,.13), rgba(90,184,255,.10)), #fff !important;
  padding: 12px !important;
}

.besma-plans-page .besma-product-visual img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  max-height: 54px !important;
  object-fit: contain !important;
}

.besma-plans-page .besma-product-visual .emoji {
  font-size: 32px !important;
}

.besma-plans-page .besma-product-content {
  display: grid !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.besma-plans-page .besma-product-top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 170px !important;
  gap: 14px !important;
  align-items: start !important;
}

.besma-plans-page .besma-product-brand {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
  margin: 0 0 5px !important;
  color: var(--plans-green-dark) !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}

.besma-plans-page .besma-plan-type-badge {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 22px !important;
  padding: 3px 7px !important;
  border-radius: 999px !important;
  background: #fff7ed !important;
  border: 1px solid #fed7aa !important;
  color: #c2410c !important;
  font-size: 10px !important;
  font-weight: 950 !important;
}

.besma-plans-page .besma-product-name {
  margin: 0 !important;
  color: var(--plans-text) !important;
  font-size: 23px !important;
  line-height: 1.25 !important;
  letter-spacing: -.04em !important;
}

.besma-plans-page .besma-product-summary {
  margin: 7px 0 0 !important;
  color: #475569 !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  font-weight: 700 !important;
}

.besma-plans-page .plan-score-panel {
  align-self: start !important;
  padding: 10px !important;
  border-radius: 16px !important;
  border: 1px solid var(--plans-border) !important;
  background: var(--plans-soft) !important;
  box-shadow: none !important;
}

.besma-plans-page .besma-total-score-main strong {
  color: var(--plans-muted) !important;
  font-size: 22px !important;
  letter-spacing: -.04em !important;
}

.besma-plans-page .besma-plan-score-note {
  display: block !important;
  margin-top: 6px !important;
  color: var(--plans-muted) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

.besma-plans-page .besma-spec-line {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
}

.besma-plans-page .besma-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  min-height: 31px !important;
  padding: 6px 9px !important;
  border-radius: 999px !important;
  background: var(--plans-soft) !important;
  border: 1px solid var(--plans-border) !important;
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
}

.besma-plans-page .besma-chip strong {
  color: var(--plans-text) !important;
  font-weight: 950 !important;
}

.besma-plans-page .besma-chip-green {
  background: #ecfdf5 !important;
  border-color: #bbf7d0 !important;
  color: #047857 !important;
}

.besma-plans-page .besma-chip-soft {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
}

.besma-plans-page .besma-card-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.besma-plans-page .premium-detail-button,
.besma-plans-page .compare-toggle-button {
  min-height: 38px !important;
  padding: 8px 13px !important;
  border-radius: 12px !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}

.besma-plans-page .compare-toggle-button.is-selected {
  background: #ecfdf5 !important;
  color: var(--plans-green-dark) !important;
  border-color: #bbf7d0 !important;
  box-shadow: none !important;
}

/* モーダル・比較トレイも一覧ページ配下だけ調整 */
.besma-plans-page .besma-modal.is-open {
  display: grid !important;
  place-items: center !important;
}

.besma-plans-page .besma-modal-panel {
  width: min(760px, calc(100vw - 24px)) !important;
  max-height: calc(100vh - 28px) !important;
  overflow: hidden !important;
  border-radius: 20px !important;
  border: 1px solid var(--plans-border) !important;
  box-shadow: 0 30px 80px rgba(15,23,42,.22) !important;
}

.besma-plans-page .besma-modal-body {
  max-height: calc(100vh - 130px) !important;
  overflow: auto !important;
}

.besma-plans-page .compare-tray-inner {
  border-radius: 22px !important;
  border-color: rgba(52,207,163,.28) !important;
  box-shadow: 0 22px 70px rgba(15,23,42,.16) !important;
}

@media (max-width: 900px) {
  .besma-plans-page .list-search-form {
    grid-template-columns: 1fr 170px !important;
  }

  .besma-plans-page .list-search-submit {
    grid-column: 1 / -1 !important;
  }

  .besma-plans-page .list-action-summary-row,
  .besma-plans-page .besma-product-top {
    grid-template-columns: 1fr !important;
    display: grid !important;
    align-items: start !important;
  }

  .besma-plans-page .plan-score-panel {
    display: none !important;
  }
}

@media (max-width: 620px) {
  .besma-plans-page .header-inner {
    min-height: 58px;
    padding: 0 12px !important;
  }

  .besma-plans-page .besma-search-hero {
    padding: 16px 0 10px !important;
  }

  .besma-plans-page .besma-search-panel-lite {
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .besma-plans-page .list-search-form {
    grid-template-columns: 1fr !important;
  }

  .besma-plans-page .list-sub-actions,
  .besma-plans-page .besma-card-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  .besma-plans-page .besma-result-pill {
    justify-self: start !important;
  }

  .besma-plans-page .besma-product-card {
    grid-template-columns: 1fr !important;
    padding: 13px !important;
    border-radius: 18px !important;
  }

  .besma-plans-page .besma-product-visual {
    width: 70px !important;
    min-height: 70px !important;
    border-radius: 18px !important;
  }

  .besma-plans-page .besma-product-name {
    font-size: 20px !important;
  }

  .besma-plans-page .besma-chip {
    width: 100% !important;
    justify-content: flex-start !important;
    border-radius: 13px !important;
  }

  .besma-plans-page .compare-tray {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
  }

  .besma-plans-page .compare-tray-inner {
    border-radius: 18px !important;
  }
}


/* =========================================================
   Plans List Rescue v3
   目的：TOP検索エリアを既存デザイン寄りに戻し、カード余白・モバイル崩れを補正
   注意：plans.php の body.besma-plans-page 配下のみ
========================================================= */
.besma-plans-page .besma-search-hero,
.besma-plans-page .list-search-section {
  padding: 22px 0 14px !important;
  border-bottom: 1px solid #eef2f7 !important;
  background: #fff !important;
}

.besma-plans-page .besma-search-panel-lite,
.besma-plans-page .list-search-panel {
  display: grid !important;
  gap: 10px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.besma-plans-page .besma-search-title-wrap strong,
.besma-plans-page .list-search-heading strong {
  margin: 0 !important;
  font-size: clamp(22px, 3vw, 28px) !important;
  letter-spacing: -.035em !important;
  line-height: 1.25 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #111827 !important;
  font-weight: 950 !important;
  white-space: nowrap !important;
}

.besma-plans-page .besma-search-title-wrap strong::before,
.besma-plans-page .list-search-heading strong::before {
  content: "" !important;
  width: 5px !important;
  height: 1.15em !important;
  border-radius: 999px !important;
  background: var(--plans-gradient) !important;
  flex: 0 0 auto !important;
}

.besma-plans-page .besma-search-title-wrap span,
.besma-plans-page .list-search-heading span {
  display: block !important;
  margin: 4px 0 0 !important;
  color: var(--plans-muted) !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  font-weight: 750 !important;
}

/* PCカード：画像と本文の余白を広げる */
.besma-plans-page .besma-product-card {
  grid-template-columns: 112px minmax(0, 1fr) !important;
  gap: 22px !important;
  align-items: start !important;
  padding: 16px !important;
}

.besma-plans-page .besma-product-visual {
  width: 112px !important;
  min-width: 112px !important;
  min-height: 112px !important;
  align-self: start !important;
}

.besma-plans-page .besma-product-content {
  min-width: 0 !important;
  gap: 12px !important;
}

.besma-plans-page .besma-product-top {
  grid-template-columns: minmax(0, 1fr) 180px !important;
  gap: 18px !important;
}

.besma-plans-page .besma-product-name,
.besma-plans-page .besma-product-summary,
.besma-plans-page .besma-product-brand {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

.besma-plans-page .besma-spec-line {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  min-width: 0 !important;
}

.besma-plans-page .besma-card-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  justify-content: flex-start !important;
}

/* タブレット：スコアは下に回し、カードの横幅不足を防ぐ */
@media (max-width: 900px) {
  .besma-plans-page .besma-product-card {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    gap: 16px !important;
  }

  .besma-plans-page .besma-product-visual {
    width: 96px !important;
    min-width: 96px !important;
    min-height: 96px !important;
  }

  .besma-plans-page .besma-product-top {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* モバイル：画像左・本文右を維持。ボタンは下段2列で崩れ防止 */
@media (max-width: 620px) {
  .besma-plans-page .besma-product-card {
    grid-template-columns: 78px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 12px !important;
    border-radius: 18px !important;
  }

  .besma-plans-page .besma-product-visual {
    width: 78px !important;
    min-width: 78px !important;
    min-height: 78px !important;
    border-radius: 15px !important;
    padding: 8px !important;
  }

  .besma-plans-page .besma-product-visual img {
    max-height: 52px !important;
  }

  .besma-plans-page .besma-product-content {
    gap: 9px !important;
  }

  .besma-plans-page .besma-product-name {
    font-size: 18px !important;
    line-height: 1.32 !important;
  }

  .besma-plans-page .besma-product-summary {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-size: 12px !important;
  }

  .besma-plans-page .besma-spec-line {
    gap: 5px !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .besma-plans-page .besma-chip {
    width: auto !important;
    max-width: 100% !important;
    min-height: 24px !important;
    padding: 4px 7px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
  }

  .besma-plans-page .besma-card-actions {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 2px !important;
  }

  .besma-plans-page .premium-detail-button,
  .besma-plans-page .compare-toggle-button {
    width: 100% !important;
    min-height: 38px !important;
    justify-content: center !important;
  }
}

/* =========================================================
   Plans List Selected Card Background Fix v4
   目的：比較選択中カード内の本文エリアだけ白く残る問題を解消
   ※plans.php 専用。body.besma-plans-page 配下のみ。
========================================================= */
.besma-plans-page .besma-product-card.is-selected {
  background:
    linear-gradient(135deg, rgba(236,253,245,.96), rgba(239,246,255,.86)),
    #ecfdf5 !important;
  border-color: rgba(52,207,163,.76) !important;
}

.besma-plans-page .besma-product-card.is-selected .besma-product-content,
.besma-plans-page .besma-product-card.is-selected .besma-product-top,
.besma-plans-page .besma-product-card.is-selected .besma-product-main,
.besma-plans-page .besma-product-card.is-selected .besma-spec-line,
.besma-plans-page .besma-product-card.is-selected .besma-card-actions {
  background: transparent !important;
  background-image: none !important;
}

.besma-plans-page .besma-product-card.is-selected .besma-chip {
  background: rgba(255,255,255,.58) !important;
  border-color: rgba(52,207,163,.28) !important;
}

.besma-plans-page .besma-product-card.is-selected .besma-chip-green {
  background: rgba(220,252,231,.78) !important;
  border-color: rgba(34,197,94,.30) !important;
}

.besma-plans-page .besma-product-card.is-selected .besma-chip-soft {
  background: rgba(239,246,255,.78) !important;
  border-color: rgba(96,165,250,.30) !important;
}

.besma-plans-page .besma-product-card.is-selected .plan-score-panel,
.besma-plans-page .besma-product-card.is-selected .besma-plan-score-note {
  background: rgba(255,255,255,.62) !important;
  border-color: rgba(52,207,163,.24) !important;
}

.besma-plans-page .besma-product-card.is-selected .besma-product-visual {
  background: rgba(255,255,255,.72) !important;
  border-color: rgba(52,207,163,.26) !important;
}
