/* ============================================================
   ALWAYS FIT — MODO DE USO
   Folha de estilos
   ------------------------------------------------------------
   ÍNDICE:
   1) VARIÁVEIS  ........... cores, raios e sombras (edite aqui)
   2) RESET / BASE ......... reset básico e tipografia
   3) HEADER ............... cabeçalho com logo e título
   4) BUSCA ................ campo de busca
   5) MAIN / STATUS ........ container principal e status bar
   6) CATEGORIA ............ títulos das seções (Suplementos, etc.)
   7) GRID ................. grade de cards (2 colunas no desktop)
   8) CARD ................. estilo dos cards de produto
   9) LOADING / EMPTY ...... estados de carregamento
   10) WHATSAPP FAB ........ botão flutuante WhatsApp
   11) FOOTER .............. rodapé
   ============================================================ */


/* ============================================================
   1) VARIÁVEIS — MUDE AQUI cores, raios e sombras
   ============================================================ */
:root {
  /* >>> PALETA DE CORES — altere para mudar a aparência global <<< */
  --primary:        #2EC836;   /* verde principal Always Fit  */
  --primary-dark:   #24A02A;   /* verde no hover               */
  --primary-darker: #1E8525;   /* verde escuro (texto)         */
  --primary-light:  #E0F7E2;   /* verde claro (fundos sutis)   */
  --primary-soft:   #F0FCF1;   /* verde quase branco           */

  /* >>> FUNDOS <<< */
  --bg-page: #FAFAFA;          /* fundo da página              */
  --bg-card: #FFFFFF;          /* fundo da área da imagem      */
  --bg-info: #F2F2F2;          /* fundo da área de info        */

  /* >>> TEXTOS <<< */
  --text:       #1F1F1F;
  --text-muted: #6B6B6B;
  --border:     #E5E5E5;

  /* >>> WHATSAPP — cor do botão flutuante <<< */
  --whatsapp: #25D366;

  /* >>> SOMBRAS E RAIOS — afetam a "suavidade" do design <<< */
  --shadow:       0 2px 8px  rgba(46, 200, 54, 0.06);
  --shadow-hover: 0 10px 28px rgba(46, 200, 54, 0.16);
  --radius:    18px;   /* raio dos cards                     */
  --radius-sm: 10px;
}


/* ============================================================
   2) RESET / BASE — não precisa mexer
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}


/* ============================================================
   3) HEADER — cabeçalho com logo + título
   Para mudar o gradiente, edite as variáveis --primary acima.
   ============================================================ */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 36px 24px 52px;
  text-align: center;
}
.logo {
  display: inline-block;
  margin-bottom: 18px;
}
.logo img {
  height: 52px;   /* tamanho do logo no topo */
}
.hero h1 {
  font-size: clamp(30px, 4.5vw, 46px);  /* tamanho do título principal */
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.hero p {
  font-size: 17px;
  opacity: 0.92;
  max-width: 600px;
  margin: 0 auto 30px;
}


/* ============================================================
   3b) BOTÃO "VOLTAR PARA O SITE" — no hero (sobre fundo verde)
   Para mudar o link, edite o href no index.html.
   ============================================================ */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 10px 22px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: white;
  background: transparent;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}
.back-btn:hover {
  background: white;
  color: var(--primary-darker);
}
.back-btn:active { transform: scale(0.97); }
.back-btn svg { width: 16px; height: 16px; }


/* ============================================================
   4) BUSCA — campo de busca em tempo real
   ============================================================ */
.search-wrap {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 17px 22px 17px 56px;
  font-size: 16px;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  background: white;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  outline: none;
  transition: box-shadow 0.2s;
}
.search-wrap input:focus {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35), 0 6px 18px rgba(0, 0, 0, 0.18);
}
/* ícone de lupa SVG embutido — para trocar a cor, edite o stroke%23... */
.search-wrap::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232EC836' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  pointer-events: none;
}


/* ============================================================
   5) MAIN / STATUS BAR — contagem e badge de fonte
   ============================================================ */
main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 14px;
}
.status-bar .count {
  font-weight: 700;
  color: var(--primary-darker);
  font-size: 16px;
}
.badge-source {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-darker);
  font-weight: 600;
}
.badge-source.offline {
  background: #FFF4E5;
  color: #B36B00;
}


/* ============================================================
   6) CATEGORIA — título de cada seção (Suplementos, etc.)
   ============================================================ */
.category-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 36px 0 20px;
  padding-top: 8px;
}
.category-heading:first-of-type { margin-top: 0; }
.category-heading h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 800;
  color: var(--primary-darker);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.category-heading .count-pill {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.category-heading .divider {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--primary), transparent);
  border-radius: 2px;
}


/* ============================================================
   7) GRID — 2 colunas no desktop, 1 coluna no mobile
   Para mudar para 3 colunas: troque "repeat(2, 1fr)" por "repeat(3, 1fr)"
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr; gap: 18px; }
}


/* ============================================================
   8) CARD — cada produto
   - Lado esquerdo (260px): imagem com fundo branco
   - Lado direito: informações com fundo cinza claro
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 260px 1fr;   /* MUDE para ajustar a largura da imagem */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
@media (max-width: 600px) {
  .card { grid-template-columns: 1fr; }   /* mobile: empilha img + info */
}

/* Área da imagem — fundo BRANCO */
.card-img {
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 280px;
}
.card-img img {
  width: 100%;
  max-width: 230px;
  height: 250px;             /* altura padronizada das imagens */
  object-fit: contain;
  display: block;
}
@media (max-width: 600px) {
  .card-img { min-height: 240px; padding: 16px; }
  .card-img img { height: 220px; max-width: 200px; }
}

/* Área de informações — fundo CINZA CLARO */
.card-body {
  background: var(--bg-info);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Título do produto */
.card-title {
  font-size: 22px;   /* MUDE para aumentar/diminuir o nome do produto */
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

/* "MODO DE USO" / "COMPOSIÇÃO" — labels pequenos em maiúsculas */
.card-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-darker);
  font-weight: 700;
  margin-bottom: 5px;
}
.card-section p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* >>> Linhas visíveis por seção (antes do "Ver mais") <<< */
.card-section.uso  p { -webkit-line-clamp: 3; }   /* MODO DE USO: 3 linhas */
.card-section.comp p { -webkit-line-clamp: 1; }   /* COMPOSIÇÃO: 1 linha   */
.card-section.expanded p { -webkit-line-clamp: unset !important; }

/* Botão "Ver mais" / "Ver menos" */
.card-toggle {
  font-size: 12.5px;
  color: var(--primary-darker);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 700;
  align-self: flex-start;
  font-family: inherit;
  margin-top: 4px;
  transition: color 0.15s;
}
.card-toggle:hover { color: var(--primary); text-decoration: underline; }

/* Botão "Saiba mais" — link para a página do produto */
.card-btn {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  padding: 14px 28px;   /* MUDE para aumentar/diminuir o botão */
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  align-self: flex-start;
  box-shadow: 0 4px 12px rgba(46, 200, 54, 0.25);
}
.card-btn:hover { background: var(--primary-dark); box-shadow: 0 6px 16px rgba(46, 200, 54, 0.35); }
.card-btn:active { transform: scale(0.97); }
.card-btn svg { width: 16px; height: 16px; }


/* ============================================================
   8b) KITS (cards com múltiplos subprodutos)
   Lista de subprodutos separados por uma linha vertical verde.
   ============================================================ */
.card-kit .kit-label {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.subproduct {
  border-left: 3px solid var(--primary);
  padding: 6px 0 6px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subproduct + .subproduct {
  margin-top: 4px;
}
.subproduct-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-darker);
  letter-spacing: -0.005em;
}
/* Os textos dos subprodutos podem ficar maiores que 1 linha sem corte */
.subproduct .card-section.uso  p { -webkit-line-clamp: 2; }
.subproduct .card-section.comp p { -webkit-line-clamp: 1; }


/* ============================================================
   9) LOADING / EMPTY — spinner e mensagens
   ============================================================ */
.state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.state.empty { font-size: 16px; }
.spinner {
  display: inline-block;
  width: 38px;
  height: 38px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ============================================================
   10) WHATSAPP FAB — botão flutuante no canto inferior direito
   Para mudar o número: edite o href no index.html (NÃO aqui)
   ============================================================ */
.whatsapp-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: var(--whatsapp);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: transform 0.2s, box-shadow 0.2s;
}
.whatsapp-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(37, 211, 102, 0.55);
}
.whatsapp-fab svg { width: 32px; height: 32px; }
/* Tooltip "Fale conosco" no hover */
.whatsapp-fab::after {
  content: 'Fale conosco';
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1F1F1F;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.whatsapp-fab:hover::after { opacity: 1; }
@media (max-width: 600px) {
  .whatsapp-fab { width: 56px; height: 56px; bottom: 18px; right: 18px; }
  .whatsapp-fab svg { width: 28px; height: 28px; }
  .whatsapp-fab::after { display: none; }   /* no mobile esconde o tooltip */
}


/* ============================================================
   11) FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  background: white;
}
footer a { color: var(--primary-darker); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }
