.modal{
    position:fixed;
    inset:0;
    display:none;
    justify-content:center;
    align-items:center;
    padding:40px;
    background:rgba(0,0,0,.82);
    z-index:99999;
}

.modal.active{
    display:flex;
    justify-content:center;
    align-items:center;
}

.modal-content{
    position:relative;
    width:min(800px,92vw);
    max-height:85vh;
    overflow-y:auto;
    background:#fff;
    padding:40px;
    border-radius:24px;
    box-shadow:0 30px 80px rgba(0,0,0,.35);
    animation:modalIn .35s ease;
}

.modal-content.legal-modal{
    width:min(950px,92vw);
    max-height:90vh;
    padding:45px;
}

@keyframes modalIn{
    from{
        opacity:0;
        transform:translateY(20px) scale(.98);
    }
    to{
        opacity:1;
        transform:none;
    }
}

.modal-content h2{
    color:var(--primary-dark);
    font-size:2rem;
    line-height:1.2;
    margin:0 0 25px;
}

.modal-content p{
    color:var(--muted);
    margin-bottom:14px;
}

.close-modal{
    position:absolute;
    top:20px;
    right:20px;
    width:38px;
    height:38px;
    border:none;
    border-radius:50%;
    background:var(--primary-dark);
    color:var(--white);
    cursor:pointer;
    font-size:1.2rem;
}

.gallery-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:14px;
    margin-top:24px;
    max-height:60vh;
    overflow-y:auto;
    padding-right:6px;
}

.gallery-grid img{
    width:100%;
    height:220px;
    object-fit:cover;
    border-radius:18px;
}

/* ===========================
   MODALES LEGALES
=========================== */

.legal-modal h2{
    margin-top:0;
}

.legal-modal section:first-of-type{
    margin-top:0;
}

.legal-section{
    margin:0 0 40px;
}

.legal-section h3{
    margin:0 0 18px;
    font-size:1.35rem;
    line-height:1.3;
    color:var(--primary-dark);
    padding-left:16px;
    border-left:4px solid var(--gold);
}

.legal-section h4{
    margin:28px 0 12px;
    color:var(--primary-dark);
}

.legal-section p{
    line-height:1.9;
    color:#5f6772;
    text-align:justify;
}

.legal-card{
    background:#fafafa;
    border:1px solid rgba(0,0,0,.08);
    border-radius:18px;
    overflow:hidden;
    margin:20px 0;
    padding:22px;
}

.legal-card p:last-child{
    margin-bottom:0;
}

.legal-list{
    margin:18px 0;
    padding-left:24px;
}

.legal-list li{
    margin-bottom:10px;
    line-height:1.8;
    color:#5f6772;
}

.legal-row{
    display:flex;
    align-items:flex-start;
    gap:16px;
    padding:12px 20px;
}

.legal-row:not(:last-child){
    border-bottom:1px solid rgba(0,0,0,.06);
}

.legal-row strong{
    min-width:150px;
    margin:0;
}

.legal-row span{
    flex:1;
    line-height:1.45;
    color:#666;
}

.legal-contact{
    padding:24px;
    background:#f7f7f7;
    border-radius:20px;
    text-align:center;
}

.legal-contact h4{
    margin-bottom:12px;
}

.legal-contact a{
    display:block;
    color:var(--gold);
    font-weight:700;
    margin:12px 0;
    text-decoration:none;
}

@media (max-width:768px){
    .modal-content.legal-modal{
        padding:30px 22px;
    }
    .gallery-grid{
        grid-template-columns:repeat(2,1fr);
    }
    .legal-row{
        flex-direction:column;
        gap:8px;
    }
}

/* Quitar el espacio superior del primer bloque */
.legal-modal .legal-section:first-of-type{
    margin-top:0 !important;
    padding-top:0 !important;
}

/* Título */
.legal-modal h2{
    margin:0 0 20px 0 !important;
}

/* Todas las secciones */
.legal-modal .legal-section{
    margin:0 0 40px 0;
}

/* Encabezados de sección */
.legal-modal .legal-section h3{
    margin:0 0 18px 0;
}

