/**
 * Styles pour Simple Order on WhatsApp Engine
 */

/* Bouton WhatsApp principal */
.sowe-whatsapp-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    margin: 10px 0;
    width: 100%;
    justify-content: center;
}

.sowe-whatsapp-btn:hover {
    background: linear-gradient(135deg, #128C7E, #25D366);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    color: white;
}

.sowe-whatsapp-btn:active {
    transform: translateY(0);
}

.sowe-whatsapp-icon {
    font-size: 18px;
}

/* Conteneurs des boutons */
.sowe-whatsapp-button-container,
.sowe-cart-whatsapp-container,
.sowe-checkout-whatsapp-container {
    margin: 20px 0;
    text-align: center;
}

/* Modal du formulaire */
.sowe-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.sowe-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.sowe-modal-header {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sowe-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.sowe-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.sowe-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.sowe-modal-body {
    padding: 30px;
}

/* Formulaire */
.sowe-form {
    display: grid;
    gap: 20px;
}

.sowe-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.sowe-form-group {
    display: flex;
    flex-direction: column;
}

.sowe-form-group.full-width {
    grid-column: 1 / -1;
}

.sowe-form-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.sowe-form-input,
.sowe-form-select,
.sowe-form-textarea {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

.sowe-form-input:focus,
.sowe-form-select:focus,
.sowe-form-textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.sowe-form-input.error,
.sowe-form-select.error,
.sowe-form-textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.sowe-form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Boutons du formulaire */
.sowe-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.sowe-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sowe-btn-primary {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.sowe-btn-primary:hover {
    background: linear-gradient(135deg, #128C7E, #25D366);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.sowe-btn-secondary {
    background: #6c757d;
    color: white;
}

.sowe-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.sowe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading spinner */
.sowe-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Messages d'erreur */
.sowe-error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.sowe-form-input.error + .sowe-error-message,
.sowe-form-select.error + .sowe-error-message,
.sowe-form-textarea.error + .sowe-error-message {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sowe-modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .sowe-modal-body {
        padding: 20px;
    }
    
    .sowe-form-row {
        grid-template-columns: 1fr;
    }
    
    .sowe-form-actions {
        flex-direction: column;
    }
    
    .sowe-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Styles pour les pages WooCommerce */
.woocommerce .sowe-whatsapp-button-container {
    margin: 20px 0;
}

.woocommerce .sowe-whatsapp-btn {
    margin: 15px 0;
}

/* Styles pour le panier */
.woocommerce-cart .sowe-cart-whatsapp-container {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Styles pour le checkout */
.woocommerce-checkout .sowe-checkout-whatsapp-container {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Amélioration de l'accessibilité */
.sowe-whatsapp-btn:focus,
.sowe-btn:focus,
.sowe-modal-close:focus {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

/* Styles pour les champs obligatoires */
.sowe-form-label.required::after {
    content: " *";
    color: #e74c3c;
}

/* Styles pour les messages de succès */
.sowe-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #c3e6cb;
}

/* Styles pour les messages d'information */
.sowe-info-message {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #bee5eb;
}
