/* Vitrine pública da Agro e Pet Guanabara. */
html:has(body.vitrine) { scroll-padding-top: 154px; }
.vitrine {
  --fundo: #f7f8f5;
  --linha: #dfe5dd;
  --suave: #586458;
  --acao: #28613a;
  padding-bottom: 48px;
}

.vitrine .topo {
  position: sticky;
  top: 0;
  z-index: 2;
  overflow: visible;
  background: var(--papel);
  border-bottom: 1px solid var(--linha);
}

.loja-cabecalho, .categorias-loja {
  max-width: 1248px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 36px);
}

.loja-cabecalho {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
  padding-block: 12px 8px;
}

.marca-loja {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.marca-loja img { flex: none; border-radius: 9px; }
.vitrine .marca-loja h1 { margin: 0; font-size: 1.05rem; font-weight: 750; line-height: 1.15; text-wrap: initial; }
.busca-loja { grid-column: 1 / -1; grid-row: 2; }
.vitrine #busca { display: block; margin: 0; padding: 10px 13px; min-height: 44px; border: 1px solid var(--linha); border-radius: 9px; box-shadow: none; background: #f7f8f6; font-size: 1rem; }
.acoes-loja { display: flex; align-items: center; gap: 5px; min-width: 0; }
.vitrine .conta, .botao-carrinho { position: static; margin: 0; min-height: 42px; padding: 7px 9px; border-radius: 8px; font-size: .84rem; font-weight: 700; }
.vitrine .conta { color: var(--acao); background: transparent; border: 0; }
.vitrine .conta:hover { background: #eef4ee; }
.botao-carrinho { border: 1px solid #cbdccd; color: var(--acao); background: #edf3ed; white-space: nowrap; }
.botao-carrinho:hover, .vitrine #abas a:hover { background: #e5efe6; }
.botao-carrinho.pulo { animation: pulo .35s; }
.vitrine #abas { gap: 6px; padding: 4px 0 8px; scrollbar-width: thin; }
.vitrine #abas a { display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 36px; padding: 5px 11px; border-radius: 8px; color: var(--suave); font-size: .86rem; font-weight: 650; white-space: nowrap; }
.vitrine #abas .ativa { color: #214d30; background: #eaf2eb; font-weight: 750; }
.interno .busca-loja, .interno .categorias-loja { display: none; }
.vitrine.interno .loja-cabecalho { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 12px; }

.vitrine #tela-cardapio {
  display: block;
  max-width: 1248px;
  padding-inline: clamp(16px, 4vw, 36px);
}

.resumo-loja { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; padding-top: 14px; }
.vitrine .selo { border-radius: 6px; padding: 3px 7px; color: #693825; background: #f5ebe5; font-size: .78rem; }
.vitrine .selo.aberto { color: #245435; background: #eaf2eb; }
.detalhes-loja { color: var(--suave); font-size: .86rem; }
.detalhes-loja summary { width: fit-content; cursor: pointer; }
.detalhes-loja .infos { margin-top: 8px; }

.vitrine #lista section > h2 {
  margin: 24px 0 12px;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.2;
  font-weight: 750;
  text-wrap: initial;
}

.vitrine #lista section > h2::after { content: none; }
.vitrine .grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.vitrine .item {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 0;
  min-height: 0;
  border: 1px solid var(--linha);
  border-radius: 10px;
  box-shadow: none;
  transition: border-color .15s, background-color .15s;
}

.vitrine .item:hover { transform: none; box-shadow: none; border-color: #91ad94; }
.vitrine .item > span:not(.mais-um) { grid-row: 2; padding: 10px 11px; }
.vitrine .item b { font-size: .94rem; font-weight: 700; line-height: 1.3; }
.vitrine .item small { font-size: .78rem; line-height: 1.3; }
.vitrine .item em { padding-top: 5px; padding-right: 33px; font: 750 1.05rem/1.25 Figtree, system-ui, sans-serif; font-style: normal; }
.vitrine .item.esgotado { opacity: 1; background: #fbfcfa; }
.vitrine .item.esgotado img { opacity: .65; }
.vitrine .item small.esgotado { color: #834229; }
.vitrine .item img, .vitrine .item.sem-foto::after {
  grid-row: 1;
  display: block;
  width: 100%;
  height: clamp(104px, 20vw, 155px);
  min-height: 0;
  max-height: none;
  padding: 9px;
  object-fit: contain;
  background-color: #fff;
}
.vitrine .item.sem-foto::after { background-size: 58px; }
.vitrine .mais-um { width: 30px; height: 30px; right: 9px; bottom: 9px; border-radius: 7px; color: var(--acao); background: #edf3ed; box-shadow: none; font-size: 1.2rem; }
.vitrine .item:hover .mais-um { transform: none; background: #e0ede1; }
.vitrine dialog .comanda, .vitrine .estreita .comanda { mask: none; border: 1px solid var(--linha); border-radius: 10px; padding: 14px; }
.vitrine .principal:hover:not(:disabled) { background: #214f30; }

@media (min-width: 680px) {
  .loja-cabecalho { grid-template-columns: minmax(180px, 1fr) minmax(200px, 2fr) auto; gap: 16px; padding-top: 15px; }
  .busca-loja { grid-column: auto; grid-row: auto; }
  .vitrine .marca-loja h1 { font-size: 1.22rem; }
  .vitrine .conta, .botao-carrinho { padding-inline: 12px; }
  .vitrine .grade { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }

}

@media (min-width: 1000px) {
  html:has(body.vitrine) { scroll-padding-top: 150px; }
  .vitrine #abas { flex-wrap: wrap; overflow: visible; padding-bottom: 8px; }
  .vitrine #abas a { padding-inline: 9px; }
  .vitrine .grade { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .vitrine .item > span:not(.mais-um) { padding: 11px 14px 14px; }
  .vitrine .item b { font-size: 1rem; }
}
/* Vitrine móvel: os estilos do desktop continuam acima. */
#carrinho-movel { display: none; }
.filtro-movel, .compra-movel { display: none; }
.produto-vitrine { display: contents; }

@media (max-width: 679px) {
  html:has(body.vitrine) { scroll-padding-top: calc(146px + env(safe-area-inset-top)); }

  .vitrine { padding-bottom: 32px; }
  .vitrine:has(#carrinho-movel:not([hidden])) {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .loja-cabecalho {
    gap: 8px 10px;
    padding-block: max(8px, env(safe-area-inset-top)) 5px;
  }
  .marca-loja { gap: 8px; }
  .marca-loja img { width: 32px; height: 32px; border-radius: 8px; }
  .vitrine .marca-loja h1 { font-size: .98rem; line-height: 1.2; }
  .vitrine .conta { min-height: 44px; min-width: 52px; padding-inline: 10px; }
  .vitrine .botao-carrinho { display: none; }

  .busca-loja { position: relative; min-width: 0; }
  .busca-loja::before, .busca-loja::after {
    content: "";
    position: absolute;
    z-index: 1;
    pointer-events: none;
  }
  .busca-loja::before {
    left: 15px;
    top: 15px;
    width: 10px;
    height: 10px;
    border: 1.7px solid #526653;
    border-radius: 50%;
  }
  .busca-loja::after {
    top: 26px;
    left: 25px;
    width: 6px;
    height: 1.7px;
    border-radius: 2px;
    background: #526653;
    transform: rotate(45deg);
  }
  .vitrine #busca { min-height: 46px; padding: 9px 12px 9px 36px; border-radius: 11px; }

  .vitrine .categorias-loja { display: none; }
  .vitrine:not(.interno) .filtro-movel { display: flex; align-items: center; gap: 10px; padding: 3px 16px 9px; }
  #categoria-movel {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 6px 11px;
    border: 1px solid #d9e6d9;
    border-radius: 10px;
    background: #edf4ed;
    color: var(--acao);
    text-align: left;
    font-size: .9rem;
    font-weight: 700;
  }
  #categoria-movel::before {
    content: "";
    width: 15px;
    height: 15px;
    flex: none;
    background: radial-gradient(circle, currentColor 2px, transparent 2.5px) 0 0 / 7px 7px;
  }
  #categoria-movel::after {
    content: "";
    margin: -3px 2px 0 auto;
    width: 6px;
    height: 6px;
    flex: none;
    border-right: 1.5px solid;
    border-bottom: 1.5px solid;
    transform: rotate(45deg);
  }
  #rotulo-categoria-movel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #dlg-categorias h2 { margin: 22px 62px 16px 18px; font-size: 1.2rem; }
  #dlg-categorias .rolagem { margin-top: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .opcao-categoria-movel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 8px 12px;
    margin-bottom: 4px;
    border: 1px solid var(--linha);
    border-radius: 8px;
    background: var(--papel);
    text-align: left;
  }
  .opcao-categoria-movel[aria-pressed="true"] { color: var(--acao); border-color: #c9dbc9; background: #edf4ed; font-weight: 700; }
  .opcao-categoria-movel[aria-pressed="true"]::after { content: "✓"; }
  #resultados-movel { color: var(--suave); font-size: .78rem; white-space: nowrap; }
  .vitrine .acompanhar {
    width: fit-content;
    margin: 8px 16px 0;
    padding: 6px 9px;
    border-radius: 6px;
    background: #eaf2eb;
    color: var(--acao);
    font-size: .86rem;
    text-align: left;
  }
  .resumo-loja { justify-content: space-between; gap: 6px; padding-top: 8px; }
  .detalhes-loja summary { margin-left: auto; padding: 6px 0; }
  .detalhes-loja .infos { max-width: 28ch; margin-top: 2px; }
  .vitrine #lista section > h2 { margin: 14px 0 8px; font-size: 1.16rem; }
  .vitrine #lista section + section { margin-top: 22px; }

  .vitrine .grade { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .produto-vitrine { display: block; min-width: 0; position: relative; }
  .vitrine .item {
    --foto-movel: 84px;
    min-height: 116px;
    grid-template-columns: var(--foto-movel) minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: start;
    gap: 9px;
    border-radius: 11px;
    padding: 9px;
  }
  .vitrine .item img, .vitrine .item.sem-foto::after {
    grid-area: 1 / 1;
    width: var(--foto-movel);
    height: var(--foto-movel);
    align-self: center;
    padding: 5px;
    border-radius: 7px;
    background: #fff;
  }
  .vitrine .item.sem-foto::after { background: #f2f5ef url(/sem-foto.svg) center / 38px no-repeat; }
  .vitrine .item > span:not(.mais-um) { grid-area: 1 / 2; align-self: stretch; padding: 2px 0 34px; gap: 3px; }
  .vitrine .item b { font-size: .89rem; font-weight: 700; line-height: 1.27; overflow-wrap: anywhere; }
  .vitrine .item small { -webkit-line-clamp: 1; font-size: .75rem; }
  .vitrine .item em { position: absolute; bottom: 16px; left: calc(var(--foto-movel) + 18px); margin: 0; padding: 0; font-size: 1rem; }
  .vitrine .item small.esgotado { position: absolute; bottom: 17px; right: 10px; }
  .vitrine .mais-um { display: none; }
  .vitrine .compra-movel {
    display: inline-flex;
    position: absolute;
    right: 6px;
    bottom: 4px;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding-inline: 9px;
    border: 0;
    border-radius: 8px;
    background: #edf3ed;
    color: var(--acao);
    font-size: .82rem;
    font-weight: 750;
  }
  .vitrine .compra-movel:hover { background: #e0ede1; }
  #carrinho-movel {
    display: block;
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--linha);
    background: var(--papel);
    box-shadow: 0 -4px 16px #1f2a1d0a;
  }
  #abrir-carrinho-movel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 7px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--acao);
    color: #fff;
    line-height: 1.2;
    text-align: left;
  }
  #abrir-carrinho-movel small { display: block; margin-top: 2px; color: #e4f0e6; }
  #total-movel { white-space: nowrap; }
  .vitrine .recado { top: auto; bottom: calc(82px + env(safe-area-inset-bottom)); text-align: center; }
  .vitrine dialog { border-radius: 18px 18px 0 0; }
  .vitrine dialog .rodape .principal { min-height: 48px; border-radius: 10px; }
}

@media (max-width: 359px) {
  .vitrine #tela-cardapio { padding-inline: 12px; }
  .vitrine .item { --foto-movel: 66px; }
}
