/* ============================================================
   JGF Distribuidora — Responsividade (mobile / tablet)
   Usa !important para sobrepor os estilos inline do React.
   minmax(0,1fr) evita o "blowout" de grid (faixas que não encolhem).
   ============================================================ */

/* ---------- TABLET (≤ 1024px) ---------- */
@media (max-width: 1024px) {
  .jgf-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .jgf-trustbar { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; row-gap: 18px !important; }
  .jgf-trustbar > div { border-right: none !important; }
  .jgf-hero-img { max-width: 48% !important; }
}

/* ---------- MOBILE / TABLET PEQUENO (≤ 860px) ---------- */
@media (max-width: 860px) {
  html, body { overflow-x: hidden !important; }
  /* esconde a barra de rolagem no mobile (visual de app/celular) */
  html { scrollbar-width: none !important; }
  html::-webkit-scrollbar { display: none !important; }

  /* top bar secundária some no mobile */
  .jgf-topbar { display: none !important; }

  /* header: logo + carrinho na 1ª linha, busca full-width abaixo */
  .jgf-header { flex-wrap: wrap !important; gap: 14px !important; padding: 14px 16px !important; }
  .jgf-header-search { order: 3 !important; flex: 1 1 100% !important; max-width: none !important; }
  .jgf-search-cat { display: none !important; }
  /* no celular o carrinho vira só ícone + badge, pra caber ao lado do logo */
  .jgf-action-text { display: none !important; }

  /* navbar de categorias com rolagem horizontal */
  .jgf-catnav { overflow-x: auto !important; gap: 18px !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .jgf-catnav::-webkit-scrollbar { display: none; }
  .jgf-catnav > button:last-child { margin-left: 14px !important; }

  /* grids reflow */
  .jgf-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .jgf-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* hero da home — banner full-width limpo no mobile */
  .jgf-hero { height: auto !important; min-height: 0 !important; }
  .jgf-hero-ov1 { clip-path: none !important; background: linear-gradient(180deg, rgba(15,29,57,.94) 0%, rgba(22,41,77,.82) 50%, rgba(15,29,57,.6) 100%) !important; }
  .jgf-hero-ov2 { display: none !important; }
  .jgf-hero-feats { display: none !important; }
  .jgf-hero-inner { display: flex !important; flex-direction: column !important; height: auto !important; padding: 0 !important; }
  .jgf-hero-text { order: 1 !important; max-width: 100% !important; height: auto !important; text-align: center !important; padding: 30px 22px 0 !important; justify-content: flex-start !important; }
  .jgf-hero-text p { margin-left: auto !important; margin-right: auto !important; }
  .jgf-hero-text button { align-self: center !important; margin-top: 22px !important; }
  .jgf-hero-title { font-size: clamp(28px, 8vw, 40px) !important; }
  .jgf-hero-img { display: block !important; position: relative !important; right: auto !important; bottom: auto !important; order: 2 !important; height: auto !important; width: auto !important; max-width: 76% !important; margin: 18px auto 34px !important; }

  /* página de limpeza: hero / listagem / banners */
  .jgf-limpeza-hero { grid-template-columns: minmax(0, 1fr) !important; gap: 22px !important; padding: 30px 26px !important; }
  .jgf-listing { grid-template-columns: minmax(0, 1fr) !important; }
  .jgf-filters-toggle { display: flex !important; }
  .jgf-sidebar { position: static !important; top: auto !important; display: none !important; margin-bottom: 18px !important; }
  .jgf-sidebar.open { display: block !important; }
  .jgf-corp { grid-template-columns: minmax(0, 1fr) !important; gap: 22px !important; padding: 28px 26px !important; }

  /* sobre + contato */
  .jgf-sobre-hero { grid-template-columns: minmax(0, 1fr) !important; }
  .jgf-contact { grid-template-columns: minmax(0, 1fr) !important; gap: 34px !important; }

  /* footer */
  .jgf-footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 26px !important; }

  /* 1 — menu de categorias enxuto: só "TODAS AS CATEGORIAS" + CTA (links via menu) */
  .jgf-catnav-link, .jgf-catnav-div { display: none !important; }
  /* CTA WhatsApp compacto no mobile (só ícone + "WHATSAPP") */
  .jgf-catnav-cta > div { padding: 0 16px 0 24px !important; font-size: 12px !important; gap: 7px !important; }
  .jgf-catnav-cta .jgf-cta-full { display: none !important; }
  .jgf-catnav-cta .jgf-cta-mini { display: inline !important; }

  /* 2 — hero da categoria centralizado */
  .jgf-limpeza-hero-text { text-align: center !important; }
  .jgf-limpeza-hero-text p { margin-left: auto !important; margin-right: auto !important; }
  .jgf-limpeza-hero-text > div { justify-content: center !important; }

  /* 4 — banner corporativo: título centralizado + enxuto, sem estourar a caixa */
  .jgf-corp { padding: 24px 18px !important; gap: 18px !important; }
  .jgf-corp-text { text-align: center !important; }
  .jgf-corp-text h3 { font-size: 20px !important; line-height: 1.18 !important; overflow-wrap: break-word !important; }
  .jgf-corp-text > div { font-size: 16px !important; }
  .jgf-corp .jgf-grid-4 { gap: 10px !important; }

  /* 5 — "Costumam ser pedidos junto" centralizado */
  .jgf-related-title { text-align: center !important; }
  .jgf-related-rule { margin-left: auto !important; margin-right: auto !important; }

  /* 6 — bloco SEO: título e texto centralizados */
  .jgf-seo-title { text-align: center !important; }
  .jgf-seo-text { text-align: center !important; margin-left: auto !important; margin-right: auto !important; }
}

/* ---------- CELULAR (≤ 620px) ---------- */
@media (max-width: 620px) {
  .jgf-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .jgf-trustbar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .jgf-grid-3 { grid-template-columns: minmax(0, 1fr) !important; }
  .jgf-footer-cols { grid-template-columns: minmax(0, 1fr) !important; gap: 22px !important; }
  .jgf-footer-bottom { flex-direction: column !important; gap: 8px !important; text-align: center !important; align-items: center !important; }

  /* cards de produto em 2 colunas responsivas no celular */
  .jgf-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
  /* card mais compacto pra caber 2 por linha sem cortar conteúdo */
  .jgf-pcard { padding: 11px !important; }
  .jgf-pcard-img { height: 106px !important; margin-bottom: 11px !important; }
  .jgf-rating { flex-wrap: wrap !important; row-gap: 2px !important; }
  /* linha de quantidade empilha: label em cima, seletor full-width embaixo */
  .jgf-pcard-qty { flex-direction: column !important; align-items: stretch !important; gap: 7px !important; }
  .jgf-stepper { justify-content: space-between !important; }
  .jgf-qty-input { flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; }

  /* mobile: card enxuto — sem estrelas/consultar, entrega e label de quantidade */
  .jgf-pcard-name { font-size: 12px !important; min-height: 34px !important; margin-bottom: 10px !important; }
  .jgf-pcard-rating-row { display: none !important; }
  .jgf-pcard-delivery { display: none !important; }
  .jgf-qty-label { display: none !important; }
  .jgf-pcard-btn { font-size: 12px !important; padding: 11px 8px !important; gap: 7px !important; }
  /* 3 — botão curto numa linha só no celular */
  .jgf-pcard-btn .jgf-btn-full { display: none !important; }
  .jgf-pcard-btn .jgf-btn-mini { display: inline !important; }

  /* 3 — título do produto alinhado à esquerda (escaneia melhor) */
  .jgf-pcard-name { text-align: left !important; }
  .jgf-pcard-brand { text-align: left !important; }

  /* 7 — rodapé centralizado */
  .jgf-footer-cols { text-align: center !important; }
  .jgf-footer-cols p { margin-left: auto !important; margin-right: auto !important; }

  /* cards institucionais: título e ícone proporcionais, sem sobreposição */
  .jgf-inst-card { padding: 22px 20px !important; min-height: 0 !important; }
  .jgf-inst-title { font-size: 17px !important; line-height: 1.18 !important; }
  .jgf-inst-text { padding-right: 56px !important; gap: 8px !important; }
  .jgf-inst-icon { top: 16px !important; right: 14px !important; }
  .jgf-inst-icon > svg, .jgf-inst-icon > img { width: 50px !important; height: 50px !important; }

  /* diferenciais: 1 card por linha no celular */
  .jgf-dif-grid { grid-template-columns: minmax(0, 1fr) !important; max-width: 420px; margin-left: auto !important; margin-right: auto !important; }

  /* avaliações: sem setas laterais (navega pelos pontos), card full-width */
  .jgf-rev-arrow { display: none !important; }
  .jgf-rev-row { gap: 0 !important; }
  .jgf-rev-title { font-size: 23px !important; }
  .jgf-rev-rating { row-gap: 2px !important; }
  /* CTA "Avalie no Google": texto numa linha, compacto */
  .jgf-rev-cta { font-size: 13.5px !important; padding: 13px 18px !important; gap: 9px !important; }

  /* contato: cabeçalho centralizado */
  .jgf-wa-submit { font-size: 13.5px !important; padding: 14px !important; }
  .jgf-contact-eyebrow { justify-content: center !important; }
  .jgf-contact-title { text-align: center !important; font-size: 28px !important; }
  .jgf-contact-sub { text-align: center !important; max-width: none !important; margin-left: auto !important; margin-right: auto !important; }

  /* NOSSOS DIFERENCIAIS — título não pode estourar a tela */
  .jgf-dif-sec { padding: 44px 0 48px !important; }
  .jgf-dif-head { margin-bottom: 30px !important; }
  .jgf-dif-title { font-size: clamp(26px, 8vw, 38px) !important; line-height: 1.08 !important; }
  .jgf-dif-sub { font-size: 15px !important; max-width: none !important; padding: 0 6px !important; }
  .jgf-dif-grid { gap: 14px !important; }

  /* SALVAGUARDA GLOBAL: nenhum título estoura a largura no mobile */
  h1, h2, h3 { overflow-wrap: break-word !important; word-break: break-word !important; }

  /* mapa: card compacto fixado embaixo, mostrando mais mapa */
  .jgf-map-sec { height: 540px !important; }
  .jgf-map-card { top: auto !important; bottom: 16px !important; left: 16px !important; right: 16px !important; width: auto !important; max-width: none !important; transform: none !important; padding: 18px 18px 16px !important; border-radius: 12px !important; }
}

/* ---------- CELULAR ESTREITO (≤ 420px) ---------- */
@media (max-width: 420px) {
  .jgf-grid-5 { grid-template-columns: minmax(0, 1fr) !important; }
  .jgf-trustbar { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ============================================================
   MELHORIAS DE UX MOBILE (revisão JGF)
   ============================================================ */

/* base: elementos que só aparecem no mobile ficam ocultos no desktop */
.jgf-orderbar { display: none; }
.jgf-filter-backdrop { display: none; }

@media (max-width: 860px) {
  /* 2 — inputs ≥16px evitam o zoom automático do iOS ao focar */
  input, select, textarea { font-size: 16px !important; }

  /* 7 — cabeçalho fixo no topo (home com MobileChrome) */
  .jgf-mobile-chrome { position: sticky; top: 0; z-index: 100; }

  /* 6 — affordance de rolagem horizontal: leve fade na borda direita */
  .jgf-mcatnav {
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, #000 92%, transparent);
  }

  /* 3 — barra inferior persistente substitui os dois FABs empilhados */
  .jgf-cart-fab, .jgf-wa-fab { display: none !important; }
  .jgf-orderbar { display: flex !important; }
  body { padding-bottom: 76px !important; }

  /* 7 — selos de confiança do hero voltam, de forma compacta e centralizada */
  .jgf-hero-feats {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px !important;
    margin: 22px auto 2px !important;
  }

  /* 4 — filtros como bottom sheet sobreposto (não empurra a listagem) */
  .jgf-filter-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(15,29,57,.5);
    z-index: 940;
    animation: fadeUp .2s ease both;
  }
  .jgf-sidebar.open {
    position: fixed !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    z-index: 950 !important;
    max-height: 82vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 18px 18px 0 0 !important;
    box-shadow: 0 -12px 40px rgba(16,30,60,.28) !important;
    padding: 6px 20px calc(20px + env(safe-area-inset-bottom)) !important;
    animation: sheetUp .28s cubic-bezier(.2,.9,.3,1) both;
  }
  .jgf-sheet-close { display: flex !important; }
  .jgf-sheet-apply { display: flex !important; align-items: center; justify-content: center; }
}

@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* 7 — mapa menos alto no celular (mostra mais conteúdo acima) */
@media (max-width: 620px) {
  .jgf-map-sec { height: 430px !important; }
}
