/* Sellerts — global desktop scrollbar (public site + panels) */

:root {
  --st-scroll-size: 9px;
  --st-scroll-track: rgba(17, 36, 62, 0.09);
  --st-scroll-thumb: #334155;
  --st-scroll-thumb-hover: #1e293b;
  --st-scroll-thumb-active: #0f172a;
}

[data-theme="dark"] {
  --st-scroll-track: rgba(255, 255, 255, 0.12);
  --st-scroll-thumb: #e2e8f0;
  --st-scroll-thumb-hover: #cbd5e1;
  --st-scroll-thumb-active: #94a3b8;
}

/* Keep page-level scrolling vertical by default */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

@media screen and (min-width: 769px) {
  html {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--st-scroll-thumb) var(--st-scroll-track);
  }

  html::-webkit-scrollbar {
    width: var(--st-scroll-size);
    height: var(--st-scroll-size);
    -webkit-appearance: none;
    appearance: none;
  }

  html::-webkit-scrollbar-track {
    background: var(--st-scroll-track);
    border-radius: 999px;
  }

  html::-webkit-scrollbar-thumb {
    background-color: var(--st-scroll-thumb);
    border-radius: 999px;
    min-height: 40px;
  }

  html::-webkit-scrollbar-thumb:hover {
    background-color: var(--st-scroll-thumb-hover);
  }

  html::-webkit-scrollbar-thumb:active {
    background-color: var(--st-scroll-thumb-active);
  }

  html::-webkit-scrollbar-corner {
    background: var(--st-scroll-track);
  }

  body,
  body * {
    scrollbar-width: thin;
    scrollbar-color: var(--st-scroll-thumb) var(--st-scroll-track);
  }

  body *::-webkit-scrollbar {
    width: var(--st-scroll-size);
    height: var(--st-scroll-size);
    -webkit-appearance: none;
    appearance: none;
  }

  body *::-webkit-scrollbar-track {
    background: var(--st-scroll-track);
    border-radius: 999px;
  }

  body *::-webkit-scrollbar-thumb {
    background-color: var(--st-scroll-thumb);
    border-radius: 999px;
    min-height: 40px;
  }

  body *::-webkit-scrollbar-thumb:hover {
    background-color: var(--st-scroll-thumb-hover);
  }

  body *::-webkit-scrollbar-thumb:active {
    background-color: var(--st-scroll-thumb-active);
  }

  body *::-webkit-scrollbar-corner {
    background: var(--st-scroll-track);
  }

  /* Simplebar custom scrollbars (panels) — always visible at rest */
  .simplebar-track.simplebar-vertical {
    width: var(--st-scroll-size) !important;
    background: var(--st-scroll-track) !important;
    border-radius: 999px;
  }

  .simplebar-track.simplebar-horizontal {
    height: var(--st-scroll-size) !important;
    background: var(--st-scroll-track) !important;
    border-radius: 999px;
  }

  .simplebar-scrollbar:before {
    left: 1px !important;
    right: 1px !important;
    border-radius: 999px !important;
    background-color: var(--st-scroll-thumb) !important;
    opacity: 1 !important;
    transition: none !important;
  }

  .simplebar-scrollbar:hover:before {
    background-color: var(--st-scroll-thumb-hover) !important;
  }

  .simplebar-scrollbar.simplebar-visible:before,
  .simplebar-scrollbar:before {
    opacity: 1 !important;
  }

  .text-white .simplebar-scrollbar:before {
    background-color: var(--st-scroll-thumb) !important;
    opacity: 1 !important;
  }

  /* Bootstrap-table: keep native scrollbars for column sync */
  .fixed-table-container,
  .fixed-table-container * {
    scrollbar-width: thin !important;
    scrollbar-color: var(--st-scroll-thumb) var(--st-scroll-track) !important;
  }

  .fixed-table-container::-webkit-scrollbar,
  .fixed-table-container *::-webkit-scrollbar {
    width: var(--st-scroll-size);
    height: var(--st-scroll-size);
  }

  .fixed-table-container::-webkit-scrollbar-track,
  .fixed-table-container *::-webkit-scrollbar-track {
    background: var(--st-scroll-track);
    border-radius: 999px;
  }

  .fixed-table-container::-webkit-scrollbar-thumb,
  .fixed-table-container *::-webkit-scrollbar-thumb {
    background-color: var(--st-scroll-thumb);
    border-radius: 999px;
  }

  /* Simplebar replaces native scrollbars */
  [data-simplebar] .simplebar-content-wrapper,
  .simplebar-content-wrapper {
    scrollbar-width: none !important;
  }

  [data-simplebar] .simplebar-content-wrapper::-webkit-scrollbar,
  .simplebar-content-wrapper::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* Components that intentionally hide scrollbars */
  .st-tabs,
  .st-mp-trust--strip .st-mp-trust,
  .st-mp-categories__list,
  .bc-header__nav,
  .st-legal-nav__links,
  [data-horizontal-scroll],
  .nav-overflow,
  .content-right-body,
  .content-sidebar-body {
    scrollbar-width: none !important;
  }

  .st-tabs::-webkit-scrollbar,
  .st-mp-trust--strip .st-mp-trust::-webkit-scrollbar,
  .st-mp-categories__list::-webkit-scrollbar,
  .bc-header__nav::-webkit-scrollbar,
  .st-legal-nav__links::-webkit-scrollbar,
  [data-horizontal-scroll]::-webkit-scrollbar,
  .nav-overflow::-webkit-scrollbar,
  .content-right-body::-webkit-scrollbar,
  .content-sidebar-body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
