/* ShopBase Simulador de Parcelas
 *
 * Cores derivadas da cor do texto do tema: funciona em temas claros e escuros.
 * Personalização pelo tema:
 *   .sbp-simulator, .sbp-loop { --sbp-accent: #11804a; --sbp-radius-inner: 12px; }
 */

.sbp-simulator,
.sbp-loop {
	--sbp-accent: #11804a;
	--sbp-accent-soft: rgba(17, 128, 74, 0.12);
	--sbp-line: rgba(128, 128, 128, 0.24);
	--sbp-tint: rgba(128, 128, 128, 0.07);
	--sbp-tint-strong: rgba(128, 128, 128, 0.1);
	--sbp-radius-inner: 12px;
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
	.sbp-simulator,
	.sbp-loop {
		--sbp-line: color-mix(in srgb, currentColor 12%, transparent);
		--sbp-tint: color-mix(in srgb, currentColor 4%, transparent);
		--sbp-tint-strong: color-mix(in srgb, currentColor 7%, transparent);
	}
}

/* Blindagem: temas e o WooCommerce estilizam ul, li, img e strong de forma
 * genérica (ex.: "ul.products li.product strong { display: block }"). */
.sbp-simulator .sbp-card ul,
.sbp-simulator .sbp-card li {
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
	border: 0;
}

.sbp-simulator .sbp-card li::before,
.sbp-simulator .sbp-card li::marker {
	content: none;
}

.sbp-simulator .woocommerce-Price-amount,
.sbp-simulator bdi,
.sbp-loop .woocommerce-Price-amount,
.sbp-loop bdi {
	display: inline;
	float: none;
	margin: 0;
	padding: 0;
}

/* ---------- Página do produto ---------- */

/* Sem margem própria: o espaçamento vem do tema/construtor (ex.: o espaçamento
 * entre widgets do Elementor ou o "block gap" dos temas de blocos). */
:where(.sbp-simulator) {
	margin: 0;
}

.sbp-simulator {
	container-type: inline-size;
	max-width: 500px;
	padding: 0;
	font-size: 1rem;
	line-height: 1.4;
	text-align: left;
	transition: opacity 0.15s ease;
}

.sbp-simulator.sbp-loading {
	opacity: 0.55;
}

/* O bloco é o preço do produto: direto na página, sem moldura, caixas nem margem. */
.sbp-simulator .sbp-card {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

/* Preço do tema substituído pelo bloco. */
.sbp-price-replaced,
.sbp-hide-variation-price .woocommerce-variation-price {
	display: none !important;
}

.sbp-simulator .sbp-was {
	margin: 0 0 8px;
	font-size: 0.92em;
	opacity: 0.62;
}

.sbp-simulator .sbp-was del {
	opacity: 1;
	text-decoration: line-through;
}

.sbp-simulator .sbp-title {
	margin: 0 0 14px;
	font-size: 1.25em;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.sbp-simulator .sbp-methods {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
}

/* Pix e cartão soltos na página: sem borda, fundo ou espaçamento interno. */
.sbp-simulator .sbp-method {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

/* Ícone sem fundo, alinhado à primeira linha (rótulo). */
.sbp-simulator .sbp-icon {
	flex: 0 0 28px;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	margin-top: 1px;
	background: none;
}

.sbp-simulator .sbp-icon svg {
	display: block;
	width: 26px;
	height: 26px;
	opacity: 0.8;
}

.sbp-simulator .sbp-icon--pix {
	color: var(--sbp-accent);
}

.sbp-simulator .sbp-icon--pix svg {
	opacity: 1;
}

/* Ícone do Pix como imagem de fundo de um <span> (e não <img>): regras de tema
 * para "img" não alteram o tamanho. */
.sbp-simulator .sbp-icon__img {
	display: block !important;
	flex: 0 0 auto;
	width: 26px !important;
	height: 26px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background-color: transparent !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	background-size: contain !important;
}

/* Símbolo com margem interna no arquivo (SVG do Mercado Pago): um pouco maior. */
.sbp-simulator .sbp-icon--pad .sbp-icon__img {
	width: 34px !important;
	height: 34px !important;
}

/* Logo largo do Pix (símbolo + nome): mostra só o símbolo, à esquerda. */
.sbp-simulator .sbp-icon--crop .sbp-icon__img {
	background-position: 0 50% !important;
	background-size: cover !important;
}

.sbp-simulator .sbp-method__body {
	flex: 1 1 auto;
	min-width: 0;
}

.sbp-simulator .sbp-label {
	margin-bottom: 2px;
	font-size: 0.88em;
	opacity: 0.68;
}

.sbp-simulator .sbp-main {
	display: block;
	font-size: 1.5em;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.sbp-simulator .sbp-main .sbp-n,
.sbp-simulator .sbp-main .sbp-value,
.sbp-simulator .sbp-main .woocommerce-Price-amount,
.sbp-simulator .sbp-main bdi {
	font-weight: 800;
}

.sbp-simulator .sbp-main .sbp-value,
.sbp-simulator .sbp-nowrap {
	white-space: nowrap;
}

/* "A partir de" (produto variável com preços diferentes) */
.sbp-simulator .sbp-from {
	display: block;
	margin-bottom: 1px;
	font-size: 0.6em;
	font-weight: 500;
	letter-spacing: 0;
	opacity: 0.7;
}

.sbp-simulator .sbp-sub {
	margin-top: 4px;
	font-size: 0.9em;
	opacity: 0.72;
	text-wrap: pretty;
}

.sbp-simulator .sbp-sub .woocommerce-Price-amount {
	font-weight: 700;
}

.sbp-simulator .sbp-sub + .sbp-sub {
	margin-top: 2px;
}

.sbp-simulator .sbp-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--sbp-accent-soft);
	color: var(--sbp-accent);
	font-size: 0.58em;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0;
	vertical-align: 0.2em;
	white-space: nowrap;
}

.sbp-simulator .sbp-badge--fee {
	background: var(--sbp-tint-strong);
	color: inherit;
	font-weight: 600;
}


/* Ver todas as parcelas: link compacto dentro do bloco do cartão, alinhado ao texto dele */

.sbp-simulator .sbp-details {
	margin: 8px 0 0;
	padding: 0;
	border: 0;
}

.sbp-simulator .sbp-details > summary {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 2px 0;
	color: var(--sbp-accent);
	font-size: 0.9em;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.4;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.sbp-simulator .sbp-details > summary:hover span {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.sbp-simulator .sbp-details > summary::-webkit-details-marker {
	display: none;
}

.sbp-simulator .sbp-details > summary::before,
.sbp-simulator .sbp-details > summary::after {
	content: none;
}

.sbp-simulator .sbp-details > summary:focus {
	outline: none;
}

.sbp-simulator .sbp-details > summary:focus-visible {
	border-radius: 6px;
	box-shadow: 0 0 0 2px var(--sbp-accent);
}

.sbp-simulator .sbp-chevron {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}

.sbp-simulator .sbp-details[open] .sbp-chevron {
	transform: rotate(180deg);
}

.sbp-simulator .sbp-panel {
	padding: 12px 0 2px;
}

.sbp-simulator .sbp-group + .sbp-group {
	margin-top: 18px;
}

.sbp-simulator .sbp-group-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 1em;
	font-weight: 700;
}

.sbp-simulator .sbp-group--free .sbp-group-title {
	color: var(--sbp-accent);
}

.sbp-simulator .sbp-group--fee .sbp-group-title {
	opacity: 0.62;
}

.sbp-simulator .sbp-check {
	display: block;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
}

/* Sem juros: grade solta, sem caixas (3 por linha; valores longos ganham mais espaço) */
.sbp-simulator .sbp-card .sbp-tiles {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px 16px;
	margin-top: 10px;
}

.sbp-simulator .sbp-card .sbp-tile {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 2px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
}

.sbp-simulator .sbp-tile__n {
	color: var(--sbp-accent);
	font-size: 0.92em;
	font-weight: 700;
}

.sbp-simulator .sbp-tile__v {
	font-size: 1.12em;
	font-weight: 800;
	white-space: nowrap;
}

/* Com juros: tabela */
.sbp-simulator .sbp-table {
	margin-top: 8px;
}

.sbp-simulator .sbp-card .sbp-row {
	display: grid;
	grid-template-columns: minmax(3.2em, 0.8fr) 1.5fr 1fr;
	align-items: baseline;
	gap: 8px;
	padding: 11px 6px;
	border-bottom: 1px solid var(--sbp-line);
	font-variant-numeric: tabular-nums;
}

.sbp-simulator .sbp-card .sbp-row--head {
	padding-top: 6px;
	padding-bottom: 8px;
	font-size: 0.86em;
	opacity: 0.62;
}

.sbp-simulator .sbp-row > :last-child {
	text-align: right;
	white-space: nowrap;
}

.sbp-simulator .sbp-row__v {
	font-weight: 600;
	white-space: nowrap;
}

.sbp-simulator .sbp-row__t {
	opacity: 0.62;
}

.sbp-simulator .sbp-note {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	padding: 0;
	border-radius: 0;
	background: none;
	font-size: 0.86em;
	line-height: 1.45;
}

.sbp-simulator .sbp-note svg {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	opacity: 0.6;
}

.sbp-simulator .sbp-note span {
	opacity: 0.75;
}

/* Telas estreitas */
@container (max-width: 420px) {
	.sbp-simulator .sbp-method {
		gap: 10px;
	}

	.sbp-simulator .sbp-main {
		font-size: 1.3em;
		text-wrap: wrap;
	}

	/* Sempre 3 por linha: o valor diminui com a largura disponível. */
	.sbp-simulator .sbp-card .sbp-tiles {
		gap: 10px 8px;
	}

	.sbp-simulator .sbp-tile__v {
		font-size: min(0.94em, 4.4cqi);
		letter-spacing: -0.01em;
	}

	.sbp-simulator .sbp-tiles--long .sbp-tile__v {
		font-size: min(0.94em, 3.8cqi);
	}
}

/* Telas muito estreitas (até ~320 px de largura de tela) */
@container (max-width: 300px) {
	.sbp-simulator .sbp-icon {
		display: none;
	}

	.sbp-simulator .sbp-main {
		font-size: 1.2em;
	}

	.sbp-simulator .sbp-tile__v {
		font-size: min(0.95em, 5cqi);
	}

	.sbp-simulator .sbp-tiles--long .sbp-tile__v {
		font-size: min(0.95em, 4.3cqi);
	}
}

/* Elementor: o bloco entra como irmão do widget de preço e recebe o mesmo
 * espaçamento entre widgets (.elementor-widget:not(:last-child)). */
.sbp-elementor {
	width: 100%;
}

.sbp-elementor > .sbp-simulator,
.sbp-elementor > .sbp-loop {
	margin: 0;
}

/* ---------- Listagens ---------- */

.sbp-loop {
	margin: 4px 0 8px;
	font-size: 0.85em;
	line-height: 1.4;
}

.sbp-loop--left {
	text-align: left;
}

.sbp-loop--center {
	text-align: center;
}

.sbp-loop--right {
	text-align: right;
}

/* Preço no Pix (com o ícone): é o preço principal do card. */
.sbp-loop .sbp-loop__price {
	display: block;
	margin: 0 0 2px;
	font-size: 1.25em;
	font-weight: 700;
	line-height: 1.3;
}

.sbp-loop .sbp-loop__price .woocommerce-Price-amount,
.sbp-loop .sbp-loop__price bdi {
	font-weight: 800;
}

/* Ícone do Pix: <span> com imagem de fundo (não <img>), porque o ícone fica
 * dentro do link do card e o WooCommerce, os temas e o "CSS adicional" das
 * lojas forçam o tamanho de "ul.products li.product a img" (às vezes com
 * !important). Tamanho em em: acompanha o preço. */
.sbp-loop .sbp-loop__icon {
	display: inline-block !important;
	box-sizing: content-box !important;
	width: 1em !important;
	height: 1em !important;
	min-width: 0 !important;
	max-width: none !important;
	min-height: 0 !important;
	max-height: none !important;
	margin: 0 0.3em 0 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background-color: transparent !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	background-size: contain !important;
	vertical-align: -0.12em !important;
}

svg.sbp-loop__icon {
	color: var(--sbp-accent);
}

.sbp-loop .sbp-loop__icon--crop {
	background-position: 0 50% !important;
	background-size: cover !important;
}

/* Símbolo com margem interna no arquivo (SVG do Mercado Pago): um pouco maior. */
.sbp-loop .sbp-loop__icon--pad {
	width: 1.3em !important;
	height: 1.3em !important;
	margin: 0 0.15em 0 -0.12em !important;
	vertical-align: -0.3em !important;
}

.sbp-loop .sbp-loop__label {
	font-size: 0.78em;
	font-weight: 500;
	opacity: 0.75;
	white-space: nowrap;
}

.sbp-loop .sbp-loop__from {
	display: block;
	font-size: 0.72em;
	font-weight: 500;
	line-height: 1.3;
	opacity: 0.75;
}

.sbp-loop .sbp-loop__was {
	display: block;
	font-size: 0.95em;
	opacity: 0.6;
}

.sbp-loop .sbp-loop__was del {
	text-decoration: line-through;
}

.sbp-loop .sbp-loop__alt {
	display: block;
	opacity: 0.75;
}

.sbp-loop .sbp-loop__price .sbp-value,
.sbp-loop .sbp-loop__alt .woocommerce-Price-amount {
	white-space: nowrap;
}

.sbp-loop .sbp-summary {
	display: block;
	margin: 0;
	text-wrap: balance;
}

.sbp-loop .sbp-summary .sbp-n,
.sbp-loop .sbp-summary .sbp-value,
.sbp-loop .sbp-summary .woocommerce-Price-amount,
.sbp-loop .sbp-summary bdi {
	font-weight: 700;
}

.sbp-loop .sbp-tail {
	display: inline;
	white-space: nowrap;
}

.sbp-loop .sbp-summary--free .sbp-tail {
	color: var(--sbp-accent);
	font-weight: 700;
}

.sbp-loop .sbp-summary--fee .sbp-tail {
	opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
	.sbp-simulator,
	.sbp-simulator * {
		transition: none !important;
	}
}
