/* =========================================
   ESTRUCTURA GENERAL FORMULARIO
   ========================================= */
.contacto-main {
    padding: 5rem 0;
    background-color: var(--light);
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 40px;
    color: var(--hero-text);
    margin-bottom: 1rem;
    font-weight: 800;
    font-family: 'Baloo 2', sans-serif;
}

.contacto-main .section-title p {
    font-family: 'Montserrat', sans-serif;
    color: #666;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* =========================================
   CONTENEDOR FLEX (FORMULARIO + MAPA)
   ========================================= */
.contacto-wrapper {
    display: flex;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Lado del Formulario --- */
.contacto-form-container {
    flex: 1.2;
    padding: 40px;
    /* AÑADE ESTAS 3 LÍNEAS: */
    display: flex;
    flex-direction: column;
    justify-content: center; 
}

.custom-form .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.custom-form .form-group {
    flex: 1;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.custom-form label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--hero-text);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.custom-form input,
.custom-form textarea,
.custom-form select {
    padding: 12px 15px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    background: #fdfdfd;
    transition: all 0.3s ease;
}

.custom-form input:focus,
.custom-form textarea:focus,
.custom-form select:focus {
    border-color: var(--primary);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.btn-submit {
    width: 100%;
    cursor: pointer;
    border: none;
    margin-top: 10px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
}

/* Anular el margen inferior del texto para que el flexbox lo centre perfectamente */
.checkbox-group label {
    margin-bottom: 0;
    /* Te sugiero quitar las mayúsculas aquí para mejorar la legibilidad del legal */
    text-transform: none;
}

/* Resetear el padding y márgenes que heredó de la regla general de inputs */
.custom-form input[type="checkbox"] {
    padding: 0;
    margin: 0;
    width: auto;
    cursor: pointer;
}

/* --- Lado del Mapa --- */
.contacto-map-container {
    flex: 0.8;
    position: relative;
    min-height: 450px;
    background: #eee;
}

.contacto-map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.info-adicional {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--hero-text);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    text-align: center;
}

/* =========================================
   MENSAJE DE ÉXITO
   ========================================= */
.mensaje-exito {
    display: none; /* Oculto por defecto */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.mensaje-exito h3 {
    margin-top: 1.5rem;
    color: #333;
}

/* =========================================
   RESPONSIVE ESPECÍFICO FORMULARIO
   ========================================= */
@media (max-width: 900px) {
    .contacto-wrapper {
        flex-direction: column;
        margin: 0 10px;
    }

    .contacto-form-container {
        padding: 30px 20px;
    }

    .custom-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .contacto-map-container {
        min-height: 350px;
        order: -1;
        /* El mapa aparece arriba en móviles */
    }

    .section-title {
        text-align: center;
        margin-bottom: 4rem;
    }

    .section-title h2 {
        font-size: 25px;
        color: var(--hero-text);
        margin-bottom: 1rem;
        font-weight: 800;
        font-family: 'Baloo 2', sans-serif;
    }

    /* Hacer que el contenedor del mapa sea responsivo */
    .contacto-map-container {
        width: 100%;
        min-height: 300px;
        /* Asegura que el mapa tenga altura visible en móvil */
        position: relative;
        display: block;
    }

    /* Forzar al iframe a llenar su contenedor */
    .contacto-map-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
    }

    /* Evitar que el formulario flote o se monte encima del mapa en móvil */
    .contacto-wrapper {
        display: flex;
        flex-direction: column;
        /* Apila uno debajo de otro limpiamente */
        gap: 20px;
        /* Añade separación real entre mapa y formulario */
    }
}