/* ==================================================================
   Componentes compartilhados — checkout, carrinho e minha-conta.
   Paleta: docs/superpowers/specs/2026-08-26-checkout-etapas-area-cliente-design.md §5
   ================================================================== */

.ngr-checkout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	max-width: 1100px;
	margin: 0 auto;
}

@media (min-width: 769px) {
	.ngr-checkout {
		grid-template-columns: minmax(0, 1fr) 360px;
		align-items: start;
	}
}

/* Campo de formulário -------------------------------------------------- */
.ngr-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 16px;
}
.ngr-field label {
	font-family: var(--wd-title-font, inherit);
	font-size: 13px;
	font-weight: 600;
	color: var(--ngr-title);
}
.ngr-field input,
.ngr-field select {
	border: 1px solid var(--ngr-border);
	border-radius: var(--ngr-radius);
	padding: 10px 12px;
	font-size: 15px;
	color: var(--ngr-text);
	background: var(--ngr-surface);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.ngr-field input:focus,
.ngr-field select:focus {
	outline: 2px solid var(--ngr-primary);
	outline-offset: 1px;
	border-color: var(--ngr-primary);
}
.ngr-field.is-invalid input,
.ngr-field.is-invalid select {
	border-color: var(--ngr-error);
}
.ngr-field-error {
	display: none;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--ngr-error);
}
.ngr-field-error::before {
	content: "!";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--ngr-error);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}
.ngr-field.is-invalid .ngr-field-error {
	display: flex;
}
.ngr-field.is-consultando input {
	background-image: linear-gradient(90deg, transparent 0%, var(--ngr-primary-soft) 50%, transparent 100%);
	background-size: 200% 100%;
	animation: ngr-consultando 1.1s ease-in-out infinite;
}
@keyframes ngr-consultando {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}
.ngr-field input[readonly] {
	background: var(--ngr-bg);
	color: var(--ngr-muted);
	cursor: not-allowed;
}
.ngr-nf-section {
	margin-top: 24px;
}
.ngr-field-warning {
	margin-top: 4px;
	padding: 8px 10px;
	border-radius: var(--ngr-radius);
	background: rgba(183, 121, 31, .12);
	color: var(--ngr-warning);
	font-size: 13px;
}

/* Cartão de dado salvo (endereço/faturamento) --------------------------- */
.ngr-card-resumo {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	padding: 16px;
	border: 1px solid var(--ngr-border);
	border-radius: var(--ngr-radius);
	background: var(--ngr-surface);
}
.ngr-card-resumo__dados {
	font-size: 14px;
	color: var(--ngr-text);
	line-height: 1.5;
}
.ngr-card-resumo__acoes {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* Botões ----------------------------------------------------------------- */
.ngr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: var(--ngr-radius);
	padding: 12px 24px;
	font-family: var(--wd-title-font, inherit);
	font-size: 15px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}
.ngr-btn--primary {
	background: var(--ngr-primary);
	color: #fff;
}
.ngr-btn--primary:hover,
.ngr-btn--primary:focus {
	background: var(--ngr-primary-dark);
	color: #fff !important; /* Woodmart troca a cor do texto no hover de button */
}
.ngr-btn--cta {
	background: var(--ngr-accent);
	color: #fff;
}
.ngr-btn--cta:hover,
.ngr-btn--cta:focus {
	background: var(--ngr-accent-dark);
	color: #fff !important;
}
.ngr-btn--ghost {
	background: transparent;
	color: var(--ngr-primary);
	border-color: var(--ngr-border);
}
.ngr-btn--ghost:hover {
	background: var(--ngr-primary-soft);
}
.ngr-btn:disabled,
.ngr-btn.is-loading {
	opacity: .65;
	cursor: not-allowed;
}
.ngr-btn.is-loading::after {
	content: "";
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .5);
	border-top-color: #fff;
	animation: ngr-spin .6s linear infinite;
}
@keyframes ngr-spin {
	to { transform: rotate(360deg); }
}

/* Stepper ------------------------------------------------------------------ */
.ngr-stepper {
	display: flex;
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	gap: 8px;
}
.ngr-stepper li {
	flex: 1;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--ngr-muted);
	padding-bottom: 10px;
	border-bottom: 3px solid var(--ngr-border);
	cursor: default;
}
.ngr-stepper li.is-done {
	color: var(--ngr-primary);
	border-bottom-color: var(--ngr-primary);
	cursor: pointer;
}
.ngr-stepper li.is-current {
	color: var(--ngr-primary);
	border-bottom-color: var(--ngr-accent);
}

/* Status de pedido ---------------------------------------------------------- */
.ngr-status-chip {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: var(--ngr-bg);
	color: var(--ngr-text);
}
.ngr-status-chip--processing { background: var(--ngr-primary-soft); color: var(--ngr-primary); }
.ngr-status-chip--completed { background: rgba(18, 135, 55, .12); color: var(--ngr-success); }
.ngr-status-chip--cancelled,
.ngr-status-chip--failed { background: rgba(214, 54, 56, .12); color: var(--ngr-error); }
.ngr-status-chip--on-hold { background: rgba(183, 121, 31, .12); color: var(--ngr-warning); }
.ngr-status-chip--refunded { background: var(--ngr-bg); color: var(--ngr-muted); }

/* Nota fiscal ---------------------------------------------------------------- */
.ngr-nf {
	padding: 16px;
	border: 1px solid var(--ngr-border);
	border-radius: var(--ngr-radius);
	background: var(--ngr-bg);
}
.ngr-nf__linha {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	margin-bottom: 6px;
}

/* Resumo do pedido (sidebar / colapsável no mobile) -------------------------- */
.ngr-order-summary {
	border: 1px solid var(--ngr-border);
	border-radius: var(--ngr-radius);
	background: var(--ngr-surface);
	padding: 16px;
}
@media (max-width: 768px) {
	.ngr-order-summary.is-collapsed .ngr-order-summary__body {
		display: none;
	}
	.ngr-order-summary__toggle {
		display: flex;
	}
}
.ngr-order-summary__toggle {
	display: none;
	width: 100%;
	justify-content: space-between;
	align-items: center;
	background: none;
	border: none;
	font-weight: 700;
	color: var(--ngr-primary);
	padding: 0;
	cursor: pointer;
}

/* Frete no resumo: o título fica no topo e cada opção se lê como uma linha. */
.woocommerce-checkout-review-order-table .shipping {
	align-items: flex-start;
}
.woocommerce-checkout-review-order-table .shipping th {
	flex: 0 0 64px;
	padding-top: 5px;
}
.woocommerce-checkout-review-order-table .shipping td {
	padding: 0;
}
.woocommerce-checkout-review-order-table .shipping #shipping_method {
	margin: 0;
	padding: 0;
	text-align: left;
}
.woocommerce-checkout-review-order-table .shipping #shipping_method li {
	display: flex;
	align-items: flex-start;
	margin: 0 0 8px;
}
.woocommerce-checkout-review-order-table .shipping #shipping_method li:last-child {
	margin-bottom: 0;
}
.woocommerce-checkout-review-order-table .shipping #shipping_method input.shipping_method {
	position: static;
	float: none;
	margin: 3px 8px 0 0;
	flex: 0 0 auto;
}
.woocommerce-checkout-review-order-table .shipping #shipping_method label {
	margin: 0;
	text-align: left;
	line-height: 1.4;
}

/* Etapas do checkout ---------------------------------------------------------- */
.ngr-step {
	animation: ngr-step-fade .18s ease;
}
@keyframes ngr-step-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.ngr-step,
	.ngr-field.is-consultando input {
		animation: none;
	}
}
.ngr-step-title {
	font-family: var(--wd-title-font, inherit);
	color: var(--ngr-title);
	font-size: 20px;
	margin-bottom: 16px;
}
.ngr-step-actions {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 24px;
}
.ngr-place-order {
	width: 100%;
}
.ngr-conta-fields {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--ngr-border);
}

/* Resumo da etapa 4 (revisão) ------------------------------------------------- */
.ngr-review-block {
	margin-bottom: 20px;
}
.ngr-review-block h4 {
	font-family: var(--wd-title-font, inherit);
	color: var(--ngr-title);
	font-size: 15px;
	margin-bottom: 8px;
}
.ngr-review-nome,
.ngr-review-endereco {
	font-size: 14px;
	color: var(--ngr-text);
	margin: 0 0 4px;
}
.ngr-review-tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--ngr-primary-soft);
	color: var(--ngr-primary);
	font-size: 12px;
	font-weight: 600;
}

/* Etapas escondidas: o atributo [hidden] perde pra regras display do tema — força. */
.ngr-step[hidden],
.ngr-billing-address-group[hidden],
.form-row.ngr-billing-address-group[hidden],
.form-row[hidden] {
	display: none !important;
}

/* Breadcrumb "Carrinho → Pagamento → Concluído" do Woodmart duplica o stepper. */
.woocommerce-checkout .wd-checkout-steps {
	display: none !important;
}

/* Reset de li do tema no stepper (margens/line-height desalinhavam a 4ª barra). */
.ngr-stepper li,
.ngr-stepper li:last-child {
	margin: 0;
	line-height: 1.3;
}

/* Etapa Conta: alternador cadastro/login ------------------------------------ */
.ngr-conta-switch {
	display: flex;
	gap: 8px;
	margin: 0 0 20px;
	padding: 4px;
	background: var(--ngr-bg);
	border-radius: var(--ngr-radius);
}
.ngr-conta-tab {
	flex: 1;
	padding: 10px 14px;
	border: 0;
	border-radius: calc(var(--ngr-radius) - 2px);
	background: transparent;
	color: var(--ngr-muted);
	font-family: var(--wd-title-font, "Poppins", sans-serif);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.ngr-conta-tab:hover {
	color: var(--ngr-primary);
}
.ngr-conta-tab.is-active {
	background: var(--ngr-surface);
	color: var(--ngr-primary);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.ngr-conta-pane[hidden] {
	display: none !important;
}
.ngr-conta-hint {
	margin: 4px 0 16px;
	font-size: 13px;
	color: var(--ngr-text-soft);
}
.ngr-conta-hint a {
	color: var(--ngr-primary);
	text-decoration: underline;
}
.ngr-login-error {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-radius: var(--ngr-radius);
	background: rgba(214, 54, 56, .08);
	color: var(--ngr-error);
	font-size: 13px;
}
.ngr-login-error[hidden] {
	display: none !important;
}

/* Texto digitado x placeholder: cores diferentes (antes ambos #777). */
.ngr-checkout .input-text,
.ngr-checkout select,
.ngr-checkout textarea,
.woocommerce-account .input-text,
.woocommerce-account select {
	color: var(--ngr-title);
}
.ngr-checkout .input-text::placeholder,
.woocommerce-account .input-text::placeholder {
	color: #9AA3AE;
	opacity: 1;
}

/* Wrappers nativos vazios não viram card. */
.ngr-step .woocommerce-account-fields[hidden],
.ngr-step .woocommerce-additional-fields:empty {
	display: none !important;
}

/* Checkboxes não precisam de "(opcional)". */
#billing_ie_isento_field .optional,
#ngr_billing_same_as_shipping_field .optional {
	display: none;
}

/* Pagamento (Mercado Pago) compacto: menos ar entre blocos, sem rolagem pra achar o cartão. */
.ngr-step[data-key="pagamento"] .payment_box {
	padding: 4px 0 0 !important;
}
.ngr-step[data-key="pagamento"] .mp-checkout-custom-container {
	padding: 8px 0 8px !important;
}
.ngr-step[data-key="pagamento"] .mp-checkout-custom-card-flags {
	margin-bottom: 12px !important;
}
.ngr-step[data-key="pagamento"] .mp-test-mode-card {
	margin-bottom: 12px !important;
	padding: 10px 12px !important;
}
.ngr-step[data-key="pagamento"] .mp-wallet-button-container-wrapper {
	margin-bottom: 12px !important;
}
.ngr-step[data-key="pagamento"] .mp-wallet-button-container {
	padding: 12px !important;
	margin-bottom: 0 !important;
}
.ngr-step[data-key="pagamento"] .mp-checkout-custom-issuers-container {
	padding-bottom: 12px !important;
}
.ngr-step[data-key="pagamento"] .mp-checkout-custom-card-row {
	margin-bottom: 8px !important;
}
.ngr-step[data-key="pagamento"] .wc_payment_method {
	margin-bottom: 6px;
}

/* CTA de contato nos equipamentos (catálogo). */
.ngr-contato-cta {
	margin: 16px 0 24px;
}

/* Equipamento (catálogo): nada de preço nem no "produto anterior/próximo" do Woodmart. */
.ngr-equipamento .wd-product-nav .price,
.ngr-equipamento .summary .price,
.ngr-equipamento .wd-sticky-btn .price {
	display: none !important;
}

/* /minha-conta/ deslogado (login + cadastro do Woodmart) na paleta Nigro. */
.wd-registration-page .wd-login-title {
	font-family: var(--wd-title-font, "Poppins", sans-serif);
	color: var(--ngr-title);
}
.wd-registration-page .button,
.woocommerce-form-login__submit,
.woocommerce-form-register .button {
	background-color: var(--ngr-primary) !important;
	color: #fff !important;
	border-radius: var(--ngr-radius);
}
.wd-registration-page .button:hover,
.woocommerce-form-login__submit:hover,
.woocommerce-form-register .button:hover {
	background-color: var(--ngr-primary-dark) !important;
	color: #fff !important;
}
.wd-registration-page a,
.login-form-footer a {
	color: var(--ngr-primary);
}
.wd-registration-page .input-text {
	color: var(--ngr-title);
}

/* Ícone "Minha conta" do header: mesma cor dos outros ícones. */
.wd-header-my-account > a {
	color: inherit;
}

/* Confirmação da conta (código de 6 dígitos por e-mail ou WhatsApp) -----
   Usada na etapa "Conta" do checkout, em /minha-conta/ e na senha perdida.
   Back-end: inc/loja-verificacao.php */
.ngr-verif-canais {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 0 16px;
}
.ngr-verif-canais .ngr-btn,
.woocommerce .ngr-verif-canais button.ngr-btn {
	width: 100%;
	justify-content: center;
	text-align: center;
	white-space: normal;
}
.ngr-verif-canais .ngr-btn small {
	display: inline-block;
	margin-left: 6px;
	font-size: 13px;
	font-weight: 400;
	opacity: 0.85;
	white-space: nowrap;
}
.ngr-verif-canais--trocar {
	margin-top: 16px;
}
.ngr-verif-trocar {
	padding: 0;
	border: 0;
	background: none;
	color: var(--ngr-primary);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}
.ngr-verif-titulo {
	font-size: 20px;
	margin: 0 0 8px;
	color: var(--ngr-title);
}
.ngr-verif-intro {
	margin: 0 0 20px;
	color: var(--ngr-text);
}
.ngr-verif-intro strong {
	white-space: nowrap;
}
.ngr-verif-inputs {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}
/* O tema pai estiliza `input` com especificidade alta — casamos com ela. */
.ngr-verif .ngr-verif-digito,
.woocommerce .ngr-verif input.ngr-verif-digito {
	width: 100%;
	max-width: 56px;
	min-height: 56px;
	height: 56px;
	margin: 0;
	padding: 0;
	text-align: center;
	font-size: 24px;
	line-height: 54px;
	font-weight: 700;
	color: var(--ngr-title);
	border: 1px solid var(--ngr-border);
	border-radius: var(--ngr-radius);
	background: var(--ngr-surface);
}
.ngr-verif .ngr-verif-digito:focus,
.woocommerce .ngr-verif input.ngr-verif-digito:focus {
	outline: 2px solid var(--ngr-primary);
	outline-offset: 1px;
	border-color: var(--ngr-primary);
}
.ngr-verif .ngr-verif-codigo,
.woocommerce .ngr-verif input.input-text.ngr-verif-codigo {
	max-width: 220px;
	height: 56px;
	letter-spacing: 8px;
	font-size: 22px;
	font-weight: 600;
	text-align: center;
	color: var(--ngr-title);
	border: 1px solid var(--ngr-border);
	border-radius: var(--ngr-radius);
	background: var(--ngr-surface);
}
.ngr-verif-error {
	margin: 0 0 12px;
	font-size: 14px;
	color: var(--ngr-error);
}
.ngr-verif-reenviar {
	padding: 0;
	border: 0;
	background: none;
	color: var(--ngr-primary);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}
.ngr-verif-reenviar[disabled] {
	color: var(--ngr-muted);
	text-decoration: none;
	cursor: default;
}
.ngr-verif-contador {
	color: var(--ngr-muted);
}

/* Enquanto o cliente confirma, o seletor cadastro/login some — um caminho só. */
.ngr-step[data-key="conta"].is-verificando .ngr-conta-switch {
	display: none;
}

/* Mesma ideia em /minha-conta/: o form do código substitui login e cadastro
   (e, na senha perdida por WhatsApp, o form "Esqueci minha senha" do Woo). */
body.ngr-verificando #customer_login,
body.ngr-verificando form.lost_reset_password {
	display: none;
}
.ngr-verif--conta {
	max-width: 460px;
	margin: 0 auto 32px;
	padding: 24px;
	border: 1px solid var(--ngr-border);
	border-radius: var(--ngr-radius);
	background: var(--ngr-surface);
}
