/**
 * Styles pour la modal combinée assurance + CGV
 * UX optimisé pour réduire les étapes de réservation
 */

/* Variables pour cohérence avec le thème */
:root {
    --primary-color: #ffb747;
    --secondary-color: #ffbc50;
    --text-color: #333;
    --background-color: #fff;
    --light-orange: #FFF8F3;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --border-radius-lg: 15px;
    --border-radius-md: 10px;
    --border-radius-sm: 8px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal de base */
.combined-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: flex-start; /* Changé de center à flex-start pour permettre le scroll */
    opacity: 0;
    transition: var(--transition);
    overflow-y: auto; /* Permet le scroll sur la modal elle-même */
    padding: 20px 0; /* Ajoute un padding pour éviter que le contenu touche les bords */
}

.combined-modal.show {
    opacity: 1;
}

.combined-modal-content {
    background: var(--background-color);
    border-radius: var(--border-radius-lg);
    max-width: 1000px;
    width: 90%;
    max-height: none; /* Supprime la limite de hauteur pour permettre le scroll */
    min-height: 50vh; /* Hauteur minimum pour éviter que la modal soit trop petite */
    overflow: visible; /* Permet au contenu de déborder pour le scroll */
    box-shadow: var(--box-shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    margin: auto; /* Centre la modal horizontalement */
}

/* En-tête */
.combined-modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.combined-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white !important;
}

.combined-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combined-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Corps de la modal */
.combined-modal-body {
    flex: 1;
    overflow-y: visible; /* Permet au contenu de déborder naturellement */
    padding: 0;
    -webkit-overflow-scrolling: touch; /* Améliore le scroll sur iOS */
}

/* En-têtes de section */
.section-header {
    padding: 25px 30px 15px;
    margin: 0px;
}

.section-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.section-subtitle {
    margin: 0;
    color: #666;
}

/* Section assurance */
.insurance-section {
    background: #fafbfc;
}

/* Section récapitulatif du voyage */
.booking-summary-section {
    background: #f8f9fa;
}

.booking-summary-content {
    padding: 15px 30px 25px;
}

.booking-summary-card {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}

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

.summary-row.total-row {
    border-top: 2px solid var(--primary-color);
    margin-top: 8px;
    padding-top: 16px;
    font-weight: 600;
}

.summary-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 0.95rem;
}

.summary-label i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.summary-value {
    color: var(--text-color);
    font-weight: 500;
    text-align: right;
    font-size: 0.95rem;
}

.total-row .summary-value {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.insurance-options {
    padding: 15px 30px 25px;
    display: grid;
    gap: 10px;
}

.insurance-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.insurance-option:hover {
    border-color: var(--primary-color);
    box-shadow: 0 3px 10px rgba(255, 183, 71, 0.2);
    transform: translateY(-1px);
}

.insurance-option.selected {
    border-color: var(--primary-color);
    background: var(--light-orange);
    box-shadow: 0 3px 15px rgba(255, 183, 71, 0.3);
    position: relative;
}

.insurance-option.selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.insurance-option-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.insurance-radio {
    position: relative;
    flex-shrink: 0;
}

.insurance-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.insurance-info {
    flex: 1;
    min-width: 0;
}

.insurance-info h4 {
    margin: 0 0 2px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
}

.insurance-info p {
    margin: 0;
    color: #666;
    font-size: 0.8rem;
    line-height: 1.2;
}

.insurance-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(255, 183, 71, 0.1);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 183, 71, 0.3);
    flex-shrink: 0;
    align-self: flex-start;
    white-space: nowrap;
}

/* Features compactes pour les assurances */
.insurance-features-compact {
    margin-top: 12px;
    display: grid;
    gap: 6px;
}

.feature-compact {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.feature-icon {
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.feature-icon.green {
    color: var(--success-color);
}

.feature-icon.red {
    color: var(--danger-color);
}

.feature-text {
    color: #555;
}

.feature-text .highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* Provider (Allianz) */
.insurance-provider {
    color: #666;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 2px;
}

/* Avertissement pour "aucune assurance" */
.insurance-warning-compact {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius-sm);
    padding: 8px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #856404;
    line-height: 1.3;
}

/* Conditions compactes */
.insurance-conditions-compact {
    background: #f8f9fa;
    border-radius: var(--border-radius-sm);
    padding: 8px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.3;
    font-style: italic;
}

/* Séparateur */
.section-divider {
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 0;
}

/* Section CGV */
.cgv-section {
    background: white;
}

.cgv-important-notes {
    padding: 20px 30px;
    display: grid;
    gap: 20px;
}

.important-note {
    background: #f8f9fa;
    border-left: 4px solid var(--warning-color);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    padding: 20px;
}

.note-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.note-header i {
    color: var(--warning-color);
    font-size: 1.1rem;
}

.note-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.important-note p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #555;
    font-size: 0.95rem;
}

.calendly-link {
    text-align: center;
    margin-top: 15px;
}

.calendly-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 183, 71, 0.3);
}

.calendly-link a:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 183, 71, 0.4);
}

/* Cases à cocher */
.acceptance-checkboxes {
    padding: 25px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: grid;
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    margin-top: 2px;
    flex-shrink: 0;
}

.checkbox-item label {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
    cursor: pointer;
    flex: 1;
}

.checkbox-item label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-item label a:hover {
    text-decoration: underline;
}

/* Pied de modal optimisé */
.combined-modal-footer {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-top: 3px solid var(--primary-color);
    padding: 20px 30px;
    display: grid;
    gap: 20px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

/* Cases à cocher compactes dans le footer */
.footer-checkboxes {
    display: grid;
    gap: 12px;
    background: white;
    border-radius: var(--border-radius-md);
    padding: 20px;
    border: 1px solid #e9ecef;
}

.checkbox-compact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-compact input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.checkbox-compact label {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-color);
    cursor: pointer;
    flex: 1;
}

.checkbox-compact label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-compact label a:hover {
    text-decoration: underline;
}

/* Boutons d'action */
.modal-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
    align-items: center;
}

.btn-secondary, .btn-primary {
    padding: 15px 25px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 5px 20px rgba(255, 183, 71, 0.4);
    border: 2px solid var(--primary-color);
    font-size: 1rem;
    font-weight: 700;
    padding: 12px 20px;
}

.btn-primary .btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.btn-primary .btn-main {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-primary .btn-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 183, 71, 0.5);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.btn-primary:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    border-color: #ccc;
    transform: none;
}

.btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled .btn-price {
    color: #999;
    text-shadow: none;
}

/* Responsive */
@media (max-width: 768px) {
    .combined-modal {
        padding: 10px 0; /* Réduit le padding sur mobile */
    }
    
    .combined-modal-content {
        width: 95%;
        margin: 10px auto; /* Centre la modal */
        max-height: none; /* Supprime la limite de hauteur */
        min-height: 0; /* Permet à la modal de rétrécir si nécessaire */
    }

    .combined-modal-header {
        padding: 20px;
    }

    .combined-modal-header h2 {
        font-size: 1.3rem;
    }

    .section-header {
        padding: 20px 20px 15px;
    }

    .insurance-options {
        padding: 12px 20px 20px;
        gap: 8px;
    }

    .booking-summary-content {
        padding: 12px 20px 20px;
    }

    .booking-summary-card {
        padding: 15px;
    }

    .summary-row {
        padding: 10px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .summary-value {
        text-align: left;
        font-size: 0.9rem;
    }

    .total-row .summary-value {
        font-size: 1rem;
    }

    .insurance-option {
        padding: 10px 12px;
    }

    .insurance-option-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .insurance-info {
        min-width: 0;
        flex: 1;
    }

    .insurance-info h4 {
        font-size: 0.85rem;
        line-height: 1.2;
    }

    .insurance-info p {
        font-size: 0.75rem;
    }

    .insurance-price {
        font-size: 0.75rem;
        padding: 3px 6px;
    }

    .feature-compact {
        font-size: 0.8rem;
        gap: 6px;
    }

    .insurance-warning-compact,
    .insurance-conditions-compact {
        font-size: 0.75rem;
        padding: 8px;
        margin-top: 8px;
    }

    .cgv-important-notes {
        padding: 15px 20px;
    }

    .combined-modal-footer {
        padding: 15px 20px;
        gap: 15px;
    }

    .footer-checkboxes {
        padding: 15px;
        gap: 10px;
    }

    .checkbox-compact label {
        font-size: 0.85rem;
    }

    .modal-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .btn-secondary, .btn-primary {
        width: 100%;
        padding: 12px 20px;
        min-height: 50px;
        font-size: 0.95rem;
    }

    .btn-primary .btn-main {
        font-size: 0.9rem;
    }

    .btn-primary .btn-price {
        font-size: 1.1rem;
    }

}

/* Responsive pour très petits écrans */
@media (max-width: 480px) {
    .combined-modal {
        padding: 5px 0; /* Réduit encore plus le padding sur très petit écran */
    }
    
    .combined-modal-content {
        width: 98%;
        margin: 5px auto; /* Centre la modal */
        max-height: none; /* Supprime la limite de hauteur */
        min-height: 0;
    }

    .combined-modal-header {
        padding: 15px;
    }

    .combined-modal-header h2 {
        font-size: 1.2rem;
    }

    .section-header {
        padding: 15px 15px 10px;
    }

    .insurance-options {
        padding: 10px 15px 20px;
    }

    .booking-summary-content {
        padding: 10px 15px 20px;
    }

    .booking-summary-card {
        padding: 12px;
    }

    .cgv-important-notes {
        padding: 10px 15px;
    }

    .combined-modal-footer {
        padding: 12px 15px;
    }

    .footer-checkboxes {
        padding: 12px;
    }

    .btn-primary .btn-price {
        font-size: 1rem;
    }

}
