:root {
  --primaria: #113d42;
  --primaria-hover: #0b292d;
  --primaria-clara: #e6f0f1;
  --destaque-ouro: #c28e54;
  --escura: #1e293b;
  --texto-secundario: #475569;
  --fundo: #f1f5f9;
  --card: #ffffff;
  --borda: #e2e8f0;
  --sombra-card: 0 6px 18px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--fundo);
  color: var(--escura);
  padding-bottom: 90px;
  overflow-x: hidden;
}

/* Cabeçalho Ajustado para Celular e PC */
.topo {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(231, 221, 189, 0.96);
  padding: 12px 14px;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  gap: 8px;
}

.topo-conteudo {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topo-linha-superior {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  overflow: hidden;
}

.logo-app {
  height: 68px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transform: scale(1.85);
  transform-origin: center center;
  mix-blend-mode: multiply;
}

.buscas {
  gap: 8px;
}

.topo input[type="search"] {
  width: 100%;
  padding: 11px 16px;
  background: #ffffff;
  border: 1.5px solid #dfd8cc;
  border-radius: 12px;
  font-size: 0.92rem;
  color: var(--escura);
  display: block;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.topo input[type="search"]:focus {
  outline: none;
  border-color: var(--destaque-ouro);
  box-shadow: 0 0 0 3px rgba(194, 142, 84, 0.16);
}

/* Carrossel de Categorias 100% dentro da tela */
.filtros {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filtros::-webkit-scrollbar {
  display: none;
}

.chip {
  border: 1px solid #dfd8cc;
  background: #ffffff;
  color: var(--primaria);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--destaque-ouro);
}

.chip.ativo {
  background: var(--primaria);
  color: #ffffff;
  border-color: var(--primaria);
  box-shadow: 0 2px 8px rgba(17, 61, 66, 0.22);
}

/* Alinhamento Centralizado no Computador (Desktop) */
@media (min-width: 768px) {
  .topo-conteudo {
    max-width: 760px;
  }

  .logo-box {
    height: 62px;
  }

  .logo-app {
    height: 76px;
    transform: scale(2.0);
  }

  .filtros {
    justify-content: center;
    padding-top: 2px;
  }
}
/* Feed Centralizado (Celular) */
.feed {
  max-width: 520px;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 14px;
}

.feed > p {
  text-align: center;
  color: var(--texto-secundario);
  padding: 40px 20px;
  font-size: 0.95rem;
}

/* Grade Centralizada no Computador (Desktop) */
@media (min-width: 768px) {
  .topo h1,
  .topo input[type="search"],
  .filtros {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
  }

  .feed {
    max-width: 1120px;
    margin: 24px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 340px));
    justify-content: center;
    gap: 22px;
    padding: 0 24px;
  }

  .feed > p {
    grid-column: 1 / -1;
  }

  .barra-inferior {
    max-width: 520px;
    left: 50% !important;
    transform: translateX(-50%);
    bottom: 14px !important;
    border-radius: 999px;
    border: 1px solid var(--borda);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  }
}

/* Cartões dos Anúncios */
.card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--sombra-card);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.11);
}

.card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: #e2e8f0;
  display: block;
}

.card-corpo {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.badge {
  align-self: flex-start;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--primaria-clara);
  color: #065f46;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-corpo h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--escura);
  line-height: 1.3;
}

.preco {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primaria);
  margin: 6px 0 8px;
}

.desc-anuncio {
  font-size: 0.9rem;
  color: var(--texto-secundario);
  line-height: 1.45;
  margin-bottom: 10px;
}

.btn-ver-mais {
  background: none;
  border: none;
  color: var(--primaria);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}

.btn-ver-mais:hover {
  text-decoration: underline;
}

.card-corpo small {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: auto;
}

.card-acoes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--borda);
  padding-top: 12px;
  margin-top: 12px;
  gap: 6px;
}

.card-acoes button {
  background: var(--fundo);
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--escura);
}

.card-acoes button:nth-child(3) {
  background: var(--primaria-clara);
  color: #065f46;
}

.card-acoes button:last-child {
  background: transparent;
  color: #94a3b8;
  padding: 8px;
}

/* Barra Inferior Fixa */
.barra-inferior {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 8px;
  border-top: 1px solid var(--borda);
  z-index: 30;
}

.barra-inferior button {
  background: none;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--texto-secundario);
  cursor: pointer;
  padding: 6px 10px;
}

.btn-destaque {
  background: var(--primaria) !important;
  color: #ffffff !important;
  padding: 10px 18px !important;
  border-radius: 999px;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Modais e Caixa Alta do Chat */
.modal {
  margin: auto;
  border: none;
  border-radius: 20px;
  padding: 22px;
  width: 92%;
  max-width: 440px;
  background: var(--card);
  color: var(--escura);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.18);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal input,
.modal select,
.modal textarea {
  padding: 11px 12px;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  font-size: 0.92rem;
}

.aviso-politica {
  font-size: 0.8rem;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.acoes-modal {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.acoes-modal button[type="button"] {
  background: var(--fundo);
  color: var(--texto-secundario);
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primario {
  background: var(--primaria);
  color: #ffffff;
  border: none;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.modal-chat-container {
  width: 92% !important;
  max-width: 390px !important;
  height: 82vh !important;
  max-height: 680px !important;
  padding: 0 !important;
  border-radius: 24px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-chat-container:not([open]) {
  display: none;
}

.chat-header {
  background: linear-gradient(135deg, #065f46 0%, #059669 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header small {
  color: #d1fae5;
  font-size: 0.78rem;
  display: block;
}

.btn-voltar-chat,
.btn-fechar-x {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
}

.lista-conversas-box {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow-y: auto;
  gap: 10px;
}

.lista-conversas-box > small {
  margin: auto;
  text-align: center;
  color: #64748b;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lista-conversas-box > small::before {
  content: '💬';
  font-size: 2.6rem;
  background: #d1fae5;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-conversa {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
}

.avatar-conversa {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #d1fae5;
  color: #065f46;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sala-chat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.aviso-seguranca-chat {
  background: #fefce8;
  color: #854d0e;
  font-size: 0.76rem;
  padding: 8px 12px;
  border-bottom: 1px solid #fef08a;
  text-align: center;
}

.mensagens-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background-color: #efeae2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bolha-msg {
  padding: 9px 13px;
  border-radius: 16px;
  max-width: 78%;
  font-size: 0.9rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.bolha-eu {
  align-self: flex-end;
  background: #059669;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.bolha-outro {
  align-self: flex-start;
  background: #ffffff;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}

.hora-msg {
  display: block;
  font-size: 0.68rem;
  opacity: 0.75;
  text-align: right;
  margin-top: 3px;
}

.chat-input-bar {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
}

.chat-input-bar input {
  flex: 1;
  border-radius: 999px !important;
  padding: 10px 16px !important;
}

.btn-enviar-chat {
  background: #059669;
  color: #ffffff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  }

  @media (max-width: 767px) {
  .barra-inferior {
    padding: 8px 4px !important;
    justify-content: space-between !important;
    z-index: 99999 !important;
  }

  .barra-inferior button {
    font-size: 0.78rem !important;
    padding: 6px 6px !important;
  }

  .btn-destaque {
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
  }
}

/* Ferramentas Inteligentes do Chat */
.aviso-seguranca-chat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left !important;
}

.btn-mini-seguro {
  background: #113d42;
  color: #ffffff;
  border: none;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.painel-locais-box {
  background: #f0fdf4;
  border-bottom: 1px solid #bbf7d0;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #14532d;
}

.lista-pontos-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.lista-pontos-btns button {
  background: #ffffff;
  border: 1px solid #86efac;
  color: #166534;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.alerta-golpe-banner {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
  padding: 8px 12px;
  font-size: 0.76rem;
  line-height: 1.35;
}

.respostas-rapidas-chat {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px 10px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.respostas-rapidas-chat::-webkit-scrollbar {
  display: none;
}

.respostas-rapidas-chat button {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #113d42;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.respostas-rapidas-chat button:hover {
  border-color: #c28e54;
  background: #fdfbf7;
}
