/* ============================================================
   Quick Edit Table — Google Sheets-inspired Design
   ============================================================ */

/* Section wrapper */
.quick-edit-section-wrapper {
    background: #fff !important;
    -webkit-box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.15);
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.15);
    border-radius: 4px;
    margin: 24px 0;
}

div#quick-edit-section {
    padding: 20px 16px;
    background: #fff;
}

/* Scrollable wrapper — always horizontal-scroll on overflow */
div.pssg-quick-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    height: 1000px;
}

/* ---- Base table ---- */
.pssg-quick-edit-table {
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #202124;
    background: #fff;
    min-width: 100%;
    table-layout: auto;
}

.pssg-quick-edit-table tr td,
.pssg-quick-edit-table tr th {
    border: 1px solid #e0e0e0;
    padding: 4px 8px !important;
    white-space: nowrap;
    vertical-align: middle;
    background: #fff;
    line-height: 1.5;
    min-height: 26px;
}

/* ---- Header row (row-num-0 / type-Type) ---- */
.pssg-quick-edit-table tr.type-Type td,
.pssg-quick-edit-table tr.row-num-0 td {
    background: #f8f9fa !important;
    color: #202124 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    border: 1px solid #c7c7c7 !important;
    border-bottom: 2px solid #bdbdbd !important;
    padding: 6px 8px !important;
    user-select: none;
    text-align: left;
}

/* ---- Frozen first row (all screen sizes) ---- */
.pssg-quick-edit-table tr.type-Type,
.pssg-quick-edit-table tr.row-num-0,
.pssg-quick-edit-table tr.type-Type td,
.pssg-quick-edit-table tr.row-num-0 td {
    position: sticky;
    top: 0;
    z-index: 3;
}

/* ---- Product type rows ---- */
.pssg-quick-edit-table tr.type-simple td {
    background: #fff;
    color: #202124;
}

.pssg-quick-edit-table tr.type-variable td {
    background: #fafafa;
    color: #1a1a1a;
    font-weight: 600;
}

.pssg-quick-edit-table tr.type-variation td {
    background: #fff;
    color: #5f6368;
    font-style: italic;
}

/* Subtle alternating rows */
.pssg-quick-edit-table tr.pssg-quick-table-tr:nth-child(even) td {
    background: #f8f9fa;
}
.pssg-quick-edit-table tr.pssg-quick-table-tr:nth-child(even).type-variable td {
    background: #f0f0f0;
}

/* ---- Non-editable cells ---- */
.pssg-quick-edit-table tr td[contenteditable="false"] {
    background: #f1f3f4 !important;
    color: #80868b !important;
    cursor: default;
}

/* ---- Currently editing row (AJAX in progress) ---- */
.pssg-quick-edit-table tr.editing-row td,
.pssg-quick-edit-table tr.editing-row {
    background: #fff8e1 !important;
    border-top: 1px solid #f9a825 !important;
    border-bottom: 1px solid #f9a825 !important;
    color: #5d4037 !important;
    outline: none;
}

/* ---- Successfully saved row ---- */
.pssg-quick-edit-table tr.product-edited td,
.pssg-quick-edit-table tr.product-edited {
    background: #e6f4ea !important;
    border-top: 1px solid #81c995 !important;
    border-bottom: 1px solid #81c995 !important;
    color: #1e4620 !important;
}

/* ---- Focus / active cell highlight ---- */
.pssg-quick-edit-table td[contenteditable="true"]:focus {
    outline: 2px solid #1a73e8;
    outline-offset: -2px;
    background: #e8f0fe !important;
    position: relative;
    z-index: 1;
}

/* ---- Stock colour badges ---- */
.pssg-quick-table-tr.stock-In-stock td.cell-stock {
    color: #188038;
    font-weight: 600;
}
.pssg-quick-table-tr.stock-Out-of-stock td.cell-stock {
    color: #d93025;
    font-weight: 600;
}

/* ---- Fixed-width utility columns ---- */
.pssg-quick-edit-table tr td.cell-ID {
    width: 46px;
    min-width: 46px;
    text-align: center;
}
.pssg-quick-edit-table tr td.cell-type {
    width: 68px;
    min-width: 68px;
}
.cell-_thumbnail,
.cell-_thumbnail:active,
.cell-_thumbnail:focus,
.each-cell{
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.each-cell:focus,
.each-cell:active{
    overflow: visible;
    white-space: normal;
    z-index: 10;
    position: relative;
}

/* ---- Description / Short Description — capped width ---- */
.pssg-quick-edit-table tr td.cell-description,
.pssg-quick-edit-table tr td.cell-short_description,
.pssg-quick-edit-table tr td.cell-post_content,
.pssg-quick-edit-table tr td.cell-post_excerpt {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pssg-quick-edit-table tr td.cell-description:focus,
.pssg-quick-edit-table tr td.cell-short_description:focus,
.pssg-quick-edit-table tr td.cell-post_content:focus,
.pssg-quick-edit-table tr td.cell-post_excerpt:focus,
.pssg-quick-edit-table tr td.cell-description:active,
.pssg-quick-edit-table tr td.cell-short_description:active,
.pssg-quick-edit-table tr td.cell-post_content:active,
.pssg-quick-edit-table tr td.cell-post_excerpt:active {
    overflow: visible;
    white-space: normal;
    z-index: 10;
    position: relative;
}

/* ---- Pagination ---- */
.pssg-pagination-wrapper {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 10px 0;
}

.pssg-pagination-wrapper .page-numbers,
.pssg-pagination-wrapper span.page-numbers,
.pssg-pagination-wrapper span,
.pssg-pagination-wrapper a,
.pssg-pagination-wrapper a.page-numbers {
    color: #1a73e8;
    display: inline-block;
    padding: 5px 12px;
    text-decoration: none;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    transition: background-color 0.2s, color 0.2s;
    float: none;
}

.pssg-pagination-wrapper .page-numbers:hover,
.pssg-pagination-wrapper a.page-numbers:hover {
    background: #f1f3f4;
    color: #1558b0;
    border-color: #dadce0;
}

.pssg-pagination-wrapper span.page-numbers.current,
.pssg-pagination-wrapper span.current {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

/* ---- Error message ---- */
p.pssg-error.pssg-limit-crossed {
    color: #d93025;
    font-size: 16px;
    font-weight: 600;
    margin: 8px 0;
}

/* ---- Frozen first two columns ---- */
.pssg-quick-edit-table td.col-0 {
    position: sticky;
    left: 0;
    z-index: 2;
}
.pssg-quick-edit-table td.col-1 {
    position: sticky;
    left: var(--pssg-col0-width, 62px);
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.10);
}
/* Corner cells (frozen row + frozen column) need the highest z-index */
.pssg-quick-edit-table tr.row-num-0 td.col-0,
.pssg-quick-edit-table tr.row-num-0 td.col-1,
.pssg-quick-edit-table tr.type-Type td.col-0,
.pssg-quick-edit-table tr.type-Type td.col-1 {
    z-index: 5;
}

/* Other some setting and fixing width  */
.cell-_product_category{
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-_product_category:hover,
.cell-_product_category:active,
.cell-_product_category:focus{
    overflow: visible;
    white-space: normal;
    z-index: 10;
    position: relative;
}
td.each-cell.cell-_thumbnail,
.cell-_thumbnail,
.pssg-quick-table-tr .cell-_thumbnail,
.pssg-quick-table-tr .cell-_thumbnail:active,
.pssg-quick-table-tr .cell-_thumbnail:focus{
    /* width: 60px; */
    max-width: fit-content;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
td.each-cell.col-2.cell-_thumbnail {
    text-align: center;
    max-width: fit-content;
}