/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-container {
    background-color: var(--blanco);
    border-radius: 4px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    background-color: var(--azul-oscuro);
    color: var(--blanco);
    padding: 8px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px 4px 0 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

.modal-close {
    background: none;
    border: none;
    color: var(--blanco);
    font-size: 1.3em;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Estilos para inputs del modal - texto negro siempre */
#cotizacionModal input,
#cotizacionModal textarea {
    color: #000000 !important;
}

/* Selects con texto blanco */
#cotizacionModal select {
    color: #ffffff !important;
}

#cotizacionModal select option {
    background-color: var(--bg-secondary) !important;
    color: #ffffff !important;
}

/* Modo oscuro para el modal */
body.dark-mode .modal-container {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary);
}

body.dark-mode .modal-body {
    color: var(--text-primary);
}

body.dark-mode .modal-body .btn {
    color: var(--blanco) !important;
}

body.dark-mode .modal-body .btn-secondary {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .modal-body .btn-secondary:hover {
    color: var(--blanco) !important;
}

/* Estilos para selects con flecha gris */
.modal-body select,
#cotizacionModal select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px !important;
}

body.dark-mode .modal-body select,
body.dark-mode #cotizacionModal select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23acacac' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

@media (max-width: 1024px) {
    .modal-container {
        max-width: 90%;
    }
    
    .modal-header h2 {
        font-size: 1.05em;
    }
    
    .modal-body {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .modal-overlay.active {
        padding: 15px;
        align-items: flex-start;
        padding-top: 30px;
    }
    
    .modal-container {
        max-width: 95%;
        max-height: 90vh;
        margin: 0 auto;
    }
    
    .modal-header {
        padding: 8px 12px;
    }
    
    .modal-header h2 {
        font-size: 0.95em;
        padding-right: 30px;
    }
    
    .modal-close {
        width: 28px;
        height: 28px;
        font-size: 1.2em;
        right: 10px;
    }
    
    .modal-body {
        padding: 12px;
    }
    
    .modal-body .form-group {
        margin-bottom: 15px;
    }
    
    .modal-body .form-group label {
        font-size: 0.9em;
    }
    
    .modal-body .form-group input,
    .modal-body .form-group select,
    .modal-body .form-group textarea {
        font-size: 0.9em;
        padding: 10px 12px;
    }
    
    .modal-body .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .modal-overlay.active {
        padding: 10px;
        padding-top: 20px;
    }
    
    .modal-container {
        max-width: 98%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 6px 10px;
    }
    
    .modal-header h2 {
        font-size: 0.9em;
        padding-right: 25px;
    }
    
    .modal-close {
        width: 26px;
        height: 26px;
        font-size: 1.1em;
        right: 8px;
    }
    
    .modal-body {
        padding: 10px;
    }
    
    .modal-body .form-group {
        margin-bottom: 12px;
    }
    
    .modal-body .form-group label {
        font-size: 0.85em;
        margin-bottom: 5px;
    }
    
    .modal-body .form-group input,
    .modal-body .form-group select,
    .modal-body .form-group textarea {
        font-size: 0.85em;
        padding: 9px 11px;
    }
    
    .modal-body .form-group textarea {
        min-height: 80px;
    }
    
    .modal-body .btn {
        padding: 11px 18px;
        font-size: 0.9em;
    }
}

