/* WooCommerce Product Sync - Table Styles */
:root {
    --wps-dark: #272D3D;
    --wps-gold: #F0B110;
    --wps-white: #ffffff;
    --wps-dark-80: rgba(39, 45, 61, 0.08);
    --wps-dark-border: rgba(39, 45, 61, 0.12);
    --wps-gold-light: rgba(240, 177, 16, 0.12);
    --wps-text: #272D3D;
    --wps-text-muted: #6b7280;
    --wps-bg-light: #f9fafb;
}

.wps-product-table-wrapper {
    margin: 30px 0;
    font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-weight: 500;
    color: var(--wps-text);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(39, 45, 61, 0.08);
}

/* ── Filters ── */
.wps-filters {
    margin-bottom: 0;
    padding: 20px 24px;
    background: var(--wps-dark);
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.wps-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.wps-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wps-filter-item label {
    font-weight: 700;
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wps-filter-item.wps-filter-button {
    justify-content: flex-end;
}

.wps-search-input {
    padding: 9px 14px;
    border: 1.5px solid var(--wps-dark-border);
    border-radius: 8px;
    font-size: 14px;
    width: 260px;
    max-width: 100%;
    background: var(--wps-bg-light);
    color: var(--wps-text);
    transition: all 0.2s ease;
}

.wps-category-select {
    padding: 9px 14px;
    border: 1.5px solid var(--wps-dark-border);
    border-radius: 8px;
    font-size: 14px;
    min-width: 180px;
    background: var(--wps-bg-light);
    color: var(--wps-text);
    transition: all 0.2s ease;
    cursor: pointer;
}

.wps-search-input:focus,
.wps-category-select:focus {
    outline: none;
    border-color: var(--wps-gold);
    background: var(--wps-white);
    box-shadow: 0 0 0 3px var(--wps-gold-light);
}

.wps-clear-filters {
    background: transparent;
    color: var(--wps-white);
    border: 1.5px solid rgba(255,255,255,0.25);
}

.wps-clear-filters:hover {
    background: var(--wps-gold);
    color: var(--wps-dark);
    border-color: var(--wps-gold);
    font-weight: 700;
}

/* ── Category Sections ── */
.wps-category-section {
    margin-bottom: 36px;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.wps-category-title {
    padding: 14px 20px;
    background: var(--wps-dark);
    color: var(--wps-white);
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wps-category-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--wps-gold);
    border-radius: 2px;
    flex-shrink: 0;
}

.wps-category-title .wps-category-count {
    font-weight: 400;
    font-size: 13px;
    color: var(--wps-gold);
    margin-left: auto;
    background: rgba(240, 177, 16, 0.15);
    padding: 2px 10px;
    border-radius: 20px;
}

/* ── Product Table ── */
.wps-product-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--wps-white);
    border: none;
}

.wps-category-section .wps-product-table {
    border-top: none;
    border-radius: 0 0 12px 12px;
}

/* ── Table Head ── */
.wps-product-table thead tr {
    background: var(--wps-bg-light);
    border-bottom: 2px solid var(--wps-dark-border);
}

.wps-product-table th {
    padding: 13px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    color: var(--wps-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    position: relative;
    border-bottom: 2px solid var(--wps-dark-border);
}

.wps-product-table th.wps-sortable {
    cursor: pointer;
    user-select: none;
    padding-right: 32px;
    transition: all 0.15s ease;
}

.wps-product-table th.wps-sortable:hover {
    background: var(--wps-gold-light);
    color: var(--wps-dark);
}

.wps-sort-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 11px;
    transition: color 0.15s ease;
}

.wps-sort-icon::after {
    content: '⇅';
}

th.wps-sorted-asc .wps-sort-icon::after {
    content: '↑';
    color: var(--wps-gold);
}

th.wps-sorted-desc .wps-sort-icon::after {
    content: '↓';
    color: var(--wps-gold);
}

th.wps-sorted-asc,
th.wps-sorted-desc {
    color: var(--wps-dark);
    background: var(--wps-gold-light);
}

/* ── Table Body ── */
.wps-product-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--wps-dark-border);
    color: var(--wps-text);
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.5;
}

.wps-product-table tbody tr {
    transition: background 0.15s ease;
}

.wps-product-table tbody tr:hover {
    background: var(--wps-gold-light);
}

.wps-product-table tbody tr:last-child td {
    border-bottom: none;
}

/* Zebra stripe - subtle */
.wps-product-table tbody tr:nth-child(even) {
    background: var(--wps-bg-light);
}

.wps-product-table tbody tr:nth-child(even):hover {
    background: var(--wps-gold-light);
}

.wps-product-table a {
    color: var(--wps-dark);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1.5px solid var(--wps-gold);
    padding-bottom: 1px;
    transition: all 0.15s ease;
}

.wps-product-table a:hover {
    color: var(--wps-gold);
    border-bottom-color: transparent;
}

/* ── Stock Status Pills ── */
.wps-in-stock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #166534;
    background: #dcfce7;
    font-weight: 600;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.wps-in-stock::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #16a34a;
    border-radius: 50%;
    display: inline-block;
}

.wps-out-of-stock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #991b1b;
    background: #fee2e2;
    font-weight: 600;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.wps-out-of-stock::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #dc2626;
    border-radius: 50%;
    display: inline-block;
}

/* ── Table Footer ── */
.wps-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--wps-dark);
    border-radius: 0;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: -1px;
}

.wps-product-count {
    color: rgba(255,255,255,0.6);
}

.wps-product-count span {
    color: var(--wps-gold);
    font-weight: 700;
}

.wps-last-sync {
    font-style: italic;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
}

/* ── No Products ── */
.wps-no-products {
    padding: 60px 40px;
    text-align: center;
    background: var(--wps-white);
    border-radius: 12px;
    color: var(--wps-text-muted);
    border: 2px dashed var(--wps-dark-border);
    font-size: 15px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .wps-product-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wps-product-table {
        min-width: 600px;
    }

    .wps-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .wps-filter-item {
        width: 100%;
    }

    .wps-search-input,
    .wps-category-select {
        width: 100%;
        box-sizing: border-box;
    }

    .wps-table-footer {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        border-radius: 0 0 12px 12px;
    }

    .wps-category-title {
        font-size: 14px;
    }
}

/* ── Print ── */
@media print {
    .wps-filters,
    .wps-clear-filters {
        display: none;
    }

    .wps-product-table {
        box-shadow: none;
    }

    .wps-category-title {
        background: var(--wps-dark) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}