/* ============================================================
   style3.css — Styles de l'outil Répartition livre
   Complète style2.css (thème Themefisher) — ne pas modifier
   style2.css directement.
   ============================================================ */

/* ── 1. CORRECTION DROPDOWN NAVIGATION ─────────────────────────────────────
   Le thème gère le hover desktop via CSS (visibility/opacity).
   Bootstrap JS gère le clic sur mobile.
   On s'assure que les styles sont correctement appliqués.
   ─────────────────────────────────────────────────────────────────────────── */

/* Chevron Font Awesome à la place de tf-ion-chevron-down (police absente) */
.navigation .nav-link .fa-chevron-down {
  font-size: 10px;
  margin-left: 5px;
  vertical-align: middle;
  transition: transform .25s ease;
}
.navigation .dropdown.show .fa-chevron-down,
.navigation .dropdown:hover .fa-chevron-down {
  transform: rotate(180deg);
}

/* Dropdown menu */
.navigation .dropdown-menu {
  min-width: 230px;
  border-radius: 0;
  border: 0;
  background: #f5f5f5;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.navigation .dropdown-item {
  font-family: "Josefin Sans", sans-serif;
  font-size: 15px;          /* même taille que style.css */
  font-weight: 600;
  color: #444;
  padding: .6rem 1.1rem .4rem;
  transition: background .2s, color .2s;
}
.navigation .dropdown-item:hover,
.navigation .dropdown-item:focus,
.navigation .dropdown-item.active {
  background: #f9a743;
  color: #fff;
}

/* ── 2. TYPOGRAPHIE — alignée sur style.css ─────────────────────────────────
   style.css définit :
     body   → 14px / 300 / line-height 25px
     h1     → 44px, h2 → 30px, h3 → 23px, h4 → 20px
     p      → 18px / line-height 25px
     .nav-link → 16px bold
   On reprend ces tailles dans tout l'outil.
   ─────────────────────────────────────────────────────────────────────────── */

/* En-tête de l'outil */
.tool-header h2 {
  font-size: 40px;          /* = .heading h2 du thème */
  font-weight: 600;
  line-height: 1.15;
  color: #3c3c3c;
  margin-bottom: 12px;
}
.tool-header h2 span { color: #f9a743; }

.tool-header p {
  font-size: 18px;          /* = p du thème */
  font-weight: 300;
  line-height: 25px;
  color: #777;
}

.tool-header .eyebrow {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #f9a743;
  display: block;
  margin-bottom: 10px;
  font-weight: 400;
}

/* Titres des cartes */
.tool-card-title {
  font-size: 23px;          /* = h3 du thème */
  font-weight: 600;
  color: #3c3c3c;
  margin-bottom: 6px;
  line-height: 25px;
}
.tool-card-sub {
  font-size: 15px;          /* légèrement au-dessus du body */
  color: #777;
  font-weight: 300;
  line-height: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dadada;
  margin-bottom: 20px;
}

/* Labels des champs */
.field-label {
  font-size: 13px;          /* légèrement plus grand qu'avant */
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #3c3c3c;
}
.field-hint {
  font-size: 12px;          /* +1px vs avant */
  color: #aaa;
  font-weight: 300;
}

/* Select */
select.part-select {
  font-size: 14px;          /* = body du thème */
  font-weight: 600;
}

/* Barre total */
.total-bar {
  font-size: 14px;          /* = body du thème */
  font-weight: 400;
}

/* Bouton Générer — taille identique à .btn-main du thème */
.btn-generer {
  font-size: 16px;
  font-weight: 700;
  padding: 14px 28px;
}

/* Légende du camembert */
.legend-name {
  font-size: 13px;          /* +2px vs avant */
  font-weight: 600;
  letter-spacing: .06em;
}
.legend-pct {
  font-size: 14px;          /* = body */
  color: #777;
}
.legend-eur {
  font-family: "Droid Serif", serif;
  font-size: 15px;          /* = p.price du thème réduit */
  color: #f9a743;
}

/* Récap HT/TTC */
.recap-val {
  font-family: "Droid Serif", serif;
  font-size: 24px;
  color: #f9a743;
}
.recap-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #777;
}

/* Messages d'erreur / avertissement */
.prix-error    { font-size: 13px; }
.avertissement { font-size: 13px; }

/* État vide */
.empty-state p {
  font-size: 16px;          /* = body thème légèrement + */
  line-height: 1.7;
  color: #aaa;
}

/* ── 3. LAYOUT & COMPOSANTS (inchangés) ────────────────────────────────────── */

:root {
  --c-tva:         #a8d5a2;
  --c-editeur:     #f9a743;
  --c-fabrication: #6ec6e6;
  --c-auteur:      #b07fcc;
  --c-librairie:   #161061;
  --c-diffusion:   #f06292;
}

.tool-section { padding: 60px 0; background: #f4f4f4; }
.tool-header  { text-align: center; margin-bottom: 40px; }

.tool-header .heading-line {
  display: block; width: 60px; height: 3px;
  background: #f9a743; border-radius: 2px; margin: 0 auto 16px;
}

.session-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; letter-spacing: .1em; color: #777;
  background: #fff; border: 1px solid #dadada;
  border-radius: 100px; padding: 5px 16px; margin-top: 14px;
}
.session-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #f9a743; animation: sdot 2s infinite;
}
@keyframes sdot { 0%,100%{opacity:1} 50%{opacity:.25} }

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) { .tool-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: #fff; border-radius: 5px;
  box-shadow: 0 10px 40px rgba(0,0,0,.08);
  padding: 30px 28px 26px;
}
.tool-card-sticky { position: sticky; top: 80px; }

/* Prix TTC */
.prix-wrap {
  margin-bottom: 20px; padding: 14px 18px;
  background: #f4f4f4; border-radius: 5px;
  border-left: 3px solid #f9a743;
}
.prix-wrap label {
  font-size: 13px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: #3c3c3c;
  display: block; margin-bottom: 10px;
}
.prix-inner { display: flex; align-items: center; gap: 8px; }
.prix-input {
  width: 120px; height: 46px;
  border: 1px solid #dadada; border-radius: 35px;
  padding: 0 18px; font-family: 'Droid Serif', serif;
  font-size: 20px; color: #f9a743; text-align: center;
  background: #fff; transition: border-color .2s;
}
.prix-input:focus      { outline: none; border-color: #f9a743; box-shadow: none; }
.prix-input.is-invalid { border-color: #e74c3c; box-shadow: 0 0 0 3px rgba(231,76,60,.1); }
.prix-input.is-valid   { border-color: #27ae60; }
.prix-suffix { font-family: 'Droid Serif', serif; font-size: 18px; color: #777; }
.prix-limits { font-size: 12px; color: #aaa; margin-top: 7px; }
.prix-error {
  margin-top: 8px; padding: 8px 14px;
  background: rgba(231,76,60,.08); border: 1px solid rgba(231,76,60,.25);
  border-radius: 30px; font-size: 13px; color: #e74c3c;
  display: flex; align-items: center; gap: 7px;
}

.fields-list { display: flex; flex-direction: column; gap: 11px; }
.field-row   { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.field-info  { display: flex; align-items: center; gap: 11px; }
.color-dot   { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

select.part-select {
  height: 46px; border: 1px solid #dadada; border-radius: 35px;
  padding: 0 36px 0 18px; font-family: 'Josefin Sans', sans-serif;
  color: #3b4045; background: #fff; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23f9a743' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer; min-width: 95px; transition: border-color .2s;
}
select.part-select:focus { outline: none; border-color: #f9a743; box-shadow: none; }

.diffusion-auto {
  height: 46px; min-width: 95px;
  display: flex; align-items: center; justify-content: center;
  background: #f4f4f4; border: 1px dashed #dadada; border-radius: 35px;
  padding: 0 18px; font-size: 14px; font-weight: 600;
  color: var(--c-diffusion);
}

.total-bar {
  margin-top: 18px; padding: 11px 18px; border-radius: 5px;
  display: flex; align-items: center; justify-content: space-between;
}
.total-ok  { background: #eafaf1; border: 1px solid #a8d5a2; color: #27ae60; }
.total-err { background: #fef0ef; border: 1px solid #f5b7b1; color: #e74c3c; }

.avertissement {
  background: #fff8ee; border: 1px solid rgba(249,167,67,.4);
  border-radius: 5px; padding: 10px 16px; margin-top: 10px;
}

.btn-row-tool { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 22px; }

.btn-generer {
  color: #fff; border-radius: 30px; font-family: 'Josefin Sans', sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  border: none; background-color: #f9a743;
  box-shadow: 0 15px 40px rgba(249,167,67,.45);
  background-image: linear-gradient(to top, rgba(255,239,206,0) 0%, rgba(255,239,206,.25) 100%);
  cursor: pointer; transition: transform .15s, box-shadow .2s;
}
.btn-generer:hover  { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(249,167,67,.45); }
.btn-generer:active { transform: translateY(0); }

.btn-effacer {
  height: 100%; padding: 14px 20px;
  background: transparent; color: #777;
  font-family: 'Josefin Sans', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid #dadada; border-radius: 30px;
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  transition: color .2s, border-color .2s, background .2s;
}
.btn-effacer:hover { color: #e74c3c; border-color: rgba(231,76,60,.4); background: rgba(231,76,60,.05); }

.chart-wrap { position: relative; width: 100%; max-width: 260px; margin: 0 auto 24px; }

.legend-list { display: flex; flex-direction: column; gap: 8px; }
.legend-item {
  display: grid; grid-template-columns: 12px 1fr auto auto;
  align-items: center; gap: 9px;
  padding: 9px 13px; border-radius: 5px;
  background: #f4f4f4; border: 1px solid #dadada;
  transition: border-color .2s;
}
.legend-item:hover { border-color: #f9a743; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

.prix-recap {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #dadada;
}
.recap-box {
  text-align: center; padding: 14px 8px;
  background: #f4f4f4; border-radius: 5px; border: 1px solid #dadada;
}

.empty-state { text-align: center; padding: 40px 20px; color: #aaa; }
