/**
 * Order Form - CSS
 * Formulaire de commande progressif
 */

/* Modal overlay */
.ew-modal-open {
    overflow: hidden;
}

.ew-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Modal container */
.ew-order-modal {
    background: #ffffff !important;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

/* Header modal */
.ew-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #ffffff !important;
    z-index: 10;
    border-radius: 16px 16px 0 0;
}

.ew-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.ew-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.ew-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Indicateurs d'étapes */
.ew-steps-indicator {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    padding: 0 24px;
}

.ew-step-indicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.ew-step-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.ew-step-indicator:first-child::before {
    display: none;
}

.ew-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    z-index: 1;
    transition: all 0.3s ease;
}

.ew-step-indicator.active .ew-step-number {
    background: #8B5CF6;
    color: white;
}

.ew-step-indicator.completed .ew-step-number {
    background: #10B981;
    color: white;
}

.ew-step-label {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.ew-step-indicator.active .ew-step-label {
    color: #8B5CF6;
    font-weight: 600;
}

/* Contenu modal */
.ew-modal-body {
    padding: 24px;
}

/* Étapes du formulaire */
.ew-form-step {
    display: none;
}

.ew-form-step.active {
    display: block;
}

.ew-form-group {
    margin-bottom: 20px;
}

.ew-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.ew-form-group label.required::after {
    content: ' *';
    color: #EF4444;
}

.ew-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    color: #1f2937;
    transition: all 0.2s ease;
}

.ew-form-control:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ew-form-control:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

textarea.ew-form-control {
    resize: vertical;
    min-height: 80px;
}

.ew-form-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Résumé de commande */
.ew-order-summary {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.ew-order-summary h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.ew-summary-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.ew-summary-line.ew-summary-total {
    border-top: 2px solid #e5e7eb;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #8B5CF6;
}

/* Checkbox personnalisé */
.ew-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f0fdf4;
    border: 2px solid #10B981;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ew-checkbox-group:hover {
    background: #dcfce7;
}

.ew-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.ew-checkbox-label {
    flex: 1;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.5;
}

.ew-checkbox-label strong {
    color: #10B981;
    font-size: 16px;
}

/* Boutons */
.ew-form-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.ew-btn {
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ew-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.ew-btn-secondary:hover {
    background: #e5e7eb;
}

.ew-btn-primary {
    background: #8B5CF6;
    color: white;
}

.ew-btn-primary:hover {
    background: #7C3AED;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.ew-btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

/* Messages d'erreur */
.ew-error-message {
    background: #FEE2E2;
    border: 2px solid #EF4444;
    color: #991B1B;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    animation: shake 0.3s ease;
}

/* Confirmation de commande */
.ew-order-success {
    background: #ffffff !important;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    padding: 40px 24px;
    margin: 20px auto;
    max-width: 500px;
    position: relative;
    z-index: 100;
}

.ew-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease;
}

.ew-order-success h2 {
    margin: 0 0 16px 0;
    font-size: 28px;
    font-weight: 700;
    color: #10B981;
}

.ew-order-number {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 24px;
}

.ew-order-number strong {
    color: #8B5CF6;
    font-size: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .ew-order-modal {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .ew-modal-header h2 {
        font-size: 20px;
        padding-right: 40px;
    }

    .ew-steps-indicator {
        padding: 0 12px;
    }

    .ew-step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .ew-step-label {
        font-size: 10px;
    }

    .ew-modal-body {
        padding: 16px;
    }

    .ew-form-actions {
        flex-direction: column-reverse;
    }

    .ew-btn {
        width: 100%;
    }
}

/* =========================================
   CART UI ENHANCEMENTS (Mode Panier)
   ========================================= */

.ew-cart-items-container {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 24px;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.02);
}

.ew-cart-items-container::-webkit-scrollbar {
    width: 6px;
}

.ew-cart-items-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ew-cart-items-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.ew-cart-item-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #e5e7eb;
    padding-bottom: 15px;
    align-items: center;
    transition: background 0.2s;
}

.ew-cart-item-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.ew-cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #f3f4f6;
    background: #f9fafb;
}

.ew-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ew-cart-item-details {
    flex: 1;
}

.ew-cart-item-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.ew-cart-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ew-cart-item-price {
    font-size: 14px;
    color: #8B5CF6;
    font-weight: 600;
}

.ew-cart-item-qty {
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
}

.ew-remove-cart-item {
    border: none;
    background: #FEF2F2;
    color: #EF4444;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.ew-remove-cart-item:hover {
    background: #EF4444;
    color: #ffffff;
    transform: scale(1.1);
}

/* Quantity Controls */
.ew-quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 20px;
}

.ew-quantity-controls button {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: #4b5563;
    transition: all 0.2s;
    line-height: 1;
}

.ew-quantity-controls .ew-qty-plus {
    color: #10B981;
}

.ew-quantity-controls button:hover {
    transform: scale(1.2);
}

.ew-quantity-controls .ew-qty-value {
    font-size: 14px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    color: #1f2937;
}