/* ============================================================
   MÓDULOS DE MODALES — SIGv
   Estilos globales para popups, visores y confirmaciones
============================================================ */

/* ------------------------------------------------------------
   OVERLAY BASE
------------------------------------------------------------ */
.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

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

/* ------------------------------------------------------------
   CONTENEDOR GENÉRICO
------------------------------------------------------------ */
.modal-box {
    background: white;
    width: 90%;
    max-width: 480px;
    border-radius: var(--radius-card, 14px);
    padding: 20px 22px;
    box-shadow: var(--shadow-lg, 0 8px 22px rgba(0,0,0,0.25));
    position: relative;
    animation: modalFadeIn 0.25s ease-out;
    max-height: 90%;
    overflow-y: auto;
}

/* Animación */
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ------------------------------------------------------------
   BOTÓN CERRAR
------------------------------------------------------------ */
.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 20px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--color-vino);
    transition: color 0.2s ease, transform 0.1s ease;
}

.modal-close:hover {
    color: var(--color-verde);
    transform: scale(1.15);
}

/* ------------------------------------------------------------
   TIPOGRAFÍA INTERNA
------------------------------------------------------------ */
.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-vino);
    margin-top: 5px;
    margin-bottom: 12px;
}

.modal-text {
    font-size: 15px;
    color: var(--color-text, #2c3e50);
    line-height: 1.45;
    margin-bottom: 12px;
}

.modal-subinfo {
    font-size: 12px;
    color: #777;
}

/* ------------------------------------------------------------
   IMÁGENES (QUEJAS)
------------------------------------------------------------ */
.modal-img {
    max-width: 100%;
    border-radius: var(--radius-card);
    margin-top: 12px;
    box-shadow: var(--shadow-md);
    display: block;
}

/* ------------------------------------------------------------
   BOTONERA
------------------------------------------------------------ */
.modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-actions .btn {
    min-width: 110px;
}

/* ------------------------------------------------------------
   VISOR DE PDF / DOCUMENTOS
------------------------------------------------------------ */
.modal-viewer {
    background: white;
    width: 96%;
    max-width: 900px;
    height: 90%;
    border-radius: var(--radius-card);
    overflow: hidden;
    position: relative;
    animation: modalFadeIn 0.25s ease-out;
    box-shadow: var(--shadow-xl, 0 10px 25px rgba(0,0,0,0.35));
}

.modal-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ------------------------------------------------------------
   MODAL PEQUEÑO (confirmaciones)
------------------------------------------------------------ */
.modal-small {
    max-width: 360px;
    padding: 18px;
    text-align: center;
}

.modal-small .modal-title {
    font-size: 18px;
}

.modal-small p {
    font-size: 14px;
}

/* ------------------------------------------------------------
   MODALES CON ESTADO (success / error / warning)
------------------------------------------------------------ */
.modal-success .modal-title {
    color: #2e7d32;
}

.modal-error .modal-title {
    color: #c62828;
}

.modal-warning .modal-title {
    color: #e67e22;
}

/* ------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------ */
@media (max-width: 600px) {
    .modal-box {
        padding: 18px;
        width: 92%;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-viewer {
        width: 98%;
        height: 85%;
    }
}
