/* ════════════════════════════════════════════════════════════
   RENATA · páginas legales (garantía, privacidad, términos y bases)
   Usa la base de renata.css; aquí solo el formato de documento.
════════════════════════════════════════════════════════════ */

body.legal-page { padding-bottom: 0; }

.back-link { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: .95rem; font-weight: 500; transition: background-color .2s, color .2s; }
.back-link .i { width: 18px; height: 18px; }
.back-link:hover { background: var(--ink); color: var(--paper); }

/* ═══ ENCABEZADO DEL DOCUMENTO ═══ */
.page-header { padding: 72px 0 56px; }
.page-header .container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.page-header .container::before { content: 'Documento legal'; display: block; margin-bottom: 26px; padding-top: 16px; border-top: 1.5px solid var(--ink); font-size: .95rem; color: var(--muted); }
.page-header h1 { max-width: 900px; font-size: clamp(2.6rem, 1.2rem + 4.4vw, 5rem); line-height: 1; letter-spacing: -.035em; }
.page-header p { margin-top: 22px; font-size: 1rem; color: var(--muted); }

/* ═══ CUERPO: índice fijo a la izquierda, texto a la derecha ═══ */
.legal-content { padding-bottom: 120px; }
.legal-content > .container {
  display: grid; grid-template-columns: 260px minmax(0, 720px); gap: 72px; justify-content: space-between; align-items: start;
  width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
}
.legal-body { grid-column: 2; min-width: 0; }
.legal-body h2 {
  margin: 56px 0 18px; padding-top: 18px; border-top: 1px solid var(--rule);
  font-size: clamp(1.5rem, 1.2rem + .8vw, 1.95rem); line-height: 1.2; letter-spacing: -.02em; scroll-margin-top: calc(var(--nav-h) + 20px);
}
.legal-body h2:first-child { margin-top: 0; border-top: 1.5px solid var(--ink); }
.legal-body p, .legal-body li { font-size: 1.05rem; line-height: 1.75; color: var(--ink-2); }
.legal-body p + p { margin-top: 16px; }
.legal-body ol { margin: 14px 0 18px; padding-left: 1.4em; list-style: lower-alpha; }
.legal-body ol li { padding-left: 6px; }
.legal-body ol li + li { margin-top: 10px; }
.legal-body ol li::marker { font-family: var(--serif); font-style: italic; color: var(--muted); }
.legal-body strong { color: var(--ink); }
.legal-body a:not(.btn) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.legal-body a:not(.btn):hover { text-decoration-color: var(--ink); }
.legal-body .btn { margin-top: 48px; }

/* índice de cláusulas (lo arma legal.js) */
.toc { grid-column: 1; grid-row: 1; position: sticky; top: calc(var(--nav-h) + 24px); max-height: calc(100vh - var(--nav-h) - 48px); overflow-y: auto; }
.toc > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 14px; border-top: 1.5px solid var(--ink); cursor: pointer; list-style: none; font-size: .95rem; color: var(--muted); }
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary .i { width: 18px; height: 18px; transition: transform .25s ease; }
.toc[open] > summary .i { transform: rotate(45deg); }
.toc ol { counter-reset: toc; }
.toc li { border-top: 1px solid var(--rule); }
.toc a { display: grid; grid-template-columns: 30px minmax(0, 1fr); padding: 9px 0; font-size: .9rem; line-height: 1.35; color: var(--ink-2); transition: color .2s; }
.toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-family: var(--serif); font-style: italic; color: var(--muted); }
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--ink); font-weight: 600; }
.toc a.is-current::before { color: var(--ink); }

/* ═══ PANTALLAS MEDIANAS Y CELULARES ═══ */
@media (max-width: 900px) {
  .legal-content > .container { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .legal-body { grid-column: 1; }
  .toc { position: static; max-height: none; overflow: visible; }
  .toc > summary { padding: 16px 18px; border: 1.5px solid var(--ink); border-radius: 14px; color: var(--ink); font-weight: 500; }
  .toc[open] > summary { border-radius: 14px 14px 0 0; }
  .toc ol { padding: 4px 18px 10px; border: 1.5px solid var(--ink); border-top: 0; border-radius: 0 0 14px 14px; }
  .toc li:first-child { border-top: 0; }
}
@media (max-width: 640px) {
  .back-link { min-height: 40px; padding: 0 14px; font-size: .88rem; }
  .back-long { display: none; }
  .page-header { padding: 44px 0 36px; }
  .page-header h1 { font-size: clamp(2.2rem, 10vw, 3rem); }
  .legal-content { padding-bottom: 88px; }
  .legal-body p, .legal-body li { font-size: 1rem; }
  .legal-body .btn { width: 100%; }
}

@media print {
  .nav, .footer, .toc { display: none; }
  .legal-content > .container { display: block; }
}
