/**
 * Product Selector Modal - Table View
 * Clean table layout matching catalog table style
 */

/* Table container */
.product-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table base */
.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

/* Header */
.product-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--bg-tertiary);
}

.product-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.product-table th:first-child {
    padding-left: 16px;
}

.product-table th:last-child {
    padding-right: 16px;
}

/* Rows */
.product-table tbody tr {
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s;
}

.product-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.product-table tbody tr:hover .col-name__model {
    color: var(--accent);
}

.product-table tbody tr:hover .col-image img {
    transform: scale(1.05);
}

.product-table tbody tr:hover .product-table__favorite {
    opacity: 1;
}

/* Cells */
.product-table td {
    padding: 10px 12px;
    vertical-align: middle;
    color: var(--text-secondary);
}

.product-table td:first-child {
    padding-left: 16px;
}

.product-table td:last-child {
    padding-right: 16px;
}

/* Image column */
.col-image {
    width: 56px;
}

.col-image img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    background-color: #fff;
    border-radius: 6px;
    display: block;
    transition: transform 0.2s;
}

.light .col-image img {
    border: 1px solid var(--border);
}

/* Name column */
.col-name {
    min-width: 180px;
}

.col-name__brand {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    line-height: 1.2;
}

.col-name__model {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
    transition: color 0.15s;
}

/* Spec columns */
.col-spec {
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Price column */
.col-price {
    white-space: nowrap;
    font-weight: 600;
    color: var(--accent);
    font-size: 0.875rem;
}

.col-price--unavailable {
    color: var(--text-muted);
    font-weight: 500;
}

/* Stock column */
.col-stock {
    white-space: nowrap;
    font-size: 0.75rem;
}

.col-stock__in {
    color: var(--success);
}

.col-stock__out {
    color: var(--text-muted);
}

.col-stock__unavailable {
    color: var(--error, #f87171);
}

/* Action column */
.col-action {
    white-space: nowrap;
    text-align: right;
    width: 140px;
}

.col-action__inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Favorite button in table */
.product-table__favorite {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-table__favorite:hover {
    color: var(--error, #f87171);
}

.product-table__favorite.is-favorite {
    opacity: 1;
    color: var(--error, #f87171);
}

/* Add button in table */
.product-table__btn-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background-color: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.product-table__btn-add:hover {
    opacity: 0.85;
}

/* Empty state row */
.product-table__empty td {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
}
