/* Carrinho (Figma 101:101, 1920 px): conteúdo de 1620 px = itens (1fr) + resumo (552 px), gap 32. */
.atp-carrinho__grade { display: grid; grid-template-columns: minmax(0, 1fr) 552px; gap: 32px; align-items: start; }
.atp-carrinho__itens { display: flex; flex-direction: column; gap: 28px; min-width: 0; }

.atp-titulo { display: flex; flex-direction: column; gap: 4px; }
.atp-titulo__h1 { margin: 0; font-size: 44px; line-height: 61.6px; font-weight: 800; color: var(--atp-titulo); }
.atp-titulo__sub { margin: 0; font-size: 20px; line-height: 28px; color: var(--atp-apoio); }

/* Item do pedido. */
.atp-itens { display: flex; flex-direction: column; gap: 16px; }
.atp-itens__lista { display: flex; flex-direction: column; gap: 16px; }
.atp-item { display: flex; align-items: center; gap: 28px; padding: 24px; background: var(--atp-cartao); border: 1px solid var(--atp-borda); border-radius: 22px; }
.atp-item__foto { flex: 0 0 220px; width: 220px; height: 190px; border-radius: 16px; overflow: hidden; background: var(--atp-menta); }
.atp-item__foto a, .atp-item__foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.atp-item__corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.atp-item__nome { margin: 0; font-size: 22px; line-height: 30.8px; font-weight: 800; color: var(--atp-texto); }
.atp-item__nome a { color: inherit; text-decoration: none; }
.atp-item__attrs { margin: 0; font-size: 16px; line-height: 22.4px; font-weight: 500; color: var(--atp-apoio); }
.atp-item__linha { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.atp-item__preco { margin-left: auto; font-size: 26px; line-height: 36.4px; font-weight: 700; color: var(--atp-texto); text-align: right; }
.atp-item__remover { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; color: var(--atp-apoio); }
.atp-item__remover:hover { background: var(--atp-bege); color: var(--atp-texto); }

.atp-qtd { display: flex; align-items: center; justify-content: space-between; width: 156px; height: 52px; background: var(--atp-cartao-2); border: 1px solid var(--atp-borda); border-radius: 14px; }
.atp-qtd button { display: grid; place-items: center; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 13px; background: transparent; color: var(--atp-apoio); cursor: pointer; }
.atp-qtd button[disabled] { color: #afb9bd; cursor: not-allowed; }
.atp-qtd .quantity { display: grid; place-items: center; width: 50px; margin: 0; }
.atp-qtd .qty { width: 50px; height: 50px; padding: 0; border: 0; background: transparent; text-align: center; font: 700 20px/28px var(--atp-fonte); color: var(--atp-texto); -moz-appearance: textfield; }
.atp-qtd .qty::-webkit-outer-spin-button, .atp-qtd .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.atp-qtd--fixa { width: auto; padding: 0 18px; gap: 8px; font-size: 16px; color: var(--atp-apoio); }
.atp-qtd--fixa .quantity { display: none; }

/* "Atualizar carrinho" só aparece sem JS; com JS os botões − / + enviam. */
.atp-itens__acoes { display: flex; justify-content: flex-end; }
.atp-itens[data-atp-js] .atp-itens__atualizar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Você também pode precisar: 3 cartões compactos lado a lado. */
.atp-vc { display: flex; flex-direction: column; gap: 14px; }
.atp-vc__cab { display: flex; align-items: center; gap: 10px; color: var(--atp-coral); }
.atp-vc__titulo { margin: 0; font-size: 22px; line-height: 30.8px; font-weight: 800; color: var(--atp-titulo); }
.atp-vc__lista { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.atp-vc__item { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; background: var(--atp-cartao); border: 1px solid #d7e9e0; border-radius: 16px; }
.atp-vc__foto { display: block; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--atp-menta); }
.atp-vc__foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.atp-vc__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.atp-vc__nome { margin: 0; font-size: 15px; line-height: 21px; font-weight: 700; color: var(--atp-titulo); }
.atp-vc__nome a { color: inherit; text-decoration: none; }
.atp-vc__preco { margin: 0; font-size: 15px; line-height: 21px; font-weight: 600; color: var(--atp-titulo); }
.atp-vc__acao { flex: 0 0 auto; width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 12px; font-size: 15px; line-height: 21px; }

/* Resumo do pedido. */
.atp-resumo { display: flex; flex-direction: column; gap: 22px; padding: 32px; background: var(--atp-cartao); border: 1px solid var(--atp-borda); border-radius: 24px; }
.atp-resumo__titulo { margin: 0; font-size: 32px; line-height: 44.8px; font-weight: 800; color: var(--atp-texto); }

.atp-valores { display: flex; flex-direction: column; gap: 16px; width: 100%; margin: 0; border: 0; border-collapse: collapse; }
.atp-valores tbody { display: flex; flex-direction: column; gap: 16px; }
.atp-valores tr { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.atp-valores th, .atp-valores td { display: block; padding: 0; border: 0; background: transparent; font-size: 20px; line-height: 28px; text-align: left; }
.atp-valores th { font-weight: 400; color: var(--atp-apoio); }
.atp-valores td { font-weight: 500; color: var(--atp-texto); text-align: right; }
.atp-valores td::before { display: none; }

.atp-total { display: flex; flex-direction: column; gap: 4px; }
.atp-total__linha { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.atp-total__linha span { font-size: 26px; line-height: 36.4px; font-weight: 700; color: var(--atp-texto); }
.atp-total__linha strong { font-size: 32px; line-height: 44.8px; font-weight: 800; color: var(--atp-texto); }
.atp-total__parcelas { margin: 0; text-align: right; font-size: 16px; line-height: 22.4px; color: var(--atp-apoio); }
.atp-total__nota { margin: 0; font-size: 15px; line-height: 21px; color: var(--atp-apoio); }
.wc-proceed-to-checkout { margin: 0; padding: 0; }
.atp-barra__total { display: none; }


.atp-carrinho-vazio { text-align: center; }
.atp-carrinho-vazio .woocommerce-info, .atp-carrinho-vazio .cart-empty { margin: 0 auto 24px; max-width: 560px; font-size: 20px; }
.atp-cta--auto { display: inline-flex; width: auto; padding: 16px 32px; }

@media (max-width: 1200px) {
	.atp-carrinho__grade { grid-template-columns: 1fr; }
	.atp-carrinho__resumo { order: 2; }
}
@media (max-width: 640px) {
	.atp-titulo__h1 { font-size: 32px; line-height: 44.8px; }
	.atp-titulo__sub { font-size: 17px; line-height: 24px; }
	.atp-item { flex-direction: column; align-items: stretch; gap: 16px; padding: 16px; }
	.atp-item__foto { flex-basis: auto; width: 100%; height: 200px; }
	.atp-item__linha { flex-wrap: wrap; }
	.atp-item__preco { width: 100%; margin-left: 0; text-align: left; font-size: 22px; }
	.atp-vc__lista { grid-template-columns: minmax(0, 1fr); }
	.atp-vc__item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
	.atp-vc__foto { width: 64px; height: 64px; }
	.atp-vc__acao { width: auto; }
	.atp-resumo { padding: 20px; }
	.atp-resumo__titulo { font-size: 26px; line-height: 36px; }
	.atp-valores th, .atp-valores td { font-size: 17px; line-height: 24px; }
	.atp-total__linha strong { font-size: 28px; }
}

/* O CSS do WooCommerce (a.remove, .cart-collaterals, .checkout-button) tem especificidade parecida: reforço. */
.atp-sp .atp-item .atp-item__remover.remove { display: grid; place-items: center; width: 48px; height: 48px; margin: 0; border-radius: 12px; font-size: inherit; line-height: 1; text-indent: 0; color: var(--atp-apoio); background: transparent; }
.atp-sp .atp-item .atp-item__remover.remove:hover { background: var(--atp-bege); color: var(--atp-texto); }
.atp-sp .atp-carrinho__resumo .cart-collaterals { float: none; width: 100%; }
.atp-sp .atp-carrinho__resumo .cart-collaterals .cart_totals { float: none; width: 100%; max-width: none; margin: 0; }
.atp-sp .wc-proceed-to-checkout { padding: 0; margin: 0; }
.atp-sp .wc-proceed-to-checkout a.checkout-button.atp-cta { display: flex; width: 100%; min-height: 64px; margin: 0; padding: 16px; border-radius: 16px; background: var(--atp-menta); color: var(--atp-texto); font: 700 20px/28px var(--atp-fonte); text-align: center; }

/* Tabelas do Woo (shop_table) trazem borda, raio e fundo próprios: zera dentro do resumo. */
.atp-sp .atp-resumo table.atp-valores { border: 0; border-radius: 0; margin: 0; width: 100%; background: transparent; }
.atp-sp .atp-resumo table.atp-valores th, .atp-sp .atp-resumo table.atp-valores td { border: 0; padding: 0; background: transparent; font-size: 20px; line-height: 28px; }
.atp-sp .atp-resumo table.atp-valores th { font-weight: 400; color: var(--atp-apoio); }
.atp-sp .atp-resumo table.atp-valores td { font-weight: 500; color: var(--atp-texto); text-align: right; }
/* a.remove do Woo usa !important (vermelho, fundo vermelho no hover). */
.atp-sp .atp-item .atp-item__remover.remove { color: var(--atp-apoio) !important; background: transparent !important; }
.atp-sp .atp-item .atp-item__remover.remove:hover { color: var(--atp-texto) !important; background: var(--atp-bege) !important; }

.atp-sp .atp-resumo table.atp-valores tr, .atp-sp .atp-resumo table.atp-valores tr:nth-child(even) { background: transparent; }

/* Celular: o resumo sobe para logo abaixo dos itens (a venda cruzada desce) e o "Finalizar compra" vira uma barra fixa no rodapé, com o total.
   O Woo troca o .cart_totals inteiro a cada atualização por AJAX, então a barra mora dentro dele (o total nunca fica velho).
   Fica no fim do arquivo para vencer, em especificidade igual, as regras do botão acima. */
@media (max-width: 640px) {
	.atp-carrinho__grade { gap: 24px; }
	.atp-carrinho__itens { display: contents; }
	.atp-titulo { order: 1; }
	.atp-itens { order: 2; }
	.atp-carrinho__resumo { order: 3; }
	.atp-carrinho__itens > .atp-divisoria { order: 4; }
	.atp-vc { order: 5; }
	.atp-carrinho { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }

	/* 68 px à direita: os botões flutuantes de WhatsApp e carrinho (popup do Elementor) ficam ao lado, não em cima do botão. */
	.atp-sp .wc-proceed-to-checkout { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 68px calc(12px + env(safe-area-inset-bottom)) 16px; background: var(--atp-cartao-2); border-top: 1px solid var(--atp-borda); box-shadow: 0 -8px 24px rgba(20, 45, 60, .08); }
	/* O clearfix do Woo (::before/::after) viraria dois itens do flex, cada um com um gap a mais. Sem espaço para o valor e o botão na mesma linha (tela de 320 px, total alto), o botão desce para a linha de baixo. */
	.atp-sp .wc-proceed-to-checkout::before, .atp-sp .wc-proceed-to-checkout::after { content: none; display: none; }
	.atp-barra__total { display: flex; flex: 1 1 auto; flex-direction: column; margin: 0; }
	.atp-barra__rotulo { font: 500 13px/18px var(--atp-fonte); color: var(--atp-apoio); white-space: nowrap; }
	.atp-barra__valor { font: 800 clamp(16px, 5vw, 20px)/26px var(--atp-fonte); color: var(--atp-titulo); white-space: nowrap; }
	.atp-barra__valor small { display: none; }
	.atp-sp .wc-proceed-to-checkout a.checkout-button.atp-cta { flex: 0 0 auto; width: auto; min-height: 52px; margin-left: auto; padding: 10px 16px; border-radius: 26px; font-size: 16px; line-height: 22px; }
	.atp-sp .wc-proceed-to-checkout a.checkout-button.atp-cta .atp-i { display: none; }
}
