/* 🔥 MODAL BASE */
.modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;

    display: none;

    background: rgba(0, 0, 0, 0.45);

    justify-content: center;
    align-items: center;

    z-index: 9999;

    pointer-events: none; /* 🔥 FIX CLAVE */
}

/* 🔥 ACTIVO */
.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;

    pointer-events: auto; /* 🔥 FIX CLAVE */
}

/* 🔥 FONDO OSCURO */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);

    z-index: 5; /* 🔥 SUBIMOS */
    cursor: pointer;

    pointer-events: auto;
}

/* 🔥 CONTENEDOR */
.modal-content {
    width: 100%;
    max-width: 520px;

    background: #fff;
    border-radius: 16px;

    padding: 24px;

    max-height: 90vh;
    overflow-y: auto;

    position: relative;
    z-index: 10; /* 🔥 SUBIMOS */

    pointer-events: auto;
}

.hidden {
    display: none !important;
}

/* 🔥 BOTÓN CERRAR */
.modal-close {
    position: absolute;
    right: 0;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close--intro {
    top: 0;
    right: 0;
}
/* 🔥 CONTENIDO */
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

/* 🔥 ICONO */
.modal-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

/* 🔥 TITULO */
.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1F2024;
    line-height: 1.3;
}

/* 🔥 TEXTO */
.modal-subtitle {
    font-size: 14px;
    color: #4B4F58;
    line-height: 1.5;
}

/* 🔥 NOTA */
.modal-note {
    font-size: 13px;
    color: #8B9098;
}

/* 🔥 BOTÓN */
.modal-btn {
    margin-top: 12px;

    background: #FF4B33;
    color: #FFFFFF;

    padding: 14px;
    border-radius: 10px;

    font-weight: 600;
    text-decoration: none;

    transition: all 0.2s ease;
}

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

.modal-btn.full {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 🔥 ICON IMG */
.modal-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* 🔥 MOBILE FIX COMPLETO */
@media (max-width: 768px) {

    .modal {
        display: none;
        justify-content: center;
         align-items: flex-start; /* 🔥 clave */
         padding-top: 40px;       /* 🔥 separación arriba */
         padding-bottom: 20px;
        z-index: 999999 !important;
    }

    .modal.active {
        display: flex !important; /* 🔥 FIX */
    }

    /* 🔥 CONTENEDOR */
    .modal-content {
        width: 92%;
        height: auto;
         max-height: 85vh; /* 🔥 límite pero no full */

        border-radius: 20px 20px 0 0;
        padding: 20px;

        overflow-y: auto;

        background: #fff;

        position: relative;
        z-index: 10 !important; /* 🔥 FIX */

        pointer-events: auto;
    }

    /* 🔥 BOTÓN CERRAR */
    .modal-close {
        top: 16px;
        right: 16px;

        z-index: 30 !important; /* 🔥 MÁS ARRIBA */
        pointer-events: auto;
    }

    /* 🔥 ICONO MÁS GRANDE EN MOBILE */
    .modal-icon img {
        width: 60px;
        height: auto;
    }

    /* 🔥 OVERLAY SIEMPRE DETECTA CLICK */
    .modal-overlay {
        z-index: 5 !important;
        pointer-events: auto !important;
    }
}
/* =========================
🔥 MODAL STEPS (FLOW)
========================= */

.modal-step {
    display: none;
}

.modal-step.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========================
🔥 HEADER FORM (BACK + TITLE)
========================= */

.form-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center; /* 🔥 centra el título */
    height: 40px;
}

.back-btn {
    position: absolute;
    left: 0;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.form-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F2024;
    padding: 0 40px; /* 🔥 espacio para el botón back */

    text-align: center;
}

/* =========================
🔥 PROGRESS BAR
========================= */

.progress-bar {
    width: 100%;
    height: 6px;
    background: #E6E8EC;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    width: 35%; /* puedes cambiar luego */
    height: 100%;
    background: #1D4377;
    border-radius: 10px;
}

/* =========================
🔥 FORM TEXT
========================= */

.form-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1F2024;
}

.form-subtext {
    font-size: 13px;
    color: #6B7280;
}

/* =========================
🔥 INPUTS
========================= */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group input {
    width: 100%;
    height: 48px;

    border-radius: 10px;
    border: 1px solid #DADDE3;

    padding: 0 14px;

    font-size: 14px;
    outline: none;

    transition: all 0.2s ease;
}

.form-group select,
.form-group textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #DADDE3;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #FFFFFF;
    color: #1F2024;
}

.form-group select {
    height: 48px;
    appearance: none;
    -webkit-appearance: none;
}

.form-group textarea {
    min-height: 104px;
    padding-top: 14px;
    padding-bottom: 14px;
    resize: vertical;
}

.form-group input:focus {
    border-color: #FF4B33;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 75, 51, 0.14);
}

.form-group input:focus-visible,
.form-group input:active,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #FF4B33;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 75, 51, 0.14);
}

.form-group select:focus-visible,
.form-group select:active,
.form-group textarea:focus-visible,
.form-group textarea:active {
    border-color: #FF4B33;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 75, 51, 0.14);
}

.financing-lead-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.financing-form-grid {
    display: grid;
    gap: 14px;
}

.financing-form-grid--split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.financing-form-success {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #F5F7FA;
    color: #1F2024;
    font-size: 13px;
    line-height: 1.5;
}

.financing-form-success--error {
    background: #FFF4F2;
    color: #A63B2D;
}

/* =========================
🔥 CHECKBOX
========================= */

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 13px;
    color: #4B4F58;
}

/* ocultamos el checkbox default */
.checkbox input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #DADDE3;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* estado activo */
.checkbox input:checked {
    background: #FF4B33;
    border-color: #FF4B33;
}

.checkbox input:focus,
.checkbox input:focus-visible,
.checkbox input:active {
    border-color: #FF4B33;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 75, 51, 0.14);
}

/* check blanco */
.checkbox input:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: white;
}

/* =========================
🔥 FULL WIDTH BUTTON (FORM)
========================= */

.modal-btn.full {
    width: 100%;
}
/* =========================================================
   🔥 IMAGE MODAL (CARVANA STYLE)
========================================================= */

.image-modal {
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.85);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;

    z-index: 999999;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
}

/* 🔥 IMAGE */
.image-modal img {
    width: auto !important;
    height: auto !important;

    max-width: 95vw !important;
    max-height: 90vh !important;

    object-fit: contain !important;

    display: block;

    border-radius: 12px;
}

.image-modal {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;
}

/* 🔥 CLOSE */
.image-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    font-weight: 600;

    color: #FF4B33; /* 🔥 NARANJA */
    
    background: rgba(255,255,255,0.08);
    border-radius: 50%;

    border: none;
    cursor: pointer;
}

/* 🔥 NAV */
.image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 26px;
    font-weight: 600;

    color: #FF4B33; /* 🔥 NARANJA */

    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 50%;

    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.image-modal-nav.left {
    left: 24px;
}

.image-modal-nav.right {
    right: 24px;
}

.image-modal-nav:hover,
.image-modal-close:hover {
    background: rgba(255,255,255,0.2);
    color: #E43F29; /* 🔥 NARANJA OSCURO */
    backdrop-filter: blur(6px);
}

/* =========================
🔥 MOBILE FORM FIX
========================= */

@media (max-width: 768px) {

    .form-section-title {
        font-size: 16px;
    }

    .form-subtext {
        font-size: 12px;
    }

    .form-group input {
        height: 44px;
        font-size: 13px;
    }

    .form-group select,
    .form-group textarea {
        font-size: 13px;
    }

    .form-group select {
        height: 44px;
    }

    .form-group textarea {
        min-height: 88px;
    }

    .financing-form-grid--split {
        grid-template-columns: 1fr;
    }

    .financing-lead-form {
        gap: 12px;
    }

    .progress-bar {
        height: 5px;
    }

}
.modal-close img,
.back-btn img {
    width: 20px !important;
    height: 20px !important;

    max-width: 20px; /* 🔥 extra seguridad */
    max-height: 20px;

    object-fit: contain;
    display: block;
}
.modal-close,
.back-btn {
     width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent; /* 🔥 clave */
    border: none;            /* 🔥 clave */

    cursor: pointer;
}
.modal-btn {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.modal-btn:focus,
.modal-btn:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.vehicle-iframe-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10000;
}

.vehicle-iframe-modal.is-active {
    display: flex;
}

.vehicle-iframe-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.vehicle-iframe-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(95vw, 1120px);
    max-width: 1120px;
    height: min(96vh, 900px);
    max-height: 96vh;
    background: transparent;
    border-radius: 18px;
    overflow: hidden;
}

.vehicle-iframe-modal-shell {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

.vehicle-iframe-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 0;
    background: #FFFFFF;
    color: #FF5722;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.vehicle-iframe-modal__title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.vehicle-iframe-modal__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.vehicle-iframe-modal-shell .vehicle-iframe-modal__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.budget-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
    min-height: 100vh;
}

.budget-modal.active {
    display: flex;
}

.budget-modal__content {
    width: min(94vw, 1000px);
    max-width: 1000px;
    height: min(94vh, 900px);
    max-height: 94vh;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    position: relative;
    z-index: 1;
    border-radius: 0 !important;
    overflow: visible !important;
}

.budget-modal iframe {
    width: 100%;
    display: block;
    height: 100%;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

#closeBudgetModal {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
    background: #FFFFFF;
    border: none;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    color: var(--color-brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#closeBudgetModal:hover {
    background: var(--color-brand-primary);
    color: #FFFFFF;
}

@media (max-width: 768px) {
    .vehicle-iframe-modal {
        padding: 0;
    }

    .vehicle-iframe-modal__dialog {
        width: 95vw;
        max-width: 95vw;
        height: 95vh;
        max-height: 95vh;
        border-radius: 16px;
    }

    .vehicle-iframe-modal-shell {
        border-radius: 0 !important;
    }

    .vehicle-iframe-modal__frame {
        border-radius: 16px;
    }

    .vehicle-iframe-modal-shell .vehicle-iframe-modal__frame {
        border-radius: 0 !important;
    }

    .vehicle-iframe-modal__close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 28px;
    }

    .budget-modal {
        padding: 0;
    }

    .budget-modal__content {
        width: 95vw;
        max-width: 95vw;
        height: 95vh;
        max-height: 95vh;
    }

    #closeBudgetModal {
        top: 10px;
        right: 10px;
        width: 34px;
        height: 34px;
    }

    .budget-modal iframe {
        width: 100%;
        height: 100%;
    }
}
