/* =========================================================
   CSMK TABLE SCROLL — HINT + SCROLLBAR CUSTOM + DRAG HANDLE
   Scope : body.coconsem article.prose
   ========================================================= */

body.coconsem article.prose .table-scroll{
  position: relative !important;

  /* NE JAMAIS dépasser 1100px */
  width: 100% !important;
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
      margin-bottom: 0px;

  /* Empêche le débordement qui crée le scroll horizontal de page */
  overflow-x: hidden !important;
  overflow-y: visible !important; /* garde le hint/scrollbar visibles */
}

/* Le conteneur scrollable */
body.coconsem article.prose .table-scroll .table-scroll-inner{
  width: 100% !important;
  max-width: 100% !important;

  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;

  /* Réserve la place pour le handle + la scrollbar custom */
  padding-bottom: 0 !important;
}
body.coconsem article.prose .table-scroll.has-x-overflow .table-scroll-inner{
  padding-bottom: 0px !important; /* 54/60 selon ton besoin */
}

/* =========================================================
   TABLE LAYOUT — “smart overflow”
   - Le tableau prend 100% de la colonne
   - MAIS les cellules ont un min-width => overflow seulement si nécessaire
   ========================================================= */
body.coconsem article.prose .table-scroll .table-scroll-inner table{
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

/* ✅ Min-width par cellule : déclenche un vrai overflow si le container est trop étroit */
/* Desktop : on laisse le tableau respirer, pas de min-width qui force l’overflow */
@media (min-width: 1024px){
  body.coconsem article.prose .table-scroll .table-scroll-inner th,
  body.coconsem article.prose .table-scroll .table-scroll-inner td{
    min-width: 0 !important;
  }
}

/* Mobile : on garde une lisibilité minimale (scroll interne OK) */
@media (max-width: 1023px){
  body.coconsem article.prose .table-scroll .table-scroll-inner th,
  body.coconsem article.prose .table-scroll .table-scroll-inner td{
    min-width: 160px !important;
  }
}
body.coconsem article.prose .table-scroll .table-scroll-inner tbody td{
	    line-height: 18px;
    padding-bottom: 19px;
    padding-top: 13px;
}
/* ✅ Colonne 1 souvent plus courte / “label” */
body.coconsem article.prose .table-scroll .table-scroll-inner th:first-child,
body.coconsem article.prose .table-scroll .table-scroll-inner td:first-child{
  min-width: 170px;
  font-weight: 700;
}

/* ✅ Colonne 3 souvent “prix” : plus petite */
body.coconsem article.prose .table-scroll .table-scroll-inner th:nth-child(3),
body.coconsem article.prose .table-scroll .table-scroll-inner td:nth-child(3){
  min-width: 140px;
}

/* ✅ Mobile: on réduit juste les min-width pour éviter un overflow trop violent */
@media (max-width: 480px){
  body.coconsem article.prose .table-scroll .table-scroll-inner{
    /*padding-bottom: 56px !important;*/
  }

  body.coconsem article.prose .table-scroll .table-scroll-inner th,
  body.coconsem article.prose .table-scroll .table-scroll-inner td{
    min-width: 160px;
  }
}

/* Masquer le scrollbar natif seulement quand overflow (UI custom active) */
body.coconsem article.prose .table-scroll.has-x-overflow .table-scroll-inner{
  scrollbar-width: none !important;     /* Firefox */
  -ms-overflow-style: none !important;  /* Edge legacy */
}
body.coconsem article.prose .table-scroll.has-x-overflow .table-scroll-inner::-webkit-scrollbar{
  height: 0 !important;                 /* Chrome/Safari */
}

/* =========================
   Custom scrollbar (track)
   ========================= */
body.coconsem article.prose .table-scroll .csmk-scrollbar{
 
  left: 14px !important;
  right: 14px !important;
  bottom: 64px !important;

  height: 8px !important;
  border-radius: 999px !important;
  background: rgba(0,0,0,.10) !important;
  overflow: hidden !important;

  z-index: 2 !important;

  opacity: 0 !important;
  transform: translateY(4px) !important;
  transition: opacity .2s ease, transform .2s ease !important;

  pointer-events: none !important;
}

body.coconsem article.prose .table-scroll.has-x-overflow .csmk-scrollbar{
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

body.coconsem article.prose .table-scroll .csmk-scrollbar .csmk-scrollbar-thumb{
  height: 100% !important;
  width: 46px;
  border-radius: 999px !important;

  background: var(--borders) !important;
  transform: translateX(0);

  transition: transform .06s linear, width .12s ease, background .15s ease !important;

  pointer-events: auto !important;
  touch-action: none !important;
  cursor: grab !important;
}
body.coconsem article.prose .table-scroll.is-dragging .csmk-scrollbar .csmk-scrollbar-thumb{
  background: #ff2b2b !important;
  cursor: grabbing !important;
}

/* =========================
   Handle rouge “Glissez”
   ========================= */
body.coconsem article.prose .table-scroll .csmk-scroll-hint{
  position: absolute !important;
  right: 12px !important;
  bottom: 8px !important;

  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;

  padding: 10px 14px !important;
  border-radius: 999px !important;

  background: #b30000 !important;
  color: #fff !important;

  box-shadow: 0 10px 22px rgba(0,0,0,.22) !important;

  z-index: 3 !important;

  pointer-events: auto !important;
  touch-action: none !important;

  user-select: none !important;
  -webkit-user-select: none !important;

  opacity: 0 !important;
  transform: translateY(6px) !important;
  transition: opacity .2s ease, transform .2s ease, background .15s ease, box-shadow .15s ease !important;
}

body.coconsem article.prose .table-scroll.has-x-overflow .csmk-scroll-hint{
  opacity: 1 !important;
  transform: translateY(0) !important;
}

body.coconsem article.prose .table-scroll.is-dragging .csmk-scroll-hint{
  background: #ff2b2b !important;
  box-shadow: 0 14px 26px rgba(0,0,0,.28) !important;
}

/* Texte */
body.coconsem article.prose .table-scroll .csmk-scroll-hint .csmk-hint-text{
  font-weight: 900 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  letter-spacing: .2px !important;
  white-space: nowrap !important;
}

/* Zone flèches ↔ */
body.coconsem article.prose .table-scroll .csmk-scroll-hint .csmk-hint-arrows{
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  animation: csmkNudgeBoth 1.1s ease-in-out infinite !important;
}

/* Bulles flèches */
body.coconsem article.prose .table-scroll .csmk-scroll-hint .csmk-hint-arrow{
  width: 28px !important;
  height: 28px !important;
  display: grid !important;
  place-items: center !important;

  border-radius: 999px !important;
  background: rgba(255,255,255,.18) !important;

  font-size: 16px !important;
  line-height: 1 !important;
}

@keyframes csmkNudgeBoth{
  0%   { transform: translateX(0); opacity: .85; }
  50%  { transform: translateX(8px); opacity: 1; }
  100% { transform: translateX(0); opacity: .85; }
}

@media (prefers-reduced-motion: reduce){
  body.coconsem article.prose .table-scroll .csmk-scroll-hint .csmk-hint-arrows{
    animation: none !important;
  }
}

/* Mobile compact: juste l’UI du hint */
@media (max-width: 480px){
  body.coconsem article.prose .table-scroll .csmk-scroll-hint{
    right: 10px !important;
    bottom: 8px !important;
    padding: 10px 14px !important;
  }
  body.coconsem article.prose .table-scroll .csmk-scroll-hint .csmk-hint-text{
    font-size: 17px !important;
  }
}

/* Safety: if old JS still toggles .hint-hidden, keep handle visible while dragging */
body.coconsem article.prose .table-scroll.hint-hidden.is-dragging .csmk-scroll-hint{
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* =========================================================
   PATCH: ne JAMAIS dépasser 1100px en desktop (zéro scroll page)
   ========================================================= */
/* =========================================================
   1) STOP overflow-x global (filet de sécurité)
   ========================================================= */
html, body{
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* =========================================================
   2) Fix WordPress Admin Bar: screen-reader-text qui déborde
   (quand connecté)
   ========================================================= */
#wpadminbar .screen-reader-text,
#wpadminbar .screen-reader-text *{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;

  /* double sécurité moderne + legacy */
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;

  white-space: nowrap !important;
  border: 0 !important;
}

/* IMPORTANT : on respecte l’accessibilité au focus (WP standard) */
#wpadminbar .screen-reader-text:focus{
  clip: auto !important;
  clip-path: none !important;
  height: auto !important;
  width: auto !important;
  overflow: visible !important;
  position: static !important;
  white-space: normal !important;
}

/* Empêche les enfants flex de dépasser (cause #1 des scrollbars horizontales fantômes) */
body.coconsem article.prose .table-scroll,
body.coconsem article.prose .table-scroll .table-scroll-inner{
  min-width: 0 !important;
  max-width: 100% !important;
  display: block !important;
}


/* Demande client ......... */
body.coconsem article.prose .table-scroll .csmk-scroll-hint{
	display:none!important;
}