/* ===== Variables de diseño ===== */
:root {
  --bg: #0D1512;
  --surface: #16211C;
  --border: #2A3B32;
  --text: #EDEDE6;
  --text-secondary: #9CA89E;
  --accent: #D4A24C;      /* cobre — para acciones y precios */
  --accent-mint: #5FAE8C; /* traza de circuito — para links y detalles */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ===== Reset básico ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(13, 21, 18, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 20px; text-decoration: none; }
.logo span { color: var(--accent); }
.main-nav { display: flex; gap: 32px; }
.main-nav a { text-decoration: none; color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.main-nav a:hover { color: var(--text); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ===== Hero ===== */
.hero { position: relative; padding: 96px 0 80px; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-inner { max-width: 620px; position: relative; z-index: 2; }
.eyebrow { font-size: 13px; color: var(--accent-mint); letter-spacing: 0.05em; margin-bottom: 16px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero-sub { font-size: 17px; color: var(--text-secondary); max-width: 480px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.trace-line { position: absolute; top: 0; right: -40px; height: 100%; width: 420px; z-index: 1; pointer-events: none; }

/* ===== Botones ===== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 24px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-primary { background: var(--accent); color: #1A1206; }
.btn-primary:hover { background: #e0ad5a; }
.btn-ghost { border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent-mint); color: var(--accent-mint); }

/* ===== Secciones (títulos compartidos) ===== */
.tiers, .how-it-works, .guides { padding: 80px 0; }
.tiers h2, .how-it-works h2, .guides h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 40px;
}

/* ===== Tarjetas de nivel de presupuesto ===== */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.tier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}
.tier-card:hover { border-color: var(--accent-mint); transform: translateY(-2px); }
.tier-price { display: block; font-size: 14px; color: var(--accent); margin-bottom: 12px; }
.tier-card h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.tier-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.tier-card a { color: var(--accent-mint); text-decoration: none; font-size: 14px; font-weight: 500; }

/* ===== Cómo funciona ===== */
.how-it-works { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.step-num { display: block; color: var(--accent-mint); font-size: 14px; margin-bottom: 12px; }
.step h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.step p { color: var(--text-secondary); font-size: 14px; }

/* ===== Espacio publicitario ===== */
.ad-slot {
  margin: 48px auto;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

/* ===== Guías destacadas ===== */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.guide-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.2s;
}
.guide-card:hover { border-color: var(--accent); }
.guide-tag { display: inline-block; font-size: 11px; color: var(--accent); margin-bottom: 10px; }
.guide-card h3 { font-family: var(--font-display); font-size: 16px; font-weight: 500; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-secondary); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ===== Accesibilidad ===== */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-mint);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .hp-art { animation: none; }
  .hover-preview { transform: none; }
}

/* ===== Responsive / móvil ===== */
@media (max-width: 720px) {
  .trace-line { display: none; }
  .main-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-150%);
    transition: transform 0.3s;
  }
  .main-nav.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .comp-row { grid-template-columns: 1fr; gap: 6px; }
  .comp-price { text-align: left; }
  .level-total { text-align: left; }
  .comp-price-wrap { text-align: left; }
}

/* ===== Páginas de nivel ===== */
.level-hero { padding: 56px 0 40px; border-bottom: 1px solid var(--border); }
.breadcrumb { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.breadcrumb a { color: var(--accent-mint); text-decoration: none; }
.level-hero h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); font-weight: 600; margin-bottom: 14px; }
.level-body { padding: 56px 0 80px; }

.comp-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.comp-label { font-size: 13px; color: var(--accent-mint); padding-top: 2px; }
.comp-name { font-family: var(--font-display); font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.comp-specs { display: block; font-size: 13px; color: var(--text-secondary); }
.comp-alt { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.comp-price { font-size: 15px; color: var(--accent); white-space: nowrap; }

.level-total {
  text-align: right;
  font-size: 18px;
  color: var(--accent);
  margin: 28px 0;
  padding-top: 12px;
}
.level-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  font-size: 14px;
  color: var(--text-secondary);
  margin: 24px 0 40px;
}
.level-nav { display: flex; gap: 12px; flex-wrap: wrap; }
.level-pill {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.level-pill:hover { border-color: var(--accent-mint); color: var(--text); }
.level-pill.active { border-color: var(--accent); color: var(--accent); }

/* ===== Selector de moneda ===== */
.moneda-selector {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--text-secondary);
}
.moneda-selector select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
}
.moneda-selector select:hover { border-color: var(--accent-mint); }
.moneda-selector select:focus-visible { outline: 2px solid var(--accent-mint); outline-offset: 2px; }

/* ===== Precio dual (USD + moneda local) ===== */
.comp-price-wrap { text-align: right; white-space: nowrap; }
.comp-price-local {
  display: block;
  font-size: 13px;
  color: var(--accent-mint);
  margin-top: 2px;
}
.total-local { color: var(--accent-mint); font-size: 15px; }

/* ===== Configurador ===== */
.config-intro { padding: 48px 0 32px; border-bottom: 1px solid var(--border); }
.config-intro h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 38px); font-weight: 600; margin-bottom: 12px; }
.config-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.preset-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.preset-label { font-size: 13px; color: var(--text-secondary); margin-right: 4px; }
.preset-buttons button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.preset-buttons button:hover { border-color: var(--accent-mint); color: var(--accent-mint); }
.preset-clear { color: var(--text-secondary) !important; }

.config-body { padding: 40px 0 80px; }
.config-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }

/* --- Categorías --- */
.cat-card { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; background: var(--surface); }
.cat-card.open { border-color: var(--accent-mint); }
.cat-head {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 130px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.cat-order { color: var(--accent-mint); font-size: 13px; }
.cat-label { font-family: var(--font-display); font-size: 16px; font-weight: 500; }
.cat-chosen { color: var(--text-secondary); font-size: 14px; text-align: right; }
.cat-chosen em { color: var(--text-secondary); opacity: 0.6; }
.cat-arrow { color: var(--text-secondary); font-size: 11px; text-align: center; }

.cat-options { padding: 4px 12px 12px; }
.option {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.option:hover:not(:disabled) { background: var(--bg); border-color: var(--border); }
.option.selected { border-color: var(--accent); background: rgba(212, 162, 76, 0.08); }
.option.incompatible { opacity: 0.55; cursor: not-allowed; }
.option-main { display: flex; flex-direction: column; gap: 2px; }
.option-name { font-family: var(--font-display); font-size: 15px; font-weight: 500; }
.option-specs { font-size: 13px; color: var(--text-secondary); }
.option-reason { font-size: 12px; color: #e08a6a; margin-top: 4px; }
.option-price { font-size: 14px; color: var(--accent); white-space: nowrap; padding-top: 2px; }

/* --- Panel de resumen --- */
.config-summary { position: sticky; top: 84px; }
.summary-inner { border: 1px solid var(--border); border-radius: 12px; padding: 24px; background: var(--surface); }
.summary-inner h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 16px; }

.summary-status { border-radius: 8px; padding: 12px 14px; font-size: 13px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 6px; }
.summary-status strong { font-size: 13px; }
.summary-status span { color: var(--text-secondary); line-height: 1.4; }
.status-neutral { background: var(--bg); }
.status-ok { background: rgba(95, 174, 140, 0.12); }
.status-ok strong { color: var(--accent-mint); }
.status-warn { background: rgba(212, 162, 76, 0.12); }
.status-warn strong { color: var(--accent); }
.status-error { background: rgba(224, 138, 106, 0.14); }
.status-error strong { color: #e08a6a; }

.summary-list { list-style: none; margin: 0 0 20px; }
.summary-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.summary-list li.empty { opacity: 0.5; }
.sum-cat { grid-column: 1; font-size: 11px; color: var(--accent-mint); }
.sum-piece { grid-column: 1; font-size: 14px; }
.sum-price { grid-column: 2; grid-row: 1 / 3; font-size: 13px; color: var(--accent); align-self: center; text-align: right; }

.summary-total { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-top: 1px solid var(--border); margin-bottom: 16px; }
.summary-total span { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.summary-total div { font-size: 18px; color: var(--accent); }
.summary-export { width: 100%; justify-content: center; }
.summary-export:disabled { opacity: 0.4; cursor: not-allowed; }

.loading { color: var(--text-secondary); padding: 40px 0; text-align: center; }

/* --- Responsive configurador --- */
@media (max-width: 860px) {
  .config-layout { grid-template-columns: 1fr; }
  .config-summary { position: static; order: -1; }
  .cat-head { grid-template-columns: 32px 1fr 20px; }
  .cat-chosen { display: none; }
}

/* ===== Badge de fecha de precios (transparencia) ===== */
.precios-fecha {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
}
.config-toolbar .precios-fecha { margin-top: 0; width: 100%; }

/* ===== Sello de fecha de precios (transparencia) ===== */
.precios-fecha, .precio-sello {
  font-size: 12px;
  color: var(--accent-mint);
  margin-top: 14px;
  letter-spacing: 0.02em;
}
.precio-sello { margin: 0 0 10px; }

/* ===== Índice de guías ===== */
.guides-hero { padding: 56px 0 32px; border-bottom: 1px solid var(--border); }
.guides-hero h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 46px); font-weight: 600; margin: 8px 0 14px; }
.guides-list-section { padding: 48px 0 80px; }
.guides-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.guide-list-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.guide-list-card:hover { border-color: var(--accent-mint); transform: translateY(-2px); }
.guide-list-card h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 10px 0 10px; }
.guide-list-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; line-height: 1.55; }
.guide-meta { font-size: 12px; color: var(--accent-mint); }

/* ===== Artículo de guía ===== */
.container-narrow { max-width: 720px; }
.guide-article { padding: 48px 0 80px; }
.guide-article h1 { font-family: var(--font-display); font-size: clamp(28px, 4.5vw, 42px); font-weight: 600; margin: 12px 0 8px; line-height: 1.15; }
.guide-article .guide-meta { display: block; margin-bottom: 32px; }
.guide-intro { font-size: 18px; color: var(--text); line-height: 1.65; margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.guide-article h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 40px 0 16px; }
.guide-article h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 28px 0 10px; color: var(--text); }
.guide-article p { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 16px; }
.guide-article p strong { color: var(--text); font-weight: 600; }
.guide-article a { color: var(--accent-mint); }
.guide-article ul { margin: 0 0 20px; padding-left: 24px; }
.guide-article li { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 8px; }
.guide-article li strong { color: var(--text); }

/* Glosario (lista de definiciones) */
.glossary { margin: 20px 0; }
.glossary dt { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--accent); margin-top: 20px; }
.glossary dd { margin: 6px 0 0; font-size: 16px; line-height: 1.65; color: var(--text-secondary); }

/* Llamado a la acción dentro de la guía */
.guide-cta {
  background: var(--surface);
  border: 1px solid var(--accent-mint);
  border-radius: 12px;
  padding: 32px;
  margin: 48px 0 40px;
  text-align: center;
}
.guide-cta h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.guide-cta p { margin-bottom: 20px; }

/* Guías relacionadas al final */
.guide-related h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 40px 0 16px; }
.related-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.related-cards .guide-card h4 { font-family: var(--font-display); font-size: 15px; font-weight: 500; margin: 8px 0 0; }

/* ===== Vista previa flotante de componentes ===== */
.hoverable { cursor: help; transition: color 0.2s; }
.hoverable:hover { color: var(--accent-mint); }
.hoverable-inline {
  cursor: help;
  border-bottom: 1px dashed var(--accent-mint);
  color: var(--text);
  transition: color 0.2s;
}
.hoverable-inline:hover { color: var(--accent-mint); }

.hover-preview {
  position: fixed;
  z-index: 200;
  width: 180px;
  background: var(--surface);
  border: 1px solid var(--accent-mint);
  border-radius: 12px;
  padding: 16px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.hover-preview.visible { opacity: 1; }
.hover-preview[hidden] { display: none; }
.hp-art {
  width: 120px;
  height: 120px;
  margin: 0 auto 10px;
  animation: flotar 3s ease-in-out infinite;
}
.hp-art svg { width: 100%; height: 100%; }
.hp-label {
  text-align: center;
  font-size: 12px;
  color: var(--accent-mint);
  letter-spacing: 0.02em;
}

@keyframes flotar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
/* ===== Páginas institucionales ===== */
.info-page { padding: 48px 0 80px; }
.info-page h1 { font-family: var(--font-display); font-size: clamp(28px, 4.5vw, 42px); font-weight: 600; margin: 12px 0 8px; }
.info-page h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 36px 0 14px; }
.info-page p { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 16px; }
.info-page p strong { color: var(--text); font-weight: 600; }
.info-page a { color: var(--accent-mint); }
.info-page ul { margin: 0 0 20px; padding-left: 24px; }
.info-page li { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 8px; }
.info-page li strong { color: var(--text); }
.info-page code { font-family: var(--font-mono); font-size: 13px; background: var(--bg); padding: 2px 6px; border-radius: 4px; color: var(--accent); }

/* Recuadro de nota (para personalizar / avisos) */
.info-note {
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 28px 0;
}
.info-note p { font-size: 14px; margin: 0; color: var(--text-secondary); }

/* Tarjeta de contacto */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--accent-mint);
  border-radius: 12px;
  padding: 32px;
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.contact-label { font-size: 12px; color: var(--accent-mint); }
.contact-email { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--text) !important; text-decoration: none; }
.contact-card .btn { margin-top: 8px; }

/* ===== Bloque "no verificado" (tercer estado del motor de compatibilidad) ===== */
/* Deliberadamente neutro, no alarmante: no es un problema, es honestidad sobre
   un dato que todavía no tenemos. Nunca usa el rojo/ámbar de error o aviso. */
.summary-unverified {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 12px;
  background: var(--bg);
  border: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-unverified strong { color: var(--text-secondary); font-size: 12px; }
.summary-unverified span { color: var(--text-secondary); line-height: 1.4; opacity: 0.85; }
.summary-unverified[hidden] { display: none; }

/* ===== Consumo estimado y margen de la fuente ===== */
.summary-power {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.power-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.power-row span:first-child { color: var(--text-secondary); }
.power-empty { font-size: 12px; color: var(--text-secondary); opacity: 0.8; }
.power-ok span:last-child { color: var(--accent-mint); }
.power-warn span:last-child { color: var(--accent); }
.power-bad span:last-child { color: #e08a6a; }
