/* Phase 2 — onglets globaux + ind09 / ind10
 * Aligné sur la grille indicateurs existante : 275px × N colonnes + gap 2rem
 */

.indicators-main-tabs-wrap {
  display: grid;
  gap: 2rem;
  margin: 2rem;
  grid-template-columns: repeat(1, 275px);
  justify-content: center;
}

@media screen and (min-width: 600px) {
  .indicators-main-tabs-wrap {
    grid-template-columns: repeat(2, 275px);
  }
}

@media screen and (min-width: 1200px) {
  .indicators-main-tabs-wrap {
    grid-template-columns: repeat(4, 275px);
  }
}

.indicators-main-tabs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  background: #fff;
  border-radius: 2.4rem;
  padding: 1rem;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.indicators-main-tab {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 1.2rem 2.4rem;
  border: 0;
  border-radius: 2rem;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  /* html font-size 62.5% → 2rem = 20px (échelle Figma) */
  font-size: 2rem;
  color: inherit;
  line-height: 1.2;
}

.indicators-main-tab.is-active {
  background: rgba(40, 87, 119, 0.08);
}

.indicators-main-tab[data-indicators-tab="electricite"] {
  color: #3e5e3d;
}

.indicators-main-tab[data-indicators-tab="gaz"] {
  color: #c15806;
}

.indicators-main-tab[data-indicators-tab="couts"] {
  color: #285777;
}

/* SVG Figma 40×40 (cercle coloré + glyphe) — pas de fond CSS en double */
.indicators-main-tab-icon {
  width: 4.8rem;
  height: 4.8rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  overflow: visible;
  background: transparent;
}

.indicators-main-tab-icon img {
  display: block;
  width: 4.8rem;
  height: 4.8rem;
  max-width: none;
}

/* Coûts : même grille 275px que Électricité / Gaz (évite le décalage width:100% + margin) */
.grid-couts {
  display: grid;
  gap: 2rem;
  margin: 2rem;
  grid-template-columns: repeat(1, 275px);
  justify-content: center;
  box-sizing: border-box;
}

.grid-couts > .card-cost {
  width: 100%;
  min-width: 0;
}

@media screen and (min-width: 600px) {
  .grid-couts {
    grid-template-columns: repeat(2, 275px);
  }

  .grid-couts > .card-cost {
    grid-column: span 2; /* 570px — comme .card-width */
  }
}

@media screen and (min-width: 1200px) {
  .grid-couts {
    grid-template-columns: repeat(4, 275px);
  }

  .grid-couts > .card-cost {
    grid-column: span 2;
  }

  .grid-couts > .card-full {
    grid-column: span 4;
  }
}

.card.card-cost {
  min-height: 366px;
  display: flex;
  flex-direction: column;
  /* laisser dépasser le cercle d’icône (comme les anciens indicateurs) */
  overflow: visible;
}

.card.card-cost .card-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

.card.card-cost .indicator-heading-icon,
.card.card-cost .indicator-heading-icon-circle {
  overflow: visible;
}

/* Même structure / hauteur de header que les cartes gaz (card-width) */
.card.card-cost .indicator-heading {
  color: #fff;
  overflow: visible;
  min-height: auto;
  padding: 1.8rem 2rem 1.5rem;
  align-items: center;
}

.card.card-cost .indicator-heading-title {
  padding-top: 0.25rem;
}

.card.card-cost .indicator-heading-title h3 {
  color: #fff;
  margin: 0;
  /* hérite la taille h3 des autres indicateurs */
  font-weight: 600;
  line-height: 1.2;
}

/* (i) aligné comme sur les anciens — pas de vertical-align:super excessif */
#indicator-gaz-conso .indicator-heading .tooltip-target [class^="icon-"],
#indicator-gaz-conso .indicator-heading .icon-icon_tooltip,
.card.card-cost .indicator-heading .tooltip-target [class^="icon-"],
.card.card-cost .indicator-heading .icon-icon_tooltip {
  vertical-align: text-top;
  position: relative;
  top: 0.05em;
  font-size: 0.85rem;
  line-height: 1;
  color: #fff !important;
}

#indicator-gaz-conso .indicator-heading .icon-icon_tooltip:before,
.card.card-cost .indicator-heading .icon-icon_tooltip:before {
  color: #fff !important;
}

.card.card-cost .indicator-heading .tooltip-target {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  vertical-align: baseline;
}

.card.card-cost .indicator-content {
  padding: 1rem 1.375rem 0.6rem; /* ~22px horizontal comme Figma */
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.card.card-cost .indicator-content.tab-container {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.card.card-cost .tab-content {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.card.card-cost .tab-content.active {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* SVG Figma header 40×40 (cercle inclus) — même emprise que .indicator-heading-icon-circle */
.card.card-cost .indicator-heading-icon-img--figma {
  width: 4rem;
  height: 4rem;
  min-width: 4rem;
  display: block;
  max-width: none;
}

/* Annuler les contraintes tab des cartes 275px (tab-list max-width, etc.) */
#indicator-couts-carburants.tab-container,
#indicator-couts-carburants .tab-container,
#indicator-couts-carburants.card .tab-container {
  margin: 0;
  width: 100%;
  max-width: none;
}

#indicator-couts-carburants .tab-content {
  margin-top: 0.75rem;
  width: 100%;
}

#indicator-couts-carburants .tab-content.active {
  display: flex !important;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100%;
  visibility: visible;
}

/* Sous-onglets FPC — style Figma (actif blanc / inactif teal) */
#indicator-couts-carburants .indicator-cost-tabs,
.indicator-cost-tabs {
  display: flex;
  gap: 5px;
  margin: 0;
  border-bottom: 1px solid #5b7a7d;
  padding: 0;
  width: 100%;
  max-width: none !important;
  transform: none !important;
  box-sizing: border-box;
}

#indicator-couts-carburants .indicator-cost-tabs .tab-button,
.indicator-cost-tabs .tab-button {
  border: 1px solid #5b7a7d;
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
  padding: 5px 14px 6px;
  font-size: 11px;
  line-height: 1.2;
  background: #5b7a7d;
  color: #fff;
  cursor: pointer;
  font-weight: 400;
  box-shadow: none;
}

#indicator-couts-carburants .indicator-cost-tabs .tab-button.active,
.indicator-cost-tabs .tab-button.active {
  background: #fff;
  color: #5b7a7d;
  font-weight: 700;
  border-color: #5b7a7d;
}

.indicator-fpc-table {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.indicator-fpc-table-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  font-size: 11px;
  color: #5b5751;
  padding: 0 0 8px;
}

.indicator-fpc-table-head span:last-child {
  text-align: right;
}

.indicator-fpc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #eaeef1;
}

.indicator-fpc-fuel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.indicator-fpc-badge {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
}

.indicator-fpc-badge img {
  display: block;
  width: 25px;
  height: 25px;
  max-width: none;
}

.indicator-fpc-label {
  font-size: 14px;
  line-height: 24px;
  color: #1a1a1a;
}

.indicator-fpc-price {
  text-align: right;
  font-weight: 700;
}

.indicator-fpc-price-num {
  font-size: 22px;
  line-height: 1.1;
}

.indicator-fpc-price-unit {
  font-size: 11px;
}

.indicator-fpc-chart-title {
  font-size: 11px;
  margin: 0 0 0.35rem;
  color: #5b5751;
  flex: 0 0 auto;
}

/* Remplir toute la hauteur restante de la carte (onglet Évolution) */
#indicator-couts-carburants .tab-content.active:has(.indicator-fpc-chart-wrap) {
  flex: 1 1 auto;
  min-height: 0;
}

.indicator-fpc-chart-wrap {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 14rem;
  height: auto;
  max-height: none;
  overflow: hidden;
}

.indicator-fpc-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-width: 100%;
}

.indicator-fpc-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 10px 0 0;
  padding: 0;
  font-size: 11px;
  font-style: italic;
  color: #5b5751;
  flex: 0 0 auto;
}

.indicator-fpc-legend li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.indicator-fpc-legend span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.indicator-fpc-empty {
  font-size: 14px;
  color: #989998;
  padding: 1rem 0;
}

.indicator-heat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eaeef1;
}

.indicator-heat-row:last-child {
  border-bottom: 0;
}

.indicator-heat-fuel {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #1a1a1a;
}

.indicator-heat-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.indicator-heat-badge-img {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
  max-width: none;
}

.indicator-heat-prices {
  text-align: right;
}

.indicator-heat-annual-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.indicator-heat-annual-unit {
  font-size: 11px;
  font-weight: 700;
}

.indicator-heat-monthly {
  font-size: 11px;
  color: #5b5751;
  margin-top: 2px;
}

/* Panels onglets globaux */
[data-indicators-panel][hidden] {
  display: none !important;
}

.indicators-main-tab.is-loading {
  opacity: 0.7;
  cursor: wait;
}

/* FAQ — icônes SVG alignées sur les headers ind09 / ind10 */
.faq-chip-icon--svg {
  object-fit: contain;
  padding: 0;
  border: none !important;
  background: transparent !important;
  width: 28px;
  height: 28px;
}
