/* legal.css — estilos de aviso-legal-privacidad.php.
   Extraído de styles.css (fase 4 css-audit). Carga DESPUÉS de styles.css. */

/* ============================================
   PÁGINAS LEGALES (Política de privacidad, Aviso legal, Cookies)
   ============================================ */
.legalSection {
    padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 8vw, 96px);
}

.legalContainer {
    max-width: 820px;
    margin: 0 auto;
    min-width: 0;
}

/* Layout 2 columnas: sidebar índice + contenido legal centrado */
.legalLayout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}











.legalBody {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
}

.legalBody h2 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--brand);
    margin: 56px 0 24px;
    letter-spacing: -0.01em;
}

.legalBody h2:first-child {
    margin-top: 0;
}

.legalBody h3 {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--brand);
    margin: 40px 0 14px;
    letter-spacing: -0.005em;
}

.legalBody p {
    margin: 0 0 16px;
}

.legalBody ul,
.legalBody ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

/* El reset global de styles.css quita list-style: aquí se restaura */
.legalBody ul {
    list-style: disc;
}

.legalBody ol {
    list-style: decimal;
}

.legalBody ul li,
.legalBody ol li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.legalBody li::marker {
    color: var(--brand-soft);
}

/* Tabla de cookies: el wrapper scrollea en pantallas estrechas para que la
   tabla nunca fuerce scroll horizontal de la página */
.legalTableWrap {
    margin: 0 0 20px;
    overflow-x: auto;
}

.legalBody table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.5;
}

.legalBody th,
.legalBody td {
    padding: 10px 14px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.legalBody th {
    background: var(--brand-pale);
    color: var(--brand);
    font-family: var(--font-heading);
    font-weight: 700;
    white-space: nowrap;
}

.legalBody tbody tr:nth-child(even) {
    background: rgba(244, 248, 248, 0.55);
}

.legalBody td code {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--brand-fade);
    color: var(--brand-deep);
    font-size: 0.84rem;
    white-space: nowrap;
}

.legalBody .legalTableTbd {
    padding: 18px 14px;
    text-align: center;
    font-style: italic;
    color: var(--text-soft);
}

.legalBody strong {
    color: var(--brand-deep);
    font-weight: 700;
}

.legalBody a {
    color: var(--brand);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--t-base);
}

.legalBody a:hover {
    color: var(--brand-deep);
}

@media (max-width: 720px) {
    .legalSection {
        padding: 48px 0 40px;
    }

    

    .legalBody h2 {
        font-size: 1.9rem;
        margin-top: 40px;
    }

    .legalBody h3 {
        font-size: 1.4rem;
        margin-top: 28px;
    }
}

/* Índice numerado simple en cabecera legal */








/* Fecha de actualización al final del aviso legal: línea fina a la izquierda
   que llega hasta el texto de la fecha alineado a la derecha */
.legalUpdated {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    font-size: 0.9rem;
    color: var(--text-soft);
    letter-spacing: 0.02em;
    font-style: italic;
}

.legalUpdated::before {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* Sub-numeración finalidades (h4 dentro de h3) */
.legalBody h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand);
    margin: 28px 0 12px;
}

/* Separación entre las 2 secciones (aviso legal + privacidad) */
.legalBody#politica-privacidad {
    margin-top: 48px;
}

/* ============================================
   SIDEBAR LEGAL — índice sticky en columna grid izquierda
   ============================================ */
.legalSection {
    position: relative;
}

.legalSidebar {
    position: sticky;
    /* top coincide con la posición inicial del sidebar (alto del header
       sticky 72px + padding-top de .legalSection 56px). Sin viaje inicial
       — se queda fijo desde el primer pixel de scroll. */
    top: 128px;
    align-self: start;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    /* Scrollbar discreto */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 64, 82, 0.2) transparent;
}

.legalSidebar::-webkit-scrollbar {
    width: 6px;
}

.legalSidebar::-webkit-scrollbar-track {
    background: transparent;
}

.legalSidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 64, 82, 0.2);
    border-radius: 3px;
}

.legalSidebarNav {
    display: flex;
    flex-direction: column;
    gap: 22px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    line-height: 1.4;
}

.legalSidebarGroup {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legalSidebarTitle {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--brand-deep);
    text-decoration: none;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    letter-spacing: -0.005em;
    transition: color var(--t-base);
}

.legalSidebarTitle:hover {
    color: var(--brand);
}

.legalSidebarGroup ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legalSidebarGroup li a {
    display: block;
    padding: 5px 10px;
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 500;
    border-left: 2px solid transparent;
    margin-left: -10px;
    transition: color var(--t-base), border-color var(--t-base), background var(--t-base);
    border-radius: 0 4px 4px 0;
}

.legalSidebarGroup li a:hover {
    color: var(--brand);
    border-left-color: var(--brand);
    background: rgba(0, 64, 82, 0.04);
}

/* Estado activo: sección actual donde está el scroll */
.legalSidebarGroup li a.is-active {
    color: var(--brand-deep);
    font-weight: 800;
    border-left-color: var(--brand);
    background: rgba(0, 64, 82, 0.06);
}

.legalSidebarTitle.is-active {
    color: var(--brand);
}

/* Scroll suave para clicks en anchors, con offset por sticky header */
html {
    scroll-behavior: smooth;
}

.legalBody h2,
.legalBody h3 {
    scroll-margin-top: 80px;
}

/* Oculto en pantallas estrechas — móvil + tablet */
@media (max-width: 1024px) {
    .legalLayout {
        grid-template-columns: 1fr;
    }

    .legalSidebar {
        display: none;
    }
}
