/* ========== Reset y variables ========= */
* { box-sizing: border-box; }
html { font-size: 16px; }
html, body { margin: 0; padding: 0; }
:root {
  --bg: #ffffff;
  --text: #121212;
  --muted: #6b7280;
  --primary: #0ea5e9;
  --primary-contrast: #ffffff;
  --surface: #f5f7fb;
  --border: #e5e7eb;
  --focus: #93c5fd;
}
[data-theme="dark"] {
  --bg: #0b1020;
  --text: #e5e7eb;
  --muted: #a1a1aa;
  --primary: #38bdf8;
  --primary-contrast: #0b1020;
  --surface: #0f172a;
  --border: #1f2937;
  --focus: #60a5fa;
}
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg: #0b1020;
    --text: #e5e7eb;
    --muted: #a1a1aa;
    --primary: #38bdf8;
    --primary-contrast: #0b1020;
    --surface: #0f172a;
    --border: #1f2937;
    --focus: #60a5fa;
  }
}

/* ========== Layout ========= */
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  line-height: 1.6;
}
.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 1.25rem 0;
}
header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand img { width: 100%; height: 46px; border-radius: 8px; object-fit: cover; }
.brand .title { font-weight: 700; letter-spacing: .2px; }

nav a {
  text-decoration: none;
  color: var(--text);
  padding: .5rem .75rem;
  border-radius: .5rem;
}
nav a:hover { background: var(--border); }

.theme-select {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .95rem;
}
.theme-select select {
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--bg);
  color: var(--text);
}
main { padding: 1.25rem 0 2rem; }
h1 { font-size: clamp(1.6rem, 2.5vw, 2rem); margin: .5rem 0 1rem; }
h2 { font-size: clamp(1.2rem, 2vw, 1.4rem); margin-top: 1.25rem; }
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .9rem;
  padding: 1rem;
  margin: 1rem 0;
}
ul { padding-left: 1.25rem; }
a.link { color: var(--primary); }

footer.site {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: .95rem;
  padding: 1rem 0 2rem;
}
.footer-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
.footer-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem .9rem; border-radius: .6rem; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--primary); color: var(--primary-contrast); border-color: transparent; }
.btn:hover { filter: brightness(1.02); }
.btn:focus { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ========== Modal Cookies ========= */
.cookie-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.cookie-modal {
  background: var(--bg);
  color: var(--text);
  width: min(720px, 92vw);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 20px 40px rgba(0,0,0,.3);
}
.cookie-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.cookie-body { margin: .75rem 0; }
.cookie-row {
  display: grid; gap: .5rem;
  grid-template-columns: 1fr auto;
  padding: .75rem; border: 1px solid var(--border); border-radius: .75rem; margin: .5rem 0;
  background: var(--surface);
}
.cookie-row h4 { margin: 0; font-size: 1rem; }
.cookie-row p { margin: 0; color: var(--muted); font-size: .95rem; }
.switch {
  position: relative; display: inline-block; width: 50px; height: 28px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; transition: .2s; border-radius: 30px;
}
.slider:before {
  position: absolute; content: ""; height: 22px; width: 22px; left: 3px; top: 3px;
  background: white; transition: .2s; border-radius: 50%;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* Mostrar modal */
.cookie-backdrop.show { display: flex; }

/* Responsivo */
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
}

