@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-color: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --accent-color: #059669;
  --accent-hover: #047857;
  --accent-light: #ecfdf5;

  --warning-color: #d97706;
  --danger-color: #dc2626;
  --danger-light: #fef2f2;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --text-white: #ffffff;

  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1200px;
}

[data-theme="dark"] {
  --primary-color: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-light: #082f49;
  --primary-border: #0284c7;

  --accent-color: #34d399;
  --accent-hover: #10b981;
  --accent-light: #064e3b;

  --warning-color: #fbbf24;
  --danger-color: #f87171;
  --danger-light: #450a0a;

  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-card-elevated: #1e293b;
  --bg-subtle: #1f2937;
  --bg-input: #1f2937;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;

  --border-color: #334155;
  --border-subtle: #1e293b;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--accent-color) !important; }
.text-danger  { color: var(--danger-color) !important; }
.text-muted   { color: var(--text-muted) !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(29, 78, 216, 0.25);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.35);
}

.btn-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-main) !important;
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-main) !important;
}
.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color) !important;
  background-color: var(--primary-light);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}
.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}
.btn-block {
  width: 100%;
}

.btn-group-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.btn-group-row .btn {
  flex: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .site-header {
  background-color: rgba(17, 24, 39, 0.95);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-color), #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.logo-text span {
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.2rem;
  position: relative;
  transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lang-btn {
  display: none !important;
}
.lang-flag {
  font-size: 1.05rem;
  line-height: 1;
}

.modal-backdrop {
  display: none !important;
}

.currency-select {
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.mobile-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-main);
  border-radius: 2px;
}

.hero-section {
  padding: 2.5rem 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background-color: var(--accent-light);
  color: var(--accent-color);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-color);
}

.hero-title {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.calc-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.input-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.15rem;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.input-header label {
  font-weight: 600;
  font-size: 0.92rem;
}
.input-value-badge {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-color);
}

.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}
.input-with-symbol span,
.input-with-symbol svg {
  position: absolute;
  left: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
}
.input-with-symbol input[type="number"] {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 700;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}
.input-with-symbol input[type="number"]:focus {
  border-color: var(--primary-color);
}

.term-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.term-header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.term-select {
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}
.term-select:focus {
  border-color: var(--primary-color);
}

.range-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
  cursor: pointer;
}

.results-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.kpi-hero-card {
  background: linear-gradient(135deg, var(--primary-color), #1e3a8a);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(29, 78, 216, 0.25);
  position: relative;
  overflow: hidden;
}

.kpi-tag {
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.9;
}
.kpi-main-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.4rem 0;
}
.kpi-subtext {
  font-size: 0.9rem;
  opacity: 0.85;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.metric-title {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.metric-value {
  font-size: 1.15rem;
  font-weight: 800;
}

.distribution-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.progress-bar-container {
  height: 28px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-full);
  display: flex;
  overflow: hidden;
  margin-bottom: 0.65rem;
  position: relative;
}
.progress-bar-principal {
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  min-width: 0;
  padding: 0 4px;
  transition: width 0.3s ease;
}
.progress-bar-interest {
  background-color: var(--danger-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  min-width: 0;
  padding: 0 4px;
  transition: width 0.3s ease;
}

.bar-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  justify-content: center;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.35rem;
}
.dot-principal { background-color: var(--primary-color); }
.dot-interest  { background-color: var(--danger-color); }

.details-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}
.table-toolbar h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.table-responsive-wrapper {
  overflow-x: auto;
  max-height: 400px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}
.data-table th {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
.data-table tr:hover {
  background-color: var(--bg-subtle);
}

.early-payoff-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}
.payoff-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.payoff-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}
.payoff-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.payoff-inputs-grid label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.payoff-inputs-grid input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 700;
}
.payoff-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.payoff-comparison-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.payoff-comparison-card.featured-option {
  border: 2px solid var(--accent-color);
}
.card-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: var(--accent-light);
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}
.card-badge.badge-neutral {
  background-color: var(--primary-light);
  color: var(--primary-color);
}
.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.stat-highlight {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.faq-accordion-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
}
.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 0.85rem;
}
.faq-item h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.faq-item p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.articles-section {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* ==========================================================================
   CATEGORIES HUB & NAVIGATION TABS
   ========================================================================== */

.categories-hub-section {
  margin: 3.5rem 0;
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.categories-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.category-hub-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.category-hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border-color);
  transition: background 0.25s ease;
}

.category-hub-card.hub-hipotecas::before { background: #1d4ed8; }
.category-hub-card.hub-prestamos::before { background: #059669; }
.category-hub-card.hub-tarjetas::before { background: #d97706; }
.category-hub-card.hub-educacion::before { background: #7c3aed; }

.category-hub-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-border);
}

.category-hub-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  background: var(--bg-subtle);
}

.category-hub-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-hub-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.category-hub-card p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.category-hub-action {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.2s ease;
}

.category-hub-card:hover .category-hub-action {
  gap: 0.75rem;
}

/* Category Navigation Tabs (on category pages) */
.category-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 2.5rem 0;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.cat-tab:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.cat-tab.active {
  background-color: var(--primary-color);
  color: #ffffff !important;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}
/* ==========================================================================
   ARTICLE POST & EDITORIAL DESIGN SYSTEM
   ========================================================================== */

/* Reading progress bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease;
  pointer-events: none;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 3rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem 1.5rem;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  font-weight: 500;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

.breadcrumbs span {
  color: var(--text-main);
  font-weight: 600;
}

/* Article Container */
.article-body {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.article-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

/* Article Header */
.article-post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

/* Category Pills */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  line-height: 1;
}

.pill-hipotecas {
  background: rgba(29, 78, 216, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.25);
}

.pill-prestamos {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.pill-educacion {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

[data-theme="dark"] .pill-hipotecas {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .pill-prestamos {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

[data-theme="dark"] .pill-educacion {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

/* Article Title & Meta */
.article-post-header h1 {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.article-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.article-meta-row strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Lead Paragraph */
.lead-paragraph {
  font-size: 1.18rem;
  line-height: 1.8;
  color: var(--text-main);
  font-weight: 450;
  margin-bottom: 2.25rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-subtle);
  border-left: 4px solid var(--primary-color);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  text-wrap: pretty;
}

/* Article Headings */
.article-body h2 {
  font-size: 1.55rem;
  font-weight: 750;
  color: var(--text-main);
  margin-top: 2.75rem;
  margin-bottom: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  text-wrap: balance;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

/* Article Body Typography */
.article-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 1.4rem;
  text-wrap: pretty;
}

.article-body strong {
  color: var(--text-main);
  font-weight: 700;
}

.article-body ul,
.article-body ol {
  margin: 1.25rem 0 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.article-body li {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-muted);
  text-wrap: pretty;
}

.article-body li::marker {
  color: var(--primary-color);
  font-weight: 700;
}

/* Callout Info Alert */
.info-alert {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.05), rgba(29, 78, 216, 0.02));
  border: 1px solid var(--primary-border);
  border-left: 5px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  margin: 2.25rem 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .info-alert {
  background: rgba(56, 189, 248, 0.07);
  border-color: rgba(56, 189, 248, 0.3);
  border-left-color: var(--primary-color);
}

.info-alert strong {
  color: var(--primary-color);
}

[data-theme="dark"] .info-alert strong {
  color: var(--primary-color);
}

/* Tables inside Article */
.article-body .table-responsive-wrapper {
  margin: 2.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
}

.article-body .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}

.article-body .data-table th {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.article-body .data-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.article-body .data-table tbody tr:hover {
  background-color: var(--bg-subtle);
}

.article-body .highlight-row {
  background-color: rgba(220, 38, 38, 0.06) !important;
}

[data-theme="dark"] .article-body .highlight-row {
  background-color: rgba(248, 113, 113, 0.1) !important;
}

/* Tool Callout Card (Interactive CTA to Simulator) */
.tool-callout-card {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.08) 0%, rgba(5, 150, 105, 0.08) 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  margin: 3.5rem 0 1.5rem 0;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .tool-callout-card {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
  border-color: rgba(56, 189, 248, 0.3);
}

.tool-callout-card h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.tool-callout-card p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.tool-callout-card .btn {
  padding: 0.85rem 1.85rem;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.3);
}

.tool-callout-card .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.4);
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-card:hover {
  box-shadow: var(--shadow-md);
}

.sidebar-card h4 {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--text-main);
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.author-bio-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 0;
}

.author-bio-card::after {
  content: '✓ Verificado por Equipo CuotaPro';
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-color);
  background: rgba(5, 150, 105, 0.1);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  margin-top: 1rem;
}

[data-theme="dark"] .author-bio-card::after {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

/* Sidebar Links */
.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
}

.sidebar-links li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-links li a::after {
  content: '→';
  font-size: 1.1rem;
  color: var(--text-light);
  transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-links li a:hover {
  border-color: var(--primary-border);
  background-color: var(--primary-light);
  color: var(--primary-color);
  transform: translateX(4px);
}

.sidebar-links li a:hover::after {
  color: var(--primary-color);
  transform: translateX(3px);
}

/* Article Card in Grids (Categories & Home) */
.article-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-border);
}

.article-card .article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.article-card .read-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  background-color: var(--bg-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.article-card h3 {
  font-size: 1.2rem;
  font-weight: 750;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.article-card h3 a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-card h3 a:hover {
  color: var(--primary-color);
}

.article-card p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

.article-card .article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.article-card .article-meta .author {
  font-weight: 600;
  color: var(--text-main);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2rem 1rem 4rem 1rem;
  }
  
  .article-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .article-body {
    padding: 2rem 1.25rem;
    border-radius: var(--radius-md);
  }

  .article-post-header h1 {
    font-size: 1.85rem;
  }

  .lead-paragraph {
    font-size: 1.05rem;
    padding: 1.15rem 1.25rem;
  }

  .tool-callout-card {
    padding: 2rem 1.25rem;
  }
}

.site-footer {
  margin-top: auto;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0 1.25rem 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr 1.2fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.footer-bio {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.footer-links-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.footer-links-col ul {
  list-style: none;
}
.footer-links-col li {
  margin-bottom: 0.4rem;
}
.footer-links-col a {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-links-col a:hover {
  color: var(--primary-color);
}
.footer-bottom-bar {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-light);
}

@media (max-width: 900px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  .payoff-results-grid {
    grid-template-columns: 1fr;
  }
  .payoff-inputs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
  }
  .nav-menu.nav-open {
    display: flex;
  }
  .mobile-toggle {
    display: flex;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Legal Documents (Premium UI) --- */
.legal-document {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.legal-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.legal-header h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.1;
}

.legal-header .page-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

.legal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 4rem;
  box-shadow: var(--shadow-lg);
}

.legal-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-subtle);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p, .legal-content li {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.legal-content ul, .legal-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.legal-content li::marker {
  color: var(--primary-color);
  font-weight: 700;
}

.legal-content strong {
  color: var(--text-main);
  font-weight: 700;
}

.legal-content code {
  background-color: var(--bg-subtle);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--primary-color);
  font-family: monospace;
}

@media (max-width: 768px) {
  .legal-content {
    padding: 2rem 1.5rem;
  }
  .legal-header h1 {
    font-size: 2.2rem;
  }
}

/* Ocultar selector de idioma temporalmente hasta aprobación de AdSense */
#langToggleBtn,
.lang-btn {
  display: none !important;
}
