/** Calculator Form */

.infixs-correios-automatico-calculator {
	margin-bottom: 1rem;
	margin-top: 1rem;
}

.infixs-correios-automatico-calculator
	.infixs-correios-automatico-calculator-title {
	margin-bottom: 0.3rem;
	font-size: 0.9rem;
	font-weight: bold;
}

.infixs-correios-automatico-calculator input.infixs-correios-automatico-input {
	max-width: 200px;
	min-height: 44px;
	height: 44px;
	padding-top: 0;
	padding-bottom: 0;
	padding-left: 44px !important;
	padding-right: 28px;
	margin-bottom: 0;
}

.infixs-correios-automatico-calculator
	.infixs-correios-automatico-calculate-submit {
	padding: 0 20px;
	margin-top: 0;
	margin-bottom: 0;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}

.infixs-correios-automatico-calculator
	.infixs-correios-automatico-calculate-box {
	display: flex;
	gap: 1rem;
}

.infixs-correios-automatico-calculator
	.infixs-correios-automatico-calculate-find-link {
	font-size: 12px;
	line-height: 1;
	margin-top: 8px;
}

/* Hide calculator UI (input/button/title/help) only when in compact mode */
.infixs-correios-automatico-calculator.infixs-calc-compact .infixs-correios-automatico-calculate-box,
.infixs-correios-automatico-calculator.infixs-calc-compact .infixs-correios-automatico-calculator-title,
.infixs-correios-automatico-calculator.infixs-calc-compact .infixs-correios-automatico-calculate-find-link {
    display: none !important;
}

.infixs-correios-automatico-shipping-results-address {
	font-size: 12px;
	line-height: 1;
	margin-bottom: 10px;
}

/* Change CEP link: inherit theme palette (WoodMart/Bufalo) */
.infixs-correios-automatico-change-cep .infixs-change-cep-link {
	color: #3483fa; /* links no asociados a precio */
	text-decoration: none;
	font-weight: 600;
}

.infixs-correios-automatico-change-cep .infixs-change-cep-link:hover,
.infixs-correios-automatico-change-cep .infixs-change-cep-link:focus {
	color: #3483fa;
	text-decoration: underline;
}

.infixs-correios-automatico-postcode-button-box {
	display: flex;
	justify-content: center;
	align-items: center;
}

/** Calculator Results */
.infixs-correios-automatico-shipping-results {
	margin-top: 1rem;
}

.infixs-correios-automatico-shipping-results-list {
	display: grid;
	gap: 6px;
}

.infixs-result-line {
	font-size: 0.95rem;
	line-height: 1.35;
}

.infixs-result-line .infixs-cost {
	color: #00a650; /* precio en verde */
	font-weight: 700; /* price stays bold */
}

/* Color delivery time and pickup line with theme primary */
.infixs-result-line .infixs-time,
.infixs-pickup-line {
	color: #00a650; /* días de entrega y 'Retire grátis' en verde */
	font-weight: 700; /* delivery time bold */
}

/* 'Receba' también en verde */
.infixs-result-line .infixs-receive {
	color: #00a650;
	font-weight: 600;
}

/* Wrapper with normal weight, children override as needed */
.infixs-result-line .infixs-line-green {
	color: #000000; /* black for connecting words (com, por) */
	font-weight: 400; /* normal weight for connecting words (com, por) */
}

/* Map link styling similar to theme link */
.infixs-pickup-map-link a {
	color: #3483fa; /* links no asociados a precio */
	text-decoration: none;
	font-weight: 600;
}
.infixs-pickup-map-link a:hover,
.infixs-pickup-map-link a:focus {
	color: #3483fa;
	text-decoration: underline;
}

.infixs-result-line .infixs-method-name {
	font-weight: 700; /* shipping method name bold (SEDEX, PAC) */
	color: inherit;
	margin-right: 0; /* evita espacio extra a la derecha */
}

/* Override: delivery time, cost, and method name stay bold and green */
.infixs-result-line .infixs-line-green .infixs-time,
.infixs-result-line .infixs-line-green .infixs-cost,
.infixs-result-line .infixs-line-green .infixs-method-name {
	font-weight: 700;
	color: #00a650; /* green for bold important info */
}

/* Receive text can stay semi-bold and green */
.infixs-result-line .infixs-line-green .infixs-receive {
	font-weight: 600;
	color: #00a650;
}

.infixs-correios-automatico-shipping-results-grid > :nth-child(1),
.infixs-correios-automatico-shipping-results-grid > :nth-child(2) {
	border-bottom: 1px solid #0002;
}

.infixs-correios-automatico-shipping-results-grid > :nth-child(n + 3) {
	padding-top: 0.3rem;
}

.infixs-correios-automatico-shipping-results-grid > :nth-child(odd) {
	padding-right: 2rem;
}

.infixs-correios-automatico-shipping-results-empty {
	font-size: 0.95rem;
}

.infixs-correios-automatico-shipping-results-grid {
	display: inline-grid;
	grid-template-columns: auto auto;
}

.infixs-correios-automatico-shipping-results-time {
	font-size: 0.85rem;
	line-height: normal;
}

.infixs-correios-automatico-shipping-results-method {
	font-weight: bold;
}

.infixs-correios-automatico-shipping-results-cost {
	color: #046bd2;
	font-weight: bold;
}

/** Button */

.infixs-correios-automatico-input-text {
	position: relative;
}

.infixs-correios-automatico-input-text.infixs-correios-automatico-invalid
	.infixs-correios-automatico-input-text-prepend {
	color: #ff0000;
}

.infixs-correios-automatico-input-text.infixs-correios-automatico-invalid
	input.infixs-correios-automatico-input {
	border-color: #ff0000;
}

.infixs-correios-automatico-input-text
	.infixs-correios-automatico-input-text-prepend {
	position: absolute;
	left: 0.4rem;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	line-height: normal;
}

.infixs-correios-automatico-input-text-prepend > svg {
	margin-bottom: 0 !important;
	margin-top: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	width: 32px;
	height: 32px;
}

.infixs-correios-automatico-input-text
	.infixs-correios-automatico-input-text-append {
	position: absolute;
	right: 0.35rem;
	top: 50%;
	transform: translateY(-50%);
	color: #046bd2;
	display: inline-flex;
	line-height: normal;
}

.infixs-correios-automatico-input-text-append
	.infixs-correios-automatico-loading {
	display: none;
}

/** Animations */

.infixs-correios-automatico-spin-animation {
	animation: infixsCorreiosAutomaticoSpin 1s linear infinite;
}

/** Cart */

.infxs-correios-automatico-cart-shipping-calculator-visible
	.shipping-calculator-button {
	display: none !important;
}

.infxs-correios-automatico-cart-shipping-calculator-visible
	.woocommerce-shipping-calculator
	.shipping-calculator-form {
	display: block !important;
}

.infxs-correios-automatico-cart-shipping-calculator-hidden-button
	.woocommerce-shipping-calculator
	button[name="calc_shipping"] {
	display: none !important;
}

@keyframes infixsCorreiosAutomaticoSpin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* Initial loading spinner for calculator */
.infixs-correios-automatico-calculator {
	position: relative;
	min-height: 120px;
}

.infixs-correios-automatico-initial-loader {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.98);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999;
	min-height: 120px;
}

.infixs-correios-automatico-initial-loader .spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #3498db;
	border-radius: 50%;
	animation: infixsCorreiosAutomaticoSpin 1s linear infinite;
}

/* Hide all calculator content initially */
.infixs-correios-automatico-calculator > *:not(.infixs-correios-automatico-initial-loader) {
	opacity: 0;
	transition: opacity 0.3s ease;
}

/* Show content when loaded */
.infixs-correios-automatico-calculator.loaded > *:not(.infixs-correios-automatico-initial-loader) {
	opacity: 1;
}

.infixs-correios-automatico-calculator.loaded .infixs-correios-automatico-initial-loader {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}
