/* Componentes compartilhados: marca, botões, cartões, selos, esqueletos, estados. Só var(--…). */
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.brand__logo {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}

.brand__logo--large {
  width: 96px;
  height: 96px;
}

.brand__text {
  display: flex;
  flex-direction: column;
}

.brand__name {
  font-size: var(--fs-title);
  font-weight: 700;
  line-height: var(--lh-tight);
}

.brand__tag {
  color: var(--text-2);
  font-size: var(--fs-small);
}

.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition:
    background var(--t-fast),
    border-color var(--t-fast);
}

.btn:hover {
  background: var(--surface-3);
}

.btn:active {
  background: var(--surface);
}

.btn--primary {
  border-color: transparent;
  background: var(--grad);
  color: var(--on-accent);
}

.btn--primary:hover,
.btn--primary:active {
  background: var(--grad);
  filter: brightness(1.08);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn[aria-disabled='true'],
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Resumo do Início */
.summary {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--grad-surface);
  box-shadow: var(--shadow-card);
}

.summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
}

.summary__label {
  color: var(--text-2);
  font-size: var(--fs-small);
}

.summary__value {
  text-align: right;
}

/* Áreas do painel */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-height: 112px;
  padding: var(--s-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color var(--t-fast),
    background var(--t-fast);
}

.tile:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.tile--wide {
  flex-direction: row;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--tap);
  padding: var(--s-3) var(--s-4);
}

.tile__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--accent);
}

.tile__title {
  font-weight: 700;
}

.tile__hint {
  color: var(--text-2);
  font-size: var(--fs-small);
}

/* Alertas recentes */
.block {
  display: grid;
  gap: var(--s-3);
}

.alert-list {
  display: grid;
  gap: var(--s-2);
}

.alert-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-1) var(--s-3);
  align-items: center;
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface);
}

.alert-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-row__meta {
  grid-column: 1 / -1;
  color: var(--text-2);
  font-size: var(--fs-small);
}

/* Selos */
.badge {
  display: inline-block;
  width: fit-content;
  padding: 2px var(--s-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-small);
  font-weight: 600;
}

.badge--drop {
  background: var(--positive-bg);
  color: var(--positive);
}

.badge--rise {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Cartão de produto */
.cards {
  display: grid;
  gap: var(--s-3);
}

.card {
  padding: var(--s-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--grad-surface);
  box-shadow: var(--shadow-card);
}

.card--paused {
  opacity: 0.75;
}

.card__top {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--s-3);
}

.card__img {
  width: 96px;
  height: 96px;
  border-radius: var(--r-md);
  background: var(--surface);
  object-fit: contain;
}

.card__img--empty {
  display: grid;
  place-items: center;
  color: var(--text-3);
}

.card__body {
  display: grid;
  align-content: start;
  gap: var(--s-1);
}

.card__name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: var(--fs-body);
  font-weight: 600;
}

.card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-1) var(--s-2);
}

.card__price strong {
  font-size: var(--fs-price);
  font-variant-numeric: tabular-nums;
  line-height: var(--lh-tight);
}

.card__stamp,
.card__meta {
  color: var(--text-2);
  font-size: var(--fs-small);
}

.card__meta--warn,
.card__stale {
  color: var(--warning);
  font-size: var(--fs-small);
}

/* Estados */
.state {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
}

.state--error {
  background: var(--danger-bg);
  color: var(--text);
}

.state__title {
  font-size: var(--fs-title);
  font-weight: 700;
}

.state__text {
  color: var(--text-2);
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.skeleton--block {
  height: 88px;
}

.skeleton--card {
  height: 200px;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--surface-2), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-small);
}

.notice--error {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--text);
}

.notice--warning {
  border-color: var(--warning);
  background: var(--warning-bg);
  color: var(--text);
}

/* Faixa de transparência: fixa no topo, sempre visível, sem fechar (FR-033). */
.band {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 calc(var(--gutter) * -1);
  padding: var(--s-2) var(--gutter);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: var(--shadow-card);
}

.band__text {
  font-size: 12px;
  line-height: 1.3;
}

.band__text + .band__text {
  margin-top: var(--s-1);
}

.consent__text {
  color: var(--text-2);
  font-size: var(--fs-small);
}

.consent__text + .consent__text {
  margin-top: var(--s-2);
}

/* Formulário e escolha (Adicionar produto) */
.add-form {
  display: grid;
  gap: var(--s-3);
}

.field__label {
  color: var(--text-2);
  font-size: var(--fs-small);
}

.field {
  width: 100%;
  min-height: var(--tap);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}

.field::placeholder {
  color: var(--text-3);
}

.field__error {
  color: var(--danger);
  font-size: var(--fs-small);
}

.choice-list {
  display: grid;
  gap: var(--s-2);
}

.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  width: 100%;
  min-height: var(--tap);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.choice--selected {
  border-color: var(--accent);
  background: var(--surface-2);
}

.choice__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Planos e Ajuda */
.plan {
  position: relative;
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--grad-surface);
  box-shadow: var(--shadow-card);
}

.plan--highlight {
  border-color: var(--accent);
}

.plan__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.plan__price {
  font-size: var(--fs-price);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plan__features {
  display: grid;
  gap: var(--s-2);
}

.plan__features li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  color: var(--text-2);
}

.plan__features .icon {
  width: 20px;
  height: 20px;
  color: var(--positive);
}

.help-section {
  display: grid;
  gap: var(--s-2);
}

.help-list {
  display: grid;
  gap: var(--s-2);
  color: var(--text-2);
}

.help-list li {
  padding-left: var(--s-3);
  border-left: 2px solid var(--border);
}

/* Checkout Pix */
.qr {
  align-self: center;
  width: 220px;
  height: 220px;
  border-radius: var(--r-md);
  background: var(--text);
  padding: var(--s-2);
}

.pix-code {
  padding: var(--s-3);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  user-select: all;
}

/* Alertas e configurações */
.pref-list {
  display: grid;
  gap: var(--s-2);
}

.pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface);
}

.pref--locked {
  opacity: 0.85;
}

.pref__text {
  display: grid;
  gap: 2px;
}

.pref__title {
  font-weight: 600;
}

.pref__hint {
  color: var(--text-2);
  font-size: var(--fs-small);
}

.switch {
  position: relative;
  flex: none;
  width: 56px;
  height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
}

/* Trilho desenhado dentro de um alvo de toque de 44 px. */
.switch::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 2px;
  width: 52px;
  height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  transition: background var(--t-fast);
}

.switch--on::before {
  border-color: transparent;
  background: var(--accent);
}

.switch__knob {
  position: absolute;
  top: 10px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  transition: transform var(--t-fast);
}

.switch--on .switch__knob {
  transform: translateX(20px);
  background: var(--on-accent);
}

.switch[aria-disabled='true'],
.segmented__item[aria-disabled='true'] {
  opacity: 0.6;
  pointer-events: none;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-1);
  padding: var(--s-1);
  border-radius: var(--r-md);
  background: var(--surface);
}

.segmented__item {
  min-height: var(--tap);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
}

.segmented__item--on {
  background: var(--surface-3);
  color: var(--text);
}

/* Detalhe e histórico */
.card__more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  margin-top: var(--s-2);
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.history {
  display: grid;
  gap: var(--s-1);
}

.history__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
}

.history__when {
  color: var(--text-2);
  font-size: var(--fs-small);
}

.history__price {
  font-variant-numeric: tabular-nums;
}
