:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #5b6573;
  --brand: #e8702a;
  --brand-dark: #c95b1a;
  --border: #e3e7ec;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --radius: 12px;
  --maxw: 880px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

header.site {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo { font-weight: 800; font-size: 1.25rem; color: var(--text); }
.logo span { color: var(--brand); }
nav.site a { margin-left: 18px; color: var(--muted); font-weight: 600; font-size: .95rem; }
nav.site a:hover { color: var(--brand-dark); text-decoration: none; }

.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { font-size: 2.1rem; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 620px; margin: 0 auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: block;
}
.card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-2px); transition: .15s; }
.card h3 { margin: 0 0 6px; color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.card .ico { font-size: 1.8rem; }

section { padding: 28px 0; }
h2.section-title { font-size: 1.5rem; margin: 0 0 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head .section-title { margin-bottom: 12px; }

.grid-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
@media (max-width: 600px) { .grid-fields { grid-template-columns: 1fr; } }
.calc .field { margin-bottom: 0; }
article.guide h3 { font-size: 1.05rem; margin-top: 18px; margin-bottom: 4px; }

/* Calculator */
.calc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.calc .field { margin-bottom: 16px; }
.calc label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.calc input, .calc select {
  width: 100%; padding: 11px 12px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.calc input:focus, .calc select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn {
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  padding: 12px 20px; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--brand-dark); }
.result {
  margin-top: 20px; padding: 18px; border-radius: 10px;
  background: #fff5ee; border: 1px solid #f6d3bb;
}
.result.hidden { display: none; }
.result .big { font-size: 1.8rem; font-weight: 800; color: var(--brand-dark); }
.result ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); }

/* Article */
article.guide { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
article.guide h1 { font-size: 1.9rem; margin-top: 0; }
article.guide h2 { font-size: 1.35rem; margin-top: 28px; }
article.guide p, article.guide li { color: #2b3442; }
.meta { color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin: 18px 0; }

.cta-box { margin: 26px 0; padding: 18px; background: #fff5ee; border: 1px solid #f6d3bb; border-radius: 10px; }

footer.site { border-top: 1px solid var(--border); background: var(--card); margin-top: 40px; padding: 28px 0; color: var(--muted); font-size: .9rem; }
footer.site a { color: var(--muted); }

.post-list { list-style: none; padding: 0; }
.post-list li { border-bottom: 1px solid var(--border); padding: 14px 0; }
.post-list a { font-weight: 700; font-size: 1.05rem; }
.post-list .d { color: var(--muted); font-size: .85rem; }

/* Anuncios */
.ad-slot {
  margin: 24px auto;
  text-align: center;
  min-height: 90px;
  overflow: hidden;
}
.ad-slot::before {
  content: "Publicidad";
  display: block;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #aab2bd;
  margin-bottom: 4px;
}
.ad-slot ins { display: block; }

/* Banner de cookies */
#cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: #1f2733; color: #eef1f5;
  box-shadow: 0 -2px 12px rgba(0,0,0,.18);
}
.cookie-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: space-between;
}
.cookie-inner p { margin: 0; font-size: .9rem; flex: 1 1 320px; }
.cookie-inner a { color: #ffb784; }
.cookie-btns { display: flex; gap: 10px; }
.btn-ghost {
  background: transparent; color: #cdd4dd; border: 1px solid #45505f;
  border-radius: 8px; padding: 10px 18px; font-weight: 600; cursor: pointer;
}
.btn-ghost:hover { border-color: #6b7787; }

.legal h1 { font-size: 1.8rem; }
.legal h2 { font-size: 1.25rem; margin-top: 26px; }
.legal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .row2 { grid-template-columns: 1fr; }
  nav.site a { margin-left: 12px; }
  .cookie-btns { width: 100%; }
  .cookie-btns button { flex: 1; }
}
