/* ═══════════════════════════════════════════════════════════════
   Tracely Pricing — Style sobre & professionnel v2
   Couleurs : #2563EB (bleu), #111827 (texte), #F9FAFB (fond)
   Police   : Manrope (héritée du site)
═══════════════════════════════════════════════════════════════ */

/* ── Reset & base ─────────────────────────────────────────────── */
.tracely-pricing *,
.tracely-pricing *::before,
.tracely-pricing *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.tracely-pricing {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: start;
  padding: 48px 0 64px;
  font-family: 'Manrope', sans-serif;
  background: transparent;
}

@media (max-width: 960px) {
  .tracely-pricing {
    grid-template-columns: 1fr;
    padding: 32px 0 48px;
  }
  .tp-cart {
    position: static !important;
    order: -1;
  }
}

/* ── Layout gauche ────────────────────────────────────────────── */
.tp-left {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ── Titres de section ────────────────────────────────────────── */
.tp-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 16px;
}

/* ── Toggle Mensuel / Annuel ──────────────────────────────────── */
.tp-toggle-wrap {
  display: inline-flex;
  background: #F3F4F6;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 2px;
}

.tp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 24px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #6B7280;
  transition: all .2s;
  white-space: nowrap;
}

.tp-toggle.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.tp-badge-eco {
  display: inline-block;
  background: #DCFCE7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── Grille des plans ─────────────────────────────────────────── */
.tp-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .tp-plans { grid-template-columns: 1fr; }
}

.tp-plan-card {
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
}

.tp-plan-card:hover {
  box-shadow: 0 4px 16px rgba(37,99,235,.08);
}

.tp-plan-card.selected {
  border-color: #2563EB;
  border-width: 2px;
  box-shadow: 0 4px 20px rgba(37,99,235,.12);
}

.tp-plan-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  position: absolute;
  top: 24px;
  right: 24px;
  transition: all .2s;
  background: #fff;
}

.tp-plan-radio.selected {
  background: #2563EB;
  border-color: #2563EB;
  box-shadow: inset 0 0 0 3px #fff;
}

.tp-recommended {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: #EFF6FF;
  color: #2563EB;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: .02em;
}

.tp-plan-name {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.tp-plan-desc {
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 20px;
  line-height: 1.5;
}

.tp-plan-price {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

.tp-plan-price span {
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
}

.tp-plan-price-sub {
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  margin-top: 6px;
  min-height: 18px;
}

.tp-engage-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: #FEF9C3;
  color: #854D0E;
  padding: 3px 10px;
  border-radius: 20px;
  margin: 12px 0 16px;
}

.tp-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
}

.tp-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #EFF6FF;
  color: #2563EB;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Cartes matériel ──────────────────────────────────────────── */
.tp-hw-card {
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: border-color .2s;
}

.tp-hw-card:last-child { margin-bottom: 0; }

.tp-hw-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tp-hw-icon {
  font-size: 22px;
  width: 44px;
  height: 44px;
  background: #F3F4F6;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-hw-info { flex: 1; }

.tp-hw-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.tp-hw-desc {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 2px;
}

.tp-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.tp-qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 300;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  line-height: 1;
}

.tp-qty-btn:hover {
  border-color: #2563EB;
  color: #2563EB;
  background: #EFF6FF;
}

.tp-qty-num {
  font-size: 16px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  color: #111827;
}

.tp-hw-opts {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tp-opt {
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  border: 1.5px solid #E5E7EB;
  background: #F9FAFB;
  color: #6B7280;
  transition: all .2s;
}

.tp-opt.active {
  background: #2563EB;
  color: #fff;
  border-color: #2563EB;
}

/* ── Gateway ──────────────────────────────────────────────────── */
.tp-gateway-card {
  border-style: dashed;
  opacity: .6;
  transition: all .3s;
}

.tp-gateway-card.tp-gateway-active {
  opacity: 1;
  border-style: solid;
  border-color: #2563EB;
  background: #F0F7FF;
}

.tp-gateway-auto {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: #FEF3C7;
  color: #92400E;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Panier ───────────────────────────────────────────────────── */
.tp-cart {
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  padding: 28px;
  position: sticky;
  top: 100px;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
}

.tp-cart-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #F3F4F6;
}

.tp-cart-label {
  font-size: 10px;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 16px 0 8px;
}

.tp-cart-label:first-of-type { margin-top: 0; }

.tp-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
}

.tp-cart-item span:last-child {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}

.tp-divider {
  height: 1px;
  background: #F3F4F6;
  margin: 16px 0;
}

.tp-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tp-total-label {
  font-size: 13px;
  color: #6B7280;
}

.tp-total-val {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.tp-grand-label {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.tp-grand-val {
  display: block !important;
  font-size: 20px;
  font-weight: 800;
  color: #2563EB;
  text-align: right;
}

.tp-grand-val-wrap {
  display: block !important;
  text-align: right !important;
}

.tp-ttc-sub {
  display: block !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  color: #9CA3AF !important;
  margin-top: 4px !important;
  line-height: 1.4 !important;
  text-align: right;
}

/* Mise en avant du montant réellement dû aujourd'hui — lueur bleutée discrète */
.tp-grand-row-highlight {
  background: #EFF6FF;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  box-shadow: 0 0 0 1px rgba(37,99,235,.12), 0 2px 10px rgba(37,99,235,.10);
}

.tp-saving-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 14px;
  text-align: center;
}

.tp-saving-box p {
  font-size: 12px;
  font-weight: 700;
  color: #166534;
}

/* ── Bouton Commander ─────────────────────────────────────────── */
.tp-cta-btn {
  width: 100%;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  margin-top: 20px;
  transition: background .2s, transform .1s;
  letter-spacing: .01em;
}

.tp-cta-btn:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
}

.tp-cta-btn:active {
  transform: translateY(0);
}

.tp-cta-btn:disabled {
  background: #93C5FD;
  cursor: not-allowed;
  transform: none;
}

.tp-foot-note {
  font-size: 11px;
  color: #9CA3AF;
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}

/* ── Prix moins gras ──────────────────────────────────────────── */
.tp-plan-price {
  font-weight: 600 !important;
}

/* ── Lien Voir plus ───────────────────────────────────────────── */
.tp-see-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #2563EB;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}

.tp-see-more:hover {
  border-bottom-color: #2563EB;
}

/* ── Images matériel ──────────────────────────────────────────── */
.tp-hw-icon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
}

/* ── Section Formules ─────────────────────────────────────────── */
.tp-formules {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid #E5E7EB;
}

.tp-formules-title {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  text-align: center;
  margin-bottom: 8px;
}

.tp-formules-sub {
  font-size: 15px;
  color: #6B7280;
  text-align: center;
  margin-bottom: 40px;
}

.tp-formules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .tp-formules-grid { grid-template-columns: 1fr; }
}

.tp-formule-card {
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 16px;
  padding: 28px;
  position: relative;
}

.tp-formule-card.tp-formule-featured {
  border-color: #2563EB;
  border-width: 2px;
  box-shadow: 0 4px 24px rgba(37,99,235,.1);
}

.tp-formule-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563EB;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 20px;
  white-space: nowrap;
}

.tp-formule-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #F3F4F6;
}

.tp-formule-name {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.tp-formule-price {
  font-size: 26px;
  font-weight: 800;
  color: #2563EB;
}

.tp-formule-price span {
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
}

.tp-formule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tp-formule-list li {
  font-size: 13px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Tableau comparatif ───────────────────────────────────────── */
.tp-cmp-table {
  max-width: 900px;
  margin: 0 auto;
}

.tp-cmp-header {
  display: grid;
  grid-template-columns: 1fr 140px 140px;
  gap: 0;
  margin-bottom: 8px;
  padding-bottom: 16px;
  border-bottom: 2px solid #E5E7EB;
}

.tp-cmp-col-feature { padding: 0 16px 0 0; }

.tp-cmp-col-plan {
  text-align: center;
  padding: 16px 8px;
  border-radius: 12px 12px 0 0;
}

.tp-cmp-col-featured {
  background: #EFF6FF;
  position: relative;
}

.tp-cmp-badge {
  display: inline-block;
  background: #2563EB;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.tp-cmp-plan-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.tp-cmp-plan-price {
  font-size: 18px;
  font-weight: 800;
  color: #2563EB;
}

.tp-cmp-plan-price span {
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
}

.tp-cmp-row {
  display: grid;
  grid-template-columns: 1fr 140px 140px;
  gap: 0;
  border-bottom: 1px solid #F3F4F6;
  align-items: center;
}

.tp-cmp-row:hover { background: #FAFAFA; }

.tp-cmp-col-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 16px 16px 0;
}

.tp-cmp-icon {
  width: 36px;
  height: 36px;
  background: #EFF6FF;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-cmp-icon svg {
  width: 18px;
  height: 18px;
  color: #2563EB;
}

.tp-cmp-feature-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 3px;
}

.tp-cmp-feature-desc {
  font-size: 12px;
  color: #9CA3AF;
  line-height: 1.4;
}

.tp-cmp-col-plan {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
}

.tp-cmp-col-featured {
  background: #F5F9FF;
}

.tp-cmp-check {
  width: 24px;
  height: 24px;
  color: #2563EB;
}

.tp-cmp-cross {
  width: 24px;
  height: 24px;
  color: #D1D5DB;
}

@media (max-width: 700px) {
  .tp-cmp-header,
  .tp-cmp-row {
    grid-template-columns: 1fr 80px 80px;
  }
  .tp-cmp-col-plan { padding: 12px 4px; }
  .tp-cmp-feature-desc { display: none; }
}

/* ── Fix en-tête comparatif ───────────────────────────────────── */
.tp-cmp-header .tp-cmp-col-feature {
  display: block;
  padding: 0;
}

.tp-cmp-header .tp-cmp-col-plan {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 8px 16px;
  min-height: 90px;
}

/* Supprimer la ligne de séparation en haut de la section formules */
.tp-formules {
  border-top: none !important;
  padding-top: 56px;
}

/* ── Fix responsive mobile comparatif ────────────────────────── */
@media (max-width: 768px) {
  .tp-cmp-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tp-cmp-header,
  .tp-cmp-row {
    grid-template-columns: 1fr 70px 70px;
    min-width: 320px;
  }

  .tp-cmp-col-plan {
    padding: 8px 4px;
    min-height: auto;
  }

  .tp-cmp-check,
  .tp-cmp-cross {
    width: 20px !important;
    height: 20px !important;
  }

  .tp-cmp-feature-desc {
    display: none;
  }

  .tp-cmp-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  .tp-cmp-icon svg {
    width: 15px;
    height: 15px;
  }

  .tp-cmp-feature-name {
    font-size: 13px;
  }

  .tp-cmp-plan-name {
    font-size: 13px;
  }

  .tp-cmp-plan-price {
    font-size: 14px;
  }

  .tp-cmp-plan-price span {
    font-size: 11px;
    display: block;
  }

  .tp-formules-title {
    font-size: 22px;
  }
}

/* ── Fix responsive mobile global ────────────────────────────── */
@media (max-width: 960px) {
  .tracely-pricing {
    grid-template-columns: 1fr;
  }

  /* Panier SOUS le matériel, pas au-dessus */
  .tp-cart {
    position: static !important;
    order: 2 !important;
  }

  .tp-left {
    order: 1 !important;
  }
}

/* ── Fix comparatif mobile — scroll horizontal ────────────────── */
@media (max-width: 768px) {
  .tp-formules {
    overflow: hidden;
  }

  .tp-cmp-table {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .tp-cmp-header,
  .tp-cmp-row {
    grid-template-columns: 180px 80px 80px;
    min-width: 340px;
  }

  .tp-cmp-col-feature {
    gap: 8px;
    padding: 12px 8px 12px 0;
  }

  .tp-cmp-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .tp-cmp-icon svg {
    width: 14px;
    height: 14px;
  }

  .tp-cmp-feature-name {
    font-size: 12px;
    line-height: 1.3;
  }

  .tp-cmp-feature-desc {
    display: none !important;
  }

  .tp-cmp-check,
  .tp-cmp-cross {
    width: 18px !important;
    height: 18px !important;
  }

  .tp-cmp-plan-name {
    font-size: 12px;
  }

  .tp-cmp-plan-price {
    font-size: 13px;
  }

  .tp-cmp-badge {
    font-size: 9px;
    padding: 2px 8px;
  }
}

/* ── Affichage plan unique (Pro retiré — sera réintroduit plus tard) ─────── */
.tp-plans-single {
  grid-template-columns: 1fr !important;
  max-width: 360px;
}

.tp-cmp-table-single .tp-cmp-header,
.tp-cmp-table-single .tp-cmp-row {
  grid-template-columns: 1fr 140px !important;
}

@media (max-width: 700px) {
  .tp-cmp-table-single .tp-cmp-header,
  .tp-cmp-table-single .tp-cmp-row {
    grid-template-columns: 1fr 80px !important;
  }
}

@media (max-width: 768px) {
  .tp-cmp-table-single .tp-cmp-header,
  .tp-cmp-table-single .tp-cmp-row {
    grid-template-columns: 1fr 70px !important;
    min-width: 260px;
  }
}
