/* ===== MADACSA — Páginas legales (paleta corporativa real) ===== */
:root {
  /* Azul Madacsa (extraído del logo) */
  --blue: #0060a0;
  --blue-dark: #003e6c;
  --blue-darker: #002545;
  --blue-light: #4080b0;
  --blue-pale: #d4e3f0;
  --blue-paler: #eef4fa;

  /* Acento rojo del logo */
  --red: #c01020;
  --red-dark: #8e0c18;
  --red-soft: #fde7e9;

  /* Tinta principal */
  --ink: #0a1a2e;
  --ink-2: #1f3147;
  --muted: #5b6a7c;

  /* Estructura */
  --paper: #f4f7fb;
  --paper-2: #e7eef6;
  --line: #d6e0ec;

  /* Estado */
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --ok: #15803d;
  --ok-soft: #dcfce7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Century Gothic TM", "Century Gothic", "Raleway", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------- BRAND BAR ---------- */
.brand-bar {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}
.brand-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 65%, var(--red) 65%, var(--red) 100%);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand img { height: 44px; width: auto; display: block; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: .3px; line-height: 1.2; color: var(--blue-darker); }
.brand-name em { color: var(--muted); font-style: normal; font-weight: 500; display: block; font-size: 12px; margin-top: 2px; }
.brand-nav { display: flex; gap: 18px; align-items: center; }
.brand-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14px; }
.brand-nav a:hover { color: var(--blue); }

/* Language switcher */
.lang-switch {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-left: 4px;
}
.lang-switch a {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.lang-switch a:hover { color: var(--blue); }
.lang-switch a.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,96,160,.25);
}

/* ---------- HERO ---------- */
.legal-hero {
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(0,96,160,.10) 0%, transparent 60%),
    radial-gradient(50% 70% at 0% 100%, rgba(192,16,32,.05) 0%, transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, #fff 100%);
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--line);
}
.crumbs {
  font-size: 13px; color: var(--muted);
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 18px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }

.legal-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -.5px;
  font-weight: 700;
  color: var(--blue-darker);
}
.hero-sub {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 720px;
  margin: 0 0 24px;
  line-height: 1.55;
}
.meta-pills {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.meta-pills li {
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(10,26,46,.04);
}
.meta-pills strong { color: var(--blue-darker); font-weight: 700; }

/* ---------- LAYOUT ---------- */
.legal-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 64px;
  align-items: start;
}
@media (max-width: 900px) {
  .legal-shell { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static !important; }
  .toc-inner { max-height: none !important; }
}

/* ---------- TOC ---------- */
.toc {
  position: sticky;
  top: 88px;
}
.toc-inner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.toc-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.toc ol {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: toc;
}
.toc li { counter-increment: toc; margin: 2px 0; }
.toc a {
  display: block;
  padding: 7px 10px 7px 32px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 8px;
  line-height: 1.4;
  position: relative;
  transition: background .15s, color .15s;
}
.toc a::before {
  content: counter(toc);
  position: absolute;
  left: 8px;
  top: 7px;
  width: 18px; height: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: grid; place-items: center;
}
.toc a:hover { background: var(--blue-pale); color: var(--blue-darker); }
.toc a.active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
.toc a.active::before {
  background: #fff;
  border-color: #fff;
  color: var(--blue);
}
.toc-cta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.toc-link {
  display: block;
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
}
.toc-link:hover { background: var(--blue-pale); }

/* ---------- DOC ---------- */
.legal-doc { max-width: 760px; min-width: 0; }
.legal-doc section { margin-bottom: 56px; scroll-margin-top: 100px; }
.legal-doc h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--blue-darker);
  margin: 0 0 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  line-height: 1.25;
  letter-spacing: -.3px;
}
.legal-doc h2 .num {
  flex-shrink: 0;
  background: var(--blue);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 15px;
  font-weight: 800;
  font-family: ui-monospace, Menlo, monospace;
  position: relative;
  overflow: hidden;
}
.legal-doc h2 .num::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--red);
}
.legal-doc h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--blue-darker);
  margin: 32px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.legal-doc p { margin: 0 0 14px; color: var(--ink-2); }

/* ---------- CARDS / LISTS ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue) 70%, var(--red) 70%, var(--red) 100%);
}
.data-card dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 24px;
  margin: 0;
}
.data-card dt { font-weight: 700; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.data-card dd { margin: 0; color: var(--ink); font-weight: 500; }
.data-card a { color: var(--blue); font-weight: 600; }

.bullets {
  list-style: none;
  margin: 0; padding: 0;
}
.bullets li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
  color: var(--ink-2);
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 4px; top: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(0,96,160,.15);
}

/* ---------- CHIP GRID ---------- */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.chip:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,96,160,.12);
}
.chip strong { font-size: 14px; color: var(--blue-darker); }
.chip span { font-size: 13px; color: var(--muted); }

/* ---------- PROVIDER TABLE ---------- */
.provider-table, .cookie-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0 20px;
  font-size: 14px;
}
.provider-table .row, .cookie-table .row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1.4fr;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  align-items: center;
  gap: 12px;
}
.cookie-table .row { grid-template-columns: 1.4fr 1fr 1.6fr .6fr; }
.provider-table .row:first-child, .cookie-table .row:first-child { border-top: 0; }
.provider-table .head, .cookie-table .head {
  background: var(--blue-darker);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.provider-table .row:nth-child(even):not(.head),
.cookie-table .row:nth-child(even):not(.head) { background: var(--paper); }
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: #92400e; }
.dur {
  background: var(--blue-pale);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-darker);
  text-align: center;
}
code {
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--blue-darker);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- CALLOUT ---------- */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 18px 0;
  border-left: 4px solid;
  align-items: flex-start;
}
.callout p { margin: 0; }
.callout-info {
  background: var(--blue-paler);
  border-color: var(--blue);
}
.callout-success {
  background: var(--ok-soft);
  border-color: var(--ok);
}
.callout-warn {
  background: var(--red-soft);
  border-color: var(--red);
}
.callout-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1.3;
}

/* ---------- RETENTION GRID ---------- */
.retention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.ret {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.ret::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue) 75%, var(--red) 75%, var(--red) 100%);
}
.ret-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue-darker);
  letter-spacing: -.5px;
}
.ret-lbl {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.ret-lbl em { color: var(--ink-2); font-style: normal; }

/* ---------- RIGHTS GRID ---------- */
.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}
.right {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  transition: transform .15s, border-color .15s, background .15s;
}
.right:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  background: #fff;
}
.right .ico { font-size: 22px; display: block; margin-bottom: 6px; }
.right strong { display: block; font-size: 14px; color: var(--blue-darker); margin-bottom: 4px; }
.right p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---------- SECURITY GRID ---------- */
.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.sec-card {
  background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sec-card .sec-ico { font-size: 22px; }
.sec-card strong { font-size: 14px; color: var(--blue-darker); }
.sec-card p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* ---------- BROWSER GRID ---------- */
.browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.browser {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.browser:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 6px 16px rgba(0,96,160,.18);
}
.browser-ico { font-size: 24px; }
.browser strong { font-size: 14px; color: var(--blue-darker); }
.browser-meta { font-size: 11px; color: var(--muted); }

/* ---------- BADGE TAGS in h3 ---------- */
.badge-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-essential { background: var(--ok-soft); color: var(--ok); }
.badge-pref { background: var(--blue-pale); color: var(--blue); }
.badge-none { background: #e9eef4; color: var(--muted); }

/* ---------- NEXT DOC ---------- */
.next-doc {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.next-doc a {
  display: flex;
  flex-direction: column;
  padding: 22px 28px;
  background: linear-gradient(135deg, var(--blue-darker) 0%, var(--blue) 100%);
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  transition: transform .2s, box-shadow .2s;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}
.next-doc a::before {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 6px;
  height: 100%;
  background: var(--red);
}
.next-doc a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,96,160,.30);
}
.next-label {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}
.next-title { font-size: 18px; font-weight: 700; }

/* ---------- FOOTER ---------- */
.legal-foot {
  background: var(--blue-darker);
  color: rgba(255,255,255,.75);
  padding: 28px 0;
  font-size: 13px;
  position: relative;
}
.legal-foot::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 65%, var(--red) 65%, var(--red) 100%);
}
.legal-foot .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.legal-foot strong { color: #fff; }
.legal-links { display: flex; gap: 20px; }
.legal-links a { color: rgba(255,255,255,.75); text-decoration: none; }
.legal-links a:hover { color: #fff; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .legal-hero { padding: 36px 0 32px; }
  .legal-doc h2 { font-size: 22px; }
  .brand img { height: 36px; }
  .brand-name { display: none; }
  .data-card dl { grid-template-columns: 1fr; gap: 4px; }
  .data-card dd { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .provider-table .row, .cookie-table .row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .provider-table .head, .cookie-table .head { display: none; }
  .provider-table .row:not(.head), .cookie-table .row:not(.head) {
    padding: 14px;
  }
}

/* ---------- PRINT ---------- */
@media print {
  .brand-bar, .toc, .next-doc, .legal-foot, .brand-nav { display: none; }
  .legal-shell { grid-template-columns: 1fr; padding: 0; }
  .legal-doc { max-width: none; }
  body { font-size: 11pt; color: #000; }
  a { color: #000; }
}
