.aveo-customer-reorder-modal[hidden] {
    display: none;
}

.aveo-customer-reorder-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.aveo-customer-reorder-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.aveo-customer-reorder-modal__dialog {
    position: relative;
    box-sizing: border-box;
    width: min(720px, calc(100% - 32px));
    max-height: calc(100vh - 64px);
    overflow: auto;
    margin: 6vh auto 0;
    padding: 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.aveo-customer-reorder-modal__dialog h2 {
    margin-top: 0;
}

.aveo-customer-reorder-modal__dialog h3 {
    margin: 18px 0 8px;
}

.aveo-customer-reorder-products {
    overflow-x: auto;
}

.aveo-customer-reorder-select-all {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    margin: 0 0 8px;
    font-weight: 600;
}

.aveo-customer-reorder-select-all input {
    margin: 0;
    transform: translateY(1px);
}

.aveo-customer-reorder-products-table {
    width: 100%;
    margin: 0;
}

.aveo-customer-reorder-products-table th,
.aveo-customer-reorder-products-table td {
    vertical-align: middle;
}

.aveo-customer-reorder-products-table__total,
.aveo-customer-reorder-products-table__quantity,
.aveo-customer-reorder-products-table__stock,
.aveo-customer-reorder-product__quantity-cell,
.aveo-customer-reorder-product__stock,
.aveo-customer-reorder-product__line-total,
.aveo-customer-reorder-products-table tfoot th,
.aveo-customer-reorder-products-table tfoot td {
    text-align: right;
    white-space: nowrap;
}

.aveo-customer-reorder-products-table tfoot th {
    text-align: left;
}

.aveo-customer-reorder-products-table tfoot td {
    font-weight: 700;
}

.aveo-customer-reorder-product__product {
    min-width: 0;
}

.aveo-customer-reorder-product__select {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    margin: 0;
    max-width: 100%;
}

.aveo-customer-reorder-product__select input {
    margin: 0;
    transform: translateY(1px);
}

.aveo-customer-reorder-product__name {
    font-weight: 600;
    line-height: 1.35;
}

.aveo-customer-reorder-product__quantity-control {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    line-height: 1.35;
    white-space: nowrap;
}

.aveo-customer-reorder-product__line-total {
    font-weight: 700;
    white-space: nowrap;
}

.aveo-customer-reorder-product__stock {
    white-space: nowrap;
}

.aveo-customer-reorder-stock-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #edf7ed;
    color: #1b5e20;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.aveo-customer-reorder-stock-badge.is-low-stock {
    background: #fff4e5;
    color: #8a4b00;
}

.aveo-customer-reorder-stock-badge.is-out-of-stock {
    background: #fcf0f1;
    color: #8a2424;
}

.aveo-customer-reorder-product__quantity-control span {
    color: #555;
}

.aveo-customer-reorder-products-table .aveo-customer-reorder-product__quantity-control input[type="number"] {
    box-sizing: border-box;
    margin: 0;
    max-width: 48px;
    min-width: 0;
    padding-left: 2px;
    padding-right: 2px;
    text-align: center;
    width: 48px;
}

.aveo-customer-reorder-addresses {
    display: grid;
    gap: 8px;
}

.aveo-customer-reorder-address-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
}

.aveo-customer-reorder-address-option input[type="checkbox"] {
    margin: 0;
    transform: translateY(1px);
}

.aveo-customer-reorder-address-option > span {
    line-height: 1.35;
}

.aveo-customer-reorder-address-option small {
    grid-column: 2;
    color: #555;
    white-space: pre-line;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.aveo-customer-reorder-error {
    padding: 10px;
    border-left: 4px solid #b32d2e;
    background: #fcf0f1;
    color: #8a2424;
}

.aveo-customer-reorder-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 600px) {
    .aveo-customer-reorder-products-table thead {
        display: none;
    }

    .aveo-customer-reorder-products-table,
    .aveo-customer-reorder-products-table tbody,
    .aveo-customer-reorder-products-table tfoot,
    .aveo-customer-reorder-products-table tr,
    .aveo-customer-reorder-products-table th,
    .aveo-customer-reorder-products-table td {
        display: block;
        width: 100%;
    }

    .aveo-customer-reorder-products-table tr {
        border-bottom: 1px solid #e2e2e2;
    }

    .aveo-customer-reorder-product__line-total {
        text-align: left;
        padding-top: 0;
    }

    .aveo-customer-reorder-product__quantity-cell {
        text-align: left;
    }

    .aveo-customer-reorder-product__stock {
        text-align: left;
    }

    .aveo-customer-reorder-product__quantity-control {
        display: flex;
        justify-content: flex-start;
        margin: 0;
    }

    .aveo-customer-reorder-product__line-total::before {
        content: attr(data-title) ": ";
        color: #555;
        font-weight: 400;
    }

    .aveo-customer-reorder-product__quantity-cell::before {
        content: attr(data-title) ": ";
        color: #555;
        font-weight: 400;
    }

    .aveo-customer-reorder-product__stock::before {
        content: attr(data-title) ": ";
        color: #555;
        font-weight: 400;
    }

    .aveo-customer-reorder-products-table tfoot th,
    .aveo-customer-reorder-products-table tfoot td {
        text-align: left;
    }

    .aveo-customer-reorder-products-table tfoot td {
        font-weight: 700;
    }
}
