/* Conversor Total — diseño utilitario tipo instrumento de precisión
   Paleta: índigo + gris claro + acento ámbar. Números tabulares. Mobile-first. */

:root {
  --indigo-900: #1e1b4b;
  --indigo-700: #3730a3;
  --indigo-600: #4f46e5;
  --indigo-500: #6366f1;
  --indigo-50:  #eef2ff;
  --amber:      #f59e0b;
  --amber-dark: #b45309;
  --amber-50:   #fffbeb;
  --gray-900:   #111827;
  --gray-700:   #374151;
  --gray-600:   #4b5563;
  --gray-500:   #6b7280;
  --gray-300:   #d1d5db;
  --gray-200:   #e5e7eb;
  --gray-100:   #f3f4f6;
  --gray-50:    #f9fafb;
  --white:      #ffffff;

  --bg:         #f4f5f9;
  --surface:    var(--white);
  --text:       var(--gray-900);
  --muted:      var(--gray-600);
  --border:     var(--gray-200);
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 1px 2px rgba(30,27,75,.06), 0 4px 16px rgba(30,27,75,.06);
  --shadow-lg:  0 8px 30px rgba(30,27,75,.12);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

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

/* ---------- Header ---------- */
.site-header {
  background: var(--indigo-900);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand .logo { font-size: 1.25rem; }
.brand small { color: var(--amber); font-weight: 600; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
}
.main-nav { display: none; }
.main-nav.open { display: block; }
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 8px 0 12px;
  display: grid;
  gap: 2px;
}
.main-nav a {
  display: block;
  padding: 9px 12px;
  color: rgba(255,255,255,.9);
  border-radius: var(--radius-sm);
  font-size: .95rem;
}
.main-nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .main-nav { display: block !important; }
  .main-nav ul {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    gap: 2px;
  }
  .main-nav a { padding: 8px 10px; font-size: .9rem; }
  .site-header .container { flex-wrap: nowrap; }
  .main-nav { flex: 1; }
}

/* ---------- Hero / page head ---------- */
.page-head {
  padding: 28px 0 8px;
}
.breadcrumbs {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.breadcrumbs a { color: var(--muted); }
h1 {
  font-size: 1.7rem;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 8px;
}
.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 4px;
  max-width: 62ch;
}

/* ---------- Converter widget ---------- */
.converter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 16px 0;
}
.converter-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--indigo-700);
  font-weight: 700;
  margin: 0 0 14px;
}
.converter-title .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-50);
}

.conv-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
}
.field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.field input,
.field select {
  width: 100%;
  padding: 12px 12px;
  font-size: 1.15rem;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}
.field select {
  font-family: var(--sans);
  font-size: 1rem;
  cursor: pointer;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px var(--indigo-50);
  background: var(--white);
}
.swap {
  align-self: center;
  margin-bottom: 2px;
}
.swap button {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  color: var(--indigo-600);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform .15s, border-color .12s, background .12s;
}
.swap button:hover {
  border-color: var(--indigo-500);
  background: var(--indigo-50);
}
.swap button:active { transform: rotate(180deg); }

.conv-result {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--indigo-50);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--indigo-900);
}
.conv-result strong { font-family: var(--mono); }

@media (max-width: 560px) {
  .conv-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .swap {
    justify-self: center;
    margin: 2px 0;
  }
  .swap button:active { transform: rotate(90deg); }
}

/* Quick multi-unit list under a converter */
.all-units {
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.all-units h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.all-units ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px;
}
.all-units li {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: .9rem; padding: 6px 10px; background: var(--gray-50);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.all-units li .u { color: var(--muted); }
.all-units li .v { font-family: var(--mono); }

/* ---------- Cards grid (hub) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--indigo-500);
}
.card .icon { font-size: 1.5rem; }
.card h3 { margin: 8px 0 4px; font-size: 1.05rem; color: var(--text); }
.card p { margin: 0; font-size: .88rem; color: var(--muted); }

/* ---------- Content prose ---------- */
.prose { margin: 22px 0; }
.prose h2 {
  font-size: 1.3rem;
  letter-spacing: -.01em;
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--indigo-50);
}
.prose h3 { font-size: 1.08rem; margin: 20px 0 8px; }
.prose p, .prose li { color: var(--gray-700); }
.prose ul, .prose ol { padding-left: 20px; }

/* ---------- Reference table ---------- */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: .92rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ref-table caption {
  text-align: left;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 10px 12px 4px;
  font-weight: 700;
}
.ref-table th, .ref-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.ref-table thead th {
  background: var(--indigo-50);
  color: var(--indigo-900);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.ref-table td:nth-child(n+2), .ref-table th:nth-child(n+2) {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ref-table tbody tr:last-child td { border-bottom: 0; }
.ref-table tbody tr:hover { background: var(--gray-50); }
.table-scroll { overflow-x: auto; }

/* ---------- Notice / callout ---------- */
.notice {
  background: var(--amber-50);
  border: 1px solid #fde68a;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 16px 0;
  font-size: .92rem;
  color: #78350f;
}
.notice strong { color: var(--amber-dark); }

/* ---------- Ad slot placeholder ---------- */
.adslot {
  margin: 20px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, var(--gray-50) 10px, var(--gray-50) 20px);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  background: var(--indigo-900);
  color: rgba(255,255,255,.75);
  padding: 28px 0;
  font-size: .9rem;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 18px;
}
.footer-cols h4 { color: var(--white); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 14px;
  font-size: .82rem;
  color: rgba(255,255,255,.55);
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--indigo-900);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  z-index: 100;
  display: none;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.cookie-banner.show { display: flex; }
.cookie-banner p { margin: 0; font-size: .88rem; flex: 1 1 240px; color: rgba(255,255,255,.85); }
.cookie-banner a { color: var(--amber); }
.cookie-actions { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--amber); color: var(--indigo-900); }
.btn-primary:hover { background: #fbbf24; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.08); }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 60px 0; }
.error-page .code { font-size: 4rem; font-family: var(--mono); color: var(--indigo-600); margin: 0; }

/* ---------- Utilities ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--amber); color: var(--indigo-900);
  padding: 8px 14px; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600; z-index: 200;
}
.skip-link:focus { left: 0; }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.related { margin: 24px 0; }
.related h2 { font-size: 1.1rem; }
