/**
 * Car Seat Finder - Frontend Styles
 *
 * @package CarSeatFinder
 */

/* Main Container */
.carseat-finder-wrap {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
}

/* Affiliate Disclosure */
.csf-affiliate-disclosure {
	background: #f0f4f8;
	border-left: 4px solid #3b82f6;
	padding: 12px 16px;
	margin-bottom: 30px;
	font-size: 14px;
	color: #4b5563;
}

/* Form Container */
.csf-form {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 30px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Progress Indicator */
.csf-progress-indicator {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 30px;
	padding: 20px 0;
	background: #f8fafc;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
}

.csf-progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	flex: 1;
	max-width: 120px;
}

.csf-progress-step:not(:last-child)::after {
	content: '';
	position: absolute;
	top: 20px;
	left: 50%;
	width: 100%;
	height: 2px;
	background: #e5e7eb;
	z-index: 1;
}

.csf-progress-step.csf-progress-active:not(:last-child)::after,
.csf-progress-step.csf-progress-completed:not(:last-child)::after {
	background: #3b82f6;
}

.csf-progress-number {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #e5e7eb;
	color: #6b7280;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 16px;
	position: relative;
	z-index: 2;
	transition: all 0.3s ease;
}

.csf-progress-step.csf-progress-active .csf-progress-number {
	background: #3b82f6;
	color: white;
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.csf-progress-step.csf-progress-completed .csf-progress-number {
	background: #10b981;
	color: white;
}

.csf-progress-label {
	margin-top: 8px;
	font-size: 12px;
	font-weight: 500;
	color: #6b7280;
	text-align: center;
}

.csf-progress-step.csf-progress-active .csf-progress-label {
	color: #3b82f6;
	font-weight: 600;
}

.csf-progress-step.csf-progress-completed .csf-progress-label {
	color: #10b981;
	font-weight: 600;
}

/* Steps */
.csf-step {
	display: none;
}

.csf-step-active {
	display: block;
}

.csf-step h3 {
	margin-top: 0;
	margin-bottom: 16px;
	font-size: 24px;
	color: #1f2937;
	font-weight: 600;
}

.csf-step-description {
	margin-bottom: 24px;
	font-size: 16px;
	color: #6b7280;
	line-height: 1.5;
	font-style: italic;
}

/* Form Rows */
.csf-form-row {
	margin-bottom: 20px;
}

.csf-form-row label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: #374151;
	font-size: 15px;
}

.csf-form-row label input[type="checkbox"] {
	margin-right: 8px;
	width: auto;
	display: inline-block;
	vertical-align: middle;
}

.csf-form-row .required {
	color: #dc2626;
	margin-left: 4px;
}

.csf-form-row input[type="number"],
.csf-form-row input[type="text"],
.csf-form-row select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 16px;
	transition: border-color 0.2s;
}

.csf-form-row input[type="number"]:focus,
.csf-form-row input[type="text"]:focus,
.csf-form-row select:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.csf-age-select {
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 8px center;
	background-repeat: no-repeat;
	background-size: 16px;
	padding-right: 40px;
}

.csf-help-text {
	margin: 6px 0 0;
	font-size: 13px;
	color: #6b7280;
	font-style: italic;
	background: #f8fafc;
	padding: 8px 12px;
	border-radius: 6px;
	border-left: 3px solid #3b82f6;
	line-height: 1.4;
}

/* Buttons */
.csf-btn {
	padding: 12px 24px;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	text-align: center;
	display: inline-block;
}

.csf-btn-primary {
	background: #3b82f6;
	color: #fff;
}

.csf-btn-primary:hover {
	background: #2563eb;
}

.csf-btn-next {
	background: #10b981;
	color: #fff;
}

.csf-btn-next:hover {
	background: #059669;
}

.csf-btn-back {
	background: #6b7280;
	color: #fff;
	margin-right: 10px;
}

.csf-btn-back:hover {
	background: #4b5563;
}

.csf-form-actions {
	display: flex;
	justify-content: space-between;
	margin-top: 30px;
}

/* Loading */
.csf-loading {
	text-align: center;
	padding: 40px 20px;
}

.csf-spinner {
	display: inline-block;
	width: 40px;
	height: 40px;
	border: 4px solid #f3f4f6;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: csf-spin 0.8s linear infinite;
}

@keyframes csf-spin {
	to {
		transform: rotate(360deg);
	}
}

.csf-loading p {
	margin-top: 16px;
	color: #6b7280;
	font-size: 16px;
}

/* Results */
.csf-results {
	margin-top: 40px;
}

.csf-results h3 {
	font-size: 26px;
	margin-bottom: 24px;
	color: #1f2937;
}

.csf-results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

@media (max-width: 768px) {
	.csf-results-grid {
		grid-template-columns: 1fr;
		gap: 15px;
	}
}

/* Result Card */
.csf-result-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.2s, box-shadow 0.2s;
	display: flex;
	flex-direction: column;
}

.csf-result-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.csf-result-image {
	width: 100%;
	min-height: 250px;
	max-height: 350px;
	overflow: visible;
	background: #f9fafb;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 15px;
	border-radius: 8px;
}

.csf-result-image img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	object-position: center;
	background: transparent;
	border-radius: 4px;
}

/* Specific styles for car seat images */
.csf-result-image img[alt*="seggiolino"],
.csf-result-image img[alt*="car seat"],
.csf-result-image img[alt*="baby seat"] {
	max-width: 95%;
	max-height: 95%;
	object-fit: contain;
	object-position: center;
}

/* Desktop specific image improvements */
@media (min-width: 768px) {
	.csf-result-image {
		min-height: 280px;
		max-height: 400px;
		padding: 20px;
	}
	
	.csf-result-image img {
		max-width: 100%;
		max-height: 100%;
		object-fit: contain;
		object-position: center;
	}
	
	.csf-result-image img[alt*="seggiolino"],
	.csf-result-image img[alt*="car seat"],
	.csf-result-image img[alt*="baby seat"] {
		max-width: 100%;
		max-height: 100%;
		object-fit: contain;
		object-position: center;
	}
}

/* Force image visibility - prevent cropping */
.csf-result-image img {
	display: block;
	margin: 0 auto;
	object-fit: contain !important;
	object-position: center !important;
}

/* Global image container rules */
.csf-result-image {
	overflow: visible !important;
	position: relative;
}

/* Ensure images are never cropped */
.csf-result-image img {
	position: relative;
	z-index: 1;
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 767px) {
	.csf-result-image {
		min-height: 220px;
		max-height: 320px;
		padding: 15px;
	}
	
	.csf-result-image img {
		max-width: 100%;
		max-height: 100%;
		object-fit: contain;
		object-position: center;
	}
}

/* Additional desktop optimizations */
@media (min-width: 1024px) {
	.csf-result-image {
		min-height: 300px;
		max-height: 450px;
		padding: 25px;
	}
}

.csf-placeholder-image {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 48px;
	font-weight: bold;
}

.csf-result-content {
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.csf-result-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 12px;
}

.csf-result-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #111827;
	line-height: 1.4;
	flex: 1;
	padding-right: 10px;
}

.csf-result-score {
	background: #10b981;
	color: white;
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	flex-shrink: 0;
}

.csf-result-price {
	margin-bottom: 15px;
}

.csf-price {
	font-size: 20px;
	font-weight: 700;
	color: #059669;
}

.csf-price-fallback {
	color: #6b7280;
	text-decoration: underline;
	font-size: 14px;
}

.csf-price-fallback:hover {
	color: #059669;
}

.csf-result-title {
	flex: 1;
}

.csf-result-title h4 {
	margin: 0 0 4px;
	font-size: 20px;
	color: #1f2937;
}

.csf-result-title .csf-brand {
	font-weight: 600;
	color: #3b82f6;
}

.csf-result-score {
	background: #10b981;
	color: #fff;
	padding: 6px 12px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 18px;
	min-width: 60px;
	text-align: center;
}

.csf-result-reasons {
	margin: 16px 0;
	padding-left: 20px;
}

.csf-result-reasons li {
	color: #4b5563;
	margin-bottom: 6px;
	font-size: 15px;
}

.csf-result-specs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 16px 0;
}

.csf-spec-badge {
	display: inline-flex;
	align-items: center;
	background: #f3f4f6;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 13px;
	color: #4b5563;
	font-weight: 500;
}

.csf-crash-test-badge {
	background: linear-gradient(135deg, #4CAF50, #45a049);
	color: white;
	font-weight: 600;
	box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
	font-size: 12px;
	line-height: 1.2;
	padding: 6px 10px;
	white-space: nowrap;
}

.csf-spec-badge.csf-badge-highlight {
	background: #dbeafe;
	color: #1e40af;
}

.csf-result-review {
	margin-top: 16px;
}

.csf-review-badge {
	display: inline-block;
	background: #fef3c7;
	color: #92400e;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.2s;
}

.csf-review-badge:hover {
	background: #fde68a;
	text-decoration: none;
}

.csf-result-review {
	margin-bottom: 15px;
}

.csf-review-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: linear-gradient(135deg, #fbbf24, #f59e0b);
	color: white;
	padding: 6px 12px;
	border-radius: 20px;
	text-decoration: none;
	font-size: 12px;
	font-weight: 600;
	transition: transform 0.2s;
}

.csf-review-badge:hover {
	transform: scale(1.05);
	text-decoration: none;
	color: white;
}

.csf-review-icon {
	font-size: 14px;
}

.csf-review-score {
	background: rgba(255, 255, 255, 0.2);
	padding: 2px 6px;
	border-radius: 10px;
	font-size: 11px;
}

.csf-result-cta {
	margin-top: auto;
}

.csf-btn-secondary {
	background: #6b7280;
	color: white;
}

.csf-btn-secondary:hover {
	background: #4b5563;
	color: white;
}

.csf-cta-button {
	display: inline-block;
	background: #f59e0b;
	color: #fff;
	padding: 12px 24px;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	transition: background 0.2s;
	text-align: center;
}

.csf-cta-button:hover {
	background: #d97706;
	text-decoration: none;
	color: #fff;
}

.csf-amazon-data {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e5e7eb;
}

.csf-price {
	font-size: 24px;
	font-weight: 700;
	color: #1f2937;
}

.csf-price-updated {
	font-size: 12px;
	color: #9ca3af;
	margin-top: 4px;
}

/* AI Recommendations */
.csf-ai-recommendation {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 8px;
	padding: 16px;
	margin: 16px 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	box-shadow: 0 4px 6px rgba(102, 126, 234, 0.15);
}

.csf-ai-brand {
	font-size: 12px;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.9);
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1.2;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	padding-bottom: 6px;
}

.csf-ai-recommendation p {
	color: white;
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	font-weight: 500;
}

.csf-ai-reason {
	background: #f3f4f6;
	border-left: 3px solid #667eea;
	padding: 10px 12px;
	margin: 12px 0;
	font-size: 13px;
	color: #4b5563;
	border-radius: 4px;
}

.csf-ai-label {
	font-weight: 600;
	color: #667eea;
	margin-right: 6px;
}

/* Compare Button */
.csf-compare-btn {
	background: #8b5cf6;
	color: white;
	padding: 8px 16px;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	margin-left: 10px;
	display: inline-block;
	text-align: center;
	min-width: 100px;
}

.csf-compare-btn:hover {
	background: #7c3aed;
	transform: translateY(-1px);
}

.csf-compare-btn.selected {
	background: #dc2626;
}

/* CTA Container */
.csf-result-cta {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 15px;
	align-items: center;
}

.csf-cta-button {
	width: 100%;
	background: #3b82f6;
	color: white;
	padding: 12px 20px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	text-align: center;
	text-decoration: none;
	display: block;
}

.csf-cta-button:hover {
	background: #2563eb;
	transform: translateY(-1px);
	text-decoration: none;
	color: white;
}

/* No Results */
.csf-no-results {
	text-align: center;
	padding: 40px 20px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	margin-top: 30px;
}

.csf-no-results p {
	color: #991b1b;
	font-size: 16px;
	margin: 0;
}

/* FAQ Section */
.csf-faq {
	margin-top: 60px;
	padding-top: 40px;
	border-top: 2px solid #e5e7eb;
}

.csf-faq h2 {
	font-size: 28px;
	margin-bottom: 30px;
	color: #1f2937;
}

.csf-faq-item {
	margin-bottom: 24px;
}

.csf-faq-item h3 {
	font-size: 18px;
	color: #374151;
	margin-bottom: 8px;
	font-weight: 600;
}

.csf-faq-item p {
	color: #6b7280;
	line-height: 1.6;
	margin: 0;
}

/* Shortcode Styles */
.carseat-finder-shortcode {
	margin: 20px 0;
}

.csf-shortcode-title {
	margin-bottom: 20px;
	font-size: 28px;
	color: #1f2937;
	font-weight: 700;
	text-align: center;
}

/* Compact Mode */
.csf-compact-mode .csf-step h3 {
	font-size: 20px;
	margin-bottom: 12px;
}

.csf-compact-mode .csf-step-description {
	font-size: 14px;
	margin-bottom: 16px;
}

.csf-compact-mode .csf-form-row {
	margin-bottom: 16px;
}

.csf-compact-mode .csf-btn {
	padding: 10px 20px;
	font-size: 14px;
}

.csf-compact-mode .csf-help-text {
	font-size: 12px;
	margin-top: 4px;
}

/* Elementor Integration */
.csf-compact-mode .csf-progress-indicator {
	margin-bottom: 20px;
	padding: 15px 0;
}

.csf-compact-mode .csf-progress-step {
	max-width: 100px;
}

.csf-compact-mode .csf-progress-number {
	width: 32px;
	height: 32px;
	font-size: 14px;
}

.csf-compact-mode .csf-progress-label {
	font-size: 11px;
	margin-top: 6px;
}

.csf-compact-mode .csf-form {
	padding: 20px;
}

.csf-compact-mode .csf-form-row label {
	font-size: 14px;
}

.csf-compact-mode .csf-form-row input[type="text"],
.csf-compact-mode .csf-form-row select {
	padding: 8px 12px;
	font-size: 14px;
}

/* Elementor Widget Container */
.elementor-widget-shortcode .carseat-finder-shortcode {
	margin: 0;
	padding: 0;
}

.elementor-widget-shortcode .csf-compact-mode {
	background: transparent;
	box-shadow: none;
	border: none;
}

/* Elementor Mode - Ultra Compact */
.carseat-finder-shortcode.csf-elementor-mode {
	background: transparent !important;
	box-shadow: none !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.carseat-finder-shortcode.csf-elementor-mode .carseat-finder-wrap {
	background: transparent !important;
	box-shadow: none !important;
	border: none !important;
	padding: 15px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-progress-indicator {
	margin-bottom: 12px !important;
	padding: 8px 0 !important;
	background: #f8fafc !important;
	border-radius: 6px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-progress-step {
	max-width: 70px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-progress-number {
	width: 24px !important;
	height: 24px !important;
	font-size: 11px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-progress-label {
	font-size: 9px !important;
	margin-top: 3px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-step h3 {
	font-size: 16px !important;
	margin-bottom: 8px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-step-description {
	font-size: 12px !important;
	margin-bottom: 10px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-form-row {
	margin-bottom: 10px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-form-row label {
	font-size: 12px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-form-row input[type="text"],
.carseat-finder-shortcode.csf-elementor-mode .csf-form-row select {
	padding: 5px 8px !important;
	font-size: 12px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-btn {
	padding: 6px 12px !important;
	font-size: 12px !important;
}

.carseat-finder-shortcode.csf-elementor-mode .csf-help-text {
	font-size: 10px !important;
	margin-top: 2px !important;
	padding: 4px 6px !important;
}

/* Responsive */
@media (max-width: 640px) {
	.carseat-finder-wrap {
		padding: 15px;
	}

	.csf-form {
		padding: 20px;
	}

	.csf-step h3 {
		font-size: 20px;
	}

	.csf-form-actions {
		flex-direction: column;
		gap: 10px;
	}

	.csf-btn {
		width: 100%;
	}

	.csf-btn-back {
		margin-right: 0;
	}

	.csf-result-header {
		flex-direction: column;
		gap: 12px;
	}

	/* Mobile image optimization */
	.csf-result-image {
		min-height: 200px;
		max-height: 300px;
		padding: 12px;
		overflow: visible;
	}

	.csf-result-image img {
		max-width: 100%;
		max-height: 100%;
		width: auto;
		height: auto;
		object-fit: contain;
		object-position: center;
		display: block;
		margin: 0 auto;
	}
	
	.csf-result-image img[alt*="seggiolino"],
	.csf-result-image img[alt*="car seat"],
	.csf-result-image img[alt*="baby seat"] {
		max-width: 100%;
		max-height: 100%;
		object-fit: contain;
		object-position: center;
	}

	/* Mobile CTA buttons */
	.csf-result-cta {
		align-items: center;
		gap: 8px;
	}

	.csf-compare-btn {
		width: 100%;
		margin-left: 0;
		margin-top: 8px;
	}

	.csf-result-score {
		align-self: flex-start;
	}
}


