/* ============================================================
   DAVEC — Páginas legales (privacidad · datos · términos)
   Hereda el sistema visual de styles.css
   ============================================================ */

/* ---- Cabecera legal ---- */
.legal-hero {
  background:
    radial-gradient(120% 90% at 88% -20%, rgba(46,123,79,.16), transparent 55%),
    linear-gradient(165deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.legal-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 70% at 50% 0%, #000, transparent 78%);
  opacity: .5; pointer-events: none;
}
.legal-hero-inner {
  position: relative; z-index: 2;
  padding-block: clamp(48px, 6vw, 84px) clamp(40px, 5vw, 64px);
}
.crumbs {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,.6);
  margin-bottom: 26px;
}
.crumbs a { color: rgba(255,255,255,.6); transition: color .2s var(--ease); }
.crumbs a:hover { color: var(--gold-soft); }
.crumbs svg { width: 15px; height: 15px; opacity: .5; }
.crumbs .current { color: var(--gold-soft); }

.legal-hero h1 {
  color: #fff; font-size: clamp(34px, 4.6vw, 58px); line-height: 1.04;
  letter-spacing: -0.03em; font-weight: 800; max-width: 18ch;
}
.legal-meta {
  display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center;
  margin-top: 26px; font-size: 14px; color: rgba(255,255,255,.7);
}
.legal-meta .lm {
  display: inline-flex; align-items: center; gap: 9px; font-weight: 600;
}
.legal-meta svg { width: 17px; height: 17px; color: var(--gold-soft); }

/* Switcher entre documentos legales */
.legal-tabs {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 34px;
}
.legal-tabs a {
  font-family: var(--sans); font-weight: 700; font-size: 13.5px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.06); border: 1px solid var(--line-dk);
  padding: 10px 18px; border-radius: 999px;
  transition: all .25s var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
}
.legal-tabs a svg { width: 15px; height: 15px; opacity: .8; }
.legal-tabs a:hover { border-color: rgba(199,162,78,.5); color: #fff; transform: translateY(-2px); }
.legal-tabs a.active {
  background: var(--gold); color: var(--navy-900); border-color: var(--gold);
}
.legal-tabs a.active svg { opacity: 1; }

/* ---- Cuerpo legal ---- */
.legal-body { background: var(--cream); padding-block: clamp(48px, 6vw, 88px); }
.legal-layout {
  display: grid; grid-template-columns: 264px 1fr; gap: clamp(36px, 5vw, 76px);
  align-items: start;
}

/* Índice lateral pegajoso */
.legal-toc { position: sticky; top: 100px; }
.legal-toc .toc-label {
  font-family: var(--sans); font-weight: 700; font-size: 12px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep);
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.legal-toc .toc-label::before { content: ""; width: 22px; height: 2px; background: var(--gold); }
.legal-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex; gap: 11px; align-items: baseline;
  padding: 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  border-left: 2px solid transparent;
  transition: all .2s var(--ease); line-height: 1.35;
}
.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--display); font-weight: 700; font-size: 11.5px;
  color: var(--gold-deep); flex: none; padding-top: 1px;
}
.legal-toc a:hover { background: var(--paper); color: var(--navy-800); }
.legal-toc a.active {
  background: var(--paper); color: var(--navy-800);
  border-left-color: var(--gold); box-shadow: var(--shadow-sm);
}

/* Prosa */
.legal-prose { max-width: 760px; }
.legal-intro {
  font-size: 18.5px; color: var(--ink); font-weight: 500; line-height: 1.65;
  padding-bottom: 30px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.legal-section { padding-top: 38px; scroll-margin-top: 100px; }
.legal-section:first-of-type { padding-top: 14px; }
.legal-section h2 {
  font-size: clamp(23px, 2.4vw, 30px); margin-bottom: 18px;
  display: flex; gap: 16px; align-items: baseline;
}
.legal-section h2 .sec-num {
  font-family: var(--display); font-weight: 800; font-size: 16px;
  color: var(--gold-deep); flex: none;
  border: 1.5px solid rgba(199,162,78,.4); border-radius: 8px;
  padding: 4px 10px; line-height: 1; align-self: center;
}
.legal-section h3 { font-size: 18.5px; margin: 26px 0 10px; color: var(--navy-700); }
.legal-section p { color: var(--ink-soft); font-size: 16px; line-height: 1.72; margin-bottom: 16px; }
.legal-section p strong { color: var(--navy-700); font-weight: 700; }
.legal-section ul.bullets { display: flex; flex-direction: column; gap: 11px; margin: 4px 0 20px; }
.legal-section ul.bullets li {
  position: relative; padding-left: 28px; color: var(--ink-soft);
  font-size: 15.5px; line-height: 1.6;
}
.legal-section ul.bullets li::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg);
}
.legal-section ul.bullets li strong { color: var(--navy-700); }

/* Marcador por completar (NIT, dirección, etc.) */
.tbd {
  display: inline-block; font-weight: 700; font-size: .9em;
  color: var(--gold-deep); background: rgba(199,162,78,.12);
  border: 1px dashed rgba(199,162,78,.5); border-radius: 6px;
  padding: 0 7px; line-height: 1.5; letter-spacing: .04em;
}

/* Bloque de datos del responsable / contacto formal */
.legal-data {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 18px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px 24px; margin: 6px 0 8px;
  box-shadow: var(--shadow-sm);
}
.legal-data dt {
  font-weight: 700; font-size: 14px; color: var(--navy-700);
  letter-spacing: .01em;
}
.legal-data dd { margin: 0; font-size: 15px; color: var(--ink-soft); }
.legal-data dd a { color: var(--gold-deep); font-weight: 600; }
@media (max-width: 560px) {
  .legal-data { grid-template-columns: 1fr; gap: 3px 0; padding: 18px 18px; }
  .legal-data dd { margin-bottom: 10px; }
  .legal-data dd:last-child { margin-bottom: 0; }
}

/* Callout / nota destacada */
.legal-note {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 12px; padding: 20px 22px; margin: 8px 0 24px;
  box-shadow: var(--shadow-sm);
}
.legal-note .ln-ico {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(46,123,79,.1); color: var(--green);
  border: 1px solid rgba(46,123,79,.22);
}
.legal-note .ln-ico svg { width: 20px; height: 20px; }
.legal-note p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.legal-note p strong { color: var(--navy-800); }

/* Caja de contacto al cierre */
.legal-contact-box {
  margin-top: 46px; background: linear-gradient(155deg, var(--navy-700), var(--navy-900));
  border-radius: 18px; padding: clamp(28px, 3.5vw, 42px);
  color: #fff; box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.legal-contact-box::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 90% at 0% 0%, rgba(46,123,79,.22), transparent 60%);
  pointer-events: none;
}
.legal-contact-box h3 { color: #fff; font-size: 24px; position: relative; }
.legal-contact-box p { color: rgba(255,255,255,.76); font-size: 15.5px; margin-top: 12px; position: relative; }
.legal-contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; position: relative; }

/* Botón volver arriba flotante (reutiliza fab pero distinto) */
.to-top {
  position: fixed; left: 24px; bottom: 24px; z-index: 120;
  width: 48px; height: 48px; border-radius: 999px;
  background: var(--navy-800); color: #fff; border: 1px solid var(--line-dk);
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .25s var(--ease);
  box-shadow: var(--shadow-md);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--gold); color: var(--navy-900); }
.to-top svg { width: 20px; height: 20px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 0; }
  .legal-toc {
    position: static; margin-bottom: 30px;
    background: var(--paper); border: 1px solid var(--line);
    border-radius: 14px; padding: 18px 16px; box-shadow: var(--shadow-sm);
  }
  .legal-toc ol { columns: 2; column-gap: 14px; }
  .legal-toc a { border-left: 0; padding: 7px 8px; }
  .legal-toc a.active { box-shadow: none; }
}
@media (max-width: 560px) {
  .legal-toc ol { columns: 1; }
  .to-top { left: 16px; bottom: 16px; }
  .legal-tabs a { font-size: 12.5px; padding: 9px 14px; }
}
