/* Comisio — Hoja de estilos única
   Mobile-first, sin dependencias, sin build step.
   Diseño profesional: tipografía limpia, jerarquía clara y resultado destacado.
*/

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #f0f2f8;
  --text: #14202c;
  --text-soft: #5a6b7d;
  --text-mute: #8898a8;
  --primary: #1565d8;
  --primary-dark: #0f4ca8;
  --accent: #18a999;
  --accent-strong: #0f8276;
  --danger: #c0392b;
  --border: #e1e6ee;
  --border-strong: #c9d2df;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 44, 0.05);
  --shadow-md: 0 6px 24px rgba(20, 32, 44, 0.08);
  --max-w: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; display: block; }

/* ---------- layout ---------- */

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  max-width: var(--max-w);
  margin: 0 auto;
  gap: 12px;
  position: relative;   /* ancla el dropdown del nav */
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand .dot { color: var(--accent); }

/* ---------- hamburger (solo visible en móvil) ---------- */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
/* Estado abierto: forma una X */
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- nav ---------- */

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.main-nav a:hover { background: var(--surface-alt); text-decoration: none; }
.main-nav a.is-current { color: var(--primary); background: var(--surface-alt); }

/* ---------- lang switch ---------- */

.lang-switch {
  display: inline-flex;
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 2px;
  margin-left: 4px;
}
.lang-switch button {
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-soft);
  border-radius: 6px;
}
.lang-switch button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ---------- móvil: menú desplegable ---------- */

@media (max-width: 767px) {
  .hamburger { display: flex; }

  .main-nav {
    display: none;           /* oculto por defecto en móvil */
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
    padding: 8px 12px 14px;
    gap: 2px;
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
  .main-nav.is-open { display: flex; }

  .main-nav a {
    padding: 12px 10px;
    border-radius: 8px;
    font-size: 15px;
  }

  .lang-switch {
    margin-left: 0;
    margin-top: 6px;
    align-self: flex-start;
  }
}

/* ---------- hero ---------- */

.hero {
  padding: 32px 0 16px;
}
.hero h1 {
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  max-width: 640px;
}

/* ---------- calculator layout ---------- */

.calculator {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 16px 0 32px;
}

@media (min-width: 880px) {
  .calculator { grid-template-columns: 1.05fr 1fr; gap: 24px; }
  .hero h1 { font-size: 36px; }
  .hero p  { font-size: 18px; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.card h2 {
  font-size: 16px;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* ---------- form ---------- */

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.field input,
.field select {
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.15);
}
.field .hint {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
  line-height: 1.4;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
/* En pantallas muy estrechas (< 440px) apila a una sola columna */
@media (max-width: 439px) {
  .row-2 { grid-template-columns: 1fr; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

button.btn,
a.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
button.btn:hover { background: #e7ebf3; }
button.btn--primary,
a.btn--primary {
  background: var(--primary);
  color: #fff;
}
button.btn--primary:hover,
a.btn--primary:hover { background: var(--primary-dark); text-decoration: none; }
button.btn--ghost { background: transparent; border-color: var(--border-strong); }

/* ---------- results ---------- */

.net-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
}
.net-hero .label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 4px;
}
.net-hero .amount {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
@media (min-width: 600px) {
  .net-hero .amount { font-size: 38px; }
}

#results-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.row__label { color: var(--text-soft); }
.row__value { font-variant-numeric: tabular-nums; font-weight: 600; }

.row--total {
  background: var(--surface-alt);
  font-weight: 700;
}
.row--total .row__label,
.row--subtotal .row__label { color: var(--text); }
.row--subtotal { font-weight: 600; }
.row--info { color: var(--text-mute); font-size: 13px; }
.row--info .row__value { color: var(--text-mute); font-weight: 500; }
.row--deduction .row__label { color: var(--danger); }
.row--deduction .row__value { color: var(--danger); }
.row--final {
  display: none; /* el hero ya muestra el neto; lo ocultamos para no duplicar */
}

.preset-notes {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-soft);
}

.disclaimer {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.5;
}
.disclaimer p { margin: 0 0 6px; }

/* ---------- ad slots ---------- */

.ad-slot {
  margin: 24px 0;
  padding: 12px;
  background: var(--surface-alt);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-mute);
  font-size: 12px;
}

/* ---------- guides ---------- */

.guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0 30px;
}
@media (min-width: 720px) {
  .guide-grid { grid-template-columns: 1fr 1fr; }
}
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.guide-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.guide-card p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-soft);
}

/* ---------- article (guides individual) ---------- */

.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 18px 0;
  max-width: 760px;
}
.article h1 {
  margin-top: 0;
  font-size: 28px;
  line-height: 1.2;
}
.article h2 {
  margin-top: 28px;
  font-size: 20px;
}
.article h3 {
  margin-top: 22px;
  font-size: 17px;
}
.article p, .article li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}
.article ul, .article ol {
  padding-left: 22px;
}
.article .meta {
  color: var(--text-mute);
  font-size: 13px;
  margin-bottom: 18px;
}
.article blockquote {
  border-left: 4px solid var(--accent);
  margin: 18px 0;
  padding: 6px 16px;
  background: var(--surface-alt);
  border-radius: 6px;
  color: var(--text-soft);
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 22px 0;
  margin-top: 40px;
  color: var(--text-mute);
  font-size: 13px;
}
.site-footer .row-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
@media (min-width: 720px) {
  .site-footer .row-foot {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
.site-footer a { color: var(--text-soft); margin: 0 8px; }
