/* One logical product row; retain Filament fields, validation and action handlers. */
.order-product-table {
    container-type: inline-size;
    --order-product-columns: minmax(0, 2fr) minmax(6.5rem, 1fr) minmax(0, 2fr) minmax(7.5rem, 1fr) minmax(7rem, 1fr);
    --order-product-actions: 3.5rem;
}
.order-product-table .order-product-column-headings { display: none; }
.order-product-table .product-table-repeater .fi-fo-repeater-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--order-product-actions);
    align-items: start;
    gap: .75rem;
    padding: .75rem 0 !important;
}
.order-product-table .product-table-repeater .fi-fo-repeater-item-header {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    gap: .5rem;
    overflow: visible;
    padding: 0 !important;
}
.order-product-table .product-table-repeater .fi-fo-repeater-item-header > ul {
    margin-inline: auto;
}
.order-product-table .product-table-repeater .fi-fo-repeater-item-content {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    border-top: 0 !important;
    padding: 0 !important;
}
.order-product-table .order-product-row-grid > .fi-fo-component-ctn {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 1rem !important;
    align-items: start;
}
.order-product-table .order-product-row-grid > .fi-fo-component-ctn > :not(.hidden) {
    grid-column: 1 / -1 !important;
    min-width: 0;
}
.order-product-table .order-product-row-grid > .fi-fo-component-ctn > :has(.order-product-price),
.order-product-table .order-product-row-grid > .fi-fo-component-ctn > :has(.order-product-total) {
    grid-column: auto !important;
}
.order-product-table .product-table-repeater .fi-fo-field-wrp > label.sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0 0 .25rem;
    overflow: visible;
    clip: auto;
    white-space: normal;
    font-size: .75rem;
    font-weight: 500;
}
.order-product-table .product-table-quantity .fi-input-wrp { max-width: 12rem; }
.order-product-table .product-table-repeater .fi-input,
.order-product-table .product-table-repeater .fi-select-input { font-size: .875rem; }
.order-product-table .order-product-notes textarea { min-height: 2.5rem; }
.order-product-table .order-product-total,
.order-product-table .order-product-total-heading {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.order-product-table .order-product-price .fi-fo-placeholder p {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.order-product-table .order-availability { font-size: .75rem; }
.order-product-table .order-availability summary { overflow-wrap: normal; }
@container (min-width: 850px) {
    .order-product-table .order-product-column-headings {
        display: block;
        padding-right: calc(var(--order-product-actions) + .75rem);
    }
    .order-product-table .order-product-heading-grid,
    .order-product-table .order-product-row-grid > .fi-fo-component-ctn {
        display: grid;
        grid-template-columns: var(--order-product-columns) !important;
        gap: 1rem !important;
        align-items: start;
    }
    .order-product-table .order-product-row-grid > .fi-fo-component-ctn > :not(.hidden) {
        grid-column: auto !important;
    }
    .order-product-table .product-table-repeater .fi-fo-field-wrp > label.sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
}
@media (pointer: coarse) {
    .order-product-table .fi-input,
    .order-product-table textarea { font-size: 1rem !important; }
    .order-product-table .fi-fo-repeater-item-header button { min-width: 44px; min-height: 44px; }
}

/* One main price row; VAT-inclusive amounts are secondary read-only captions. */
.order-product-table .order-product-price > .fi-fo-component-ctn,
.order-product-table .order-product-total > .fi-fo-component-ctn { gap: .25rem !important; }
.order-product-table .order-product-price .fi-fo-field-wrp-label,
.order-product-table .order-product-total .fi-fo-field-wrp-label { min-height: 2rem; font-size: .75rem; line-height: 1rem; }
.order-product-table .order-product-price .fi-fo-field-wrp-label > span,
.order-product-table .order-product-total .fi-fo-field-wrp-label > span { font-size: inherit; line-height: inherit; }
.order-product-table .order-product-net-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    background: #f9fafb;
    padding: .3125rem .75rem;
    line-height: 1.5rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.order-product-table .order-product-vat-caption {
    color: #b91c1c;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    white-space: normal;
    font-variant-numeric: tabular-nums;
}
.order-product-table .fi-fo-field-wrp:has(.product-table-quantity) .fi-fo-field-wrp-helper-text { font-size: .75rem; line-height: 1rem; }
@container (min-width: 850px) {
    .order-product-table .order-product-price .fi-fo-field-wrp > .grid > .flex,
    .order-product-table .order-product-total .fi-fo-field-wrp > .grid > .flex { display: none; }
    .order-product-table .order-product-total-heading { white-space: normal; }
}
