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

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

  /* Apport FORK : centrage + largeur max */
  width: 100% !important;
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;

  overflow: visible !important;
}

/* =========================================================
   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;

  padding-bottom: 0 !important;
}

body.coconsem article.prose .table-scroll.has-x-overflow .table-scroll-inner{
  padding-bottom: 60px !important;
}

/* =========================================================
   TABLE LAYOUT — smart overflow
   ========================================================= */

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;
}

/* Cellules */
body.coconsem article.prose .table-scroll .table-scroll-inner th,
body.coconsem article.prose .table-scroll .table-scroll-inner td{
  min-width: 190px;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  box-sizing: border-box !important;
}

/* Ligne */
body.coconsem article.prose .table-scroll .table-scroll-inner tbody td{
  line-height: 18px;
  padding-top: 13px;
  padding-bottom: 19px;
}

/* Colonne 1 = 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 = prix */
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;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Desktop : aucune contrainte artificielle */
@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 */
@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;
  }
}

/* =========================================================
   SCROLLBAR NATIVE — masquée quand UI custom active
   ========================================================= */

body.coconsem article.prose .table-scroll.has-x-overflow .table-scroll-inner{
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

body.coconsem article.prose .table-scroll.has-x-overflow
.table-scroll-inner::-webkit-scrollbar{
  height: 0 !important;
}

/* =========================================================
   CUSTOM SCROLLBAR
   ========================================================= */

body.coconsem article.prose .table-scroll .csmk-scrollbar{
  position: absolute !important;
  left: 14px !important;
  right: 14px !important;
  bottom: 64px !important;

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

  z-index: 2 !important;
  overflow: hidden !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: #d80000 !important;
  transform: translateX(0);

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

  cursor: grab !important;
  touch-action: none !important;
}

body.coconsem article.prose .table-scroll.is-dragging
.csmk-scrollbar .csmk-scrollbar-thumb{
  background: #ff2b2b !important;
  cursor: grabbing !important;
}

/* =========================================================
   HINT “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;
  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 .csmk-hint-text{
  font-weight: 900 !important;
  font-size: 16px !important;
  white-space: nowrap !important;
}

/* Flèches */
body.coconsem article.prose .csmk-hint-arrows{
  display: inline-flex !important;
  gap: 6px !important;
  animation: csmkNudgeBoth 1.1s ease-in-out infinite !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 .csmk-hint-arrows{
    animation: none !important;
  }
}

/* Safety */
body.coconsem article.prose
.table-scroll.hint-hidden.is-dragging .csmk-scroll-hint{
  opacity: 1 !important;
  transform: translateY(0) !important;
}
