/* =========================================================
   Wide list tables (admin + PSR / Seller panels), turned on per table with
     <div class="table-responsive" data-sticky-table data-sticky-start="2">
   mrt-sticky-table.js adds the classes below only while the table is wider than its box:
   - the Action column (last) stays on the right, on every screen
   - the first N columns stay on the left (laptop / desktop)
   - the box fits the screen so its side scrollbar is always visible; header row stays on top
   - drag with the mouse or Shift + wheel to move sideways
   ========================================================= */

.st-scroll {
    position: relative;
    overscroll-behavior-x: contain;
    scrollbar-color: #9aa5b8 #eef1f5;
}

.st-scroll.st-fit {
    overflow: auto !important;
}

.st-scroll:focus-visible {
    outline: 2px solid #3461ff;
    outline-offset: 2px;
}

.st-scroll::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.st-scroll::-webkit-scrollbar-track {
    background: #eef1f5;
}

.st-scroll::-webkit-scrollbar-thumb {
    background: #9aa5b8;
    border-radius: 10px;
    border: 2px solid #eef1f5;
}

.st-scroll::-webkit-scrollbar-thumb:hover {
    background: #6c7a92;
}

.st-scroll.can-drag {
    cursor: grab;
}

.st-scroll.is-dragging,
.st-scroll.is-dragging * {
    cursor: grabbing !important;
    user-select: none;
}

/*
 * Sticky cells need "separate" borders: with collapsed borders Chrome lets the scrolled text
 * show through at their edges and the lines scroll away. Cells draw right + bottom lines only,
 * so a bordered table still looks like one thin grid.
 */
.st-scroll.st-on>table {
    border-collapse: separate;
    border-spacing: 0;
}

.st-scroll.st-on>table.table-bordered {
    border-width: 0 0 0 1px;
}

.st-scroll.st-on>table.table-bordered> :not(caption)>* {
    border-width: 0;
}

.st-scroll.st-on>table.table-bordered> :not(caption)>*>* {
    border-style: solid;
    border-width: 0 1px 1px 0;
}

.st-scroll.st-on>table.table-bordered>thead>tr:first-child>* {
    border-top-width: 1px;
}

/* ---------------------------------------------------- header row on top (fitted box only) */
.st-scroll.st-fit.st-on>table>thead>tr>th {
    position: sticky;
    top: 0;
    z-index: 3;
}

/* ---------------------------------------------------- sticky columns */
.st-scroll.st-on .st-start,
.st-scroll.st-on .st-end {
    position: sticky;
    z-index: 2;
}

.st-scroll.st-on .st-end {
    right: 0;
}

/* sticky header cells sit above the other header cells */
.st-scroll.st-on>table>thead>tr>th.st-start,
.st-scroll.st-on>table>thead>tr>th.st-end {
    z-index: 5;
}

/* an open Actions menu goes over the rows below it */
.st-scroll.st-on td.st-end.st-menu-open,
.st-scroll.st-on td.st-end:has(.dropdown-menu.show) {
    z-index: 6;
}

/* shadows while more of the table is hidden under the sticky columns */
.st-scroll.st-on .st-start-edge::after,
.st-scroll.st-on .st-end::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}

.st-scroll.st-on .st-start-edge::after {
    right: -10px;
    background: linear-gradient(to right, rgba(26, 34, 50, .14), rgba(26, 34, 50, 0));
}

.st-scroll.st-on .st-end::before {
    left: -10px;
    background: linear-gradient(to left, rgba(26, 34, 50, .14), rgba(26, 34, 50, 0));
}

.st-scroll.st-on.is-scrolled-start .st-start-edge::after,
.st-scroll.st-on.has-more-end .st-end::before {
    opacity: 1;
}

/* the Action column draws its own left line (cells only draw right lines) */
.st-scroll.st-on .st-end {
    background-image: linear-gradient(#dee2e6, #dee2e6);
    background-size: 1px 100%;
    background-repeat: no-repeat;
    background-position: left top;
}

/* phones: the page scrolls; keep the sticky cells under the fixed top bar and footer */
@media (max-width: 767.98px) {
    .st-scroll {
        z-index: 0;
    }
}