:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6676;
  --border: #e2e6ec;
  --primary: #0f7b5f;
  --primary-hover: #0b634c;
  --accent-bg: #e8f5f0;
  --radius: 12px;
  --max: 920px;
}

* { box-sizing: border-box; }

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

a { color: var(--primary); }

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

/* Cabecera y pie */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.logo span { color: var(--primary); }
.nav { display: flex; gap: 16px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--primary); }

.site-footer { margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; background: var(--surface); }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

/* Contenido */
main { padding: 24px 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 8px 0 8px; }
h2 { font-size: 1.35rem; margin-top: 32px; }
.lead { color: var(--muted); font-size: 1.05rem; margin-top: 0; }
.breadcrumb { font-size: .85rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

/* Calculadora */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
@media (max-width: 720px) { .calc { grid-template-columns: 1fr; } }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 10px 12px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus { outline: 2px solid var(--primary); border-color: transparent; }
.hint { font-size: .8rem; color: var(--muted); }

.btn { display: inline-block; width: 100%; padding: 12px; font-size: 1rem; font-weight: 700; color: #fff; background: var(--primary); border: 0; border-radius: 8px; cursor: pointer; }
.btn:hover { background: var(--primary-hover); }

.result-main { background: var(--accent-bg); border-radius: 10px; padding: 16px; text-align: center; margin-bottom: 14px; }
.result-main .label { color: var(--muted); font-size: .9rem; }
.result-main .value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.result-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); gap: 12px; }
.result-row:last-child { border-bottom: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { background: var(--bg); }

.note { font-size: .85rem; color: var(--muted); background: var(--bg); border-left: 3px solid var(--border); padding: 8px 12px; }

/* Listado de calculadoras */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.tool { display: block; text-decoration: none; color: var(--text); transition: border-color .15s; }
.tool:hover { border-color: var(--primary); }
.tool h3 { margin: 0 0 6px; font-size: 1.1rem; }
.tool p { margin: 0; color: var(--muted); font-size: .92rem; }
.tool.soon { opacity: .55; pointer-events: none; }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; }
summary { font-weight: 600; cursor: pointer; }

/* Compartir */
.share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 16px; font-size: .92rem; color: var(--muted); }
.share-btn { display: inline-block; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; text-decoration: none; cursor: pointer; }
.share-btn:hover { border-color: var(--primary); color: var(--primary); }
.share-btn.whatsapp { background: #25d366; border-color: #25d366; color: #fff; font-weight: 600; }
.share-btn.whatsapp:hover { background: #1ebe5b; color: #fff; }

/* Huecos para bloques de anuncio manuales. Vacíos no se muestran: con anuncios automáticos,
   AdSense coloca los anuncios por su cuenta. */
.ad-slot { margin: 24px 0; min-height: 100px; }
.ad-slot:empty { display: none; }
