/* ─────────────────────────────────────────
   components.css — Componentes compartilhados
   Usado pelas calculadoras (Shopee, TikTok, ML)
───────────────────────────────────────── */

/* ── Header ── */
.header {
  background: var(--dark);
  padding: 16px 24px 28px;
  color: white;
  border-radius: 0 0 24px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 150px; height: 150px;
  background: var(--blue);
  border-radius: 50%;
  opacity: 0.10;
}
.header h1 {
  font-size: 22px; font-weight: 800;
  line-height: 1.25; margin-bottom: 4px;
  position: relative; z-index: 1;
}
.header p {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  position: relative; z-index: 1;
}

/* Back button */
.header-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-bottom: 20px;
  position: relative; z-index: 1;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 6px 14px 6px 10px;
  transition: background 0.2s;
}
.header-back:hover { background: rgba(255,255,255,0.20); }

/* Header icon */
.header-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
  position: relative; z-index: 1;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 16px 14px;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s;
}
.card-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Inputs ── */
.input-group { margin-bottom: 14px; }
.input-group label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.input-row { display: flex; align-items: stretch; }

.prefix, .suffix {
  background: var(--prefix-bg);
  border: 1.5px solid var(--input-border);
  padding: 11px 13px;
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  display: flex; align-items: center;
  transition: background 0.3s, border-color 0.3s;
}
.prefix { border-radius: 8px 0 0 8px; border-right: none; }
.suffix { border-radius: 0 8px 8px 0; border-left:  none; }

.input-row input[type="number"] {
  flex: 1;
  border: 1.5px solid var(--input-border);
  padding: 11px 13px;
  font-size: 16px; font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
  -webkit-appearance: none;
  min-width: 0;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.input-row input[type="number"]:focus { border-color: var(--blue); }
.input-row input[type="number"]:only-child { border-radius: 8px; }

select {
  width: 100%;
  border: 1.5px solid var(--input-border);
  padding: 11px 13px;
  font-size: 14px; font-weight: 500;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
select:focus { border-color: var(--blue); }

/* ── Sliders ── */
.slider-wrap { margin-bottom: 14px; }
.slider-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.slider-header span:first-child {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
}
.slider-badge {
  background: var(--blue-light);
  color: var(--blue);
  font-size: 13px; font-weight: 700;
  padding: 3px 11px; border-radius: 20px;
}
[data-theme="dark"] .slider-badge {
  background: rgba(37,99,235,0.20);
  color: #93C5FD;
}
input[type="range"] {
  width: 100%; -webkit-appearance: none;
  height: 6px; border-radius: 3px;
  background: var(--range-bg);
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37,99,235,0.40);
}

/* ── Info box ── */
.info-box {
  background: var(--info-bg);
  border-radius: 8px; padding: 12px;
  margin-bottom: 14px;
  transition: background 0.3s;
}
.info-box-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin-bottom: 8px;
}
.info-row {
  display: flex; justify-content: space-between;
  margin-bottom: 5px; font-size: 13px;
  color: var(--text-secondary);
}
.info-row:last-child { margin-bottom: 0; }
.info-row span:last-child { font-weight: 700; color: var(--text); }

/* ── Tip / Warning ── */
.tip {
  background: var(--blue-light);
  border-radius: 8px; padding: 10px 12px;
  font-size: 12px; color: var(--blue);
  font-weight: 500; line-height: 1.5;
}
[data-theme="dark"] .tip {
  background: rgba(37,99,235,0.15);
  color: #93C5FD;
}
.warning {
  background: var(--yellow-light);
  border-left: 3px solid var(--yellow);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  font-size: 12px; color: var(--gray-600);
  margin-top: 12px; line-height: 1.5;
}
[data-theme="dark"] .warning {
  background: rgba(217,119,6,0.12);
  color: rgba(255,255,255,0.60);
}

/* ── Resultados ── */
.price-row { display: flex; gap: 10px; margin-bottom: 16px; }
.price-box { flex: 1; border-radius: 10px; padding: 14px 12px; }
.price-box.green { background: var(--price-green-bg); }
.price-box.gray  { background: var(--price-gray-bg); }
.price-box.blue  { background: var(--blue-light); }
[data-theme="dark"] .price-box.blue { background: rgba(37,99,235,0.15); }

.price-box-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.price-box.green .price-box-label { color: var(--green); }
.price-box.gray  .price-box-label { color: var(--text-muted); }
.price-box.blue  .price-box-label { color: var(--blue); }

.price-box-value {
  font-size: 26px; font-weight: 800;
  line-height: 1; margin-bottom: 3px;
}
.price-box.green .price-box-value { color: var(--green); }
.price-box.gray  .price-box-value { color: var(--text-secondary); }
.price-box.blue  .price-box-value { color: var(--blue); }
[data-theme="dark"] .price-box.gray .price-box-value { color: rgba(255,255,255,0.75); }

.price-box-sub { font-size: 11px; color: var(--text-muted); }

.divider {
  height: 1px;
  background: var(--divider-color);
  margin: 2px 0 12px;
}

.result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--divider-color);
  font-size: 13px;
}
.result-row:last-child { border-bottom: none; }
.result-row .lbl { color: var(--text-secondary); font-weight: 500; }
.result-row .val { font-weight: 700; color: var(--text); }
.result-row .val.red   { color: #E74C3C; }
.result-row .val.green { color: var(--green); }
.result-row.total {
  border-top: 2px solid var(--input-border);
  margin-top: 4px; padding-top: 12px; border-bottom: none;
}
.result-row.total .lbl {
  font-weight: 700; color: var(--text); font-size: 14px;
}
.result-row.total .val { font-size: 18px; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 36px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 42px; margin-bottom: 12px; }
.empty-state .title {
  font-weight: 700; font-size: 15px;
  margin-bottom: 6px; color: var(--text-secondary);
}
.empty-state .sub { font-size: 13px; }

/* ── Footer ── */
footer {
  text-align: center; padding: 16px;
  font-size: 12px; color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 360px) {
  .price-row { flex-direction: column; }
  .price-box-value { font-size: 22px; }
  .header h1 { font-size: 19px; }
  .card { padding: 16px; margin: 0 10px 12px; }
}
