/* ── Bouton « Partager » de la fiche circuit + fenêtre « carte postale » ── mobile d'abord */
.ekp { position: relative; display: inline-flex; align-items: center; font-family: Poppins, system-ui, sans-serif; }

.ekp-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; margin: 0; padding: 0 16px 0 5px;
  border: 1px solid #e6ddd2; border-radius: 999px; background: #fff; color: #024053; cursor: pointer;
  font: 500 14px/1 Poppins, system-ui, sans-serif; white-space: nowrap; transition: border-color .2s, background .2s;
}
.ekp-btn:hover, .ekp-btn[aria-expanded="true"] { border-color: #024053; background: #faf6f1; }
.ekp-btn:focus-visible { outline: 2px solid #b4532a; outline-offset: 2px; }
.ekp-btn-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #024053; color: #fff; transition: transform .25s; }
.ekp-btn:hover .ekp-btn-ic { transform: rotate(-12deg); }
.ekp-btn-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Fenêtre : placée par le script sous le bouton (ordinateur) ou en bas de l'écran (téléphone) */
.ekp-pop {
  position: fixed; z-index: 1080; width: 320px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid #e6ddd2; border-radius: 16px; overflow: hidden; color: #024053;
  box-shadow: 0 18px 40px -18px rgba(2, 40, 52, .45);
  opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .25s ease;
}
.ekp-pop[hidden] { display: none; }
.ekp-pop.is-ouvert { opacity: 1; transform: none; }

.ekp-prev { position: relative; display: flex; gap: 12px; padding: 14px 44px 14px 14px; background: #faf6f1; border-bottom: 1px solid #efe7dd; }
.ekp-th { flex: none; width: 68px; height: 68px; border-radius: 10px; background: #d9c9b4 center / cover no-repeat; }
.ekp-prev-tx { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.ekp-prev-tx b { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ekp-prev-tx small { margin-top: 3px; font-size: 11.5px; line-height: 1.35; color: #7d8a90; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ekp-prev-tx em { margin-top: 4px; font-style: normal; font-size: 12.5px; font-weight: 600; color: #b4532a; }
.ekp-fermer { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: #7d8a90; cursor: pointer; display: grid; place-items: center; }
.ekp-fermer:hover { background: #fff; color: #024053; }
.ekp-fermer svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.ekp-ch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 16px 10px 8px; }
.ekp-c { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; border-radius: 10px; color: #4d636c !important; font-size: 11.5px; line-height: 1.2; text-decoration: none !important; }
.ekp-c span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; transition: transform .2s; }
.ekp-c svg { width: 21px; height: 21px; fill: currentColor; }
.ekp-c svg.ekp-trait { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.ekp-c:hover span, .ekp-c:focus-visible span { transform: translateY(-2px); }
.ekp-c:focus-visible { outline: 2px solid #b4532a; outline-offset: 1px; }

/* Lien : toujours sur une ligne, coupé par « … » */
.ekp-lien { display: flex; align-items: center; gap: 8px; margin: 8px 12px 14px; padding: 4px 4px 4px 11px; border: 1px solid #e6ddd2; border-radius: 999px; }
.ekp-lien-ic { flex: none; width: 16px; height: 16px; fill: none; stroke: #b4532a; stroke-width: 2; stroke-linecap: round; }
.ekp-url { flex: 1; min-width: 0; font-size: 12px; color: #7d8a90; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ekp-copier {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; margin: 0; padding: 0 14px; border: 0; border-radius: 999px;
  background: #024053; color: #fff; cursor: pointer; font: 500 12.5px/1 Poppins, system-ui, sans-serif; transition: background .2s;
}
.ekp-copier:hover { background: #03566f; }
.ekp-copier svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ekp-copier .i-ok, .ekp-copier .t-ok { display: none; }
.ekp-copier.is-ok { background: #167a5b; }
.ekp-copier.is-ok .i-ok, .ekp-copier.is-ok .t-ok { display: inline; }
.ekp-copier.is-ok .i-copier, .ekp-copier.is-ok .t-copier { display: none; }

/* Téléphone sans menu de partage natif : fenêtre en bas de l'écran */
@media (max-width: 767.98px) {
  .ekp-pop.is-bas { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: none; border-radius: 18px 18px 0 0; transform: translateY(20px); padding-bottom: env(safe-area-inset-bottom); }
  .ekp-pop.is-bas.is-ouvert { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ekp-pop, .ekp-btn-ic, .ekp-c span { transition: none; }
}

/* Dans le sous-menu de la fiche, en dessous de 1120 px : le menu est une liste en colonne de hauteur fixe (main.css).
   Le bouton ne s'ajoute pas en bas de la liste (il débordait sur le fil d'Ariane) : il se place sur la ligne de « Devis gratuit », à droite. */
@media screen and (max-width: 1119px) {
  .box_sub_menu .sub_menu_container > .ekp { position: absolute; right: 5%; bottom: 2px; }
  /* un peu d'air sous la ligne « Devis gratuit » (main.css fixe la hauteur du menu à 415 px) */
  .box_sub_menu .sub_menu_groups:has(.ekp) { height: 439px; }
  header:has(.ekp) { min-height: 365px; }   /* main.css : 325 px ; le fil d'Ariane descend d'autant */
}
