/* ============================================================
   IVA-PORCENTAJES.CSS — SimpleConvertly v1.0
   Solo estilos EXCLUSIVOS de la calculadora de IVA y %.
   tokens.css + base.css + components.css se cargan antes.
   ============================================================ */

/* ── Keyframe exclusivo ───────────────────────────────────── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Barra de pestañas ────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
  border: none;
  background: transparent;
  font-family: var(--font-body);
}
.tab-btn:hover  { color: var(--text); background: var(--surface); }
.tab-btn.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.tab-emoji { font-size: 1rem; }

/* ── Paneles ──────────────────────────────────────────────── */
.panel        { display: none; animation: popIn 0.25s var(--ease) both; }
.panel.active { display: block; }

/* ── Tarjeta de cálculo ───────────────────────────────────── */
.calc-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 40px 44px;
  margin-bottom: 20px;
}

/* ── Grid de campos ───────────────────────────────────────── */
.field-grid           { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.field-grid.cols-3    { grid-template-columns: 1fr 1fr 1fr; }

/* ── Divisor OR ───────────────────────────────────────────── */
.or-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; }
.or-divider span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); white-space: nowrap; }
.or-divider::before,
.or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-md); }

/* ── Caja de resultado ────────────────────────────────────── */
.result-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-top: 4px;
}
body.dark .result-box,
[data-theme="dark"] .result-box { background: var(--bg-2); }
.result-box.has-result { border-color: var(--gold); background: var(--gold-soft); }

.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

.result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
body.dark .result-item,
[data-theme="dark"] .result-item { background: var(--surface-2); }
.result-item:hover              { border-color: var(--gold); transform: translateY(-2px); }
.result-item.highlight          { border-color: var(--gold); background: linear-gradient(135deg, var(--gold-soft), transparent); }

.result-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.result-val {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.result-val.green { color: var(--green); }
.result-val.red   { color: var(--red);   }
.result-val.gold  { color: var(--gold);  }
.result-sub       { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

.empty-result { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 8px 0; }

/* ── Historial de cálculos ────────────────────────────────── */
.history-section { margin-top: 12px; }
.history-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.history-title   { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.clear-history {
  background: transparent;
  border: 1px solid var(--border-md);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
.clear-history:hover { border-color: var(--red); color: var(--red); }

.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.84rem;
  cursor: pointer;
  transition: border-color var(--t-fast);
}
body.dark .history-item,
[data-theme="dark"] .history-item { background: var(--bg-2); }
.history-item:hover { border-color: var(--gold); }
.history-op  { color: var(--text-2); font-weight: 500; flex: 1; }
.history-res { font-family: var(--font-display); font-weight: 700; color: var(--gold); }

/* ── Título de sección ────────────────────────────────────── */
.section-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; }
.tips-section  { max-width: 1080px; margin: 0 auto 40px; }

/* ── Responsive exclusivo ─────────────────────────────────── */
@media (max-width: 860px) {
  .calc-card              { padding: 22px 18px; }
  .field-grid             { grid-template-columns: 1fr; }
  .field-grid.cols-3      { grid-template-columns: 1fr; }
}
