/* Améliorations modernes pour le checkout */

/* Variables CSS pour la cohérence */
:root {
    --primary-color: var(--button-color, #2563eb);
    --primary-hover: var(--button-color, #1d4ed8);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.2s ease-in-out;
}

/* Améliorations générales */
.wrapper {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.left-area {
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 30px;
    border: 1px solid var(--gray-200);
}

.right-area {
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    position: sticky;
    top: 20px;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
}

/* Optimisation de l'espace dans la sidebar */
.right-area .summary-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.right-area .summary-line {
    margin-bottom: 8px;
    padding: 6px 0;
}

.right-area .total-price {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
}

.right-area h3 {
    margin-bottom: 15px;
}

.right-area .procudure-btn {
    margin-top: 15px;
}

/* S'assurer que les lignes d'assurance sont cachées par défaut */
#insurance-line,
#mobile-insurance-line {
    display: none !important;
}

/* Amélioration des sections de formulaire */
.form-con {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.form-con:hover {
    box-shadow: var(--shadow-md);
}

.form-con h4 {
    color: var(--gray-800);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--button-color, #2563eb);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-con h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--button-color, #2563eb);
    border-radius: 2px;
}

/* Amélioration des champs de saisie */
.form-text {
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    font-size: 15px;
    color: var(--gray-700);
    background: #ffffff;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.form-text:focus {
    outline: none;
    border-color: var(--button-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.form-text::placeholder {
    color: var(--gray-400);
}

/* Options de livraison modernes */
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.shipping-option {
    background: #ffffff;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shipping-option:hover {
    border-color: var(--button-color, #2563eb);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.shipping-option.selected {
    border-color: var(--button-color, #2563eb);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.shipping-option input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
    accent-color: var(--button-color, #2563eb);
}

.shipping-option-content {
    flex: 1;
}

.shipping-option-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 5px;
    font-size: 16px;
}

.shipping-option-description {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 5px;
}

.shipping-option-delivery {
    color: var(--gray-500);
    font-size: 13px;
    font-style: italic;
}

.shipping-option-price {
    font-weight: 700;
    font-size: 18px;
    color: var(--button-color, #2563eb);
}

.shipping-option-price.free {
    color: var(--success-color);
}

.shipping-option-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--success-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Order Bump Assurance */
.order-bump {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid var(--warning-color);
    border-radius: var(--border-radius-lg);
    padding: 10px 15px;
    margin: 15px 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.order-bump:hover {
    border-color: #f59e0b;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.order-bump.selected {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.order-bump::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--warning-color), #fbbf24);
}

.order-bump-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.order-bump-icon {
    width: 28px;
    height: 28px;
    background: var(--warning-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.order-bump-content {
    flex: 1;
    min-width: 0;
}

.order-bump-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-bump-description {
    display: none;
}

.order-bump-benefits {
    display: none;
}

.order-bump-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    flex-wrap: nowrap;
}

.order-bump-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--warning-color);
    transform: scale(1.1);
    flex-shrink: 0;
}

.order-bump-toggle label {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-bump-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--warning-color);
    margin-left: auto;
    flex-shrink: 0;
}

/* Amélioration du bouton de paiement */
.procudure-btn {
    background: linear-gradient(135deg, var(--button-color, #2563eb) 0%, var(--button-color, #1d4ed8) 100%);
    border: none;
    border-radius: var(--border-radius);
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.procudure-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--button-color, #1d4ed8) 0%, #1e40af 100%);
}

.procudure-btn:active {
    transform: translateY(0);
}

.procudure-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Amélioration de la section paiement */
.card-area {
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card-area:hover {
    box-shadow: var(--shadow-md);
}

.card-top {
    background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
    border-bottom: 2px solid var(--gray-200);
    padding: 20px;
}

.card-top h2 {
    color: var(--gray-800);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-bottm {
    background: #ffffff;
    padding: 25px;
}

/* Amélioration du récapitulatif */
.right-top {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.summary-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-200);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-img {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.summary-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-name {
    flex: 1;
    font-weight: 500;
    color: var(--gray-800);
}

.summary-price {
    font-weight: 700;
    color: var(--gray-800);
    font-size: 16px;
}

/* Amélioration des totaux */
.price-con {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.price-con .d-flex {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}

.price-con .d-flex:last-child {
    border-bottom: none;
}

.total-price {
    background: linear-gradient(135deg, var(--button-color, #2563eb) 0%, var(--button-color, #1d4ed8) 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--shadow-md);
}

.total-price p {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.total-price h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 5px 0 0 0;
}

/* Amélioration des codes promo */
.copen-code {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.code-promo {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.code-promo .form-text {
    flex: 1;
    margin: 0;
}

.apply-btn {
    background: var(--success-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 12px 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.apply-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Messages de coupon */
.coupon-message {
    margin-top: 10px;
    padding: 12px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.coupon-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.coupon-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

/* Responsive Design */
@media (max-width: 992px) and (min-width: 769px) {
    .right-area {
        position: sticky;
        top: 15px;
        overflow-y: visible;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .left-area, .right-area {
        padding: 20px;
    }
    
    .right-area {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    
    .form-con {
        padding: 20px;
    }
    
    .shipping-option {
        padding: 15px;
    }
    
    .shipping-option-title {
        white-space: nowrap;
        font-size: 15px;
    }
    
    .order-bump {
        padding: 15px;
        margin: 15px 0;
    }
    
    .order-bump-header {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
        flex-wrap: nowrap;
    }
    
    .order-bump-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .order-bump-title {
        font-size: 16px;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 600;
    }
    
    .order-bump-toggle {
        margin-top: 0;
        gap: 10px;
        flex-wrap: nowrap;
        align-items: center;
    }
    
    .order-bump-checkbox {
        width: 18px;
        height: 18px;
        transform: scale(1.2);
        flex-shrink: 0;
    }
    
    .order-bump-toggle label {
        font-size: 14px;
        white-space: normal;
        line-height: 1.4;
        flex: 1;
        min-width: 0;
    }
    
    .order-bump-price {
        font-size: 16px;
        font-weight: 700;
        flex-shrink: 0;
    }
    
    .code-promo {
        flex-direction: column;
    }
    
    .apply-btn {
        width: 100%;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-con {
    animation: slideIn 0.3s ease-out;
}

.shipping-option {
    animation: slideIn 0.3s ease-out;
}

.order-bump {
    animation: slideIn 0.3s ease-out;
}

/* États de chargement */
.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 var(--gray-300);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Amélioration de l'accessibilité */
.shipping-option:focus-within {
    outline: 2px solid var(--button-color, #2563eb);
    outline-offset: 2px;
}

.order-bump:focus-within {
    outline: 2px solid var(--warning-color);
    outline-offset: 2px;
}

/* Indicateurs de progression */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-200);
}

.progress-step.active {
    background: var(--button-color, #2563eb);
    color: white;
    border-color: var(--button-color, #2563eb);
}

.progress-step.completed {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.progress-step::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.progress-step.completed::before {
    content: '✓';
    width: auto;
    height: auto;
    background: none;
    font-weight: bold;
}
