/**
 * Apex Estimator Frontend Styles
 *
 * @package Apex_Estimator
 */

:root {
	/* Colors */
	--apex-color-heading: #222222;
	--apex-color-primary: #0073aa;
	--apex-color-primary-hover: #005a87;
	--apex-color-secondary: #6c757d;
	--apex-color-secondary-hover: #5a6268;
	--apex-color-success: #28a745;
	--apex-color-border: #dddddd;
	--apex-color-border-focus: #0073aa;
	--apex-color-text: #333333;
	--apex-color-text-light: #666666;
	--apex-color-bg: #ffffff;
	--apex-color-bg-light: #f8f9fa;
	
	/* Font Sizes */
	--apex-font-size-heading: 24px;
	--apex-font-size-label: 18px;
	--apex-font-size-description: 14px;
	--apex-font-size-placeholder: 14px;
	--apex-font-size-input: 16px;
	--apex-font-size-button: 16px;
	
	/* Spacing */
	--apex-spacing-xs: 8px;
	--apex-spacing-sm: 12px;
	--apex-spacing-md: 16px;
	--apex-spacing-lg: 24px;
	--apex-spacing-xl: 32px;
}

/* Container */
.apex-estimator-container {
	max-width: 1140px;
	margin: 0 auto;
	padding: 20px;
}

.apex-estimator-wrapper {
	background: var(--apex-color-bg);
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	padding: 30px;
}

/* Title */
.apex-estimator-title {
	font-size: var(--apex-font-size-heading);
	font-weight: bold;
	color: var(--apex-color-primary);
	margin: 0 0 30px 0;
	text-align: center;
	padding-bottom: 20px;
	border-bottom: 2px solid var(--apex-color-border);
}

/* Form */
.apex-estimator-form {
	width: 100%;
}

/* Progress Bar */
.apex-estimator-progress {
	position: relative;
	margin-bottom: var(--apex-spacing-xl);
	padding: var(--apex-spacing-lg) 0;
}

.apex-estimator-progress-bar {
	position: absolute;
	top: calc(50% - 18px);
	left: 28px;
	right: 28px;
	height: 4px;
	background: var(--apex-color-border);
	transform: translateY(-50%);
	z-index: 1;
	border-radius: 2px;
}

.apex-estimator-progress-fill {
	height: 100%;
	background: var(--apex-color-primary);
	border-radius: 2px;
	transition: width 0.4s ease;
}

.apex-estimator-steps {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	z-index: 2;
}

.apex-estimator-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	position: relative;
}

.apex-estimator-step-circle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--apex-color-bg);
	border: 3px solid var(--apex-color-border);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	z-index: 3;
	transition: all 0.3s ease;
	color: var(--apex-color-text-light);
}

.apex-estimator-step.active .apex-estimator-step-circle {
	border-color: var(--apex-color-primary);
	background: var(--apex-color-primary);
	color: var(--apex-color-bg);
	box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.1);
}

.apex-estimator-step.passed .apex-estimator-step-circle {
	border-color: var(--apex-color-success);
	background: var(--apex-color-success);
	color: var(--apex-color-bg);
}

.apex-estimator-step-circle svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
	stroke: currentColor;
}

.apex-estimator-step-label {
	margin-top: var(--apex-spacing-sm);
	font-size: var(--apex-font-size-label);
	color: var(--apex-color-text-light);
	font-weight: 500;
	text-align: center;
	transition: color 0.3s ease;
}

.apex-estimator-step.active .apex-estimator-step-label {
	color: var(--apex-color-primary);
	font-weight: 600;
}

.apex-estimator-step.passed .apex-estimator-step-label {
	color: var(--apex-color-success);
}

/* Step Content */
.apex-estimator-steps-content {
	position: relative;
	min-height: 300px;
	margin-bottom: var(--apex-spacing-xl);
}

.apex-estimator-step-panel {
	display: none;
	animation: fadeIn 0.3s ease;
}

.apex-estimator-step-panel.active {
	display: block;
}

/* Step 4 - Contact Info - Special Layout */
.apex-estimator-step-panel[data-step="4"].active {
	display: grid !important;
	grid-template-columns: 1fr 1fr !important;
	gap: 16px 40px !important;
}

.apex-estimator-step-panel[data-step="4"] .apex-estimator-step-heading {
	grid-column: 1 / -1 !important;
	width: 100% !important;
	margin-bottom: var(--apex-spacing-lg) !important;
	display: block !important;
}

.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group {
	display: flex !important;
	flex-direction: column !important;
	grid-column: auto !important;
	gap: 0 !important;
	margin-bottom: 2px !important;
}

/* Textarea and other full-width elements in Step 4 */
/* .apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group:has(textarea),
.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group:has(.apex-estimator-description:only-child) {
	grid-column: 1 / -1 !important;
} */

.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group > label.apex-estimator-label,
.apex-estimator-step-panel[data-step="4"] .apex-estimator-field-info {
	flex: none !important;
	width: 100% !important;
}

.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group > input.apex-estimator-input,
.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group > select.apex-estimator-select,
.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group > textarea.apex-estimator-textarea,
.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group > .apex-estimator-radio-group,
.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group > .apex-estimator-toggle-wrapper,
.apex-estimator-step-panel[data-step="4"] .apex-estimator-field-input {
	flex: none !important;
	width: 100% !important;
	max-width: 100% !important;
}

@media (min-width: 1025px) {

	/* Make installation_type field full-width on step 4 */
	.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group.apex-estimator-installation-type-field {
		grid-column: 1 / -1 !important;
		width: 100% !important;
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
	}
	.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group.apex-estimator-installation-type-field .apex-estimator-field-info {
		max-width: 50%;
	}

}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.apex-estimator-step-heading {
	font-size: var(--apex-font-size-heading);
	font-weight: 700;
	color: var(--apex-color-text);
	margin: 0 0 var(--apex-spacing-lg) 0;
	padding: 0 0 var(--apex-spacing-lg) 0;
	border-bottom: 2px solid var(--apex-color-border);
}

/* Navigation Buttons */
.apex-estimator-navigation {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-direction: row-reverse;
	gap: var(--apex-spacing-md);
	padding-top: var(--apex-spacing-lg);
	border-top: 1px solid var(--apex-color-border);
}

button.apex-estimator-btn {
	padding: var(--apex-spacing-sm) var(--apex-spacing-lg) !important;
	font-size: var(--apex-font-size-button) !important;
	font-weight: 500 !important;
	border: none !important;
	border-radius: 4px !important;
	cursor: pointer !important;
	transition: all 0.3s ease !important;
	min-width: 180px !important;
}

button.apex-estimator-btn-primary {
	background: var(--apex-color-primary) !important;
	color: var(--apex-color-bg) !important;
}

button.apex-estimator-btn-primary:hover {
	background: var(--apex-color-primary-hover) !important;
}

button.apex-estimator-btn-secondary {
	background: var(--apex-color-secondary) !important;
	color: var(--apex-color-bg) !important;
}

button.apex-estimator-btn-secondary:hover {
	background: var(--apex-color-secondary-hover) !important;
}

button.apex-estimator-btn:disabled {
	opacity: 0.6 !important;
	cursor: not-allowed !important;
}

/* Make the primary next/submit button a bit longer */
.apex-estimator-btn-next {
	min-width: 220px !important;
}

/* Form Fields */
.apex-estimator-form-group {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	gap: var(--apex-spacing-xl) !important;
	align-items: start !important;
	margin-bottom: var(--apex-spacing-lg) !important;
}

.apex-estimator-form-group > label.apex-estimator-label,
.apex-estimator-field-info {
	flex: 1 1 auto !important;
	min-width: 0 !important;
}

.apex-estimator-form-group > input.apex-estimator-input,
.apex-estimator-form-group > select.apex-estimator-select,
.apex-estimator-form-group > textarea.apex-estimator-textarea,
.apex-estimator-form-group > .apex-estimator-radio-group,
.apex-estimator-form-group > .apex-estimator-toggle-wrapper,
.apex-estimator-field-input {
	flex: 0 0 320px !important;
	min-width: 0 !important;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
}

.apex-estimator-form-group.apex-estimator-gate-hidden {
	display: none !important;
}

label.apex-estimator-label {
	display: block !important;
	font-size: var(--apex-font-size-label) !important;
	font-weight: 600 !important;
	color: var(--apex-color-heading) !important;
	margin-bottom: var(--apex-spacing-xs) !important;
}

label.apex-estimator-label.apex_required {
	position: relative !important;
}

.apex-estimator-required {
	color: #d63638 !important;
	margin-left: 4px !important;
}

.apex-estimator-description {
	font-size: var(--apex-font-size-description);
	color: var(--apex-color-text-light);
	margin-top: var(--apex-spacing-xs);
	margin-bottom: var(--apex-spacing-sm);
}

.apex_estimator_price_info {
	font-size: 12px !important;
	font-weight: 600 !important;
	color: var(--apex-color-text) !important;
	background-color: rgba(0, 115, 170, 0.08) !important;
	border: 1px solid rgba(0, 115, 170, 0.25) !important;
	border-radius: 4px !important;
	padding: 4px 8px !important;
	display: inline-block !important;
	width: auto !important;
}

.apex-estimator-radio-price-info {
	display: none !important;
}

.apex-estimator-radio-price-info.apex_show {
	display: inline-block !important;
}

.apex-estimator-dynamic-price-info {
	display: none !important;
}

.apex-estimator-dynamic-price-info.apex_show {
	display: inline-block !important;
}

.apex-estimator-radio-custom-description {
	display: none !important;
	padding: var(--apex-spacing-sm) var(--apex-spacing-md) !important;
	background-color: rgba(0, 115, 170, 0.08) !important;
	border-left: 4px solid var(--apex-color-primary) !important;
	border-radius: 4px !important;
	width: 100% !important;
}

.apex-estimator-radio-custom-description.apex_show {
	display: block !important;
}

.apex-estimator-custom-description-title {
	font-weight: 600 !important;
	font-size: var(--apex-font-size-text) !important;
	color: var(--apex-color-text) !important;
	margin-bottom: var(--apex-spacing-xs) !important;
}

.apex-estimator-custom-description-text {
	font-size: var(--apex-font-size-description) !important;
	color: var(--apex-color-text-light) !important;
	line-height: 1.5 !important;
}

/* Post Information Section */
.apex-estimator-post-info-section {
	display: none !important;
	width: 100% !important;
	margin-top: var(--apex-spacing-md) !important;
	margin-bottom: var(--apex-spacing-md) !important;
	padding: var(--apex-spacing-md) var(--apex-spacing-lg) !important;
	background-color: rgba(0, 115, 170, 0.08) !important;
	border-left: 4px solid var(--apex-color-primary) !important;
	border-radius: 4px !important;
}

.apex-estimator-post-info-section.apex_show {
	display: block !important;
}

.apex-estimator-post-info-title {
	font-size: var(--apex-font-size-heading) !important;
	font-weight: 600 !important;
	color: var(--apex-color-primary) !important;
	margin: 0 0 var(--apex-spacing-md) 0 !important;
	padding-bottom: var(--apex-spacing-sm) !important;
	border-bottom: 2px solid var(--apex-color-border) !important;
}

.apex-estimator-post-info-item {
	margin-bottom: var(--apex-spacing-sm) !important;
	padding-bottom: var(--apex-spacing-sm) !important;
	font-size: var(--apex-font-size-description) !important;
	line-height: 1.6 !important;
	border-bottom: 1px solid var(--apex-color-border) !important;
}

.apex-estimator-post-info-item:last-child {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
	border-bottom: none !important;
}

.apex-estimator-post-info-label {
	font-weight: 600 !important;
	color: var(--apex-color-text) !important;
	display: block !important;
}

.apex-estimator-post-info-recommended-height,
.apex-estimator-post-info-recommended-count,
.apex-estimator-post-info-included-parts {
	color: var(--apex-color-text-light) !important;
	display: block !important;
}

.apex-estimator-post-info-recommended-height strong,
.apex-estimator-post-info-recommended-count strong,
.apex-estimator-post-info-included-parts strong {
	font-weight: 600 !important;
	color: var(--apex-color-primary) !important;
}

/* Number Field Group (2-column layout) */
.apex-estimator-number-field-group {
	display: flex !important;
	flex-direction: row !important;
	gap: var(--apex-spacing-md) !important;
	align-items: start !important;
	width: 100% !important;
}

.apex-estimator-field-info {
	flex: 1 !important;
	min-width: 0 !important;
}

input.apex-estimator-input,
select.apex-estimator-select,
textarea.apex-estimator-textarea {
	background-color: var(--apex-color-bg) !important;
	width: 100% !important;
	max-width: 320px !important;
	height: 48px !important;
	padding: var(--apex-spacing-sm) var(--apex-spacing-md) !important;
	font-size: var(--apex-font-size-input) !important;
	color: var(--apex-color-text) !important;
	border: 1px solid var(--apex-color-border) !important;
	border-radius: 4px !important;
	transition: border-color 0.3s ease !important;
}

input.apex-estimator-input:focus,
select.apex-estimator-select:focus,
textarea.apex-estimator-textarea:focus {
	outline: none !important;
	border-color: var(--apex-color-border-focus) !important;
}

input.apex-estimator-input::placeholder,
select.apex-estimator-input::placeholder,
textarea.apex-estimator-textarea::placeholder {
	color: var(--apex-color-text-light) !important;
	font-size: var(--apex-font-size-placeholder) !important;
}

textarea.apex-estimator-textarea {
	resize: vertical !important;
	min-height: 100px !important;
	height: auto !important;
}

.apex-estimator-number-control {
	display: flex;
	align-items: center;
	gap: 0;
}

button.apex-estimator-number-btn {
	width: 40px !important;
	height: 48px !important;
	border: 1px solid var(--apex-color-border) !important;
	background-color: var(--apex-color-bg) !important;
	color: var(--apex-color-text) !important;
	font-size: 18px !important;
	font-weight: bold !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: all 0.3s ease !important;
	user-select: none !important;
	padding: 0 !important;
}

button.apex-estimator-number-btn:hover {
	background: var(--apex-color-primary) !important;
	color: var(--apex-color-bg) !important;
	border-color: var(--apex-color-primary) !important;
}

button.apex-estimator-number-btn:active {
	transform: scale(0.95) !important;
}

button.apex-estimator-number-decrease {
	border-radius: 4px 0 0 4px !important;
	border-right: none !important;
}

button.apex-estimator-number-increase {
	border-radius: 0 4px 4px 0 !important;
	border-left: none !important;
}

input.apex-estimator-number-input {
	flex: 1 !important;
	width: 100% !important;
	max-width: 100px !important;
	height: 48px !important;
	padding: var(--apex-spacing-sm) var(--apex-spacing-md) !important;
	font-size: 18px !important;
	font-weight: bold !important;
	color: var(--apex-color-heading) !important;
	border: 1px solid var(--apex-color-border) !important;
	/* border-left: none !important;
	border-right: none !important; */
	border-radius: 0 !important;
	text-align: center !important;
	appearance: textfield !important;
	-moz-appearance: textfield !important;
}

input.apex-estimator-number-input::-webkit-outer-spin-button,
input.apex-estimator-number-input::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
}

input.apex-estimator-number-input:focus {
	outline: none !important;
	border-color: var(--apex-color-border-focus) !important;
}

/* Radio Group */
.apex-estimator-radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--apex-spacing-md);
}

label.apex-estimator-radio-option {
	display: flex !important;
	align-items: center !important;
	cursor: pointer !important;
	padding: var(--apex-spacing-xs) var(--apex-spacing-sm) !important;
	border: 1px solid var(--apex-color-border) !important;
	border-radius: 4px !important;
	transition: all 0.3s ease !important;
	background-color: var(--apex-color-bg) !important;
}

.apex-estimator-radio-option:hover {
	border-color: var(--apex-color-primary) !important;
	background: var(--apex-color-bg-light) !important;
}

label.apex-estimator-radio-option input[type="radio"] {
	margin: 0 var(--apex-spacing-xs) 0 0 !important;
	cursor: pointer !important;
	accent-color: var(--apex-color-primary) !important;
}

label.apex-estimator-radio-option input[type="radio"]:checked + span {
	font-weight: 600 !important;
	color: var(--apex-color-primary) !important;
}

label.apex-estimator-radio-option:has(input[type="radio"]:checked) {
	border-color: var(--apex-color-primary) !important;
	background: rgba(0, 115, 170, 0.05) !important;
}

/* Toggle Switch */
.apex-estimator-toggle-wrapper {
	display: flex;
	align-items: center;
}

.apex-estimator-toggle {
	position: relative;
	display: inline-block;
	width: 64px;
	height: 36px;
	margin-top: var(--apex-spacing-xs);
}

.apex-estimator-toggle-input {
	opacity: 0 !important;
	width: 0 !important;
	height: 0 !important;
}

.apex-estimator-toggle-label {
	position: absolute !important;
	cursor: pointer !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	background-color: var(--apex-color-secondary) !important;
	transition: 0.3s !important;
	border-radius: 36px !important;
	margin-bottom: 0 !important;
}

.apex-estimator-toggle-label:before {
	position: absolute !important;
	content: "" !important;
	height: 28px !important;
	width: 28px !important;
	left: 4px !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	background-color: white !important;
	transition: 0.3s !important;
	border-radius: 50% !important;
}

.apex-estimator-toggle-input:checked + .apex-estimator-toggle-label {
	background-color: var(--apex-color-primary) !important;
}

.apex-estimator-toggle-input:checked + .apex-estimator-toggle-label:before {
	transform: translateX(28px) translateY(-50%) !important;
}

/* Conditional Fields - Hidden by default */
.apex-estimator-conditional-group {
	display: none !important;
	width: 100% !important;
	margin-top: var(--apex-spacing-md) !important;
	padding-top: var(--apex-spacing-md) !important;
	border-top: 1px solid var(--apex-color-border) !important;
}

.apex-estimator-conditional-group.apex_show {
	display: block !important;
}

/* Required Field Indicator - Removed duplicate asterisk */

/* Messages */
.apex-estimator-message {
	display: none;
	padding: var(--apex-spacing-md);
	margin-bottom: var(--apex-spacing-lg);
	border-radius: 4px;
	font-size: var(--apex-font-size-input);
	font-weight: 500;
}

.apex-estimator-message-success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.apex-estimator-message-error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.apex-estimator-step-validation-error {
	display: block !important;
}

/* Field Error State */
/* .apex-estimator-field-error input,
.apex-estimator-field-error select,
.apex-estimator-field-error textarea {
	border-color: #d63638 !important;
	box-shadow: 0 0 0 1px #d63638 !important;
} */

/* .apex-estimator-field-error.apex-estimator-radio-option {
	border-color: #d63638 !important;
	background-color: rgba(214, 54, 56, 0.05) !important;
} */

/* Tablet Responsive */
@media (max-width: 1024px) {
	#main-content {
		padding: 0 !important;
	}

	.apex-estimator-container {
		padding: 15px;
	}

	.apex-estimator-wrapper {
		padding: 24px;
	}

	.apex-estimator-form-group > input.apex-estimator-input,
	.apex-estimator-form-group > select.apex-estimator-select,
	.apex-estimator-form-group > textarea.apex-estimator-textarea,
	.apex-estimator-form-group > .apex-estimator-radio-group,
	.apex-estimator-form-group > .apex-estimator-toggle-wrapper,
	.apex-estimator-field-input {
		flex: 0 0 300px !important;
		max-width: 100% !important;
	}

	input.apex-estimator-input,
	select.apex-estimator-select,
	textarea.apex-estimator-textarea {
		max-width: 100% !important;
	}

	/* Step 4 - Tablet: 2 columns but with better spacing */
	.apex-estimator-step-panel[data-step="4"].active {
		gap: 12px 24px !important;
	}

	.apex-estimator-number-field-group {
		flex-wrap: wrap !important;
	}

	.apex-estimator-field-input {
		flex: 0 0 280px !important;
		max-width: 100% !important;
	}

	/* Estimate table - Tablet */
	.apex-estimator-estimate-container {
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch !important;
	}

	.apex-estimator-estimate-table {
		font-size: 15px !important;
		min-width: 600px !important;
	}

	.apex-estimator-estimate-table th,
	.apex-estimator-estimate-table td {
		padding: var(--apex-spacing-xs) var(--apex-spacing-sm) !important;
	}
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.apex-estimator-container {
		padding: 0;
		max-width: 100% !important;
	}

	.apex-estimator-wrapper {
		padding: 20px;
		border-radius: 0;
		box-shadow: none;
	}

	.apex-estimator-form-group > input.apex-estimator-input,
	.apex-estimator-form-group > select.apex-estimator-select,
	.apex-estimator-form-group > textarea.apex-estimator-textarea,
	.apex-estimator-form-group > .apex-estimator-radio-group,
	.apex-estimator-form-group > .apex-estimator-toggle-wrapper,
	.apex-estimator-field-input {
		flex: 0 0 auto !important;
	}

	.apex-estimator-title {
		font-size: 20px;
		margin-bottom: 20px;
	}

	.apex-estimator-step-circle {
		width: 48px;
		height: 48px;
	}

	.apex-estimator-step-circle svg {
		width: 20px;
		height: 20px;
	}

	.apex-estimator-step-label {
		font-size: 12px;
	}

	.apex-estimator-progress {
		padding: var(--apex-spacing-md) 0;
	}

	.apex-estimator-progress-bar {
		left: 24px;
		right: 24px;
		top: calc(50% - 14px);
	}

	.apex-estimator-navigation {
		flex-direction: column;
	}

	.apex-estimator-btn {
		width: 100% !important;
	}

	.apex-estimator-form-group,
	.apex-estimator-number-field-group {
		flex-direction: column !important;
		gap: var(--apex-spacing-sm) !important;
	}

	.apex-estimator-form-group > label.apex-estimator-label,
	.apex-estimator-form-group > .apex-estimator-input,
	.apex-estimator-form-group > .apex-estimator-select,
	.apex-estimator-form-group > .apex-estimator-textarea,
	.apex-estimator-form-group > .apex-estimator-radio-group,
	.apex-estimator-form-group > .apex-estimator-toggle-wrapper,
	.apex-estimator-field-info,
	.apex-estimator-field-input {
		flex: 1 1 100% !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	input.apex-estimator-input,
	select.apex-estimator-select,
	textarea.apex-estimator-textarea {
		max-width: 100% !important;
		width: 100% !important;
	}

	.apex-estimator-field-input {
		max-width: 100% !important;
		width: 100% !important;
	}

	.apex-estimator-number-field-group {
		flex-direction: column !important;
		gap: var(--apex-spacing-sm) !important;
	}

	.apex-estimator-field-info,
	.apex-estimator-field-input {
		flex: 1 1 100% !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	input.apex-estimator-number-input {
		max-width: 100px !important;
	}

	/* Step 4 - Mobile: 1 field per row */
	.apex-estimator-step-panel[data-step="4"].active {
		display: block !important;
		grid-template-columns: 1fr !important;
		gap: 0 !important;
	}
	
	.apex-estimator-step-panel[data-step="4"] .apex-estimator-form-group {
		grid-column: 1 !important;
		margin-bottom: var(--apex-spacing-lg) !important;
		width: 100% !important;
	}

	.apex-estimator-step-panel[data-step="4"] .apex-estimator-step-heading {
		grid-column: 1 !important;
		margin-bottom: var(--apex-spacing-lg) !important;
	}

	/* Estimate table - Mobile: Horizontal scroll wrapper */
	.apex-estimator-estimate-container {
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch !important;
		margin-left: -20px !important;
		margin-right: -20px !important;
		padding-left: 20px !important;
		padding-right: 20px !important;
		padding-bottom: 20px !important;
		margin-bottom: 24px !important;
	}

	.apex-estimator-estimate-table {
		min-width: 500px !important;
		font-size: 13px !important;
	}

	.apex-estimator-estimate-table th,
	.apex-estimator-estimate-table td {
		padding: 8px 10px !important;
		font-size: 13px !important;
		white-space: nowrap !important;
	}

	.apex-estimator-estimate-table th:first-child,
	.apex-estimator-estimate-table td:first-child {
		white-space: normal !important;
		min-width: 120px !important;
	}

	.apex-estimator-estimate-total td {
		font-size: 16px !important;
	}

	.apex-estimator-estimate-total-value {
		font-size: 1.1em !important;
	}

	.apex-estimator-estimate-title {
		font-size: 18px !important;
	}

}

/* Estimate Table Styles */
.apex-estimator-estimate-container {
	margin-bottom: 0 !important;
	grid-column: 1 / -1 !important;
}

.apex-estimator-estimate-loader {
	text-align: center !important;
	padding: var(--apex-spacing-lg) !important;
}

.apex-estimator-spinner {
	border: 4px solid rgba(0, 115, 170, 0.1) !important;
	border-top: 4px solid var(--apex-color-primary) !important;
	border-radius: 50% !important;
	width: 40px !important;
	height: 40px !important;
	animation: spin 1s linear infinite !important;
	margin: 0 auto var(--apex-spacing-sm) !important;
}

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

.apex-estimator-estimate-loader p {
	margin: 0 !important;
	color: var(--apex-color-text) !important;
	font-size: var(--apex-font-size-description) !important;
}

/* Submit Overlay */
.apex-estimator-submit-overlay {
	position: absolute;
	padding: 20px;
	background: rgba(255, 252, 255, 0.85);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 10;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}
.apex-estimator-submit-overlay.apex_loader_show {
	display: flex !important;
}

.apex-estimator-content {
	position: relative !important;
}
.apex-estimator-submit-overlay-inner {
	text-align: center !important;
	color: #ffffff !important;
}
.apex-estimator-submit-overlay-inner p {
	margin: 8px 0 0 0 !important;
	font-weight: 600 !important;
}

.apex-estimator-estimate-title {
	font-size: var(--apex-font-size-heading) !important;
	font-weight: 700 !important;
	color: var(--apex-color-heading) !important;
	margin-bottom: var(--apex-spacing-md) !important;
}

.apex-estimator-estimate-table {
	width: 100% !important;
	border-collapse: collapse !important;
	margin-bottom: var(--apex-spacing-md) !important;
	background: var(--apex-color-bg) !important;
}

.apex-estimator-estimate-table thead {
	background: var(--apex-color-primary) !important;
	color: #fff !important;
}

.apex-estimator-estimate-table th {
	padding: var(--apex-spacing-sm) var(--apex-spacing-md) !important;
	text-align: left !important;
	font-weight: 600 !important;
	font-size: var(--apex-font-size-label) !important;
	border: 1px solid var(--apex-color-border) !important;
	color: #fff !important;
}

.apex-estimator-estimate-table td {
	padding: var(--apex-spacing-sm) var(--apex-spacing-md) !important;
	border: 1px solid var(--apex-color-border) !important;
	font-size: var(--apex-font-size-text) !important;
	color: var(--apex-color-text) !important;
}
.apex-estimator-estimate-table tr th:not(:first-child),
.apex-estimator-estimate-table td:not(:first-child) {
	text-align: right !important;
}

.apex-estimator-estimate-table tbody tr:nth-child(even) {
	background: rgba(0, 115, 170, 0.03) !important;
}

.apex-estimator-estimate-table tfoot {
	background: rgba(0, 115, 170, 0.1) !important;
}

.apex-estimator-estimate-total td {
	font-weight: 700 !important;
	font-size: var(--apex-font-size-heading) !important;
	color: var(--apex-color-heading) !important;
}

.apex-estimator-estimate-total-value {
	color: var(--apex-color-primary) !important;
	font-size: 1.2em !important;
}

.apex-estimator-estimate-info {
	display: none !important;
	margin-top: 0 !important;
	margin-bottom: var(--apex-spacing-lg) !important;
	padding: var(--apex-spacing-md) var(--apex-spacing-lg) !important;
	background: rgba(0, 115, 170, 0.08) !important;
	border-left: 4px solid var(--apex-color-primary) !important;
	border-radius: 4px !important;
	width: 100% !important;
}

/* Step 4: Make estimate-info full width in grid */
.apex-estimator-step-panel[data-step="4"] .apex-estimator-estimate-info {
	grid-column: 1 / -1 !important;
	width: 100% !important;
}

.apex-estimator-estimate-info.apex_show {
	display: block !important;
}

.apex-estimator-estimate-info-title {
	margin: 0 0 var(--apex-spacing-xs) 0 !important;
	font-size: var(--apex-font-size-heading) !important;
	font-weight: bold !important;
	color: var(--apex-color-primary) !important;
}

.apex-estimator-estimate-info-description {
	margin: 0 !important;
	font-size: var(--apex-font-size-description) !important;
	color: var(--apex-color-text-light) !important;
	line-height: 1.6 !important;
}

/* Upload Field */
.apex-estimator-upload-section {
	width: 100% !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 0 !important;
}

.apex-estimator-upload-intro {
	display: flex !important;
	flex-direction: column !important;
	gap: var(--apex-spacing-xs) !important;
}

.apex-estimator-upload-intro p {
	margin: 0 !important;
	font-size: var(--apex-font-size-description) !important;
	color: var(--apex-color-text-light) !important;
}

.apex-estimator-dropzone {
	position: relative !important;
	border: 2px dashed rgba(0, 115, 170, 0.4) !important;
	border-radius: 8px !important;
	padding: var(--apex-spacing-sm) !important;
	background: rgba(0, 115, 170, 0.04) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	text-align: center !important;
	flex-direction: column !important;
	gap: var(--apex-spacing-sm) !important;
	cursor: pointer !important;
	transition: background 0.3s ease, border-color 0.3s ease !important;
	min-height: 153.6px;
	margin-bottom: var(--apex-spacing-sm) !important;
}

.apex-estimator-dropzone.is-dragover {
	background: rgba(0, 115, 170, 0.1) !important;
	border-color: var(--apex-color-primary) !important;
}

.apex-estimator-dropzone-icon {
	width: 48px !important;
	height: 48px !important;
	border-radius: 12px !important;
	background-color: var(--apex-color-bg) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15) !important;
	color: var(--apex-color-primary) !important;
	font-size: 24px !important;
	font-weight: 700 !important;
}

.apex-estimator-dropzone strong {
	color: var(--apex-color-primary) !important;
}

.apex-estimator-dropzone input[type="file"] {
	position: absolute !important;
	inset: 0 !important;
	opacity: 0 !important;
	cursor: pointer !important;
}

.apex-estimator-upload-meta {
	font-size: var(--apex-font-size-description) !important;
	color: var(--apex-color-text-light) !important;
}

.apex-estimator-upload-progress-list {
	display: none !important;
}
.apex-estimator-uploaded-files {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: var(--apex-spacing-md) !important;
	margin-top: var(--apex-spacing-sm) !important;
}

.apex-estimator-uploaded-item {
	position: relative !important;
	border: 1px solid var(--apex-color-border) !important;
	border-radius: 10px !important;
	background-color: var(--apex-color-bg) !important;
	overflow: hidden !important;
	aspect-ratio: 1 / 1 !important;
	width: 100% !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	justify-content: flex-end !important;
	padding: 0 !important;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease !important;
	cursor: default !important;
	background-size: cover !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
}

.apex-estimator-uploaded-item.apex-estimator-upload-uploading {
	opacity: 0.85 !important;
}

.apex-estimator-uploaded-item:hover {
	transform: translateY(-4px) !important;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12) !important;
}

.apex-estimator-upload-file-header {
	width: 100% !important;
	background: rgba(0, 0, 0, 0.7) !important;
	color: #fff !important;
	font-size: 11px !important;
	padding: 8px 10px !important;
	text-align: center !important;
	white-space: nowrap !important;
	text-overflow: ellipsis !important;
	overflow: hidden !important;
	backdrop-filter: blur(4px) !important;
	max-width: 100% !important;
	flex-shrink: 0 !important;
	z-index: 2 !important;
}

.apex-estimator-upload-file-header span {
	display: block !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	white-space: nowrap !important;
}

.apex-estimator-upload-progress-bar {
	position: relative !important;
	width: 100% !important;
	height: 4px !important;
	background: rgba(0, 0, 0, 0.2) !important;
	overflow: hidden !important;
	flex-shrink: 0 !important;
	z-index: 3 !important;
	bottom: 0 !important;
}

.apex-estimator-upload-progress-bar-fill {
	position: absolute !important;
	left: 0 !important;
	top: 0 !important;
	height: 100% !important;
	width: 0% !important;
	background: #28a745 !important;
	transition: width 0.15s linear !important;
	box-shadow: 0 0 4px rgba(40, 167, 69, 0.5) !important;
}

.apex-estimator-upload-remove {
	position: absolute !important;
	top: 8px !important;
	right: 8px !important;
	width: 24px !important;
	height: 24px !important;
	border-radius: 50% !important;
	background: rgba(0, 0, 0, 0.7) !important;
	color: #fff !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-size: 16px !important;
	font-weight: bold !important;
	opacity: 0 !important;
	transition: opacity 0.2s ease, background 0.2s ease !important;
	cursor: pointer !important;
	z-index: 10 !important;
	backdrop-filter: blur(4px) !important;
}

.apex-estimator-upload-remove:hover {
	background: rgba(214, 54, 56, 0.9) !important;
	opacity: 1 !important;
}

.apex-estimator-uploaded-item:hover .apex-estimator-upload-remove {
	opacity: 1 !important;
}

.apex-estimator-uploaded-item[data-type="image"] {
	color: #fff !important;
}

.apex-estimator-uploaded-item[data-type="file"] {
	background-image: radial-gradient(circle at top, rgba(0, 115, 170, 0.2), rgba(0, 115, 170, 0.05)) !important;
}

@media (max-width: 1024px) {
	.apex-estimator-uploaded-files {
		grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
	}

	.apex-estimator-upload-remove {
		opacity: 1 !important;
	}

	.apex-estimator-form-group {
		gap: var(--apex-spacing-md) !important;
	}
}

@media (max-width: 767px) {
	.apex-estimator-uploaded-files {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: var(--apex-spacing-xs) !important;
	}

	.apex-estimator-estimate-info {
		margin-top: var(--apex-spacing-lg) !important;
	}
}

.apex-estimator-upload-error {
	padding: var(--apex-spacing-xs) var(--apex-spacing-sm) !important;
	background: rgba(214, 54, 56, 0.08) !important;
	color: #721c24 !important;
	border: 1px solid rgba(214, 54, 56, 0.3) !important;
	border-radius: 4px !important;
	font-size: var(--apex-font-size-description) !important;
	margin-top: var(--apex-spacing-sm) !important;
}

/* Selector Shortcode Styles */
.apex-estimator-selector-container {
	padding: var(--apex-spacing-xl) 20px !important;
}

.apex-estimator-selector-grid {
	display: grid !important;
	grid-template-columns: repeat(2, 1fr) !important;
	gap: var(--apex-spacing-xl) !important;
	margin-top: var(--apex-spacing-lg) !important;
}

.apex-estimator-selector-box {
	position: relative !important;
	background: var(--apex-color-bg) !important;
	border: 2px solid var(--apex-color-border) !important;
	border-radius: 12px !important;
	padding: var(--apex-spacing-xl) !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	text-align: center !important;
	transition: all 0.3s ease !important;
	cursor: pointer !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
	min-height: 320px !important;
}

.apex-estimator-selector-box:hover {
	border-color: var(--apex-color-primary) !important;
	box-shadow: 0 4px 16px rgba(0, 115, 170, 0.15) !important;
	transform: translateY(-4px) !important;
}

.apex-estimator-selector-link {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	z-index: 1 !important;
	text-decoration: none !important;
}

.apex-estimator-selector-icon {
	width: 80px !important;
	height: 80px !important;
	border-radius: 50% !important;
	background: rgba(0, 115, 170, 0.1) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	margin-bottom: var(--apex-spacing-lg) !important;
	color: var(--apex-color-primary) !important;
	position: relative !important;
	z-index: 2 !important;
	transition: all 0.3s ease !important;
}

.apex-estimator-selector-box:hover .apex-estimator-selector-icon {
	background: var(--apex-color-primary) !important;
	color: var(--apex-color-bg) !important;
	transform: scale(1.05) !important;
}

.apex-estimator-selector-icon svg {
	width: 40px !important;
	height: 40px !important;
}

.apex-estimator-selector-title {
	font-size: 28px !important;
	font-weight: 700 !important;
	color: var(--apex-color-heading) !important;
	margin: 0 0 var(--apex-spacing-sm) 0 !important;
	position: relative !important;
	z-index: 2 !important;
}

.apex-estimator-selector-label {
	display: inline-block !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	color: var(--apex-color-primary) !important;
	background-color: rgba(0, 115, 170, 0.1) !important;
	padding: 2px 8px !important;
	border-radius: 4px !important;
	margin: 0 0 var(--apex-spacing-md) 0 !important;
	position: relative !important;
	z-index: 2 !important;
}

.apex-estimator-selector-description {
	font-size: var(--apex-font-size-description) !important;
	color: var(--apex-color-text-light) !important;
	line-height: 1.6 !important;
	margin: 0 0 var(--apex-spacing-lg) 0 !important;
	flex: 1 !important;
	position: relative !important;
	z-index: 2 !important;
}

.apex-estimator-selector-btn {
	position: relative !important;
	z-index: 2 !important;
	pointer-events: none !important;
}

/* Tablet Responsive - Selector */
@media (max-width: 1024px) {
	.apex-estimator-selector-grid {
		gap: var(--apex-spacing-lg) !important;
	}

	.apex-estimator-selector-box {
		padding: var(--apex-spacing-lg) !important;
		min-height: 300px !important;
	}

	.apex-estimator-selector-title {
		font-size: 24px !important;
	}
}

/* Mobile Responsive - Selector */
@media (max-width: 768px) {
	.apex-estimator-selector-grid {
		grid-template-columns: 1fr !important;
		gap: var(--apex-spacing-lg) !important;
	}

	.apex-estimator-selector-box {
		padding: var(--apex-spacing-lg) !important;
		min-height: 280px !important;
	}

	.apex-estimator-selector-icon {
		width: 70px !important;
		height: 70px !important;
		margin-bottom: var(--apex-spacing-md) !important;
	}

	.apex-estimator-selector-icon svg {
		width: 35px !important;
		height: 35px !important;
	}

	.apex-estimator-selector-title {
		font-size: 22px !important;
	}

	.apex-estimator-selector-description {
		font-size: 14px !important;
	}
}

