body:has(main.ficha) { background: #eef1f4; }
.ficha.miolo { width: min(1240px, calc(100% - 32px)); }
.ficha { padding: 20px 0 72px; }
.ficha h1 { font-size: 1.35rem; font-weight: 800; line-height: 1.3; margin: 0 0 8px; }
.ficha h2 { font-size: 1rem; letter-spacing: 0; margin: 0 0 10px; }
.ficha-grade {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: start;
}
.ficha-produto {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(200px, 0.8fr);
  gap: 28px;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
}
.galeria-foto {
  display: grid;
  place-items: center;
  height: 460px;
}
.galeria-foto img { max-width: 100%; max-height: 460px; object-fit: contain; }
.ficha-sem-foto { padding: 24px; font-weight: 800; text-align: center; }
.galeria-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.galeria-thumb {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  min-height: 0;
  padding: 4px;
  border: 1px solid #e3e6e4;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.galeria-thumb img { width: 100%; height: 100%; object-fit: contain; }
.galeria-thumb.atual { border-color: #8CC400; box-shadow: 0 0 0 1px #8CC400; }
.ficha-categoria { margin: 0 0 8px; color: #5c6560; font-size: .85rem; font-weight: 700; }
.ficha-categoria a { color: inherit; text-decoration: none; }
.ficha-por { margin: 0 0 18px; color: #3d4742; font-weight: 700; }
.compra {
  position: sticky;
  top: 88px;
  padding: 18px 16px 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(14, 17, 18, .06);
}
.compra-preco { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.compra-ver {
  display: inline;
  width: auto;
  min-height: 0;
  margin: 6px 0 16px;
  padding: 0;
  border: 0;
  background: none;
  color: #3f6212;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.compra-gratis { margin: 0 0 12px; font-weight: 800; }
.compra-cep { display: flex; align-items: flex-end; gap: 8px; }
.compra-cep label { flex: 1; margin: 0; color: #5c6560; font-size: .82rem; }
#calcular-produto {
  width: auto;
  min-height: 48px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #3f6212;
  font-weight: 800;
  cursor: pointer;
}
.extrato-acao { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 10px; }
.extrato-acao label { flex: 1; min-width: 120px; margin: 0; }
.extrato-acao .botao { min-height: 40px; }
.ficha-opcoes { display: grid; margin-top: 8px; }
.ficha-opcao {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 12px 8px;
  border: 0;
  border-bottom: 1px solid rgba(14, 17, 18, .08);
  border-radius: 0;
  font-weight: 700;
  cursor: pointer;
}
.ficha-opcao.atual { background: #f7fbe9; border-radius: 10px; }
.extrato-linha {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: #166534;
  font-weight: 800;
}
#linha-cupom[hidden] { display: none !important; }
.ficha-opcao input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  min-height: 0 !important;
  margin: 0;
  opacity: 0;
}
.ficha-opcao span { display: grid; }
.ficha-opcao small { color: #5c6560; font-weight: 600; }
.compra-cupom { margin-top: 14px; }
.compra-cupom summary { font-weight: 800; cursor: pointer; }
.extrato-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(14, 17, 18, .1);
  font-weight: 800;
}
.ficha-pagar { width: 100%; margin-top: 14px; }
.ficha-sobre { margin-top: 8px; }
.ficha-sobre h2 { font-size: 1rem; margin-bottom: 8px; }
.ficha-sobre p { margin: 0; color: #3d4742; }
.ficha-sobre ul { margin: 0; padding-left: 1.15em; color: #3d4742; }
.ficha-sobre li { margin: 6px 0; }
.ficha .nota, .pagamento .nota { margin: 10px 0 0; }

dialog.pagamento {
  width: min(1120px, calc(100vw - 40px));
  height: min(960px, calc(100vh - 16px));
  max-height: calc(100vh - 16px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  color: var(--cor-tinta);
  box-shadow: 0 28px 70px rgba(14, 17, 18, .28);
}
dialog.pagamento[open] { display: flex; }
dialog.pagamento::backdrop { background: rgba(14, 17, 18, .62); }
.pag-grade {
  display: grid;
  grid-template-columns: 320px 1fr;
  flex: 1;
  width: 100%;
  min-height: 0;
}
.pag-lado {
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  background:
    linear-gradient(#8CC400, #8CC400) 0 0 / 100% 4px no-repeat,
    #0E1112;
  color: #fff;
}
.pag-selo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #8CC400;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pag-selo span { width: 22px; height: 2px; background: #8CC400; }
.pag-lado h2 { margin: 14px 0 28px; font-size: 1.45rem; line-height: 1.25; color: #fff; }
.pag-lado dl { display: grid; gap: 12px; margin: 0; }
.pag-lado dl div { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.pag-lado dt { color: #a8b3a4; font-weight: 600; }
.pag-lado dd { margin: 0; color: #fff; font-weight: 700; }
.pag-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: auto 0 0;
  padding-top: 18px;
  border-top: 0;
  background: linear-gradient(#8CC400, #8CC400) 0 0 / 42px 3px no-repeat;
  font-weight: 700;
}
.pag-total span { color: #c5d0c0; }
.pag-total strong { color: #8CC400; font-size: 1.75rem; letter-spacing: -.02em; }
.pag-seguro { margin: 16px 0 0; color: #b7c2b2; font-size: .84rem; line-height: 1.45; }
.pag-miolo {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 28px 32px 20px;
  background: #fff;
  box-shadow: inset 4px 0 0 #8CC400;
}
.pag-miolo header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pag-miolo h2 { margin: 0; font-size: 1.35rem; }
.pag-miolo h2::before {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  margin-bottom: 10px;
  background: #8CC400;
}
.pag-miolo header p { margin: 4px 0 0; color: #5c675f; font-size: .92rem; }
.pagamento-fechar {
  width: 36px;
  height: 36px;
  min-height: 0;
  border: 1px solid #e3e6e2;
  border-radius: 8px;
  background: #fff;
  color: #0E1112;
  font-size: 1.2rem;
  cursor: pointer;
}
.pagamento-fechar:hover { border-color: #8CC400; color: #3f5c00; }
.pag-palco { flex: 1; min-height: 0; margin-top: 18px; overflow: auto; padding-right: 4px; }
.pag-dados { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.pag-largo { grid-column: 1 / -1; }
.pag-miolo label { margin: 0; color: #3c4641; font-size: .82rem; font-weight: 700; }
.pag-miolo input {
  margin-top: 4px;
  background: #fbfbfa;
  border-color: #d5dad4;
  border-radius: 8px;
}
.pag-miolo input:focus {
  outline: none;
  border-color: #8CC400;
  box-shadow: 0 0 0 3px rgba(140, 196, 0, .2);
}
.pag-meio-titulo { margin: 22px 0 10px; font-size: .82rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #5c675f; }
.pag-meio-titulo::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-right: 8px;
  background: #8CC400;
  vertical-align: middle;
}
.pagamento-meios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.meio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  min-height: 64px;
  padding: 12px 12px 12px 16px;
  border: 1px solid #e4e7e2;
  border-radius: 10px;
  background: #f6f7f5;
  color: #8b948c;
  text-align: left;
  cursor: pointer;
}
.meio span { flex: 1; min-width: 0; }
.meio::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid #c9cfc8;
  border-radius: 50%;
  background: #fff;
}
.meio:hover { border-color: #b7d45a; color: #3f5c00; }
.meio b { display: block; color: inherit; font-size: .95rem; }
.meio small { color: #8b948c; font-weight: 600; }
.meio.atual {
  border-color: #8CC400;
  background: #f3f8e6;
  color: #0E1112;
  box-shadow: inset 4px 0 0 #8CC400;
}
.meio.atual small { color: #3f5c00; }
.meio.atual::after {
  border-color: #5a7a00;
  background: radial-gradient(circle at center, #8CC400 0 4px, #fff 4.5px);
}
.pag-espera { margin: 18px 0; color: #667068; }
.meio-painel { margin-top: 16px; }
.meio-painel[hidden], .pag-erro[hidden], #pag-linha-frete[hidden], #pag-linha-cupom[hidden],
#pag-resultado[hidden], #pag-qr[hidden], #pag-copia[hidden],
#pag-copiar[hidden], #pag-abrir[hidden], #pag-seguir[hidden], #pag-aguarda[hidden],
.pag-confirmar[hidden] { display: none !important; }
.meio-painel > p { margin: 0 0 14px; color: #3d4742; line-height: 1.45; }
.pagamento-linha { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 12px; margin-top: 12px; }
.pag-erro { margin: 10px 0 0; color: #8d1d1d; font-weight: 700; }
.pag-miolo footer { margin-top: 14px; }
.pag-confirmar {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  background: #0E1112;
  box-shadow: inset 0 -3px 0 #8CC400;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.pag-confirmar:hover:not(:disabled) { background: #1c2416; }
.pag-confirmar:disabled { background: #c5cac6; box-shadow: none; cursor: not-allowed; }
.pag-miolo footer p { margin: 8px 0 0; color: #6b756f; font-size: .8rem; text-align: center; }
#pag-endereco { margin-top: 14px; }
#pag-resultado { display: grid; justify-items: start; gap: 12px; }
#pag-resultado h3 { margin: 0; font-size: 1.2rem; }
#pag-resultado p { margin: 0; color: #3d4742; line-height: 1.45; }
#pag-qr {
  width: 220px;
  height: 220px;
  object-fit: contain;
  padding: 8px;
  border: 1px solid #e4e7e2;
  border-radius: 12px;
  background: #fff;
}
#pag-copia { min-height: 88px; font-size: .82rem; line-height: 1.4; }
.pag-resultado-acoes { display: flex; flex-wrap: wrap; gap: 10px; }
#pag-copiar, .pag-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #0E1112;
  background: #0E1112;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.pag-link { background: #fff; color: #0E1112; }
#pag-aguarda { color: #3f5c00; font-weight: 700; }
@media (max-width: 800px) {
  .ficha-grade, .ficha-produto { grid-template-columns: 1fr; }
  .galeria-foto, .galeria-foto img { height: 320px; max-height: 320px; }
  .compra { position: static; }
  dialog.pagamento { width: calc(100vw - 16px); height: calc(100vh - 16px); border-radius: 12px; }
  .pag-grade { grid-template-columns: 1fr; overflow: auto; }
  .pag-lado { min-height: 0; }
  .pag-miolo { box-shadow: inset 0 4px 0 #8CC400; }
  .pag-total { margin-top: 18px; }
  .pag-dados, .pagamento-meios, .pagamento-linha { grid-template-columns: 1fr; }
}
