/* ============================================================
   STYLES.CSS — Design System completo
   Tema: Dark premium para colecionáveis
   ============================================================ */

/* ---------- VARIÁVEIS DE CORES ---------- */
:root {
  /* Fundos */
  --bg:          #08080f;
  --bg-surface:  #0f0f1c;
  --bg-card:     #14142a;
  --bg-card2:    #1a1a32;
  --bg-input:    #1f1f38;

  /* Bordas */
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);

  /* Cores de destaque */
  --accent:       #7c3aed;   /* roxo principal */
  --accent-light: #9d5cf0;
  --accent-dim:   rgba(124,58,237,0.15);
  --gold:         #f59e0b;   /* dourado — lances/dinheiro */
  --gold-dim:     rgba(245,158,11,0.12);
  --red:          #ef4444;   /* vermelho — AO VIVO */
  --green:        #10b981;   /* verde — sucesso/ganhou */

  /* Textos */
  --text:         #eeeef8;
  --text-soft:    #9090b8;
  --text-muted:   #55556a;

  /* Outros */
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --transition:   all 0.18s ease;
}

/* ---------- RESET E BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; }
input, textarea { font-family: inherit; }

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-card2); border-radius: 99px; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,8,15,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

/* Mark GK — quadrado com gradiente roxo → rosa */
.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
  font-style: italic;
  color: white;
  letter-spacing: -1.5px;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.35);
}

/* Nome completo + tagline */
.logo-name {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-name .full {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.4px;
  line-height: 1;
}

.logo-name .tag {
  font-size: 9px;
  font-weight: 700;
  color: #ec4899;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 3px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- BADGE AO VIVO ---------- */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.viewers-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-soft);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* ============================================================
   BOTÕES
   ============================================================ */

/* Botão principal — roxo */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px rgba(124,58,237,0.3);
}
.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 28px rgba(124,58,237,0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

/* Botão ao vivo — vermelho pulsante */
.btn-live {
  background: var(--red);
  color: white;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 24px rgba(239,68,68,0.35);
  transition: var(--transition);
  width: 100%;
}
.btn-live:hover {
  background: #dc2626;
  box-shadow: 0 0 36px rgba(239,68,68,0.55);
  transform: translateY(-1px);
}
.btn-live.ativo {
  background: var(--bg-card2);
  color: var(--red);
  border: 2px solid var(--red);
  box-shadow: none;
}

/* Botão de lance — dourado */
.btn-bid {
  background: var(--gold);
  color: #1a0e00;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-sm);
  width: 100%;
  box-shadow: 0 0 20px rgba(245,158,11,0.3);
  transition: var(--transition);
}
.btn-bid:hover {
  background: #fbbf24;
  box-shadow: 0 0 30px rgba(245,158,11,0.5);
  transform: translateY(-1px);
}
.btn-bid:disabled {
  background: var(--bg-card2);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Botão outline */
.btn-outline {
  background: transparent;
  color: var(--text-soft);
  border: 1.5px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.btn-outline:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-card);
}

/* Botão ghost pequeno */
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
}

/* Botão perigo */
.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.25);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  width: 100%;
}
.btn-danger:hover {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
}

/* ============================================================
   INPUTS E FORMS
   ============================================================ */
.input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.input::placeholder { color: var(--text-muted); }

.input-bid {
  background: var(--bg-input);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  width: 100%;
  outline: none;
  transition: var(--transition);
}
.input-bid:focus {
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.input-bid::placeholder { color: var(--text-muted); font-weight: 400; font-size: 14px; }

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group { margin-bottom: 14px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Card de live na home */
.live-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: block;
}
.live-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-dim);
  transform: translateY(-3px);
}

.live-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-card2);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-card-thumb-placeholder {
  font-size: 48px;
  opacity: 0.2;
}

.live-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.live-card-viewers {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-card-body {
  padding: 14px;
}

.live-card-seller {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-light);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.live-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Card de produto no painel do vendedor */
.produto-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: var(--transition);
  cursor: pointer;
}
.produto-card:hover { border-color: var(--border-hover); }
.produto-card.ativo { border-color: var(--gold); background: var(--gold-dim); }

.produto-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--bg-card2);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.produto-thumb img { width: 100%; height: 100%; object-fit: cover; }

.produto-info { flex: 1; min-width: 0; }
.produto-nome {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.produto-preco { font-size: 12px; color: var(--gold); font-weight: 600; }
.produto-status { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   SEÇÃO: HOME PAGE
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 40px 0; }

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid-lives {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Hero da home */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 480px;
  margin: 0 auto 28px;
}

/* Estado vazio */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ============================================================
   SEÇÃO: LIVE PAGE
   ============================================================ */
.live-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* --- COLUNA ESQUERDA: Vídeo --- */
.live-video-col {
  position: relative;
  grid-row: 1 / -1;
  height: calc(100vh - 60px);
  background: #000;
  overflow: hidden;
}

.video-wrapper {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 220px;
  background: #000;
  overflow: hidden;
}

#video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay quando offline */
.video-offline {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-muted);
  gap: 12px;
  font-size: 15px;
}
.video-offline .icon { font-size: 48px; opacity: 0.3; }

.video-controls {
  position: absolute;
  bottom: 160px; left: 0; right: 0;
  z-index: 3;
  background: rgba(0,0,0,0.8);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seller-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.seller-handle {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* --- COLUNA DIREITA: Lances + Chat --- */
.live-side-col {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  overflow: hidden;
  position: relative; /* needed for chat-wrapper position:absolute */
}

/* Painel do produto atual */
.produto-painel {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.produto-painel-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.produto-atual {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.produto-atual-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--bg-card2);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.produto-atual-thumb img { width: 100%; height: 100%; object-fit: cover; }

.produto-atual-info { flex: 1; }
.produto-atual-nome {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}
.produto-atual-preco-inicial {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* Lance atual em destaque */
.lance-destaque {
  background: var(--gold-dim);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lance-valor {
  font-size: 26px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.5px;
}

.lance-info {
  text-align: right;
}
.lance-info .nome { font-size: 12px; font-weight: 600; }
.lance-info .qtd { font-size: 11px; color: var(--text-muted); }

/* Timer do leilão */
.timer-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.timer {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -1px;
}
.timer.urgente { color: var(--red); animation: blink 0.8s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.timer-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Barra de progresso do timer */
.timer-bar {
  height: 3px;
  background: var(--bg-card2);
  border-radius: 99px;
  margin-bottom: 14px;
  overflow: hidden;
}
.timer-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 99px;
  transition: width 1s linear;
}
.timer-bar-fill.urgente { background: var(--red); }

/* Form de lance */
.bid-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bid-sugestoes {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.bid-sugestao {
  flex: 1;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.bid-sugestao:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

/* Sem produto ativo */
.sem-produto {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
}
.sem-produto .icon { font-size: 32px; margin-bottom: 8px; opacity: 0.3; }
.sem-produto p { font-size: 13px; }

/* --- CHAT --- */
.chat-wrapper {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 160px;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  overflow: hidden;
  z-index: 2;
}

.chat-header {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-mensagens {
  height: auto;
  max-height: 150px;
  overflow-y: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.4;
  padding: 3px 0;
}

.msg-autor {
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  color: var(--accent-light);
}

.msg-texto {
  color: var(--text);
  word-break: break-word;
}

/* Mensagem de sistema (lance, aviso, etc.) */
.msg.sistema {
  background: var(--gold-dim);
  border-left: 2px solid var(--gold);
  padding: 5px 10px;
  border-radius: 0 6px 6px 0;
  margin: 3px 0;
}
.msg.sistema .msg-autor { color: var(--gold); }
.msg.sistema .msg-texto { color: var(--gold); font-weight: 600; }

.msg.sistema-verde {
  background: rgba(16,185,129,0.08);
  border-left: 2px solid var(--green);
}
.msg.sistema-verde .msg-autor,
.msg.sistema-verde .msg-texto { color: var(--green); }

.chat-input-wrapper {
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send {
  background: var(--accent);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: var(--transition);
  flex-shrink: 0;
}
.chat-send:hover { background: var(--accent-light); }

/* ============================================================
   SEÇÃO: SELLER PAGE
   ============================================================ */
.seller-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.seller-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.seller-main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
  gap: 20px;
}

.seller-status-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 6px;
  flex-shrink: 0;
}
.status-dot.online { background: var(--red); animation: pulse 1.2s infinite; }
.status-dot.verde { background: var(--green); }

.status-text {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.live-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.stat-box .val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.stat-box .val.gold { color: var(--gold); }
.stat-box .lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Controle de leilão no seller */
.leilao-control {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.leilao-control-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

/* Select estilizado */
.select {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5a78' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.select:focus { border-color: var(--accent); }

/* Sidebar produtos */
.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.produtos-lista {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Historico de lances */
.historico-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.historico-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card2);
  border-radius: 6px;
  font-size: 12.5px;
}
.historico-item .nome { color: var(--text-soft); }
.historico-item .valor { color: var(--gold); font-weight: 700; }
.historico-item .hora { color: var(--text-muted); font-size: 11px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.97);
  backdrop-filter: none;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.modal-overlay.ativo { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  transform: translateY(10px);
  transition: transform 0.18s;
}
.modal-overlay.ativo .modal { transform: translateY(0); }

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-footer .btn { flex: 1; }

/* ============================================================
   TOAST / NOTIFICAÇÕES
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.2s ease, slideOut 0.2s ease 2.8s forwards;
  pointer-events: all;
}

.toast.sucesso { border-color: var(--green); }
.toast.erro { border-color: var(--red); }
.toast.lance { border-color: var(--gold); background: var(--gold-dim); color: var(--gold); }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
  from { opacity: 1; }
  to { opacity: 0; pointer-events: none; }
}

/* ============================================================
   SPINNER / LOADING
   ============================================================ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVO — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  /* === HEADER === */
  .header { padding: 0 12px; height: 54px; }
  .logo-icon { width: 32px; height: 32px; font-size: 14px; }
  .logo-name .full { font-size: 14px; }
  .logo-name .tag { display: none; }
  .nav-right { gap: 6px; }
  .btn-outline { padding: 6px 10px; font-size: 12px; }

  /* === HOME === */
  .hero { padding: 28px 0 20px; }
  .hero h1 { font-size: 26px; letter-spacing: -.5px; }
  .hero p { font-size: 14px; margin-bottom: 20px; }
  .container { padding: 0 12px; }
  .section { padding: 24px 0; }
  .grid-lives { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .live-card-body { padding: 10px; }
  .live-card-title { font-size: 12px; }

  /* === LIVE PAGE (spectador) === */
  .live-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: calc(100vh - 54px);
  }
  .live-video-col {
    height: 56vw;
    min-height: 180px;
    max-height: 300px;
  }
  /* Fix: video-wrapper não deve ter bottom:220px no mobile */
  .video-wrapper {
    bottom: 44px !important;
  }
  .video-controls {
    bottom: 0 !important;
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .seller-name { font-size: 12px; }
  .seller-handle { display: none; }
  .live-side-col {
    border-left: none;
    border-top: 1px solid var(--border);
    height: auto;
    min-height: 380px;
    max-height: calc(100vh - 54px - 56vw);
    overflow-y: auto;
  }
  /* Chat relativo dentro da side col */
  .chat-wrapper {
    position: relative !important;
    height: auto !important;
    bottom: auto !important;
    min-height: 180px !important;
  }
  .chat-mensagens {
    height: auto;
    max-height: 120px;
  }
  /* Painel produto compacto */
  .produto-painel { padding: 10px; }
  .produto-atual-thumb { width: 48px; height: 48px; font-size: 22px; }
  .lance-valor { font-size: 20px; }
  .timer { font-size: 22px; }
  .input-bid { font-size: 16px; padding: 10px; }
  .btn-bid { padding: 12px; font-size: 14px; }
  .bid-sugestao { font-size: 11px; padding: 5px 2px; }

  /* === SELLER (fallback — sobrescrito por !important no seller.html) === */
  .seller-layout { grid-template-columns: 1fr; }
  .seller-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 200px;
  }

  /* === STATS === */
  .live-stats { grid-template-columns: repeat(3, 1fr); }
  .stat-box .val { font-size: 18px; }

  /* === MODAIS === */
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { padding: 20px; border-radius: 16px 16px 0 0; max-width: 100%; }

  /* === TOAST === */
  .toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { font-size: 12px; }

  /* === FORMS === */
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 22px; }
  .grid-lives { grid-template-columns: 1fr 1fr; gap: 8px; }
  .logo-name { display: none; }
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.font-bold { font-weight: 700; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
