/* ==========================================================================
   Bug do Desconto — Estilos Visuais Revisão 10
   Marca oficial, tipografia Nunito auto-hospedada (WOFF2 local), faixa verde claro,
   convites WhatsApp personalizados e cards limpos (imagem + título + link compacto 44x44).
   ========================================================================== */

/* --- Fontes Locais Nunito (SIL Open Font License 1.1) --- */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/nunito-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/nunito-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/nunito-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Suporte complementar Latin-ext para caracteres estendidos */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/nunito-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/nunito-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/nunito-latin-ext-800-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg-body-start: #ffffff;
  --bg-body-end: #f0fdf4;
  --surface-card: #ffffff;
  --surface-card-hover: #fafdfb;
  --border-card: #e2e8f0;
  --border-card-hover: #86efac;
  
  /* Verde claro na faixa e componentes; verde escuro para contraste/texto */
  --banner-green-start: #bbf7d0;
  --banner-green-mid: #86efac;
  --banner-green-end: #dcfce7;
  
  --green-dark-text: #14532d;
  --green-dark-sub: #166534;
  --green-accent-bg: #dcfce7;
  --green-accent-border: #86efac;
  
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --font-family-base: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 560px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-base);
  background: linear-gradient(180deg, var(--bg-body-start) 0%, var(--bg-body-end) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 1rem; /* 16px */
  font-weight: 600;
  overflow-x: hidden;
  padding: 0;
  margin: 0;
}

/* ==========================================================================
   FAIXA SUPERIOR DE PONTA A PONTA (GRADIENTE APENAS VERDE CLARO, SEM AMARELO)
   ========================================================================== */

.top-banner {
  width: 100%;
  height: 125px;
  background: linear-gradient(135deg, var(--banner-green-start) 0%, var(--banner-green-mid) 50%, var(--banner-green-end) 100%);
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.08);
  position: relative;
  overflow: hidden;
}

.banner-gradient {
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.35) 0%, transparent 60%);
}

/* ==========================================================================
   CONTÊINER PRINCIPAL (COLUNA ÚNICA CENTRALIZADA MÁXIMO 560PX)
   ========================================================================== */

.feed-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem 3rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ==========================================================================
   CABEÇALHO DO PERFIL COM LOGO OFICIAL SOBREPOSTO
   ========================================================================== */

.profile-header {
  text-align: center;
  padding: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -68px; /* Sobrepõe harmoniosamente a transição faixa/corpo */
  position: relative;
  z-index: 10;
}

/* Avatar circular verdadeiro (1:1, border-radius: 50%) com aro verde discreto e borda clara */
.profile-logo-wrapper {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  overflow: hidden;
  border: 3.5px solid #ffffff;
  box-shadow: 0 0 0 2.5px #16a34a, 0 8px 24px rgba(20, 83, 45, 0.16);
  background-color: #161717; /* Fundo do mascote original preservado */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
  box-sizing: border-box;
}

.profile-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 10px; /* Margem interna para preservar antenas e etiqueta amarela % sem corte circular */
  box-sizing: border-box;
}

.profile-name {
  font-size: 1.65rem; /* ~26px */
  font-weight: 800;
  color: var(--green-dark-text);
  margin-bottom: 0.2rem;
  letter-spacing: -0.015em;
  text-transform: none;
}

.profile-bio {
  font-size: 1rem; /* 16px */
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 90%;
  margin: 0 auto;
}

/* ==========================================================================
   DOIS CONVITES WHATSAPP COM PERSONALIDADE
   ========================================================================== */

.top-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.cta-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  text-decoration: none;
  min-height: 56px;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cta-card:active {
  transform: scale(0.985);
}

/* Grupo: preenchimento verde claro forte / borda / sombra leve */
.cta-card-group {
  background-color: var(--green-accent-bg);
  border: 1.5px solid var(--green-accent-border);
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.08);
}

.cta-card-group:hover {
  background-color: #bbf7d0;
  border-color: #4ade80;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.12);
}

/* Canal: superfície branca/verde muito claro e borda verde */
.cta-card-channel {
  background-color: #ffffff;
  border: 1.5px solid var(--green-accent-border);
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.05);
}

.cta-card-channel:hover {
  background-color: #f0fdf4;
  border-color: #4ade80;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.09);
}

.cta-card-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #25D366; /* Verde oficial WhatsApp */
  flex-shrink: 0;
}

.cta-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.cta-card-title {
  font-size: 0.975rem; /* ~15.5px */
  font-weight: 700;
  color: var(--green-dark-text);
  line-height: 1.25;
}

.cta-card-sub {
  font-size: 0.8125rem; /* ~13px */
  font-weight: 600;
  color: var(--green-dark-sub);
  opacity: 0.85;
  line-height: 1.2;
}

.cta-card-arrow {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-dark-sub);
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.15s ease;
}

.cta-card:hover .cta-card-arrow {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   CONTROLES: BUSCA E CHIPS DE CATEGORIAS
   ========================================================================== */

.controls-section {
  margin-bottom: 1.25rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input[type="search"] {
  width: 100%;
  height: 44px;
  padding: 0 2.25rem 0 2.35rem;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box input[type="search"]::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.search-box input[type="search"]:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 0.625rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.clear-search-btn:hover {
  color: var(--text-primary);
  background-color: #f1f5f9;
}

.category-chips-nav {
  margin-bottom: 0.625rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0 6px;
}

.category-chips-nav::-webkit-scrollbar {
  display: none;
}

.category-chips {
  display: flex;
  gap: 0.5rem; /* Espaçamento de 8px */
  padding: 2px 2px 6px;
  white-space: nowrap;
}

/* Cápsulas arredondadas com altura mínima de 44px e fonte da página */
.category-chip,
.chip-btn {
  background-color: #ffffff;
  border: 1.5px solid #86efac; /* Borda verde suave */
  color: var(--green-dark-text); /* #14532d Texto verde escuro */
  min-height: 44px; /* Altura mínima 44px para toque confortável */
  height: 44px;
  padding: 0 1.125rem; /* 18px */
  border-radius: 9999px; /* Cápsula arredondada */
  font-size: 0.9375rem; /* ~15px */
  font-weight: 700;
  font-family: inherit; /* Fonte Nunito acolhedora */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  box-shadow: 0 1px 3px rgba(20, 83, 45, 0.05);
  flex-shrink: 0;
  line-height: 1;
}

.category-chip:hover,
.chip-btn:hover {
  background-color: #f0fdf4;
  border-color: #4ade80;
  transform: translateY(-1px);
}

.category-chip:active,
.chip-btn:active {
  transform: scale(0.97);
}

.category-chip:focus-visible,
.chip-btn:focus-visible {
  outline: 2px solid var(--green-dark-text);
  outline-offset: 2px;
}

/* Estado ativo claramente destacado */
.category-chip.active,
.chip-btn.active {
  background-color: var(--green-dark-text); /* Ativo verde escuro */
  color: #ffffff; /* Texto branco */
  border-color: var(--green-dark-text);
  box-shadow: 0 2px 8px rgba(20, 83, 45, 0.25);
}

.category-chip.active:hover,
.chip-btn.active:hover {
  background-color: var(--green-dark-sub);
  border-color: var(--green-dark-sub);
}

.filter-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0.25rem 0;
  font-size: 0.85rem;
}

.filter-count {
  color: var(--green-dark-sub);
  font-weight: 700;
}

.reset-filters-btn {
  background: none;
  border: none;
  color: var(--green-dark-text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.2rem 0.4rem;
}

/* ==========================================================================
   FEED DE CARDS: IMAGEM + DESCRIÇÃO/TÍTULO + BOTÃO COMPACTO 44x44
   (Sem preço visível, sem badge de loja/categoria, sem blocos de cupom)
   ========================================================================= */

.feed-section {
  width: 100%;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feed-card {
  background-color: var(--surface-card);
  border: 1.5px solid var(--border-card);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feed-card:hover {
  border-color: var(--border-card-hover);
  box-shadow: 0 4px 14px rgba(22, 101, 52, 0.08);
}

/* Miniatura ampla com dimensões reservadas (104-112px) */
.feed-card-thumb-link {
  text-decoration: none;
  display: block;
  flex-shrink: 0;
}

.feed-card-thumb {
  width: 112px;
  height: 112px;
  min-width: 112px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.feed-card-thumb img {
  max-width: 96px;
  max-height: 96px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Corpo central com SOMENTE descrição/título */
.feed-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.feed-card-title-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.feed-card-title-link:hover .feed-card-title {
  color: var(--green-dark-text);
}

.feed-card-title {
  font-size: 1.05rem; /* ~17px */
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.feed-out-badge {
  font-size: 0.75rem;
  color: #dc2626;
  font-weight: 700;
  background-color: #fee2e2;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
}

/* Botão compacto de oferta: área 44x44px com seta diagonal */
.feed-card-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-compact-offer {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background-color: var(--green-accent-bg);
  border: 1.5px solid var(--green-accent-border);
  color: var(--green-dark-text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.btn-compact-offer:hover {
  background-color: var(--green-dark-sub);
  border-color: var(--green-dark-sub);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-compact-offer:active {
  transform: scale(0.96);
}

.btn-compact-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-compact-disabled {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background-color: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
  flex-shrink: 0;
}

/* ==========================================================================
   PAGINAÇÃO, SENTINELA E ESTADOS DE FEED
   ========================================================================== */

.feed-footer {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.btn-load-more {
  background-color: var(--green-dark-text);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  box-shadow: 0 2px 8px rgba(20, 83, 45, 0.2);
  width: 100%;
  max-width: 320px;
}

.btn-load-more:hover {
  background-color: var(--green-dark-sub);
  transform: translateY(-1px);
}

.btn-load-more:active {
  transform: scale(0.98);
}

.feed-sentinel {
  width: 100%;
  height: 20px;
  margin-top: 10px;
}

.feed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  color: var(--green-dark-sub);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 1.25rem 0;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #dcfce7;
  border-top-color: var(--green-dark-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.feed-end {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1.25rem 0;
  border-top: 1px solid #e2e8f0;
  width: 100%;
}

.feed-error, .empty-state, .error-state {
  text-align: center;
  padding: 2rem 1rem;
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  width: 100%;
}

.feed-error p, .empty-state p, .error-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.btn-retry {
  background-color: var(--green-dark-text);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-retry:hover {
  background-color: var(--green-dark-sub);
}

/* ==========================================================================
   RODAPÉ INSTITUCIONAL
   ========================================================================== */

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.775rem;
  line-height: 1.5;
}

/* Utilitários */
.hidden {
  display: none !important;
}

/* Foco visível acessível */
:focus-visible {
  outline: 2px solid var(--green-dark-text);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transform: none !important;
  }
}

/* ==========================================================================
   RESPONSIVIDADE: TELAS MENORES (MOBILE <= 380px)
   ========================================================================== */

@media (max-width: 380px) {
  .profile-logo-wrapper {
    width: 128px;
    height: 128px;
  }
  
  .profile-logo-img {
    padding: 9px;
  }
  
  .profile-name {
    font-size: 1.5rem; /* ~24px */
  }

  .feed-card-thumb {
    width: 104px;
    height: 104px;
    min-width: 104px;
  }
  
  .feed-card-thumb img {
    max-width: 88px;
    max-height: 88px;
  }

  .feed-card {
    gap: 0.625rem;
    padding: 0.625rem;
  }

  .feed-card-title {
    font-size: 0.95rem; /* ~15px */
  }
}

/* Telas maiores (>= 480px) */
@media (min-width: 480px) {
  .profile-logo-wrapper {
    width: 156px;
    height: 156px;
  }
  
  .profile-logo-img {
    padding: 12px;
  }
  
  .profile-name {
    font-size: 1.75rem; /* ~28px */
  }
}
