/* Styles pour les détails de commande - Version professionnelle TTC */

/* Règle de surcharge pour neutraliser les styles forcés */
html body .woocommerce-order-details table.woocommerce-table thead th:last-child,
html body .woocommerce-table--order-details thead th:last-child,
html body .shop_table.order_details thead th:last-child,
html body .woocommerce-table--order-details .woocommerce-table__product-total {
    text-align: right !important;
}

/* Tableau principal des détails de commande */
.woocommerce-table--order-details {
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* En-tête du tableau */
.woocommerce-table--order-details thead th {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 16px;
    font-weight: 600;
    text-align: left;
    border: none;
}

/* Surcharge spécifique pour la colonne Total TTC avec très haute spécificité */
html body .woocommerce-order-details .woocommerce-table--order-details thead th:last-child,
html body .woocommerce-order-details .woocommerce-table--order-details thead th.woocommerce-table__product-total,
html body .woocommerce-order-details table thead th:last-child,
.woocommerce-table--order-details thead th:last-child {
    text-align: right !important;
}

/* Lignes du corps du tableau */
.woocommerce-table--order-details tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.woocommerce-table--order-details tbody tr:hover {
    background-color: #f9fafb;
}

.woocommerce-table--order-details tbody tr:last-child {
    border-bottom: none;
}

/* Cellules du corps */
.woocommerce-table--order-details tbody td {
    padding: 16px;
    vertical-align: top;
    border: none;
}

.woocommerce-table--order-details tbody td.product-total {
    text-align: right;
    font-weight: 600;
    color: #059669;
}

/* Nom du produit */
.woocommerce-table__product-name a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.woocommerce-table__product-name a:hover {
    color: #6366f1;
    text-decoration: underline;
}

/* Quantité */
.product-quantity {
    color: #6b7280;
    font-weight: 500;
    margin-left: 8px;
}

/* Métadonnées des produits */
.wc-item-meta {
    margin: 8px 0 0 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: #6b7280;
}

.wc-item-meta li {
    margin: 4px 0;
    padding: 0;
}

.wc-item-meta-label {
    font-weight: 600;
    color: #374151;
}

/* Pied de tableau - Totaux */
.woocommerce-table--order-details tfoot {
    background-color: #f9fafb;
    border-top: 2px solid #e5e7eb;
}

.woocommerce-table--order-details tfoot th {
    padding: 12px 16px;
    font-weight: 600;
    color: #374151;
    text-align: left;
    border: none;
    border-bottom: 1px solid #e5e7eb;
}

.woocommerce-table--order-details tfoot td {
    padding: 12px 16px;
    text-align: right;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 500;
}

/* Ligne TVA */
.order-tax th {
    color: #6b7280;
    font-style: italic;
}

.order-tax td {
    color: #6b7280;
    font-style: italic;
}

/* Ligne Total TTC - Mise en évidence */
.order-total {
    background-color: #f0f9ff !important;
}

.order-total th {
    color: #1e40af !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

.order-total td {
    color: #1e40af !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

.order-total td strong {
    color: #1e40af;
}

/* Actions de commande */
.order-actions--heading {
    background-color: #f3f4f6;
    color: #374151;
}

.order-actions-button {
    margin-right: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.order-actions-button.pay {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
}

.order-actions-button.pay:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.order-actions-button.cancel {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
}

.order-actions-button.cancel:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Titre de la section */
.woocommerce-order-details__title {
    color: #1f2937;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: 2px solid #6366f1;
    padding-bottom: 8px;
}

/* Prix formatage */
.woocommerce-Price-amount {
    font-weight: 600;
}

.woocommerce-Price-currencySymbol {
    font-weight: 400;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .woocommerce-table--order-details thead th,
    .woocommerce-table--order-details tbody td,
    .woocommerce-table--order-details tfoot th,
    .woocommerce-table--order-details tfoot td {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    .woocommerce-order-details__title {
        font-size: 20px;
    }
    
    .order-actions-button {
        display: block;
        margin: 4px 0;
        text-align: center;
    }
}
