/* ========================================================================== 
   ADVANCED ORDER MANAGER (AOM) CSS - START

   All rules in this section belong to AOM.  They are scoped to the
   .manual-order-page wrapper (or an AOM-specific element ID) so that this
   stylesheet cannot alter unrelated Phoenix administration or shop pages.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Page and card presentation
   -------------------------------------------------------------------------- */
.manual-order-page {
    padding: 1rem;
}

.manual-order-page .manual-order-page-heading {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: .85rem;
}

.manual-order-page .manual-order-page-heading h1 {
    color: #343a40;
}

.manual-order-page .manual-order-search-card,
.manual-order-page .card {
    border-color: #dee2e6;
}

.manual-order-page .manual-order-search-card .card-body {
    background: #fff;
}

.manual-order-page .manual-order-edit-hint {
    min-height: 38px;
    display: flex;
    align-items: center;
}

.manual-order-page .card-header h6 {
    letter-spacing: .01em;
}

.manual-order-page #customer-action-buttons .btn {
    font-size: .75rem;
}

.manual-order-page #selected-customer-details {
    background-color: #f8f9fa !important;
}

/* --------------------------------------------------------------------------
   Customer and delivery address controls
   -------------------------------------------------------------------------- */
.manual-order-page .manual-order-delivery-toggle {
    border-top: 1px solid #dee2e6;
    padding-top: .85rem;
}

.manual-order-page .manual-order-delivery-panel {
    margin-top: .5rem;
    padding: 0 .25rem .25rem;
}

/* Keep AOM disabled/autofilled fields readable without styling other pages. */
.manual-order-page input:disabled,
.manual-order-page select:disabled,
.manual-order-page input:-webkit-autofill,
.manual-order-page input:-webkit-autofill:hover,
.manual-order-page input:-webkit-autofill:focus,
.manual-order-page input:-webkit-autofill:active {
    background-color: #fff !important;
    -webkit-box-shadow: 0 0 0 30px #fff inset !important;
    -webkit-text-fill-color: #495057 !important;
    color: #495057 !important;
    border: 1px solid #ced4da !important;
    opacity: 1 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* --------------------------------------------------------------------------
   AOM search result dropdowns
   -------------------------------------------------------------------------- */
.manual-order-page #order-results-dropdown,
.manual-order-page #customer-results-dropdown,
.manual-order-page #product-results-dropdown,
.manual-order-page .manual-order-dropdown {
    z-index: 1050;
    max-height: 250px;
    overflow-y: auto;
}

/* --------------------------------------------------------------------------
   Products table - shared rules
   -------------------------------------------------------------------------- */
.manual-order-page #cart-table {
    width: 100%;
    table-layout: fixed;
}

.manual-order-page #cart-table thead th {
    background: #f8f9fa;
    color: #6c757d;
    font-size: .72rem !important;
    font-weight: 700;
    line-height: 1.15 !important;
    letter-spacing: .3px;
    padding: .55rem .35rem !important;
    vertical-align: middle;
}

.manual-order-page #cart-table tbody td {
    font-size: .78rem !important;
    padding: .4rem .3rem !important;
    vertical-align: middle;
}

.manual-order-page #cart-table .form-control-sm {
    height: 26px !important;
    padding: 2px 4px !important;
    font-size: 11px !important;
}

/* Remove number-input spinners inside the AOM products table only. */
.manual-order-page #cart-table input[type='number']::-webkit-outer-spin-button,
.manual-order-page #cart-table input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.manual-order-page #cart-table input[type='number'] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Add Order has nine columns, including Model. */
.manual-order-add-page #cart-table th:nth-child(1),
.manual-order-add-page #cart-table td:nth-child(1) { width: 27%; }
.manual-order-add-page #cart-table th:nth-child(2),
.manual-order-add-page #cart-table td:nth-child(2) { width: 9%; }
.manual-order-add-page #cart-table th:nth-child(3),
.manual-order-add-page #cart-table td:nth-child(3) { width: 7%; text-align: center; }
.manual-order-add-page #cart-table th:nth-child(4),
.manual-order-add-page #cart-table td:nth-child(4) { width: 7%; text-align: center; }
.manual-order-add-page #cart-table th:nth-child(5),
.manual-order-add-page #cart-table td:nth-child(5),
.manual-order-add-page #cart-table th:nth-child(6),
.manual-order-add-page #cart-table td:nth-child(6),
.manual-order-add-page #cart-table th:nth-child(7),
.manual-order-add-page #cart-table td:nth-child(7),
.manual-order-add-page #cart-table th:nth-child(8),
.manual-order-add-page #cart-table td:nth-child(8) { width: 11.5%; text-align: right; }
.manual-order-add-page #cart-table th:nth-child(9),
.manual-order-add-page #cart-table td:nth-child(9) { width: 4%; text-align: center; }

/* Edit Order has eight columns and no separate Model column. */
.manual-order-edit-page #cart-table th:nth-child(1),
.manual-order-edit-page #cart-table td:nth-child(1) { width: 30%; }
.manual-order-edit-page #cart-table th:nth-child(2),
.manual-order-edit-page #cart-table td:nth-child(2) { width: 8%; text-align: center; }
.manual-order-edit-page #cart-table th:nth-child(3),
.manual-order-edit-page #cart-table td:nth-child(3) { width: 8%; text-align: center; }
.manual-order-edit-page #cart-table th:nth-child(4),
.manual-order-edit-page #cart-table td:nth-child(4),
.manual-order-edit-page #cart-table th:nth-child(5),
.manual-order-edit-page #cart-table td:nth-child(5),
.manual-order-edit-page #cart-table th:nth-child(6),
.manual-order-edit-page #cart-table td:nth-child(6),
.manual-order-edit-page #cart-table th:nth-child(7),
.manual-order-edit-page #cart-table td:nth-child(7) { width: 12%; text-align: right; }
.manual-order-edit-page #cart-table th:nth-child(8),
.manual-order-edit-page #cart-table td:nth-child(8) { width: 6%; text-align: center; }

/* --------------------------------------------------------------------------
   Totals
   -------------------------------------------------------------------------- */
.manual-order-page .manual-order-totals table td {
    vertical-align: middle;
}

.manual-order-page .manual-order-totals table td:last-child {
    width: 48%;
}

/* --------------------------------------------------------------------------
   Order status history
   -------------------------------------------------------------------------- */
.manual-order-page .manual-order-status-history {
    border-color: #dee2e6;
}

.manual-order-page .manual-order-status-history .card-header .btn-link {
    color: inherit;
    box-shadow: none;
}

.manual-order-page .manual-order-status-history .manual-order-history-chevron {
    transition: transform .2s ease;
}

.manual-order-page .manual-order-status-history .card-header .btn-link:not(.collapsed) .manual-order-history-chevron {
    transform: rotate(180deg);
}

.manual-order-page #order-status-history-table {
    width: 100%;
    table-layout: fixed;
}

.manual-order-page #order-status-history-table th,
.manual-order-page #order-status-history-table td {
    padding: .42rem .5rem;
    font-size: .75rem;
    vertical-align: top;
}

.manual-order-page #order-status-history-table th {
    background: #f8f9fa;
    color: #6c757d;
    font-weight: 700;
}

.manual-order-page #order-status-history-table th:nth-child(1),
.manual-order-page #order-status-history-table td:nth-child(1) { width: 25%; }
.manual-order-page #order-status-history-table th:nth-child(2),
.manual-order-page #order-status-history-table td:nth-child(2) { width: 20%; }
.manual-order-page #order-status-history-table th:nth-child(3),
.manual-order-page #order-status-history-table td:nth-child(3) {
    width: 45%;
    white-space: normal;
    overflow-wrap: anywhere;
}
.manual-order-page #order-status-history-table th:nth-child(4),
.manual-order-page #order-status-history-table td:nth-child(4) { width: 10%; }

/* --------------------------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .manual-order-page {
        padding: .5rem;
    }
}

/* ========================================================================== 
   ADVANCED ORDER MANAGER (AOM) CSS - END
   ========================================================================== */
