/* Readonly Orders CSS for FinalPOS
 * Styling for readonly order indicators and disabling edit functionality
 */

.finalpos-readonly-badge {
    display: inline-block;
    color: #dc3545;
    font-size: 12px;
    margin-left: 10px;
    font-weight: 500;
}

.finalpos-readonly-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 10px 0;
}

.finalpos-readonly-message {
    margin: 0;
    color: #856404;
}

/* Only apply readonly styles to specific order pages that have the readonly-order class */
body.post-type-shop_order.readonly-order .wc-order-items-editable,
body.woocommerce_page_wc-orders.readonly-order .wc-order-items-editable,
body.post-type-shop_order.readonly-order .wc-order-meta-boxes,
body.woocommerce_page_wc-orders.readonly-order .wc-order-meta-boxes {
    position: relative;
}

body.post-type-shop_order.readonly-order .wc-order-items-editable::after,
body.woocommerce_page_wc-orders.readonly-order .wc-order-items-editable::after,
body.post-type-shop_order.readonly-order .wc-order-meta-boxes::after,
body.woocommerce_page_wc-orders.readonly-order .wc-order-meta-boxes::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 100;
    pointer-events: auto;
}

/* Disable form inputs - only on readonly order pages */
body.post-type-shop_order.readonly-order input, 
body.woocommerce_page_wc-orders.readonly-order input,
body.post-type-shop_order.readonly-order textarea, 
body.woocommerce_page_wc-orders.readonly-order textarea,
body.post-type-shop_order.readonly-order select,
body.woocommerce_page_wc-orders.readonly-order select,
body.post-type-shop_order.readonly-order button,
body.woocommerce_page_wc-orders.readonly-order button,
body.post-type-shop_order.readonly-order .button,
body.woocommerce_page_wc-orders.readonly-order .button {
    opacity: 0.5 !important;
    pointer-events: none !important;
}

/* Disable links and buttons - only on readonly order pages */
body.post-type-shop_order.readonly-order a.edit_address,
body.woocommerce_page_wc-orders.readonly-order a.edit_address,
body.post-type-shop_order.readonly-order a.button,
body.woocommerce_page_wc-orders.readonly-order a.button,
body.post-type-shop_order.readonly-order .add-items,
body.woocommerce_page_wc-orders.readonly-order .add-items,
body.post-type-shop_order.readonly-order .add-line-item,
body.woocommerce_page_wc-orders.readonly-order .add-line-item {
    opacity: 0.5 !important;
    pointer-events: none !important;
}

/* Disable action buttons - only on readonly order pages */
body.post-type-shop_order.readonly-order .wc-order-data-row button,
body.woocommerce_page_wc-orders.readonly-order .wc-order-data-row button,
body.post-type-shop_order.readonly-order #woocommerce-order-action .inside .save_order,
body.woocommerce_page_wc-orders.readonly-order #woocommerce-order-action .inside .save_order {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
} 