/* Estilos para o plugin Edit Order */

.edit-order-container {
    max-width: 100%;
    margin: 20px 0;
}

.edit-order-container h3 {
    color: #333;
    margin-bottom: 20px;
    border-bottom: 2px solid #e1e1e1;
    padding-bottom: 10px;
}

.edit-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #e1e1e1;
}

.edit-order-table th,
.edit-order-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.edit-order-table th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #333;
}

.edit-order-table tr:hover {
    background-color: #f9f9f9;
}

.product-name {
    width: 40%;
}

.product-quantity {
    width: 15%;
}

.product-quantity input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

.product-price {
    width: 15%;
    font-weight: 600;
}

.product-total {
    width: 15%;
    font-weight: 600;
}

.product-actions {
    width: 15%;
}

.remove-item-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.remove-item-btn:hover {
    background-color: #c82333;
}

.order-totals {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.order-totals h4 {
    margin-top: 0;
    color: #333;
}

.order-totals table {
    width: 100%;
    border-collapse: collapse;
}

.order-totals td {
    padding: 8px 0;
    border-bottom: 1px solid #e1e1e1;
}

.order-totals .order-total {
    border-top: 2px solid #333;
    font-size: 16px;
}

.order-totals .order-total td {
    border-bottom: none;
    padding-top: 15px;
}

.form-actions {
    text-align: right;
    margin-top: 20px;
}

.form-actions .button {
    margin-left: 10px;
}

.edit-order-btn {
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 10px;
}

.edit-order-btn:hover {
    background-color: #005a87;
    color: white;
}

/* Estilos para itens removidos */
.order-item.removed {
    opacity: 0.5;
    background-color: #f8d7da;
    text-decoration: line-through;
}

.order-item.removed .quantity-input {
    display: none;
}

.order-item.removed .remove-item-btn {
    display: none;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .edit-order-table {
        font-size: 14px;
    }
    
    .edit-order-table th,
    .edit-order-table td {
        padding: 8px;
    }
    
    .product-name {
        width: 35%;
    }
    
    .product-quantity {
        width: 20%;
    }
    
    .product-price,
    .product-total,
    .product-actions {
        width: 15%;
    }
    
    .form-actions {
        text-align: center;
    }
    
    .form-actions .button {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}

/* Mensagens de notificação */
.edit-order-message {
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
    font-weight: 500;
}

.edit-order-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.edit-order-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Botão de salvar com estado de loading */
#save-order-btn.loading {
    background-color: #6c757d;
    cursor: not-allowed;
}

#save-order-btn.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}
