/* Bulk pricing matrix — aligned with order-matrix table patterns. */

.bulk-pricing {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bulk-pricing-intro-card {
    padding: 0.875rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--gray-50) 80%, transparent);
}

.dark .bulk-pricing-intro-card {
    border-color: color-mix(in srgb, #fff 10%, transparent);
    background: color-mix(in srgb, #fff 3%, transparent);
}

.bulk-pricing-intro {
    margin: 0;
    color: var(--gray-600);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.dark .bulk-pricing-intro {
    color: var(--gray-400);
}

/* ── Percent inputs in price column headers ──────────────────── */

.bulk-pricing-th-category {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--gray-700);
}

.dark .bulk-pricing-th-category {
    color: var(--gray-200);
}

.bulk-pricing-th--price {
    text-align: center;
    vertical-align: bottom;
}

.bulk-pricing-percent-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.bulk-pricing-percent-label {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.dark .bulk-pricing-percent-label {
    color: var(--gray-400);
}

.bulk-pricing-percent-input-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.bulk-pricing-percent-input {
    width: 4.5rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
    background: #fff;
    color: var(--gray-950);
}

.bulk-pricing-percent-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-500) 25%, transparent);
}

.dark .bulk-pricing-percent-input {
    border-color: var(--gray-600);
    background: var(--gray-950);
    color: #fff;
}

.bulk-pricing-percent-suffix {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-500);
}

/* ── Scrollable table ────────────────────────────────────────── */

.bulk-pricing-scroll {
    overflow: auto;
    max-height: calc(100vh - 16rem);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    background: #fff;
}

.dark .bulk-pricing-scroll {
    border-color: color-mix(in srgb, #fff 10%, transparent);
    background: var(--gray-900);
}

.bulk-pricing-table {
    width: 100%;
    min-width: 52rem;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.bulk-pricing-table thead tr {
    border-block-end: 2px solid var(--gray-200);
    background: color-mix(in srgb, var(--gray-50) 90%, transparent);
}

.dark .bulk-pricing-table thead tr {
    border-block-end-color: color-mix(in srgb, #fff 12%, transparent);
    background: color-mix(in srgb, #fff 4%, transparent);
}

.bulk-pricing-th {
    padding: 0.75rem 0.875rem;
    text-align: start;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--gray-500);
    vertical-align: bottom;
}

.dark .bulk-pricing-th {
    color: var(--gray-400);
}

.bulk-pricing-th--product {
    width: 14rem;
}

.bulk-pricing-th--code {
    width: 7rem;
}

.bulk-pricing-th--family {
    width: 11rem;
}

.bulk-pricing-th--option {
    width: 6.5rem;
}

.bulk-pricing-th--price {
    width: 9.5rem;
}

/* Sticky header row */
.bulk-pricing-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: color-mix(in srgb, var(--gray-50) 90%, transparent);
}

.dark .bulk-pricing-table thead th {
    background: color-mix(in srgb, #fff 4%, transparent);
}

/* Sticky first column only */
.bulk-pricing-table .bulk-pricing-th--product,
.bulk-pricing-table .bulk-pricing-td--product {
    position: sticky;
    inset-inline-start: 0;
    z-index: 2;
}

.bulk-pricing-table thead .bulk-pricing-th--product {
    z-index: 4;
}

.bulk-pricing-table tbody .bulk-pricing-td--product {
    background: #fff;
    box-shadow: 1px 0 0 var(--gray-200);
}

.dark .bulk-pricing-table tbody .bulk-pricing-td--product {
    background: var(--gray-900);
    box-shadow: 1px 0 0 color-mix(in srgb, #fff 10%, transparent);
}

/* Divider between product metadata and price columns */
.bulk-pricing-th--price,
.bulk-pricing-td--price {
    border-inline-start: 2px solid var(--gray-200);
}

.dark .bulk-pricing-th--price,
.dark .bulk-pricing-td--price {
    border-inline-start-color: color-mix(in srgb, #fff 12%, transparent);
}

.bulk-pricing-row {
    border-block-start: 1px solid var(--gray-100);
    background: #fff;
    transition: background-color 75ms;
}

.bulk-pricing-row:nth-child(even) {
    background: color-mix(in srgb, var(--gray-50) 45%, transparent);
}

.dark .bulk-pricing-row {
    border-block-start-color: color-mix(in srgb, #fff 5%, transparent);
    background: var(--gray-900);
}

.dark .bulk-pricing-row:nth-child(even) {
    background: color-mix(in srgb, #fff 2%, transparent);
}

.bulk-pricing-row:hover {
    background: color-mix(in srgb, var(--primary-50) 55%, transparent);
}

.dark .bulk-pricing-row:hover {
    background: color-mix(in srgb, var(--primary-500) 8%, transparent);
}

.bulk-pricing-row:hover .bulk-pricing-td--product {
    background: inherit;
}

.bulk-pricing-td {
    padding: 0.65rem 0.875rem;
    vertical-align: top;
    line-height: 1.35;
    color: var(--gray-700);
    word-wrap: break-word;
}

.dark .bulk-pricing-td {
    color: var(--gray-300);
}

.bulk-pricing-product-name {
    font-weight: 500;
    color: var(--gray-950);
}

.dark .bulk-pricing-product-name {
    color: #fff;
}

.bulk-pricing-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.dark .bulk-pricing-code {
    color: var(--gray-400);
}

.bulk-pricing-empty {
    display: block;
    text-align: center;
    color: var(--gray-400);
}

/* ── Price cells ─────────────────────────────────────────────── */

.bulk-pricing-price-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.bulk-pricing-price-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
}

.bulk-pricing-price-row--original {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.dark .bulk-pricing-price-row--original {
    background: color-mix(in srgb, #fff 6%, transparent);
    border-color: color-mix(in srgb, #fff 10%, transparent);
}

.bulk-pricing-price-row--new.bulk-pricing-price-row--increase {
    background: #dcfce7;
    border-color: #86efac;
}

.dark .bulk-pricing-price-row--new.bulk-pricing-price-row--increase {
    background: color-mix(in srgb, #22c55e 18%, transparent);
    border-color: color-mix(in srgb, #4ade80 35%, transparent);
}

.bulk-pricing-price-row--new.bulk-pricing-price-row--decrease {
    background: #fee2e2;
    border-color: #fca5a5;
}

.dark .bulk-pricing-price-row--new.bulk-pricing-price-row--decrease {
    background: color-mix(in srgb, #ef4444 18%, transparent);
    border-color: color-mix(in srgb, #f87171 35%, transparent);
}

.bulk-pricing-price-row--new.bulk-pricing-price-row--unchanged {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.dark .bulk-pricing-price-row--new.bulk-pricing-price-row--unchanged {
    background: color-mix(in srgb, #fff 6%, transparent);
    border-color: color-mix(in srgb, #fff 12%, transparent);
}

.bulk-pricing-price-tag {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bulk-pricing-price-row--original .bulk-pricing-price-tag {
    color: #6b7280;
}

.dark .bulk-pricing-price-row--original .bulk-pricing-price-tag {
    color: #9ca3af;
}

.bulk-pricing-price-row--original .bulk-pricing-price-value {
    color: #4b5563;
    font-size: 0.8125rem;
}

.dark .bulk-pricing-price-row--original .bulk-pricing-price-value {
    color: #d1d5db;
}

.bulk-pricing-price-row--increase .bulk-pricing-price-tag,
.bulk-pricing-price-row--increase .bulk-pricing-price-value {
    color: #15803d;
}

.dark .bulk-pricing-price-row--increase .bulk-pricing-price-tag,
.dark .bulk-pricing-price-row--increase .bulk-pricing-price-value {
    color: #4ade80;
}

.bulk-pricing-price-row--decrease .bulk-pricing-price-tag,
.bulk-pricing-price-row--decrease .bulk-pricing-price-value {
    color: #b91c1c;
}

.dark .bulk-pricing-price-row--decrease .bulk-pricing-price-tag,
.dark .bulk-pricing-price-row--decrease .bulk-pricing-price-value {
    color: #f87171;
}

.bulk-pricing-price-row--unchanged .bulk-pricing-price-tag,
.bulk-pricing-price-row--unchanged .bulk-pricing-price-value {
    color: #4b5563;
}

.dark .bulk-pricing-price-row--unchanged .bulk-pricing-price-tag,
.dark .bulk-pricing-price-row--unchanged .bulk-pricing-price-value {
    color: #d1d5db;
}

.bulk-pricing-price-value {
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
