/**
 * Estilos para modales de páginas legales
 * Clínica Microdental
 */

/* Modal container - oculto por defecto */
.legal-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

/* Overlay oscuro */
.legal-modal .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Contenedor del modal */
.legal-modal .modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

/* Botón de cerrar */
.legal-modal .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #B85170;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    line-height: 1;
}

.legal-modal .modal-close:hover {
    background: #a03962;
    transform: rotate(90deg);
}

/* Cuerpo del modal con scroll */
.legal-modal .modal-body {
    padding: 50px 40px 40px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 40px);
}

/* Estilos para el contenido legal */
.legal-modal .entry-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.legal-modal .entry-title,
.legal-modal h1 {
    font-family: 'Coolvetica', sans-serif;
    font-size: 2.2rem;
    color: #54595f;
    margin: 0;
    font-weight: normal;
}

.legal-modal .entry-content {
    color: #6c757d;
    line-height: 1.8;
}

.legal-modal .entry-content p {
    margin-bottom: 20px;
    font-size: 1rem;
}

.legal-modal .entry-content strong {
    color: #54595f;
    font-weight: 600;
}

.legal-modal .entry-content ol,
.legal-modal .entry-content ul {
    margin: 20px 0;
    padding-left: 30px;
}

.legal-modal .entry-content li {
    margin-bottom: 15px;
    line-height: 1.8;
}

.legal-modal .entry-content a {
    color: #B85170;
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-modal .entry-content a:hover {
    color: #a03962;
    text-decoration: underline;
}

/* Personalización del scrollbar */
.legal-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.legal-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.legal-modal .modal-body::-webkit-scrollbar-thumb {
    background: #B85170;
    border-radius: 10px;
}

.legal-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a03962;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Clase para modal activo */
.legal-modal.active {
    display: block;
}

/* Prevenir scroll del body cuando modal está abierto */
body.modal-open {
    overflow: hidden;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .legal-modal .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 10px;
    }
    
    .legal-modal .modal-body {
        padding: 40px 20px 20px;
    }
    
    .legal-modal .entry-title,
    .legal-modal h1 {
        font-size: 1.8rem;
    }
    
    .legal-modal .modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .legal-modal .entry-content p,
    .legal-modal .entry-content li {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .legal-modal .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .legal-modal .modal-body {
        max-height: 100vh;
        padding: 50px 15px 20px;
    }
    
    .legal-modal .entry-title,
    .legal-modal h1 {
        font-size: 1.5rem;
    }
}