/* ══════════════════════════════════════════
   SECCIÓN LEGAL PÚBLICA
   Estilos dedicados para /legal/ (standalone)
   ══════════════════════════════════════════ */

/* ── Variables ── */
:root {
    --legal-primary: #7380ec;
    --legal-primary-hover: #5a67d8;
    --legal-text: #2d3748;
    --legal-text-light: #677483;
    --legal-bg: #f8f9fa;
    --legal-white: #ffffff;
    --legal-border: #e2e8f0;
    --legal-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --legal-radius: 8px;
}

/* ── Reset y base ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--legal-text);
    background: var(--legal-bg);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ── Contenedor principal ── */
.legal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 2rem;
}

/* ── Encabezado de sección ── */
.legal-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--legal-border);
}

.legal-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--legal-text);
    margin-bottom: 0.5rem;
}

/* ── Navegación / enlaces de regreso ── */
.legal-nav {
    margin-bottom: 1.5rem;
}

.legal-nav a {
    font-family: 'Poppins', sans-serif;
    color: var(--legal-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.legal-nav a:hover {
    color: var(--legal-primary-hover);
    text-decoration: underline;
}

.legal-nav a::before {
    content: '←';
    font-size: 1rem;
}

/* ── Lista de documentos ── */
.legal-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.legal-lista-item {
    background: var(--legal-white);
    border-radius: var(--legal-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--legal-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.legal-lista-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.legal-lista-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.legal-lista-item h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--legal-primary);
    margin-bottom: 0.4rem;
}

.legal-lista-item p {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--legal-text-light);
    line-height: 1.5;
}

/* ── Mensaje vacío ── */
.legal-vacio {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--legal-text-light);
    font-size: 1rem;
}

/* ── Detalle del documento ── */
.legal-detalle-meta {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: var(--legal-text-light);
    margin-bottom: 1.5rem;
}

.legal-contenido {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--legal-text);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.legal-contenido h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--legal-text);
}

.legal-contenido h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: var(--legal-text);
}

.legal-contenido p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.legal-contenido ul,
.legal-contenido ol {
    margin: 0.75rem 0 1rem 1.5rem;
    line-height: 1.8;
}

.legal-contenido li {
    margin-bottom: 0.4rem;
}

.legal-contenido a {
    color: var(--legal-primary);
    text-decoration: underline;
}

.legal-contenido a:hover {
    color: var(--legal-primary-hover);
}

/* ── Botón de descarga ── */
.legal-descarga {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--legal-border);
}

.legal-descarga .btn-descargar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--legal-primary);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--legal-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.legal-descarga .btn-descargar:hover {
    background: var(--legal-primary-hover);
    transform: translateY(-1px);
}

.legal-descarga .btn-descargar::before {
    content: '⬇';
    font-size: 1rem;
}

/* ── Mensaje de error (archivo no disponible) ── */
.legal-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: var(--legal-radius);
    padding: 1rem 1.25rem;
    color: #c53030;
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

/* ── Mensaje sin contenido ── */
.legal-sin-contenido {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--legal-text-light);
    font-style: italic;
    font-size: 1rem;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

/* Viewports ≤ 768px */
@media (max-width: 768px) {
    .legal-container {
        max-width: 100%;
        width: 100%;
        padding: 1.5rem 16px;
        margin: 0;
    }

    .legal-header h1 {
        font-size: 1.4rem;
    }

    .legal-lista-item {
        padding: 1rem 1.25rem;
    }
}

/* Prevenir scroll horizontal desde 320px */
@media (max-width: 480px) {
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .legal-container {
        padding: 1rem 16px;
    }

    .legal-header h1 {
        font-size: 1.25rem;
    }

    .legal-contenido {
        font-size: 1rem;
    }

    .legal-descarga .btn-descargar {
        width: 100%;
        justify-content: center;
        padding: 0.9rem 1.5rem;
    }
}
