/* ==========================================================================
   Find Your Scent Quiz
   ========================================================================== */

/* Force page title to sapphire blue (overrides ecosoap green) */
.page-id-19464 .page-title,
.page-id-19464 .entry-title,
.page-id-19464 h1,
.page-id-19464 .elementor-heading-title {
	color: #082567 !important;
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif !important;
}

.sj-quiz {
	max-width: 720px;
	margin: 0 auto;
	padding: 20px;
	font-family: 'Lora', Georgia, serif;
}

/* --- Progress bar --- */
.sj-quiz-progress {
	margin-bottom: 32px;
}

.sj-quiz-progress-bar {
	height: 4px;
	background: #e8e4dc;
	border-radius: 2px;
	overflow: hidden;
	margin-bottom: 12px;
}

.sj-quiz-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #082567, #db2876);
	border-radius: 2px;
	transition: width 0.4s ease;
}

.sj-quiz-steps {
	display: flex;
	justify-content: space-between;
	max-width: 200px;
	margin: 0 auto;
}

.sj-quiz-step {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	background: #e8e4dc;
	color: #999;
	transition: background 0.3s, color 0.3s;
}

.sj-quiz-step.is-active {
	background: #db2876;
	color: #fff;
}

.sj-quiz-step.is-done {
	background: #082567;
	color: #fff;
}

/* --- Panels --- */
.sj-quiz-panel {
	display: none;
	animation: sjQuizFadeIn 0.35s ease;
}

.sj-quiz-panel.is-active {
	display: block;
}

@keyframes sjQuizFadeIn {
	from { opacity: 0; transform: translateX(20px); }
	to   { opacity: 1; transform: translateX(0); }
}

.sj-quiz-question {
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif;
	font-size: 22px;
	font-weight: 700;
	color: #082567;
	margin: 0 0 6px;
	text-align: center;
}

.sj-quiz-hint {
	font-size: 14px;
	color: #888;
	text-align: center;
	margin: 0 0 24px;
}

/* --- Card grids --- */
.sj-quiz-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 14px;
}

.sj-quiz-cards--skin {
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.sj-quiz-cards--base {
	grid-template-columns: repeat(3, 1fr);
	max-width: 540px;
	margin: 0 auto;
}

/* --- Quiz cards (buttons) --- */
.sj-quiz-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 20px 16px;
	border-radius: 12px;
	border: 2px solid #e8e4dc;
	background: #fff;
	cursor: pointer;
	transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
	text-align: center;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.sj-quiz-card:hover {
	transform: scale(1.02);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.sj-quiz-card.is-selected {
	border-color: #db2876;
	box-shadow: 0 0 0 3px rgba(219, 40, 118, 0.18);
	transform: scale(1.02);
	position: relative;
}

.sj-quiz-card.is-selected::after {
	content: '\2713';
	position: absolute;
	top: 8px;
	right: 10px;
	width: 22px;
	height: 22px;
	background: #db2876;
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
}

.sj-quiz-card-icon {
	font-size: 32px;
	line-height: 1;
}

.sj-quiz-card-label {
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif;
	font-size: 15px;
	font-weight: 600;
	color: #082567;
}

.sj-quiz-card-notes {
	font-size: 12px;
	color: #888;
}

/* Mood cards: gradient accent */
.sj-quiz-card--mood {
	/* Fallback for iOS < 16.2 / browsers without color-mix() */
	background: linear-gradient(135deg, #fff 60%, #f0ecfa);
	border-color: #d4c8f0;
	/* Modern: dynamic per-card accent */
	background: linear-gradient(135deg, #fff 60%, color-mix(in srgb, var(--card-accent) 12%, white));
	border-color: color-mix(in srgb, var(--card-accent) 25%, white);
}

.sj-quiz-card--mood.is-selected {
	border-color: var(--card-accent);
	/* Fallback */
	box-shadow: 0 0 0 3px rgba(123, 104, 174, 0.2);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-accent) 20%, transparent);
}

.sj-quiz-card--mood.is-selected::after {
	background: var(--card-accent);
}

/* Scent cards: themed colors */
.sj-quiz-card--scent {
	background: var(--card-bg);
	border-color: var(--card-border);
}

.sj-quiz-card--scent .sj-quiz-card-label {
	color: var(--card-text);
}

.sj-quiz-card--scent.is-selected {
	border-color: var(--card-text);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-text) 15%, transparent);
}

.sj-quiz-card--scent.is-selected::after {
	background: var(--card-text);
}

/* --- Navigation --- */
.sj-quiz-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 32px;
	gap: 12px;
}

.sj-quiz-btn {
	padding: 13px 28px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: background 0.2s, opacity 0.2s;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	min-height: 44px;
}

.sj-quiz-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.sj-quiz-btn--back {
	background: #e8e4dc;
	color: #555;
}

.sj-quiz-btn--back:hover:not(:disabled) {
	background: #d8d4cc;
}

.sj-quiz-btn--next {
	background: linear-gradient(135deg, #082567 0%, #0a3280 100%);
	color: #fff;
	margin-left: auto;
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	box-shadow: 0 2px 8px rgba(8, 37, 103, 0.2);
}

.sj-quiz-btn--next:hover:not(:disabled) {
	background: linear-gradient(135deg, #db2876 0%, #c4226a 100%);
	box-shadow: 0 3px 12px rgba(219, 40, 118, 0.3);
}

/* --- Results header section --- */
.sj-results-heading {
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif;
	font-size: 30px;
	font-weight: 700;
	color: #082567;
	text-align: center;
	margin: 0 0 6px;
	letter-spacing: -0.02em;
	padding-bottom: 8px;
	border-bottom: 3px solid #db2876;
	display: inline-block;
}

/* Center the heading wrapper */
.sj-quiz-result-cards ~ .sj-results-heading,
.sj-quiz-results {
	text-align: center;
}

.sj-results-subheading {
	font-family: 'Lora', Georgia, serif;
	font-size: 15px;
	color: #666;
	text-align: center;
	margin: 10px 0 32px;
	font-style: italic;
}

.sj-quiz-results .sj-quiz-question {
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif;
	font-size: 26px;
	color: #082567;
}

.sj-quiz-result-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 24px;
	margin: 0 0 28px;
}

/* Product cards — bright blue border frame */
.sj-result-card {
	border-radius: 16px;
	overflow: hidden;
	border: 2px solid #0076e2;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0, 118, 226, 0.1), 0 1px 4px rgba(0, 0, 0, 0.04);
	display: flex;
	flex-direction: column;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.sj-result-card:hover {
	transform: translateY(-4px);
	border-color: #db2876;
	box-shadow: 0 8px 32px rgba(219, 40, 118, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* First card (best match) gets hot pink border */
.sj-result-card:first-child {
	border: 3px solid #db2876;
	box-shadow: 0 4px 24px rgba(219, 40, 118, 0.18), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.sj-result-card:first-child:hover {
	box-shadow: 0 8px 36px rgba(219, 40, 118, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Product image area */
.sj-result-card-image {
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, #fbfafd 0%, #f0ecfa 100%);
}

.sj-result-card-image img {
	width: 100%;
	height: 220px;
	object-fit: cover;
	display: block;
}

/* Fallback header (no image) */
.sj-result-card-header {
	padding: 28px 16px;
	text-align: center;
	position: relative;
	background: linear-gradient(135deg, #082567 0%, #0a3280 100%);
	color: #fff;
}

/* Rank badge — top-left overlay */
.sj-result-rank-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: #db2876;
	color: #fff;
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 5px 12px;
	border-radius: 20px;
	text-transform: uppercase;
	box-shadow: 0 2px 8px rgba(219, 40, 118, 0.35);
	z-index: 2;
}

/* Match % badge — top-right overlay */
.sj-result-match-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	background: rgba(8, 37, 103, 0.9);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #fff;
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif;
	font-size: 18px;
	font-weight: 700;
	padding: 6px 14px;
	border-radius: 12px;
	letter-spacing: -0.01em;
	box-shadow: 0 2px 10px rgba(8, 37, 103, 0.3);
	z-index: 2;
}

/* Product name + price row */
.sj-result-card-product-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 10px;
}

.sj-result-card-name {
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif;
	font-size: 17px;
	font-weight: 700;
	color: #082567;
	margin: 0;
	line-height: 1.3;
	flex: 1;
}

.sj-result-card-price {
	font-family: 'Lora', Georgia, serif;
	font-size: 18px;
	font-weight: 700;
	color: #db2876;
	white-space: nowrap;
}

.sj-result-card-body {
	padding: 18px 18px 12px;
	flex: 1;
}

/* Scent family pill */
.sj-result-card-family {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-family: 'Lora', Georgia, serif;
	font-size: 11px;
	font-weight: 600;
	margin-bottom: 6px;
	margin-right: 4px;
}

/* Category pill */
.sj-result-card-category-pill {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-family: 'Lora', Georgia, serif;
	font-size: 11px;
	font-weight: 600;
	background: rgba(8, 37, 103, 0.08);
	color: #082567;
	margin-bottom: 6px;
}

/* Concept / why-this-match */
.sj-result-card-concept {
	font-family: 'Lora', Georgia, serif;
	font-size: 13px;
	color: #444;
	line-height: 1.6;
	margin: 10px 0 12px;
}

.sj-result-concept-mark {
	color: #db2876;
	font-size: 14px;
	margin-right: 2px;
}

/* Oil notes */
.sj-result-card-oils {
	font-family: 'Lora', Georgia, serif;
	font-size: 12px;
	color: #777;
	margin: 0 0 8px;
	line-height: 1.5;
}

.sj-result-oils-label {
	font-weight: 600;
	color: #082567;
}

/* CTA footer */
.sj-result-card-footer {
	padding: 0 18px 18px;
}

.sj-result-card-cta {
	display: block;
	width: 100%;
	padding: 14px;
	border-radius: 10px;
	font-family: 'Everlo Sans', 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	border: none;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	min-height: 48px;
	line-height: 48px;
	padding: 0 14px;
	box-sizing: border-box;
}

.sj-result-card-cta--shop {
	background: linear-gradient(135deg, #082567 0%, #0a3280 100%);
	color: #fff;
	box-shadow: 0 3px 12px rgba(8, 37, 103, 0.25);
}

.sj-result-card-cta--shop:hover {
	background: linear-gradient(135deg, #db2876 0%, #c4226a 100%);
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(219, 40, 118, 0.3);
}

.sj-result-card-cta--soon {
	background: #f0ecfa;
	color: #999;
	cursor: default;
	box-shadow: none;
}

/* Actions row */
.sj-quiz-actions {
	display: flex;
	justify-content: center;
	gap: 14px;
	margin-top: 24px;
}

.sj-quiz-btn--retake {
	background: #fbfafd;
	color: #082567;
	border: 2px solid rgba(8, 37, 103, 0.15);
}

.sj-quiz-btn--retake:hover {
	background: #f0ecfa;
	border-color: #082567;
}

.sj-quiz-btn--share {
	background: #0076e2;
	color: #fff;
}

.sj-quiz-btn--share:hover {
	background: #005bb5;
}

/* --- Responsive --- */
@media (max-width: 480px) {
	.sj-quiz {
		padding: 12px;
	}

	.sj-quiz-question {
		font-size: 18px;
	}

	/* Force single-column on small phones for all card grids */
	.sj-quiz-cards,
	.sj-quiz-cards--skin,
	.sj-quiz-cards--base {
		grid-template-columns: 1fr;
	}

	.sj-quiz-card {
		padding: 14px 12px;
	}

	.sj-result-card-header {
		padding: 12px;
	}
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
	.sj-quiz-card,
	.sj-quiz-btn,
	.sj-result-card-cta,
	.sj-quiz-progress-fill,
	.sj-quiz-step {
		transition: none !important;
		animation: none !important;
	}

	.sj-quiz-panel {
		animation: none !important;
	}

	.sj-quiz-card:hover {
		transform: none;
	}
}
