*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #0d1b3e;
  --navy2:  #122150;
  --blue:   #1a3a8f;
  --accent: #2e8adf;
  --light:  #5bb8ff;
  --pale:   #e8f4ff;
  --white:  #ffffff;
  --gray:   #f4f7fc;
  --text:   #1c2a44;
  --muted:  #5a6a84;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.75;
}

/* ── NAV ─────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13, 27, 62, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(91,184,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  padding: 0 5%;
  height: 86px;
}

.nav-logo {
  height: 60px;
  display: block;
  /*filter: brightness(0) invert(1);*/
}

.nav-back {
  position: absolute;
  right: 5%;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .03em;
  white-space: nowrap;
  transition: color .2s;
}
.nav-back:hover { color: var(--light); }

/* ── HERO ─────────────────────────────────── */
.legal-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  padding: 72px 5% 56px;
  text-align: center;
}

.section-label {
  display: inline-block;
  color: var(--light);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .7rem;
}

.legal-hero h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: .5rem;
}

.update-date {
  color: rgba(255,255,255,.5);
  font-size: .85rem;
}

/* ── BODY ─────────────────────────────────── */
.legal-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 5% 80px;
}

/* TOC */
.toc {
  background: var(--gray);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.4rem 1.8rem;
  margin-bottom: 3rem;
}

.toc h4 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: .8rem;
}

.toc ol { padding-left: 1.2rem; }

.toc li { margin-bottom: .3rem; }

.toc a {
  color: var(--navy);
  text-decoration: none;
  font-size: .9rem;
  transition: color .2s;
}
.toc a:hover { color: var(--accent); }

/* INFO BOX */
.info-box {
  background: var(--pale);
  border: 1px solid rgba(46,138,223,.25);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  font-size: .92rem;
  color: var(--navy);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.highlight-box {
  background: #fff8e1;
  border-left: 4px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.4rem;
  font-size: .9rem;
  color: #78350f;
  margin-top: 1.2rem;
  line-height: 1.7;
}

/* SECTIONS */
section {
  margin-bottom: 3.2rem;
  padding-top: .4rem;
}

section h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--pale);
}

section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin: 1.4rem 0 .6rem;
}

section p { color: var(--muted); margin-bottom: .9rem; font-size: .97rem; }

section ul {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

section ul li {
  color: var(--muted);
  font-size: .97rem;
  margin-bottom: .45rem;
}

section ul li strong { color: var(--navy); }

/* DATA TABLE */
.data-table {
  border: 1px solid #dce5f0;
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0 1.4rem;
}

.data-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid #dce5f0;
}
.data-row:last-child { border-bottom: none; }

.data-key {
  background: var(--gray);
  padding: .65rem 1rem;
  font-size: .83rem;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.data-val {
  padding: .65rem 1rem;
  font-size: .93rem;
  color: var(--muted);
}

/* RIGHTS GRID */
.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.right-card {
  background: var(--gray);
  border: 1px solid #dce5f0;
  border-radius: 10px;
  padding: 1.2rem;
  transition: border-color .2s;
}
.right-card:hover { border-color: rgba(46,138,223,.35); }

.right-icon { font-size: 1.4rem; margin-bottom: .5rem; }

.right-card h4 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .4rem;
}

.right-card p { font-size: .82rem; margin: 0; }

/* COOKIE TYPE CARDS */
.cookie-type-card {
  border-radius: 10px;
  border: 1px solid #dce5f0;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1rem;
}

.cookie-type-header {
  display: flex; align-items: center; gap: .8rem;
  margin-bottom: .6rem;
  flex-wrap: wrap;
}

.cookie-type-header h3 { margin: 0; font-size: 1rem; }

.cookie-badge {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .25rem .7rem;
  border-radius: 20px;
  white-space: nowrap;
}

.essential-badge  { background: #dcfce7; color: #166534; }
.analytics-badge  { background: #fef9c3; color: #854d0e; }
.functional-badge { background: #dbeafe; color: #1e40af; }
.marketing-badge  { background: #fee2e2; color: #991b1b; }

.essential  { border-left: 4px solid #22c55e; }
.analytics  { border-left: 4px solid #eab308; }
.functional { border-left: 4px solid #3b82f6; }
.marketing  { border-left: 4px solid #ef4444; }

/* COOKIES TABLE */
.table-wrap { overflow-x: auto; margin: 1rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

th {
  background: var(--navy);
  color: var(--white);
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

td {
  padding: .65rem 1rem;
  border-bottom: 1px solid #dce5f0;
  color: var(--muted);
  vertical-align: top;
}

tr:nth-child(even) td { background: var(--gray); }

code {
  background: #eef2ff;
  color: var(--blue);
  padding: .15rem .45rem;
  border-radius: 4px;
  font-size: .83rem;
  font-family: 'Courier New', monospace;
}

.table-note {
  font-size: .82rem;
  color: var(--muted);
  font-style: italic;
  margin-top: .6rem;
}

/* BROWSER GRID */
.browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .8rem;
  margin: 1.2rem 0;
}

.browser-card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  background: var(--gray);
  border: 1px solid #dce5f0;
  border-radius: 8px;
  padding: 1rem;
  text-decoration: none;
  transition: border-color .2s, background .2s;
}
.browser-card:hover { border-color: var(--accent); background: var(--pale); }

.browser-card strong { color: var(--navy); font-size: .9rem; }
.browser-card span   { color: var(--accent); font-size: .8rem; }

/* ── FOOTER ─────────────────────────────────── */
footer {
  background: var(--navy);
  padding: 2.4rem 5%;
  color: rgba(255,255,255,.5);
  font-size: .85rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem 2rem;
}

.footer-logo { height: 34px; filter: brightness(0) invert(1) opacity(.55); }

.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
}

.footer-copy {
  font-size: .82rem;
  color: rgba(255,255,255,.4);
  text-align: center;
  margin: 0;
}

.footer-social {
  display: flex;
  gap: .5rem;
}

.footer-social a {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  transition: background .2s, border-color .2s, color .2s;
}
.footer-social a:hover {
  background: rgba(91,184,255,.15);
  border-color: rgba(91,184,255,.4);
  color: var(--light);
}
.footer-social svg { display: block; }

.footer-links { display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; }
.footer-links a { color: rgba(255,255,255,.4); text-decoration: none; font-size: .82rem; transition: color .2s; }
.footer-links a:hover { color: var(--light); }

@media (max-width: 700px) {
  .footer-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1.2rem;
  }
  .footer-links { align-items: center; flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 600px) {
  .data-row { grid-template-columns: 1fr; }
  .data-key { border-bottom: 1px solid #dce5f0; }
  .rights-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  nav {
    height: auto;
    min-height: 70px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: .35rem;
    padding: .8rem 5%;
  }
  .nav-logo { height: 44px; }
  .nav-back  {
    position: static;
    font-size: .75rem;
    letter-spacing: .02em;
    color: rgba(255,255,255,.5);
  }

  /* Cookie banner en móvil */
  #cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 5%;
  }
  .cookie-text { min-width: 0; }
  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }
  .cookie-btn { width: 100%; text-align: center; }
}

/* ── COOKIE BANNER ───────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 500;
  background: var(--navy);
  border-top: 2px solid rgba(91,184,255,.2);
  padding: 1.2rem 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: 0 -4px 24px rgba(0,0,0,.25);
}
#cookie-banner.hidden { display: none; }

.cookie-text {
  color: rgba(255,255,255,.78);
  font-size: .87rem;
  line-height: 1.6;
  flex: 1;
  min-width: 260px;
}
.cookie-text a { color: var(--light); text-decoration: underline; }

.cookie-actions { display: flex; gap: .7rem; flex-wrap: wrap; flex-shrink: 0; }

.cookie-btn {
  padding: .55rem 1.2rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  transition: opacity .2s;
}
.cookie-btn:hover { opacity: .85; }
.cookie-accept   { background: var(--accent); color: var(--white); }
.cookie-reject   { background: transparent; color: rgba(255,255,255,.65); border: 1.5px solid rgba(255,255,255,.25); }
.cookie-settings { background: transparent; color: var(--light); border: 1.5px solid rgba(91,184,255,.35); }

/* ── COOKIE MODAL ────────────────────────────── */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cookie-modal.hidden { display: none; }

.cookie-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
}

.cookie-modal-panel {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
}

.cookie-modal-header {
  background: var(--navy);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cookie-modal-header h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}
.cookie-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: .15rem .5rem;
  border-radius: 4px;
  transition: background .2s, color .2s;
}
.cookie-modal-close:hover { background: rgba(255,255,255,.12); color: var(--white); }

.cookie-modal-body {
  padding: .4rem 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.cookie-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid #eef2f8;
}
.cookie-pref-row:last-child { border-bottom: none; }

.cookie-pref-info { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.cookie-pref-info strong { font-size: .9rem; color: var(--navy); }
.cookie-pref-info span   { font-size: .78rem; color: var(--muted); line-height: 1.45; }

.cookie-toggle-always {
  font-size: .72rem; font-weight: 700;
  color: #15803d; background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: .25rem .75rem;
  border-radius: 20px;
  white-space: nowrap; flex-shrink: 0;
}

.cookie-toggle-switch { cursor: pointer; flex-shrink: 0; }
.cookie-toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.cookie-toggle-track {
  display: block;
  width: 44px; height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  position: relative;
  transition: background .2s;
}
.cookie-toggle-switch input:checked + .cookie-toggle-track { background: var(--accent); }

.cookie-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}
.cookie-toggle-switch input:checked + .cookie-toggle-track .cookie-toggle-thumb {
  transform: translateX(20px);
}

.cookie-modal-footer {
  padding: 1rem 1.5rem;
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  border-top: 1px solid #eef2f8;
  background: #f8fafc;
}
