:root {
  /* Tokens do BCMED Design System (medidos do site bcmed.com.br) */
  --navy: #0b4d8c;            /* Azul BCMED — primário */
  --navy-2: #033266;          /* primário ativo */
  --navy-hover: #256499;
  --teal: #0b4d8c;
  --teal-dark: #033266;
  --green: #04b511;           /* Verde Compra — só para conversão */
  --green-hover: #23c229;
  --green-active: #008f0f;
  --brand-gray: #797d81;
  --bg: #f7f7f7;
  --card: #ffffff;
  --text: #333333;
  --muted: #7a7a7a;
  --border: #e0e0e0;
  --danger: #ff4d4f;
  --warn: #faad14;
  --radius: 5px;              /* raio padrão BCMED (botões, inputs, cards) */
  --radius-lg: 8px;           /* só painéis maiores */
  --font-body: 'Open Sans', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Poppins', 'Open Sans', system-ui, sans-serif;
  --shadow: 0 1px 3px rgba(11, 77, 140, .08), 0 4px 16px rgba(11, 77, 140, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
/* toque: resposta imediata, sem delay nem double-tap-zoom em controles */
a, button, input, select, textarea, .btn { touch-action: manipulation; }

/* Display BCMED: Poppins em títulos, nomes de produto e preços */
h1, h2, h3, .price, .current .v, .hero-stats .stat .v, .bigcount .v { font-family: var(--font-display); }

/* Header — fundo branco com o logo oficial, como no site BCMED */
.topbar {
  background: #fff;
  color: var(--text);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 3px solid var(--navy);
  box-shadow: var(--shadow);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; }
.logo img { height: 44px; width: auto; display: block; }
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; color: var(--navy); }
.topbar .sub { font-size: 12.5px; color: var(--brand-gray); margin-top: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 60px; }

.notice {
  background: #eef4fb;
  border: 1px solid #c9dcf0;
  color: #0a3f72;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14.5px;
}

/* Grid de produtos */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
/* só em dispositivos com mouse — evita o card "pular" no toque */
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(15,42,67,.14); }
}
.card:active { transform: scale(.985); }
.card .photo {
  aspect-ratio: 4/3;
  background: #eef1f5 center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b2bdc9;
  font-size: 40px;
  position: relative;
}
.card .photo img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
}
.badge.encerrado { background: #6b7280; }
.badge.agendado { background: var(--warn); }
.badge.urgente { background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .65; } }

.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 15.5px; line-height: 1.35; min-height: 2.6em; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; }
.price-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.price { font-size: 20px; font-weight: 700; color: var(--green-active); }
.bids-count { font-size: 12.5px; color: var(--muted); }
.countdown { font-size: 13px; font-weight: 700; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
.countdown.urgente { color: var(--danger); }
.countdown.off { color: var(--muted); font-weight: 500; }

/* faixa de tempo restante: última linha do card, em destaque */
.cd-strip {
  padding: 9px 12px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
  background: #eef4fb;
  color: var(--navy);
  border-top: 1px solid #d8e6f3;
}
.cd-strip.hoje { background: #fffbe6; color: #d48806; border-top-color: #ffe58f; }
.cd-strip.alerta { background: #fff7e6; color: #d46b08; border-top-color: #ffd591; }
.cd-strip.urgente { background: #fff2f0; color: #d9363d; border-top-color: #ffccc7; animation: pulse 1.2s infinite; }
.cd-strip.off { background: #f7f7f7; color: var(--muted); font-weight: 600; border-top-color: var(--border); }
.cd-strip.arrematado { background: #dff5dc; color: var(--green-active); border-top-color: #a8dfa3; }

/* Página do produto: galeria + painel lado a lado; descrição embaixo da galeria.
   No mobile vira coluna única na ordem galeria → painel de lance → descrição. */
.product-page { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: start; }
.col-panel { grid-column: 2; grid-row: 1 / span 2; }
.col-gallery { grid-column: 1; }
.col-desc { grid-column: 1; }
@media (max-width: 860px) {
  .product-page { grid-template-columns: 1fr; gap: 16px; }
  .col-panel, .col-gallery, .col-desc { grid-column: 1; grid-row: auto; }
}

.gallery .main {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background: #eef1f5 center/contain no-repeat;
  background-color: #fff;
  box-shadow: var(--shadow);
}
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery .thumbs div {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  background: #fff center/cover no-repeat;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.gallery .thumbs div.sel { border-color: var(--teal); }

.panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel h2 { margin: 0 0 4px; font-size: 21px; line-height: 1.3; }
.panel .code { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.bigcount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eef4fb;
  border: 1px solid #c9dcf0;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0;
}
.bigcount .t { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.bigcount .v { font-size: 22px; font-weight: 800; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
.bigcount.urgente { background: #fef2f2; border-color: #fecaca; }
.bigcount.urgente .v { color: var(--danger); }

.current { margin: 10px 0 4px; }
.current .v { font-size: 34px; font-weight: 700; color: var(--green-active); }
.current .min { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

form.bidform { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.bidform input {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 15px;
  width: 100%;
}
.bidform input:focus { outline: none; border-color: var(--teal); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }

.btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--navy-hover); }
.btn:disabled { background: #b5c1c8; cursor: not-allowed; }
.btn.sec { background: var(--navy); }
.btn.sec:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: var(--radius); }
.btn.danger { background: var(--danger); }
/* Verde Compra: reservado à conversão (dar o lance), como o botão comprar do site */
.btn.buy {
  background: var(--green);
  min-height: 50px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.btn.buy:hover { background: var(--green-hover); }
.btn.buy:active { background: var(--green-active); }
.btn.buy:disabled { background: #b5c1c8; }

.msg { padding: 11px 14px; border-radius: 9px; font-size: 14px; display: none; }
.msg.err { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.msg.ok { display: block; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

.desc { margin-top: 26px; }
.desc h3, .history h3 { font-size: 16px; color: var(--navy); }
.desc p { line-height: 1.65; color: #37424e; white-space: pre-wrap; }

.history ul { list-style: none; padding: 0; margin: 0; }
.history li {
  display: flex;
  justify-content: space-between;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.history li:first-child { font-weight: 700; color: var(--teal-dark); }
.history .when { color: var(--muted); font-size: 12.5px; }

.back { display: inline-block; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.back:hover { color: var(--navy); }

.empty { text-align: center; color: var(--muted); padding: 70px 0; font-size: 15px; }

/* flash de lance novo */
@keyframes flash { 0% { background: #dcebfa; } 100% { background: transparent; } }
.flash { animation: flash 1.6s ease-out; }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.admin-tabs button {
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.admin-tabs button.sel { background: var(--navy); color: #fff; border-color: var(--navy); }
.admin-user { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }

table.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
.tbl th { background: var(--navy); color: #fff; text-align: left; padding: 10px 12px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:hover td { background: #f8fafc; }
.tbl input, .tbl select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13.5px; width: 100%; }
.tbl .thumb { width: 52px; height: 40px; border-radius: 6px; background: #eef1f5 center/cover; }

.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .3px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14.5px;
  font-family: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }

.login-box { width: min(380px, calc(100% - 32px)); margin: 80px auto; }

dialog {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 26px;
  width: min(680px, 92vw);
  max-height: 86vh;
  overflow: auto;
}
dialog::backdrop { background: rgba(15,42,67,.45); }

/* modal estruturado: cabeçalho com X, corpo rolável, rodapé de ações sempre visível */
dialog.dlg { padding: 0; overflow: hidden; width: min(760px, 94vw); }
dialog.dlg[open] { display: flex; flex-direction: column; }
.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dlg-x {
  border: none;
  background: #eef1f5;
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.dlg-x:hover { background: #fde8e8; color: var(--danger); }
.dlg-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.dlg-foot {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 13px 22px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  flex-shrink: 0;
}

/* barra de ações em massa */
.bulkbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #eef4fb;
  border: 1px solid #c9dcf0;
  color: var(--navy);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}
.bulkbar input[type="datetime-local"] {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

/* gerenciador de fotos do produto */
.photo-mgr { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.pm-item { position: relative; width: 88px; }
.pm-item .img {
  width: 88px;
  height: 66px;
  border-radius: 6px;
  background: #eef1f5 center/cover no-repeat;
  border: 1px solid var(--border);
}
.pm-capa {
  position: absolute;
  left: 4px;
  top: 4px;
  background: var(--navy);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 2px 6px;
  border-radius: 999px;
}
.pm-x {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.pm-mv { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.pm-mv button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  padding: 1px 8px;
  color: var(--muted);
}
.pm-mv button:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.pm-mv button:disabled { opacity: .35; cursor: default; }
.photo-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.photo-add input {
  flex: 1;
  min-width: 180px;
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
}

/* editor de descrição (rich text) */
.rt-toolbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border: 1.5px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 6px;
  background: #fafbfc;
}
.rt-toolbar button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 5px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.rt-toolbar button:hover { border-color: var(--navy); color: var(--navy); }
.rt-editor {
  min-height: 110px;
  max-height: 260px;
  overflow-y: auto;
  border: 1.5px solid var(--border);
  border-radius: 0 0 8px 8px;
  padding: 10px 12px;
  font-size: 14.5px;
  line-height: 1.6;
  background: #fff;
}
.rt-editor:focus { outline: none; border-color: var(--navy); }
.rt-editor a { color: var(--navy); text-decoration: underline; }

.status-chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #fff; background: var(--teal); white-space: nowrap; }
.status-chip.encerrado { background: #6b7280; }
.status-chip.agendado { background: var(--warn); }
.status-chip.inativo { background: #cbd5e1; color: #475569; }

.footer { text-align: center; color: var(--navy); font-size: 13px; padding: 26px 0 40px; line-height: 1.9; }
.footer span { color: var(--brand-gray); }

/* ---------- Hero banner ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #033266 0%, #0b4d8c 55%, #0b62b6 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 36px 40px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 10px 34px rgba(9, 77, 140, .25);
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  pointer-events: none;
}
.hero::before { width: 420px; height: 420px; right: -120px; top: -180px; }
.hero::after { width: 260px; height: 260px; right: 140px; bottom: -160px; background: rgba(255,255,255,.045); }
.hero .mark {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  height: 150%;
  opacity: .1;
  pointer-events: none;
}
.hero-content { position: relative; flex: 1; min-width: 0; }
.hero .tag {
  display: inline-block;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero .tag .live { color: #7ef0b2; }
.hero h2 { margin: 0 0 8px; font-size: 30px; line-height: 1.18; font-weight: 800; }
.hero p { margin: 0 0 18px; font-size: 15px; opacity: .88; line-height: 1.55; }
.hero .cta {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 14px 28px;
  border-radius: 999px;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.hero .cta:hover { background: var(--green-hover); }
.hero .cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
/* carrossel de equipamentos recortados no hero */
.hero-car {
  position: relative;
  width: 215px;
  height: 235px;
  flex-shrink: 0;
  align-self: flex-end;
  cursor: pointer;
  z-index: 1;
}
.hc-item {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  opacity: 0;
  transform: translateY(8px) scale(.97);
  transition: opacity .7s ease, transform .7s ease;
  pointer-events: none;
}
.hc-item.on { opacity: 1; transform: none; }
.hc-item img {
  max-height: 196px;
  max-width: 200px;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(0, 10, 26, .45));
}
.hc-nome {
  margin-top: 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.hero-stats {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 210px;
}
.hero-stats .stat {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 11px;
  padding: 10px 16px;
  backdrop-filter: blur(2px);
}
.hero-stats .stat .v { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-stats .stat .l { font-size: 11.5px; opacity: .8; text-transform: uppercase; letter-spacing: .5px; }

@media (max-width: 760px) {
  .hero { flex-direction: column; align-items: flex-start; padding: 20px 16px 16px; border-radius: 13px; gap: 12px; margin-bottom: 16px; }
  .hero::after { display: none; }
  .hero-content { max-width: 100%; }
  .hero .tag { font-size: 10.5px; padding: 4px 11px; margin-bottom: 9px; }
  .hero h2 { font-size: 21px; }
  .hero p { font-size: 13px; margin-bottom: 13px; line-height: 1.5; }
  .hero .cta { padding: 12px 22px; font-size: 13px; }
  .hero .mark { display: none; }
  .hero-car { align-self: center; width: 170px; height: 162px; }
  .hc-item img { max-height: 126px; max-width: 160px; }
  .hc-nome { font-size: 10px; padding: 3px 10px; margin-top: 7px; }
  .hero-stats { flex-direction: row; width: 100%; min-width: 0; }
  .hero-stats .stat { flex: 1; padding: 8px 6px; text-align: center; }
  .hero-stats .stat .v { font-size: 16px; }
  .hero-stats .stat .l { font-size: 9.5px; }
}

/* âncoras não somem sob o header fixo ao rolar */
.cats, .grid, .bidform { scroll-margin-top: 72px; }

/* ---------- Busca ---------- */
.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 3px 7px 3px 16px;
  margin-bottom: 14px;
  max-width: 480px;
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.searchbar:focus-within { border-color: var(--navy); }
.searchbar .sb-ico { color: var(--muted); font-size: 15px; flex-shrink: 0; }
.searchbar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  padding: 9px 0;
  color: var(--text);
}
.searchbar input::placeholder { color: var(--muted); }
.searchbar input::-webkit-search-cancel-button { -webkit-appearance: none; }
.searchbar .sb-clear {
  border: none;
  background: #eef1f5;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}
.searchbar .sb-clear:hover { background: var(--border); color: var(--text); }

/* ---------- Categorias ---------- */
.cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cats button {
  padding: 7px 15px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.cats button:hover { border-color: var(--navy); color: var(--navy); }
.cats button.sel { background: var(--navy); color: #fff; border-color: var(--navy); }
.cats button .n { opacity: .65; font-weight: 500; margin-left: 4px; }

/* breadcrumbs */
.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 16px;
}
.crumbs a { color: var(--navy); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: #b6c2cf; }
.crumbs .here { color: var(--muted); max-width: 46ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 640px) {
  .cats { gap: 6px; margin-bottom: 14px; }
  .cats button { padding: 6px 12px; font-size: 12.5px; }
  .crumbs { font-size: 12.5px; }
  .crumbs .here { max-width: 20ch; }
}

/* ---------- Gatilhos de escassez ---------- */

/* badge "encerra hoje" */
.badge.hoje { background: var(--warn); }
.badge.arrematado { background: var(--green); }
.countdown.arrematado { color: var(--green-active); font-weight: 700; }
.bigcount.arrematado { background: #dff5dc; border-color: #a8dfa3; }
.bigcount.arrematado .v { color: var(--green-active); }

/* última hora: countdown laranja */
.countdown.alerta { color: var(--warn); }
.bigcount.alerta { background: #fff7ed; border-color: #fed7aa; }
.bigcount.alerta .v { color: var(--warn); }

/* pessoas vendo agora */
.viewers {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eef4fb;
  border: 1px solid #c9dcf0;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.viewers .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: pulse 1.4s infinite;
}

/* último lance há X */
.lastbid { font-size: 13px; color: var(--muted); margin-top: 4px; }
.lastbid.quente { color: var(--danger); font-weight: 700; }

/* selo de disputa na lista */
.hot { color: var(--danger); font-weight: 700; }

/* lances rápidos */
.quickbids { display: flex; gap: 8px; flex-wrap: wrap; }
.quickbids button {
  flex: 1;
  min-width: 100px;
  padding: 9px 8px;
  border: 1.5px solid var(--navy);
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.quickbids button:hover { background: var(--navy); color: #fff; }

/* alerta: lance superado */
.outbid {
  display: none;
  background: #fef2f2;
  border: 2px solid var(--danger);
  color: #991b1b;
  border-radius: 10px;
  padding: 13px 16px;
  margin: 12px 0;
  font-weight: 700;
  font-size: 15px;
  animation: shake .4s;
}
.outbid.on { display: block; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* toasts de atividade ao vivo */
.toasts {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
}
.toast {
  background: #fff;
  border-left: 4px solid var(--danger);
  box-shadow: 0 8px 28px rgba(9, 77, 140, .22);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  cursor: pointer;
  animation: slideIn .3s ease-out;
}
.toast b { color: var(--navy); }
.toast .t-amount { color: var(--danger); font-weight: 800; }
@keyframes slideIn {
  from { transform: translateX(-120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.saindo { transition: opacity .4s, transform .4s; opacity: 0; transform: translateX(-120%); }

/* ---------- Barra fixa de lance (só mobile, página do produto) ---------- */
.bidbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(9, 77, 140, .16);
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
  align-items: center;
  gap: 12px;
}
.bidbar .bb-info { flex: 1; min-width: 0; }
.bidbar .bb-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.bidbar .bb-price { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--green-active); line-height: 1.2; white-space: nowrap; }
.bidbar .bb-cd { font-size: 11.5px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bidbar .bb-cd.urgente { color: var(--danger); animation: pulse 1.2s infinite; }
.bidbar .bb-cd.off { color: var(--muted); font-weight: 600; }
.bidbar .btn.buy { min-height: 46px; padding: 10px 20px; flex-shrink: 0; font-size: 13px; }
@media (max-width: 860px) {
  .bidbar.on { display: flex; }
  body.has-bidbar main.wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 12px; }
  main.wrap { padding-top: 14px; }

  /* header compacto */
  .topbar { padding: 9px 0; }
  .topbar .wrap { gap: 11px; }
  .logo img { height: 32px; }
  .topbar h1 { font-size: 14.5px; }
  .topbar .sub { font-size: 11px; }

  /* grade: 2 cards por linha */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card h3 { font-size: 13px; min-height: 2.7em; }
  .card .body { padding: 10px 11px 12px; gap: 5px; }
  .price-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .price-row > div:last-child { text-align: left !important; }
  .price { font-size: 16.5px; }
  .badge { font-size: 10px; padding: 3px 8px; top: 7px; left: 7px; }
  .bids-count, .countdown { font-size: 11.5px; }
  .cd-strip { font-size: 11.5px; padding: 7px 8px; }

  /* produto */
  .panel { padding: 16px; }
  .panel h2 { font-size: 18px; }
  .current .v { font-size: 28px; }
  .bigcount { padding: 10px 12px; }
  .bigcount .v { font-size: 18px; }
  .gallery .main { aspect-ratio: 1/1; }
  .gallery .thumbs div { width: 54px; height: 54px; }
  .quickbids button { min-width: 0; font-size: 13px; }

  /* inputs confortáveis no dedo (16px evita zoom automático do iOS) */
  .bidform input { font-size: 16px; padding: 13px 14px; }
  .btn { padding: 14px 20px; }

  .notice { font-size: 13px; padding: 10px 12px; margin-bottom: 14px; }
  .toasts { bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; right: 12px; max-width: none; }
  .toast { font-size: 12.5px; padding: 10px 12px; }

  /* busca: largura total, 16px evita zoom do iOS */
  .searchbar { max-width: none; margin-bottom: 10px; }
  .searchbar input { font-size: 16px; padding: 10px 0; }

  /* categorias: fita horizontal rolável (padrão e-commerce), sem comer a tela */
  .cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -12px;
    margin-right: -12px;
    padding: 2px 12px 6px;
  }
  .cats::-webkit-scrollbar { display: none; }
  .cats button { flex: 0 0 auto; }

  /* histórico de lances: data embaixo do valor para não espremer o nome */
  .history li { gap: 10px; }
  .history li > span:last-child { text-align: right; }
  .history .when { display: block; }

  /* admin */
  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -12px;
    margin-right: -12px;
    padding: 2px 12px;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tabs button { padding: 8px 13px; font-size: 13px; flex: 0 0 auto; }
  .formgrid { grid-template-columns: 1fr; }
  dialog { padding: 18px; width: 94vw; }
  dialog.dlg { width: 96vw; max-height: 92vh; }
  .dlg-head, .dlg-foot { padding-left: 14px; padding-right: 14px; }
  .dlg-body { padding: 14px; }
  .bulkbar { font-size: 13px; padding: 9px 11px; }
  /* tabelas: rolam de lado dentro do contêiner, sem esmagar colunas */
  table.tbl { min-width: 560px; }
  /* 16px nos campos evita o zoom automático do iOS ao focar */
  .field input, .field textarea, .field select, .login-box input { font-size: 16px; }
  .login-box { margin: 44px auto; }
}

/* ---------- Jurídico: consentimento, estado do equipamento e garantias ---------- */
.consent {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 8px;
}
.consent a { color: var(--navy); font-weight: 700; }

.condbox {
  background: #fffbe6;             /* token warning-bg do design system */
  border: 1.5px solid #ffe58f;
  border-radius: var(--radius-lg);
  padding: 4px 18px 10px;
  margin-bottom: 16px;
}
.condbox h3 { color: #d48806; }
.condbox p { white-space: pre-line; }

.desc.legal {
  background: #dff5dc;             /* token success-bg do design system */
  border: 1.5px solid #a8dfa3;
  border-radius: var(--radius-lg);
  padding: 4px 18px 10px;
  margin-top: 16px;
}
.desc.legal h3 { color: var(--green-active); }
.desc.legal p { line-height: 2; }

.footer a { text-decoration: underline; }
