/**
 * DZCod COD - Styles Frontend
 * Support RTL (Right-to-Left) pour l'arabe
 */

.dzcod-form-container {
    max-width: 650px;
    margin: 30px auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dzcod-form-header {
    text-align: center;
    margin: -25px -25px 25px -25px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #E67E3C 0%, #D97941 100%);
    border-radius: 12px 12px 0 0;
}

.dzcod-form-header h3 {
    font-size: 22px;
    color: #ffffff;
    margin: 0;
    font-weight: 600;
}

.dzcod-order-form {
    margin-top: 20px;
}

.dzcod-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.dzcod-form-field {
    display: flex;
    flex-direction: column;
}

.dzcod-form-field label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.dzcod-form-field input,
.dzcod-form-field select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    direction: rtl;
    text-align: right;
}

.dzcod-form-field input:focus,
.dzcod-form-field select:focus {
    outline: none;
    border-color: #7B3FF2;
    box-shadow: 0 0 0 3px rgba(123, 63, 242, 0.1);
}

.dzcod-form-field select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Type de livraison */
.dzcod-delivery-type {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.dzcod-delivery-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 12px;
}

.dzcod-radio-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.dzcod-radio {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dzcod-radio:hover {
    border-color: #7B3FF2;
    background: #f3f0ff;
}

.dzcod-radio input[type="radio"] {
    margin-left: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.dzcod-radio input[type="radio"]:checked + span {
    color: #7B3FF2;
    font-weight: 600;
}

.dzcod-radio span {
    font-size: 15px;
    color: #555;
}

/* Quantité */
.dzcod-quantity {
    margin-bottom: 20px;
    text-align: center;
}

.dzcod-quantity label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 10px;
}

.dzcod-quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: transparent; /* Rendre transparent */
    padding: 0;
    border-radius: 0;
}

.dzcod-qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ccc; /* Bordure grise */
    color: white;
    font-size: 20px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Style pour le bouton PLUS (Vert) */
.dzcod-qty-btn.plus {
    background-color: #4CAF50; /* Vert */
    border-color: #4CAF50;
}

.dzcod-qty-btn.plus:hover {
    background-color: #388E3C; /* Vert foncé */
    border-color: #388E3C;
}

/* Style pour le bouton MOINS (Rouge) */
.dzcod-qty-btn.minus {
    background-color: #F44336; /* Rouge */
    border-color: #F44336;
}

.dzcod-qty-btn.minus:hover {
    background-color: #D32F2F; /* Rouge foncé */
    border-color: #D32F2F;
}

#dzcod-quantity {
    width: 60px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #333;
    -moz-appearance: textfield;
}

/* Boutons de soumission */
.dzcod-submit-btn {
    width: 100%;
    padding: 16px 30px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dzcod-submit-order {
    background: linear-gradient(135deg, #E67E3C 0%, #D97941 100%);
    color: white;
}

.dzcod-submit-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(217, 121, 65, 0.4);
}

.dzcod-submit-order:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.dzcod-whatsapp-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.dzcod-whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.dzcod-whatsapp-btn svg {
    width: 22px;
    height: 22px;
}

/* Résumé de commande */
.dzcod-order-summary {
    margin-top: 25px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.dzcod-summary-header {
    width: 100%;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.dzcod-summary-content {
    padding: 20px;
    background: white;
    display: none;
}

.dzcod-summary-content table {
    width: 100%;
    border-collapse: collapse;
}

.dzcod-summary-content tr {
    border-bottom: 1px solid #f0f0f0;
}

.dzcod-summary-content tr:last-child {
    border-bottom: none;
}

.dzcod-summary-content td {
    padding: 12px 0;
    font-size: 15px;
}

.dzcod-summary-content td:first-child {
    color: #666;
}

.dzcod-summary-value {
    text-align: left;
    font-weight: 600;
    color: #333;
}

.dzcod-summary-total {
    background: #f8f9fa;
    font-size: 18px !important;
}

.dzcod-summary-total td {
    padding: 15px 10px;
    font-weight: 700;
    color: #7B3FF2;
}

/* Messages */
.dzcod-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .dzcod-form-container {
        padding: 20px 15px;
        margin: 15px;
    }
    
    .dzcod-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dzcod-radio-group {
        flex-direction: column;
    }
    
    .dzcod-form-header h3 {
        font-size: 18px;
    }
    
    .dzcod-submit-btn {
        font-size: 15px;
        padding: 14px 20px;
    }
}

/* Animation de chargement */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dzcod-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
