/* =========================================================
   KORIUM TECH · Particuliers (KHS), adoucisseurs, fiches adoucisseurs
   Classes préfixées kh- (aucune collision avec eclipse.css / site.css).
   ========================================================= */

/* ---------- Portes d'entrée du pôle ---------- */
.kh-portes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kh-porte {
  position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 4px 16px; align-items: center;
  padding: 20px 52px 20px 18px; border-radius: var(--r); background: #fff;
  box-shadow: 0 0 0 1px var(--l-line); transition: box-shadow 0.4s, transform 0.5s var(--ease);
  height: 100%;
}
.kh-porte:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--blue), 0 16px 36px oklch(0.24 0.065 252 / 0.12); }
.kh-porte__sym {
  grid-row: span 2; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--blue); letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1.5px oklch(0.55 0.15 245 / 0.35); background: radial-gradient(circle, #fff 55%, oklch(0.95 0.03 238));
}
.kh-porte b { font-family: var(--display); font-weight: 500; font-size: 1rem; color: var(--l-ink); line-height: 1.25; align-self: end; }
.kh-porte span:not(.kh-porte__sym):not(.kh-porte__go) { font-size: 15px; color: var(--l-ink-3); line-height: 1.4; align-self: start; }
.kh-porte__go { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; color: var(--l-ink); opacity: 0.55; transition: transform 0.5s var(--ease), opacity 0.3s; }
.kh-porte__go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.kh-porte:hover .kh-porte__go { opacity: 1; transform: translate(4px, -50%); color: var(--blue); }

/* ---------- Appel au test de dureté ---------- */
.kh-dz { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 100px); align-items: center; }
.kh-dz__t { display: grid; gap: 18px; }
.kh-cp { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.kh-cp input {
  flex: 1 1 200px; min-width: 0; min-height: 58px; padding: 12px 22px; border: 0; border-radius: 999px;
  font-family: var(--display); font-size: 1.25rem; letter-spacing: 0.06em; color: var(--ink);
  background: oklch(0.95 0.012 240 / 0.06); box-shadow: inset 0 0 0 1px var(--line);
}
.kh-cp input::placeholder { font-family: var(--text); font-size: 1.0625rem; letter-spacing: 0; color: var(--ink-3); }
.kh-cp input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--light), 0 0 0 5px oklch(0.72 0.15 238 / 0.18); }
.kh-cp .btn { min-height: 58px; }
.kh-dz__note { font-size: 15px; color: var(--ink-3); }
.kh-dz__links { display: flex; flex-wrap: wrap; gap: 10px 26px; }

/* Échelle des quatre niveaux (seuils du test du site actuel) */
.kh-ech { display: grid; gap: 20px; }
.kh-ech__bar { position: relative; display: grid; grid-template-columns: 2fr 2fr 2fr 4fr; height: 16px; border-radius: 999px; overflow: hidden; box-shadow: 0 0 30px oklch(0.72 0.15 238 / 0.25); }
.kh-ech__bar i:nth-child(1) { background: rgb(48, 168, 240); }
.kh-ech__bar i:nth-child(2) { background: rgb(120, 200, 230); }
.kh-ech__bar i:nth-child(3) { background: rgb(240, 180, 80); }
.kh-ech__bar i:nth-child(4) { background: linear-gradient(90deg, rgb(240, 120, 60), rgb(230, 60, 50)); }
.kh-ech__ticks { position: relative; height: 18px; font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin-top: -10px; }
.kh-ech__ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.kh-ech__ticks span:first-child { transform: none; }
.kh-ech__ticks span:last-child { transform: translateX(-100%); }
.kh-ech__lv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kh-ech__lv div { display: grid; gap: 4px; padding: 16px 18px; border-radius: 12px; background: oklch(0.95 0.012 240 / 0.04); box-shadow: inset 0 0 0 1px var(--line-2); }
.kh-ech__lv b { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.kh-ech__lv b::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.kh-ech__lv em { font-style: normal; font-family: var(--mono); font-size: 14px; color: var(--light); }
.kh-ech__lv p { font-size: 15px; color: var(--ink-2); line-height: 1.5; }

/* ---------- Cartes produits (hub) ---------- */
.kh-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.kh-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 0 0 26px; border-radius: 18px; overflow: hidden;
  background: #fff; box-shadow: 0 0 0 1px var(--l-line); transition: box-shadow 0.5s, transform 0.6s var(--ease);
}
.kh-card:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px oklch(0.55 0.15 245 / 0.45), 0 22px 50px oklch(0.24 0.065 252 / 0.12); }
.kh-card__img { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: radial-gradient(80% 75% at 50% 40%, #fff, var(--labo-2)); overflow: hidden; }
.kh-card__img img { position: absolute; left: 13%; top: 8%; width: 74%; height: 84%; object-fit: contain; transition: transform 0.9s var(--ease); filter: drop-shadow(0 16px 18px oklch(0.24 0.065 252 / 0.16)); }
.kh-card__img--cover img, .kh-card__img video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: none; }
.kh-card__img--duo img { position: absolute; top: 0; width: 50%; height: 100%; object-fit: cover; filter: none; }
.kh-card__img--duo img:first-child { left: 0; }
.kh-card__img--duo img:last-child { left: 50%; }
.kh-card:hover .kh-card__img img { transform: scale(1.04); }
.kh-card__img .ia-note { position: absolute; top: 12px; right: 12px; bottom: auto; font-size: 12px; z-index: 2; }
.kh-card__k { padding: 6px 24px 0; font-size: 14px; font-weight: 600; color: var(--blue); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.kh-tag { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; background: var(--marine); color: #fff; }
.kh-card__t { padding: 0 24px; font-size: 1.3rem !important; color: var(--l-ink); line-height: 1.2; }
.kh-card__t a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.kh-card__d { padding: 0 24px; font-size: 16px; color: var(--l-ink-2); line-height: 1.55; }
.kh-card .puces { padding: 2px 24px 0; gap: 8px; font-size: 15.5px; color: var(--l-ink-2); }
.kh-card .puces li { padding-left: 26px; }
.kh-card .puces li::before { width: 14px; height: 14px; }
.kh-card__ctas { margin-top: auto; padding: 8px 24px 0; display: grid; gap: 8px; position: relative; z-index: 2; }
.kh-card__ctas a { font-weight: 600; color: var(--l-ink); display: inline-flex; gap: 8px; align-items: baseline; }
.kh-card__ctas a::after { content: "→"; color: var(--blue); transition: transform 0.4s var(--ease); }
.kh-card__ctas a:hover { color: var(--blue); }
.kh-card__ctas a:hover::after { transform: translateX(4px); }
.kh-card__ck { font-size: 14px; color: var(--l-ink-3); margin-top: 4px; margin-bottom: -6px; }
.kh-card__more { padding: 0 24px; font-size: 15px; color: var(--l-ink-2); line-height: 1.55; display: grid; gap: 8px; }
.kh-card__more strong { color: var(--l-ink); }
.kh-card--wide { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 0; padding: 0; }
.kh-card--wide .kh-card__img { aspect-ratio: auto; height: 100%; min-height: 320px; }
.kh-card--wide .kh-card__body { display: flex; flex-direction: column; gap: 12px; padding: 26px 0; }
.kh-card--full { grid-column: 1 / -1; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); }
.kh-card--full .kh-card__more p { max-width: 75ch; }
.kh-voir3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Pourquoi KHS ---------- */
.kh-pq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 100px); align-items: start; }
.kh-pq .m { aspect-ratio: 3 / 4; }
.kh-pq__side { display: grid; gap: 28px; }
.kh-reseau { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 28px; align-items: center; padding: 26px 28px; border-radius: var(--r); background: oklch(0.72 0.15 238 / 0.08); box-shadow: inset 0 0 0 1px oklch(0.72 0.15 238 / 0.3); }
.kh-reseau__n { font-family: var(--display); font-size: clamp(2.6rem, 1.6rem + 3vw, 4rem); line-height: 1; color: var(--ink); font-weight: 500; letter-spacing: -0.02em; }
.kh-reseau__n small { display: block; font-family: var(--text); font-size: 15px; letter-spacing: 0; color: var(--light); font-weight: 600; margin-top: 8px; }
.kh-reseau p { color: var(--ink-2); }
.kh-reseau .link-arrow { margin-top: 8px; display: inline-block; }

/* ---------- Formulaire « Être recontacté » ---------- */
.kh-rappel { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 100px); align-items: start; }
.kh-rappel__t { display: grid; gap: 18px; }

/* ---------- Adoucisseurs : 5 tuiles sur une ligne ---------- */
.produits.kh-p5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.produits.kh-p3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kh-under { margin-top: clamp(28px, 3vw, 44px); display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }

/* ---------- Élévation à l'échelle (hauteur ET largeur à la même échelle) ---------- */
.kh-el { --k: 2.4px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 34px 2px 8px; }
.kh-el__plot { position: relative; display: flex; align-items: flex-start; gap: clamp(26px, 3vw, 48px); width: max-content; min-width: 100%; padding-left: 64px; }
.kh-el__grid { position: absolute; left: 0; right: 0; top: calc((120 - var(--v)) * var(--k)); height: 0; border-top: 1px dashed oklch(0.24 0.065 252 / 0.18); pointer-events: none; }
.kh-el__grid span { position: absolute; left: 0; top: -9px; font-family: var(--mono); font-size: 12px; color: var(--l-ink-3); background: var(--labo); padding-right: 8px; }
.kh-el__grid--m { border-top: 1.5px solid oklch(0.55 0.15 245 / 0.55); }
.kh-el__grid--m span { color: var(--blue); font-weight: 500; }
.kh-el__grid--0 { border-top: 1.5px solid oklch(0.24 0.065 252 / 0.35); border-top-style: solid; }
.kh-el__g { position: relative; z-index: 1; display: grid; gap: 38px; justify-items: center; }
.kh-el__units { display: flex; align-items: flex-end; gap: 16px; height: calc(120 * var(--k)); }
.kh-el__col { position: relative; display: grid; justify-items: center; }
.kh-el__u {
  position: relative; width: calc(var(--w) * var(--k)); height: calc(var(--h) * var(--k));
  border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--cap) 0 13%, var(--body) 13%);
  box-shadow: inset 0 0 0 1px oklch(0.24 0.065 252 / 0.22), 0 12px 24px oklch(0.24 0.065 252 / 0.12);
  transform-origin: bottom; display: grid; place-items: center;
  transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 70ms + 200ms);
}
.kh-el.rv:not(.in) .kh-el__u { transform: scaleY(0); }
.kh-el__u b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--l-ink); background: oklch(1 0 0 / 0.9); padding: 1px 6px; border-radius: 4px; white-space: nowrap; box-shadow: 0 0 0 1px oklch(0.24 0.065 252 / 0.1); }
.kh-el__u em { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-style: normal; font-family: var(--mono); font-size: 11.5px; color: var(--blue); white-space: nowrap; }
.kh-el__m { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 12px; color: var(--l-ink-2); white-space: nowrap; }
.kh-el__n { font-family: var(--display); font-weight: 500; font-size: 14px; color: var(--l-ink); text-align: center; padding-top: 10px; border-top: 1px solid var(--l-line); width: 100%; white-space: nowrap; }
.kh-el__n a:hover { color: var(--blue); }
.kh-el__note { margin-top: 18px; font-size: 14px; color: var(--l-ink-3); }
@media (max-width: 759px) { .kh-el { --k: 1.9px; } .kh-el__units { gap: 14px; } .kh-el__u em { font-size: 10.5px; } }

/* ---------- Comparateur : cellules ---------- */
.cmp td.kh-na, .cmp .kh-na { color: var(--ink-3); font-family: var(--text); font-size: 14px; }
.kh-cmp thead th a { color: inherit; text-decoration: underline; text-decoration-color: oklch(0.55 0.15 245 / 0.4); text-underline-offset: 4px; }
.kh-cmp thead th img { display: block; width: 64px; height: 64px; object-fit: contain; margin-bottom: 8px; }
.kh-cmp td { font-size: 14px; }

/* ---------- Badges (accroche des fiches) ---------- */
.kh-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.kh-badges span { font-size: 14.5px; font-weight: 600; color: var(--ink); padding: 6px 14px; border-radius: 999px; background: oklch(0.72 0.15 238 / 0.14); box-shadow: inset 0 0 0 1px oklch(0.72 0.15 238 / 0.35); }
.kh-ref { font-family: var(--mono); font-size: 15px; color: var(--light); letter-spacing: 0.02em; }
.s--labo .kh-ref { color: var(--blue); }

/* ---------- Encadré réglementaire / sources ---------- */
.kh-src { font-size: 14px; color: var(--ink-3); }
.enc--essentiel .kh-src { color: oklch(0.82 0.03 240); }
.cmp td .kh-tx { font-family: var(--text); font-size: 15px; line-height: 1.5; }
.produits.kh-p3 { max-width: 1000px; }
.kh-src a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Accessoires ---------- */
.kh-acc { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 90px); align-items: center; }
.kh-acc + .kh-acc { margin-top: clamp(56px, 7vw, 110px); padding-top: clamp(56px, 7vw, 110px); background: linear-gradient(90deg, var(--line), transparent) left top / 100% 1px no-repeat; }
.kh-acc--rev .kh-acc__m { order: 2; }
.kh-acc__m { aspect-ratio: 1; border-radius: 20px; display: grid; place-items: center; background: radial-gradient(70% 70% at 50% 42%, #fff, var(--labo-2)); box-shadow: inset 0 0 0 1px var(--l-line); }
.kh-acc__m img { width: 62%; height: 62%; object-fit: contain; filter: drop-shadow(0 22px 22px oklch(0.24 0.065 252 / 0.16)); }
.kh-acc__t { display: grid; gap: 16px; }
.kh-acc__t h2 { font-size: clamp(1.6rem, 1rem + 2vw, 2.6rem); line-height: 1.1; color: var(--ink); }
.kh-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.kh-trio span { aspect-ratio: 3 / 4; display: grid; place-items: center; border-radius: 16px; background: radial-gradient(closest-side, oklch(0.32 0.1 248 / 0.9), transparent); }
.kh-trio img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 20px 26px oklch(0 0 0 / 0.5)); }
.kh-trio span:nth-child(2) { aspect-ratio: 3 / 5; }

/* Barres : contenance du bac à sel */
.kh-bars { display: grid; gap: 10px; }
.kh-bar { display: grid; grid-template-columns: minmax(120px, 0.34fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.kh-bar__n { font-size: 15px; color: var(--l-ink); font-weight: 500; }
.kh-bar__n small { display: block; font-family: var(--mono); font-size: 12px; color: var(--l-ink-3); font-weight: 400; }
.kh-bar__v { position: relative; height: 30px; border-radius: 6px; background: var(--labo-2); overflow: hidden; }
.kh-bar__v i { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) / var(--max) * 100%); background: linear-gradient(90deg, var(--marine), var(--blue)); border-radius: 6px; transform-origin: left; }
.kh-bar__v i { transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 50ms + 200ms); }
.kh-bars.rv:not(.in) .kh-bar__v i { transform: scaleX(0); }
.kh-bar__v b { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 13px; font-weight: 500; color: #fff; z-index: 1; white-space: nowrap; }
.kh-bar__v b.is-out { left: calc(var(--v) / var(--max) * 100% + 10px); color: var(--l-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .produits.kh-p5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .kh-portes, .kh-voir3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kh-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kh-card--wide { grid-column: span 2; }
  .kh-dz, .kh-pq, .kh-rappel, .kh-acc { grid-template-columns: 1fr; }
  .kh-acc--rev .kh-acc__m { order: 0; }
  .kh-acc__m { max-width: 420px; width: 100%; }
  .kh-pq .m { aspect-ratio: 4 / 3; max-width: 560px; }
}
@media (max-width: 759px) {
  .kh-portes, .kh-voir3 { grid-template-columns: 1fr; }
  .kh-cards { grid-template-columns: 1fr; }
  .kh-card--wide, .kh-card--full { grid-column: auto; grid-template-columns: 1fr; }
  .kh-card--wide .kh-card__img { min-height: 0; aspect-ratio: 16 / 10; }
  .kh-card__img { aspect-ratio: 16 / 10; }
  .produits.kh-p5, .produits.kh-p3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kh-ech__lv { grid-template-columns: 1fr; }
  .kh-reseau { grid-template-columns: 1fr; }
  .kh-porte { padding-right: 44px; }
  .kh-bar { grid-template-columns: 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .kh-el__u, .kh-bar__v i { transform: none !important; transition: none !important; }
}

/* ---------- Ajustements d'images ---------- */
/* Le PNG du kit de dureté a de grandes marges transparentes : on le recadre visuellement */
img[src*="kit-analyse-durete-produit"] { transform: scale(1.7); transform-origin: 50% 36%; }
.pt:hover .pt__img img[src*="kit-analyse-durete-produit"], .kh-card:hover .kh-card__img img[src*="kit-analyse-durete-produit"] { transform: scale(1.76); }
/* Galerie des fiches : la légende ne recouvre plus le produit ; les JPEG à fond blanc se fondent dans le socle clair */
.gal--pack .m:has(figcaption) img { padding-bottom: 18%; }
.gal--pack .m img[src$=".jpg"] { mix-blend-mode: multiply; }
.kh-puces3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1023px) { .kh-puces3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 759px) { .kh-puces3 { grid-template-columns: 1fr; } }
