/* Anti-duplicata: esconde clones que o tema cria em barras fixas de compra.
   A calculadora original é marcada via PHP com data-cfp-primary="1".
   Qualquer outra ocorrência é uma duplicata e fica invisível. */
.cfp-calculator:not([data-cfp-primary="1"]) {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	width: 0 !important;
	overflow: hidden !important;
	position: absolute !important;
	left: -9999px !important;
}

/* Tema Ecomus: a "Sticky Add to Cart" clona o bloco do produto inteiro
   (incluindo o atributo data-cfp-primary), então o seletor acima não pega.
   Aqui escondemos qualquer calculadora dentro dessa barra fixa. */
#ecomus-sticky-add-to-cart .cfp-calculator,
.ecomus-sticky-add-to-cart .cfp-calculator {
	display: none !important;
}

/* Calculadora de Frete — estilo Adoratta */

.cfp-calculator {
	--cfp-accent: rgb(53, 71, 52);
	--cfp-accent-strong: rgb(38, 53, 37);
	--cfp-icon: #e7aea4;
	--cfp-border: #ececec;
	--cfp-bg-card: #fafafa;
	--cfp-text: #2c2c2c;
	--cfp-text-soft: #888;

	margin: 25px 0;
	padding: 22px;
	border: 1px solid var(--cfp-border);
	border-radius: 10px;
	background: #fff;
	font-family: inherit;
	width: 100%;
	max-width: 560px;
	box-sizing: border-box;
	color: var(--cfp-text);
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.cfp-calculator *,
.cfp-calculator *::before,
.cfp-calculator *::after {
	box-sizing: border-box;
}

.cfp-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 14px;
	color: var(--cfp-text);
}

.cfp-form {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.cfp-cep-input {
	flex: 1;
	padding: 11px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
	color: var(--cfp-text);
	min-width: 0;
	transition: border-color .2s;
}

.cfp-cep-input:focus {
	outline: none;
	border-color: var(--cfp-accent);
	box-shadow: 0 0 0 3px rgba(53,71,52,.18);
}

.cfp-button {
	padding: 11px 22px;
	background: var(--cfp-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s;
	white-space: nowrap;
}

.cfp-button:hover { background: var(--cfp-accent-strong); }
.cfp-button:disabled { opacity: .6; cursor: not-allowed; }

.cfp-dont-know {
	display: inline-block;
	margin-top: 8px;
	font-size: 12px;
	color: var(--cfp-text-soft);
	text-decoration: underline;
}

.cfp-results { margin-top: 18px; }
.cfp-results:empty { display: none; }

.cfp-loading {
	padding: 14px;
	text-align: center;
	color: var(--cfp-text-soft);
	font-size: 14px;
}

.cfp-error {
	padding: 12px 14px;
	background: #fdecea;
	border: 1px solid #f5c2c0;
	border-radius: 8px;
	color: #a02622;
	font-size: 13px;
}

/* ===== Seções (Envio a domicílio / Retirar em) ===== */
.cfp-section {
	margin-bottom: 18px;
}
.cfp-section-header {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 500;
	color: var(--cfp-text);
}
.cfp-section-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	color: var(--cfp-icon);
}

.cfp-section-card-wrap {
	background: var(--cfp-bg-card);
	border-radius: 10px;
	padding: 6px 14px;
}

/* ===== Item de frete ===== */
.cfp-rate {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid #eee;
}
.cfp-rate:last-child { border-bottom: none; }

.cfp-rate-info { flex: 1; min-width: 0; }

.cfp-rate-name {
	font-size: 14px;
	font-weight: 500;
	color: var(--cfp-text);
	margin-bottom: 4px;
}

.cfp-rate-time {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	color: var(--cfp-text-soft);
}
.cfp-rate-time svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--cfp-icon); }

.cfp-rate-price {
	font-size: 15px;
	font-weight: 700;
	color: var(--cfp-accent-strong);
	white-space: nowrap;
}
.cfp-rate-price.cfp-free {
	color: var(--cfp-accent-strong);
}

/* ===== Retirar em: endereço e horários do local ===== */
.cfp-pickup-address {
	margin-top: 3px;
	font-size: 12.5px;
	color: var(--cfp-text-soft);
	line-height: 1.5;
}

.cfp-pickup-meta-list {
	margin: 6px 0 0;
	padding-left: 18px;
	font-size: 12.5px;
	color: var(--cfp-text-soft);
	line-height: 1.6;
}
.cfp-pickup-meta-list li { margin: 0; }

/* ===== Retirar em: lista de horários e endereço ===== */
.cfp-pickup-meta {
	margin-top: 6px;
	font-size: 12.5px;
	color: var(--cfp-text-soft);
	line-height: 1.6;
}
.cfp-pickup-meta ul {
	margin: 4px 0 0;
	padding-left: 18px;
	list-style: disc;
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
	.cfp-calculator {
		padding: 14px;
		margin: 18px 0;
		max-width: 100%;
	}
	.cfp-form { flex-direction: column; }
	.cfp-button { width: 100%; }
	.cfp-cep-input { width: 100%; }

	.cfp-section-card-wrap { padding: 4px 12px; }

	.cfp-rate {
		flex-wrap: wrap;
		gap: 8px;
		padding: 12px 0;
	}
	.cfp-rate-info { flex: 1 1 100%; min-width: 0; }
	.cfp-rate-price {
		font-size: 14px;
		flex-shrink: 0;
	}

	.cfp-rate-name,
	.cfp-pickup-address {
		overflow-wrap: anywhere;
		word-break: break-word;
	}
}
