/**
 * Checkout Prime — Wizard de 3 Etapas
 * Etapa 1 (dados + país), Etapa 2 (endereço), Etapa 3 (pagamento — ver checkout-cartao.css)
 */

.cu-checkout {
	--cu-ink: #12172B;
	--cu-azul: #4C6FFF;
	--cu-sucesso: #16C79A;
	--cu-erro: #FF5A5F;
	--cu-texto-mudo: #6B7280;
	--cu-borda: #E3E6ED;
	--cu-branco: #FFFFFF;

	position: relative;
	width: 100%;
	max-width: 440px;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
	color: var(--cu-ink);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* ===== Preloader — cobre o formulário até a Etapa 1 estar pronta ===== */
.cu-preloader {
	position: absolute;
	inset: 0;
	min-height: 340px;
	background: var(--cu-branco);
	border-radius: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	z-index: 50;
	opacity: 1;
	transition: opacity .35s ease;
}

.cu-preloader--saindo {
	opacity: 0;
	pointer-events: none;
}

.cu-preloader[hidden] {
	display: none;
}

.cu-preloader-spinner {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--cu-borda);
	border-top-color: var(--cu-ink);
	animation: cu-wizard-girar .7s linear infinite;
}

.cu-preloader p {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--cu-texto-mudo);
}

@media (prefers-reduced-motion: reduce) {
	.cu-preloader { transition: none; }
	.cu-preloader-spinner { animation-duration: 1.4s; }
}

/* Tablet/desktop: meio-termo (nem 440px do mobile, nem 780–920px).
   ID + !important para vencer o CSS crítico inline e o tema. */
@media (min-width: 600px) {
	#cuCheckoutWizard.cu-checkout,
	.cu-checkout {
		max-width: 520px !important;
	}
}

@media (min-width: 768px) {
	#cuCheckoutWizard.cu-checkout,
	.cu-checkout {
		max-width: 560px !important;
	}
	.cu-bloco {
		padding: 28px 32px;
	}
}

@media (min-width: 1024px) {
	#cuCheckoutWizard.cu-checkout,
	.cu-checkout {
		max-width: 580px !important;
	}
}

/* Campo de cartão (Etapa 3) herda a largura do wizard em vez do próprio limite de 440px */
.cu-checkout .cu-pagamento-cartao {
	max-width: none;
}

.cu-checkout *, .cu-checkout *::before, .cu-checkout *::after {
	box-sizing: border-box;
}

/* ===== Indicador de etapas ===== */
.cu-indicador {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 22px;
}

.cu-indicador-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 600;
	color: var(--cu-texto-mudo);
}

.cu-indicador-bolha {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #EEF0F5;
	color: var(--cu-texto-mudo);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	transition: background .2s ease, color .2s ease;
}

.cu-indicador-item.cu-ativa .cu-indicador-bolha,
.cu-indicador-item.cu-concluida .cu-indicador-bolha {
	background: var(--cu-ink);
	color: #fff;
}

.cu-indicador-item.cu-ativa { color: var(--cu-ink); }

.cu-indicador-linha {
	flex: 1;
	height: 1px;
	background: var(--cu-borda);
}

/* ===== Produto + resumo — um card só, visível nas 3 etapas ===== */
.cu-resumo-card {
	border: 1px solid var(--cu-borda);
	border-radius: 16px;
	background: #fff;
	padding: 14px 16px;
	margin-bottom: 18px;
	box-shadow: 0 4px 16px rgba(18,23,43,.05);
}

.cu-resumo-card__topo {
	display: flex;
	gap: 12px;
	align-items: center;
}

.cu-checkout .cu-resumo-card .cu-resumo-produto__img,
img.cu-resumo-produto__img {
	width: 42px !important;
	height: 42px !important;
	object-fit: cover !important;
	border-radius: 14px !important;
	border: 1.5px solid var(--cu-azul) !important;
	box-shadow: 0 2px 6px rgba(76,111,255,.15) !important;
	flex-shrink: 0;
	max-width: 42px !important;
	max-height: 42px !important;
	display: block !important;
}

.cu-resumo-produto__info {
	flex: 1;
	min-width: 0;
}

.cu-resumo-produto__nome {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--cu-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cu-resumo-produto__preco {
	display: block;
	color: var(--cu-texto-mudo);
	font-size: 12px;
	margin-top: 1px;
}

/* ===== Resumo detalhado — mesma "folha", só uma linha fina separando ===== */
.cu-resumo-detalhado {
	border-top: 1px solid var(--cu-borda);
	margin-top: 10px;
	padding-top: 8px;
}

.cu-resumo-linha {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--cu-texto-mudo);
	padding: 2px 0;
}

.cu-resumo-linha--total {
	border-top: 1px solid var(--cu-borda);
	margin-top: 4px;
	padding-top: 6px;
	font-weight: 700;
	color: var(--cu-ink);
	font-size: 13px;
}

.cu-resumo-linha--desconto {
	color: var(--cu-sucesso);
	font-weight: 600;
}

/* ===== Método de pagamento — quadradinhos compactos em uma linha ===== */
.cu-metodo-pagamento {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 6px;
	margin-bottom: 14px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.cu-metodo-opcao {
	position: relative;
	margin: 0;
	flex: 1 1 0;
	min-width: 52px;
}

.cu-metodo-opcao[hidden] {
	display: none !important;
}

.cu-metodo-opcao input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.cu-metodo-opcao label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-height: 64px;
	padding: 16px 2px 6px;
	border: 1.5px solid var(--cu-borda);
	border-radius: 10px;
	background: #FCFCFD;
	font-size: 10px;
	font-weight: 650;
	line-height: 1.15;
	text-align: center;
	cursor: pointer;
	color: var(--cu-ink);
	transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.cu-metodo-opcao label:hover {
	border-color: #C9D0DC;
	background: #fff;
}

.cu-metodo-opcao input:checked + label {
	border-color: var(--cu-ink);
	background: #fff;
	box-shadow: 0 4px 12px rgba(18, 23, 43, .1);
}

.cu-metodo-icone {
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--cu-ink);
	flex-shrink: 0;
}

.cu-metodo-icone svg {
	width: 20px;
	height: 20px;
	display: block;
}

.cu-metodo-icone--pix {
	width: 24px;
	height: 24px;
}

.cu-metodo-icone--pix svg {
	width: 24px;
	height: 24px;
	overflow: visible;
	shape-rendering: geometricPrecision;
}

.cu-metodo-nome {
	display: block;
	max-width: 100%;
	padding: 0 1px;
	font-size: 9.5px;
	font-weight: 650;
	line-height: 1.15;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cu-metodo-selo {
	position: absolute;
	top: 3px;
	left: 3px;
	z-index: 2;
	pointer-events: none;
	font-size: 8px;
	font-weight: 800;
	letter-spacing: .02em;
	line-height: 1.25;
	color: #047857;
	background: #D1FAE5;
	border: 0;
	padding: 1px 5px;
	margin: 0;
	border-radius: 999px;
	white-space: nowrap;
}

.cu-carteira-painel {
	padding: 0 0 8px;
}

.cu-confianca {
	background: #fff;
	border: 1px solid var(--cu-borda);
	border-radius: 16px;
	padding: 14px 14px 12px;
	margin: 0 0 14px;
	box-shadow: 0 8px 24px rgba(18, 23, 43, .045);
}

.cu-confianca-lista {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 11px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cu-confianca-lista li {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -.01em;
	color: #3A4158;
}

.cu-confianca-icone {
	display: block;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
}

.cu-btn-carteira {
	display: flex;
	align-items: center;
	justify-content: center;
	position: static;
	width: 100%;
	min-height: 52px;
	margin: 0 0 10px;
	padding: 15px;
	border: 0;
	border-radius: 12px;
	background: #000;
	color: #fff;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	gap: 8px;
	box-sizing: border-box;
	transform: none;
	touch-action: manipulation;
	transition: opacity .15s ease;
}

.cu-btn-carteira.cu-carteira-eco {
	visibility: hidden;
	pointer-events: none;
}

.cu-btn-carteira[hidden] {
	display: none;
}

.cu-gpay-host {
	width: 100%;
	min-height: 52px;
	margin: 0 0 10px;
	border-radius: 12px;
	overflow: hidden;
}

.cu-gpay-host[hidden] {
	display: none !important;
}

.cu-gpay-host > * {
	width: 100% !important;
	min-height: 52px !important;
}

.cu-btn-carteira:disabled {
	opacity: .7;
	cursor: default;
}

.cu-btn-carteira-marca {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .01em;
	line-height: 1;
	color: #fff;
}

.cu-btn-carteira-marca svg {
	display: block;
	height: 18px;
	width: auto;
	fill: currentColor;
}

@media (max-width: 380px) {
	.cu-confianca-lista {
		grid-template-columns: 1fr;
	}
}

.cu-btn-carteira .cu-btn-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid rgba(255,255,255,.28);
	border-top-color: #fff;
	animation: cu-wizard-girar .7s linear infinite;
}

.cu-btn-carteira.cu-carregando .cu-btn-carteira-marca {
	opacity: .7;
}

.cu-btn-carteira.cu-carregando .cu-btn-spinner {
	display: inline-block;
}

.cu-carteira-dica {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--cu-texto-mudo);
	text-align: center;
}

@media (min-width: 480px) {
	.cu-metodo-pagamento {
		gap: 8px;
	}
	.cu-metodo-opcao label {
		min-height: 70px;
		padding: 18px 4px 8px;
		border-radius: 12px;
	}
	.cu-metodo-icone,
	.cu-metodo-icone svg {
		width: 22px;
		height: 22px;
	}
	.cu-metodo-icone--pix,
	.cu-metodo-icone--pix svg {
		width: 24px;
		height: 24px;
	}
	.cu-metodo-nome {
		font-size: 11px;
	}
	.cu-metodo-selo {
		font-size: 9px;
		padding: 2px 6px;
		top: 4px;
		left: 4px;
	}
}

/* ===== Frete — aparece só depois do endereço preenchido ===== */
.cu-frete {
	margin-bottom: 20px;
}

.cu-frete-titulo {
	font-size: 12px;
	font-weight: 600;
	color: var(--cu-texto-mudo);
	margin: 0 0 8px;
}

.cu-frete-opcao {
	position: relative;
	margin-bottom: 8px;
}

.cu-frete-opcao input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.cu-frete-opcao label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1.5px solid var(--cu-borda);
	border-radius: 12px;
	font-size: 14px;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}

.cu-frete-opcao input:checked + label {
	border-color: var(--cu-azul);
	background: #F5F7FF;
}

.cu-frete-opcao input:checked + label .cu-frete-preco {
	color: var(--cu-ink);
}

.cu-frete-esquerda {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	min-width: 0;
}

.cu-frete-esquerda span:last-child {
	overflow: visible;
	text-overflow: unset;
	white-space: normal;
	line-height: 1.3;
	word-break: break-word;
}

.cu-frete-preco {
	font-weight: 600;
	color: var(--cu-texto-mudo);
	flex-shrink: 0;
	margin-left: 8px;
}

.cu-frete-icone {
	width: 17px;
	height: 17px;
	flex-shrink: 0;
	color: var(--cu-texto-mudo);
	transition: color .15s ease;
}

.cu-frete-opcao input:checked + label .cu-frete-icone {
	color: var(--cu-azul);
}

/* ===== Bloco (card branco) ===== */
.cu-bloco {
	background: var(--cu-branco);
	border-radius: 20px;
	padding: 24px;
	box-shadow: 0 20px 60px rgba(18,23,43,.08);
	border: 1px solid var(--cu-borda);
}

/* ===== "Calculando frete" — dentro do fluxo, logo abaixo do endereço ===== */
.cu-carregando-inline {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 18px 0;
	margin-bottom: 20px;
	border: 1px dashed var(--cu-borda);
	border-radius: 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cu-texto-mudo);
}

.cu-carregando-inline[hidden] {
	display: none;
}

.cu-carregando-spinner {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 3px solid var(--cu-borda);
	border-top-color: var(--cu-ink);
	animation: cu-wizard-girar .7s linear infinite;
}

@keyframes cu-wizard-girar {
	to { transform: rotate(360deg); }
}

.cu-etapa[hidden] { display: none; }

.cu-etapa-titulo {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 18px;
}

/* ===== Seletor de país (segmented control) ===== */
.cu-pais-selector {
	display: flex;
	gap: 8px;
	margin-bottom: 20px;
	background: #F5F6FA;
	padding: 4px;
	border-radius: 12px;
}

.cu-pais-opcao {
	flex: 1;
	position: relative;
}

.cu-pais-opcao input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.cu-pais-opcao label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 8px;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cu-texto-mudo);
	cursor: pointer;
	transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.cu-pais-opcao input:checked + label {
	background: #fff;
	color: var(--cu-ink);
	box-shadow: 0 2px 6px rgba(18,23,43,.10);
}

/* ===== Campos ===== */
.cu-campo {
	margin-bottom: 16px;
}

.cu-campo label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--cu-texto-mudo);
	margin-bottom: 6px;
}

.cu-campo input[type="text"],
.cu-campo input[type="email"],
.cu-campo input[type="tel"] {
	width: 100%;
	height: 48px;
	border: 1.5px solid var(--cu-borda);
	border-radius: 12px;
	background: #FCFCFD;
	padding: 0 14px;
	font-size: 16px;
	color: var(--cu-ink);
	font-family: inherit;
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.cu-campo input:focus {
	outline: none;
	border-color: var(--cu-azul);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(76,111,255,.12);
}

.cu-campo input.cu-invalido {
	border-color: var(--cu-erro);
}

.cu-campo input.cu-autofill {
	border-color: var(--cu-sucesso);
	background: #F3FBF8;
}

.cu-cep-shell {
	position: relative;
}

.cu-cep-shell input {
	padding-right: 42px;
}

.cu-cep-spinner {
	position: absolute;
	right: 14px;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border-radius: 50%;
	border: 2px solid var(--cu-borda);
	border-top-color: var(--cu-ink);
	animation: cu-wizard-girar .7s linear infinite;
	pointer-events: none;
}

.cu-cep-spinner[hidden] {
	display: none;
}

.cu-cep-status {
	display: block;
	font-size: 12px;
	line-height: 1.35;
	margin-top: 6px;
	min-height: 16px;
	color: var(--cu-texto-mudo);
}

.cu-cep-status--ok {
	color: var(--cu-sucesso);
}

.cu-cep-status--aviso {
	color: var(--cu-texto-mudo);
}

.cu-campo input::placeholder { color: #B7BCC8; }

.cu-input-shell--telefone input {
	min-width: 0;
}

.cu-tel-bandeira {
	font-size: 18px;
	line-height: 1;
	flex-shrink: 0;
	margin-right: 9px;
	padding-right: 9px;
	border-right: 1px solid var(--cu-borda);
}

.cu-linha-dupla { display: flex; gap: 14px; }
.cu-linha-dupla .cu-campo { flex: 1; min-width: 0; }

.cu-erro-msg {
	display: block;
	font-size: 12px;
	color: var(--cu-erro);
	margin-top: 6px;
	min-height: 14px;
}

/* ===== Link "Voltar" discreto (Etapa 3, acima do título) ===== */
.cu-link-voltar {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: none;
	border: 0;
	padding: 0;
	margin-bottom: 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cu-texto-mudo);
	cursor: pointer;
}

.cu-link-voltar:hover {
	color: var(--cu-ink);
}

.cu-link-voltar--centro {
	display: block;
	width: 100%;
	text-align: center;
	margin: 22px 0 0;
	padding-top: 4px;
	font-size: 12.5px;
	letter-spacing: .02em;
	text-decoration: none;
}

.cu-link-voltar--centro:hover {
	text-decoration: underline;
}

/* ===== Endereço — blocos BR/PY alternam por país ===== */
.cu-endereco-pais[hidden] { display: none; }

/* ===== Botões ===== */
.cu-botoes-etapa {
	display: flex;
	gap: 12px;
	margin-top: 20px;
}

.cu-btn {
	flex: 1;
	min-width: 0;
	padding: 15px;
	border: 0;
	border-radius: 12px;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	transition: transform .15s ease, background .15s ease, opacity .15s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	white-space: nowrap;
}

.cu-btn-continuar {
	background: var(--cu-ink);
	color: #fff;
}
.cu-btn-continuar:hover { background: #232A45; transform: translateY(-1px); }

@media (max-width: 480px) {
	.cu-bloco {
		padding: 18px 16px;
		border-radius: 16px;
	}
	.cu-resumo-card {
		padding: 12px 14px;
	}
	.cu-etapa-titulo {
		font-size: 16px;
	}
}

@media (max-width: 380px) {
	.cu-linha-dupla { gap: 10px; }
	.cu-indicador-item span.cu-rotulo { display: none; }
	.cu-botoes-etapa { gap: 8px; }
	.cu-botoes-etapa .cu-btn { padding: 13px 10px; font-size: 14px; }
	.cu-tel-bandeira { font-size: 16px; margin-right: 7px; padding-right: 7px; }
}
