/**
 * MCK Smart Guide widget styles
 *
 * Companion stylesheet for smart-guide-widget.js. Self-contained: every
 * rule is rooted at `.mck-sg-widget`, which sgMarkActive() adds to the
 * widget container when a smart_guide form boots.
 *
 * The container keeps its #mck-booking-widget id (the JS engine needs
 * it), so booking-widget.css still technically matches it. The first
 * block below explicitly neutralizes the booking-widget.css rules that
 * would otherwise bleed into Smart Guide — its 560px max-width cap and
 * its h1-h6 `all: unset` reset. Everything else here is namespaced and
 * doesn't need to fight for specificity.
 *
 * Design inspiration: Contractor Commerce HVAC journey — big
 * illustrations, big buttons, one question per screen, generous
 * whitespace, mobile-first.
 *
 * @package MCK_Lead_Suite
 */

/* ════════════════════════════════════════════════════════════════════
   0. Override booking-widget.css bleed
   The container has both #mck-booking-widget and .mck-sg-widget, so
   `#mck-booking-widget.mck-sg-widget` (specificity 1-1-0) beats every
   booking-widget.css rule scoped at `#mck-booking-widget` (1-0-0) or
   `#mck-booking-widget h2` (1-0-1).
   ════════════════════════════════════════════════════════════════════ */

#mck-booking-widget.mck-sg-widget {
	max-width: 100%;
	width: 100%;
	margin: 0 auto;
}

.mck-sg-widget-parent {
	width: 100%;
	max-width: 100%;
}

/* Re-establish a sane baseline for headings inside Smart Guide. The
   booking-widget reset does `#mck-booking-widget h1..h6 { all: unset }`;
   these rules win it back at 1-1-1 specificity. */
#mck-booking-widget.mck-sg-widget h1,
#mck-booking-widget.mck-sg-widget h2,
#mck-booking-widget.mck-sg-widget h3,
#mck-booking-widget.mck-sg-widget h4 {
	display: block;
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-weight: 700;
	color: #1f2937;
	line-height: 1.25;
	box-sizing: border-box;
}

/* Heading font sizes — must be set on the #id.class h2 selector so they
   beat the `all: unset` reset. Plain `.mck-sg-widget .bw-sg-q-title`
   would lose, since the reset is 1-0-1 and the class pair is 0-1-1. */
#mck-booking-widget.mck-sg-widget h2.bw-sg-q-title,
#mck-booking-widget.mck-sg-widget h2.bw-sg-intro-title,
#mck-booking-widget.mck-sg-widget h2.bw-sg-analyzing-title,
#mck-booking-widget.mck-sg-widget h2.bw-sg-results-title,
#mck-booking-widget.mck-sg-widget h2.bw-sg-fallback-title {
	font-size: 2rem;
	font-weight: 700;
	margin: 0 0 12px;
}
#mck-booking-widget.mck-sg-widget h2.bw-sg-intro-title {
	font-size: 2.25rem;
}
/* Analyzing title gets extra breathing room before the phase label */
#mck-booking-widget.mck-sg-widget h2.bw-sg-analyzing-title {
	margin: 0 0 28px;
}
@media (max-width: 540px) {
	#mck-booking-widget.mck-sg-widget h2.bw-sg-q-title,
	#mck-booking-widget.mck-sg-widget h2.bw-sg-intro-title,
	#mck-booking-widget.mck-sg-widget h2.bw-sg-analyzing-title,
	#mck-booking-widget.mck-sg-widget h2.bw-sg-results-title,
	#mck-booking-widget.mck-sg-widget h2.bw-sg-fallback-title {
		font-size: 1.5rem;
	}
}

/* ════════════════════════════════════════════════════════════════════
   1. Root + box model
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget,
.mck-sg-widget * ,
.mck-sg-widget *::before,
.mck-sg-widget *::after {
	box-sizing: border-box;
}

.mck-sg-widget {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	line-height: 1.5;
	color: #1f2937;
}

.bw-sg-root {
	width: 100%;
}

/* ════════════════════════════════════════════════════════════════════
   2. Step containers
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-intro,
.mck-sg-widget .bw-sg-question,
.mck-sg-widget .bw-sg-analyzing,
.mck-sg-widget .bw-sg-results {
	text-align: center;
	padding: 24px 20px;
	max-width: 720px;
	margin: 0 auto;
}

.mck-sg-widget .bw-sg-results {
	max-width: 1100px;
}

@media (max-width: 540px) {
	.mck-sg-widget .bw-sg-intro,
	.mck-sg-widget .bw-sg-question,
	.mck-sg-widget .bw-sg-analyzing,
	.mck-sg-widget .bw-sg-results {
		padding: 16px 12px;
	}
}

.mck-sg-widget .bw-sg-illustration {
	display: block;
	width: 120px;
	height: auto;
	margin: 0 auto 24px;
}

.mck-sg-widget .bw-sg-illustration-sm {
	display: block;
	width: 80px;
	height: auto;
	margin: 0 auto 16px;
}

/* ════════════════════════════════════════════════════════════════════
   3. Intro screen
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-intro-title {
	font-size: 2.25rem;
	font-weight: 700;
	color: #1f2937;
	margin: 0 0 12px;
	line-height: 1.15;
}

.mck-sg-widget .bw-sg-intro-sub {
	font-size: 1.0625rem;
	color: #4b5563;
	margin: 0 0 28px;
	line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════════
   4. Question screen
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-q-title {
	font-size: 2rem;
	font-weight: 700;
	color: #1f2937;
	margin: 0 0 10px;
	line-height: 1.25;
}

.mck-sg-widget .bw-sg-q-sub {
	font-size: 1.0625rem;
	color: #6b7280;
	margin: 0 0 40px;
	line-height: 1.5;
}

@media (max-width: 540px) {
	.mck-sg-widget .bw-sg-q-title { font-size: 1.5rem; }
	.mck-sg-widget .bw-sg-q-sub   { font-size: 1rem; margin-bottom: 28px; }
}

/* ════════════════════════════════════════════════════════════════════
   5. Pill option buttons
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-options {
	display: grid;
	gap: 14px;
	margin: 0 auto 28px;
	max-width: 760px;
	/* Container-driven: pills sit side by side when there's room, wrap
	   to a single column on narrow embeds / phones. */
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* 2-option steps (e.g. Yes/No) stay 50/50 even when narrow-ish */
.mck-sg-widget .bw-sg-options-2 {
	grid-template-columns: 1fr 1fr;
	max-width: 520px;
}

.mck-sg-widget .bw-sg-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 22px 16px;
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #1f2937;
	transition: border-color 0.15s, background 0.15s, transform 0.05s;
	min-height: 96px;
	gap: 8px;
	text-align: center;
}

.mck-sg-widget .bw-sg-option:hover {
	border-color: var(--bw-color, #b91c1c);
	background: #f9fafb;
}

.mck-sg-widget .bw-sg-option:active {
	transform: scale(0.98);
}

.mck-sg-widget .bw-sg-option-selected {
	border-color: var(--bw-color, #b91c1c);
	background: color-mix(in srgb, var(--bw-color, #b91c1c) 8%, #fff);
}

/* SVG icon (inline, via mckIcons store) */
.mck-sg-widget .bw-sg-option-icon {
	display: inline-flex;
	width: 48px;
	height: 48px;
	color: var(--bw-color, #b91c1c);
}
.mck-sg-widget .bw-sg-option-icon svg {
	width: 100%;
	height: 100%;
}

/* image-url icon variant */
.mck-sg-widget .bw-sg-option-icon-img {
	width: 56px;
	height: 56px;
	object-fit: contain;
	margin-bottom: 4px;
}

.mck-sg-widget .bw-sg-option-label {
	font-weight: 700;
	font-size: 1.0625rem;
}

.mck-sg-widget .bw-sg-option-desc {
	font-size: 0.8125rem;
	color: #6b7280;
	font-weight: 400;
	line-height: 1.4;
}

/* ════════════════════════════════════════════════════════════════════
   6. Contact + Address forms
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-contact {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 480px;
	margin: 0 auto 28px;
	text-align: left;
}

.mck-sg-widget .bw-sg-contact-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

/* Address row: street is full-width above; city / state / zip share a row */
.mck-sg-widget .bw-sg-contact .bw-sg-contact-row {
	grid-template-columns: 2fr 0.7fr 1fr;
}

/* Contact step: name / email / phone in a 2x2 grid.
     [First name] [Last name]
     [Email]      [Phone]
   Collapses to one column on narrow embeds / phones. */
.mck-sg-widget .bw-sg-contact-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	max-width: 560px;
	margin: 0 auto 28px;
	text-align: left;
}
@media (max-width: 540px) {
	.mck-sg-widget .bw-sg-contact-grid {
		grid-template-columns: 1fr;
	}
}

/* SG form inputs — self-contained styling (padding, border, radius,
   focus ring). Matches the look of the standard widget inputs. */
.mck-sg-widget .bw-input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	font-family: inherit;
	color: #1f2937;
	background: #fff;
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.mck-sg-widget .bw-input::placeholder {
	color: #9ca3af;
}

.mck-sg-widget .bw-input:focus {
	border-color: var(--bw-color, #b91c1c);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--bw-color, #b91c1c) 15%, transparent);
}

.mck-sg-widget .bw-input.bw-invalid {
	border-color: #dc2626;
}

.mck-sg-widget .bw-sg-address-field {
	position: relative;
}

/* ════════════════════════════════════════════════════════════════════
   7. Navigation row (Back / Next / Skip)
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-nav {
	display: flex;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.mck-sg-widget .bw-sg-cta,
.mck-sg-widget .bw-sg-next,
.mck-sg-widget .bw-sg-card-cta {
	background: var(--bw-color, #b91c1c);
	color: #fff;
	border: 0;
	padding: 14px 36px;
	border-radius: 10px;
	font-size: 1.0625rem;
	font-weight: 600;
	cursor: pointer;
	min-width: 180px;
	transition: opacity 0.15s, transform 0.05s;
}

.mck-sg-widget .bw-sg-cta:hover,
.mck-sg-widget .bw-sg-next:hover,
.mck-sg-widget .bw-sg-card-cta:hover {
	opacity: 0.9;
}

.mck-sg-widget .bw-sg-cta:active,
.mck-sg-widget .bw-sg-next:active {
	transform: scale(0.98);
}

.mck-sg-widget .bw-sg-cta:disabled,
.mck-sg-widget .bw-sg-next:disabled,
.mck-sg-widget .bw-sg-card-cta:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.mck-sg-widget .bw-sg-back,
.mck-sg-widget .bw-sg-skip {
	background: #fff;
	color: #4b5563;
	border: 1.5px solid #d1d5db;
	padding: 14px 28px;
	border-radius: 10px;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s;
}

.mck-sg-widget .bw-sg-back:hover,
.mck-sg-widget .bw-sg-skip:hover {
	background: #f9fafb;
}

/* ════════════════════════════════════════════════════════════════════
   8. Analyzing screen
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-analyzing-title {
	font-size: 2rem;
	font-weight: 700;
	color: #1f2937;
	margin: 0 0 14px;
	line-height: 1.2;
}

.mck-sg-widget .bw-sg-progress-label {
	font-size: 1.0625rem;
	color: #4b5563;
	margin-bottom: 18px;
	min-height: 1.4em;
	transition: opacity 0.2s;
}

.mck-sg-widget .bw-sg-progress-track {
	height: 10px;
	background: #e5e7eb;
	border-radius: 999px;
	overflow: hidden;
	max-width: 520px;
	margin: 0 auto;
}

.mck-sg-widget .bw-sg-progress-fill {
	height: 100%;
	background: var(--bw-color, #b91c1c);
	border-radius: 999px;
	transition: width 0.25s ease;
}

/* ════════════════════════════════════════════════════════════════════
   9. Results screen + GBB cards
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-results-title {
	font-size: 1.875rem;
	font-weight: 700;
	color: #1f2937;
	margin: 0 0 8px;
}

.mck-sg-widget .bw-sg-results-sub {
	font-size: 1rem;
	color: #6b7280;
	margin: 0 0 28px;
}

.mck-sg-widget .bw-sg-cards {
	display: grid;
	gap: 20px;
	margin: 0 auto;
	max-width: 1100px;
	/* Container-driven: 3 cards side by side whenever there's room for
	   ~260px each, otherwise wraps. Keys off the wrapper's own width. */
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.mck-sg-widget .bw-sg-card {
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 14px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	text-align: left;
	position: relative;
	transition: border-color 0.15s, transform 0.05s, box-shadow 0.15s;
}

.mck-sg-widget .bw-sg-card:hover {
	border-color: var(--bw-color, #b91c1c);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

/* Legacy "best" emphasis — old rules engine */
.mck-sg-widget .bw-sg-card-best {
	border-color: var(--bw-color, #b91c1c);
	box-shadow: 0 4px 14px rgba(185, 28, 28, 0.08);
}

/* Config engine: last tier in array gets emphasis styling; color driven by --sg-tier-color */
.mck-sg-widget .bw-sg-card-emphasis {
	border-color: var(--sg-tier-color, var(--bw-color, #b91c1c));
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.mck-sg-widget .bw-sg-card-badge {
	position: absolute;
	top: -10px;
	left: 16px;
	background: var(--bw-color, #b91c1c);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Legacy badge colors for old-engine cards */
.mck-sg-widget .bw-sg-card-good .bw-sg-card-badge { background: #6b7280; }
.mck-sg-widget .bw-sg-card-better .bw-sg-card-badge { background: #2563eb; }
.mck-sg-widget .bw-sg-card-best .bw-sg-card-badge { background: #16a34a; }

/* Config engine badge: inherit tier color from --sg-tier-color inline style */
.mck-sg-widget .bw-sg-card-badge-config {
	background: var(--sg-tier-color, var(--bw-color, #b91c1c));
}

.mck-sg-widget .bw-sg-card-image {
	width: 100%;
	height: 140px;
	object-fit: cover;
	border-radius: 10px;
	margin: 10px 0 14px;
}

.mck-sg-widget .bw-sg-card-name {
	font-size: 1.0625rem;
	font-weight: 700;
	color: #1f2937;
	margin: 0 0 12px;
	line-height: 1.3;
}

.mck-sg-widget .bw-sg-card-pricing {
	background: #f9fafb;
	border-radius: 10px;
	padding: 14px;
	margin-bottom: 14px;
}

.mck-sg-widget .bw-sg-card-monthly {
	display: flex;
	flex-direction: column;
	margin-bottom: 4px;
}

.mck-sg-widget .bw-sg-monthly-label {
	font-size: 0.75rem;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 600;
}

.mck-sg-widget .bw-sg-monthly-amount {
	font-size: 1.875rem;
	font-weight: 800;
	color: #1f2937;
	line-height: 1;
}

.mck-sg-widget .bw-sg-card-range {
	font-size: 0.875rem;
	color: #4b5563;
	font-weight: 600;
	margin-top: 6px;
}

.mck-sg-widget .bw-sg-card-finprint {
	font-size: 0.6875rem;
	color: #9ca3af;
	margin-top: 4px;
}

.mck-sg-widget .bw-sg-card-highlights {
	list-style: none;
	padding: 0;
	margin: 0 0 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mck-sg-widget .bw-sg-card-highlights li {
	font-size: 0.875rem;
	color: #1f2937;
	line-height: 1.4;
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.mck-sg-widget .bw-sg-card-highlights li::before {
	content: "\2713";
	color: #16a34a;
	font-weight: 700;
	flex: 0 0 auto;
	line-height: 1.4;
}

.mck-sg-widget .bw-sg-card-specs {
	margin-bottom: 16px;
	padding-top: 12px;
	border-top: 1px solid #e5e7eb;
}

.mck-sg-widget .bw-sg-card-spec {
	font-size: 0.8125rem;
	color: #6b7280;
	margin-bottom: 4px;
}

.mck-sg-widget .bw-sg-card-cta {
	margin-top: auto;
	width: 100%;
	padding: 12px 16px;
	font-size: 0.9375rem;
	min-width: 0;
}

.mck-sg-widget .bw-sg-results-disclaimer {
	margin: 24px auto 0;
	font-size: 0.75rem;
	color: #9ca3af;
	max-width: 720px;
	line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════════
   10. Fallback screen
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-fallback {
	padding: 24px;
}

.mck-sg-widget .bw-sg-fallback-title {
	font-size: 2rem;
	font-weight: 700;
	color: #1f2937;
	margin: 0 0 16px;
}

.mck-sg-widget .bw-sg-fallback-msg {
	font-size: 1.0625rem;
	color: #4b5563;
	margin: 0 0 24px;
	line-height: 1.5;
}

/* Phone block: renders only when the author enabled it and a number exists,
   so these rules never apply to an empty element. */
.mck-sg-widget .bw-sg-fallback-phone {
	font-size: 1.0625rem;
	color: #4b5563;
	margin: 0 0 24px;
	line-height: 1.5;
}

.mck-sg-widget .bw-sg-fallback-phone-label {
	color: #6b7280;
}

.mck-sg-widget .bw-sg-fallback-phone a {
	color: var(--bw-color, #b91c1c);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.mck-sg-widget .bw-sg-fallback-phone a:hover {
	text-decoration: underline;
}

/* Contact gate on the no-match screen: same grid as the contact step, only
   the surrounding spacing differs. */
.mck-sg-widget .bw-sg-fallback-contact {
	margin: 0 0 24px;
}

/* ════════════════════════════════════════════════════════════════════
   11. Loading state
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-loading {
	padding: 60px 20px;
	color: #9ca3af;
	font-size: 0.9375rem;
}

/* ════════════════════════════════════════════════════════════════════
   12. Config engine: attribute chips, more-options note, fallback card
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-card-attr-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.mck-sg-widget .bw-sg-attr-chip {
	display: inline-block;
	background: #f3f4f6;
	color: #374151;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
	border: 1px solid #e5e7eb;
	white-space: nowrap;
}

.mck-sg-widget .bw-sg-card-more {
	font-size: 0.8125rem;
	color: #6b7280;
	margin-top: 6px;
	font-style: italic;
}

/* Fallback tier card (tier.fallback === true): informational, no product */
.mck-sg-widget .bw-sg-card-fallback-msg {
	font-size: 0.9375rem;
	color: #4b5563;
	line-height: 1.5;
	padding: 16px 0;
	flex: 1;
}

/* ════════════════════════════════════════════════════════════════════
   13. Addon row (Task 4) — Amazon-style horizontal scroll
   ════════════════════════════════════════════════════════════════════ */

.mck-sg-widget .bw-sg-addons {
	margin-top: 32px;
	text-align: left;
}

.mck-sg-widget .bw-sg-addon-group {
	margin-bottom: 24px;
}

.mck-sg-widget .bw-sg-addon-group-label {
	font-size: 0.875rem;
	font-weight: 700;
	color: #374151;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 10px;
}

.mck-sg-widget .bw-sg-addon-row {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	padding-bottom: 8px;
	/* Prevent horizontal overflow from pushing page width */
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #d1d5db transparent;
}

.mck-sg-widget .bw-sg-addon-row::-webkit-scrollbar {
	height: 4px;
}
.mck-sg-widget .bw-sg-addon-row::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 999px;
}

.mck-sg-widget .bw-sg-addon-card {
	flex: 0 0 auto;
	width: 160px;
	background: #fff;
	border: 1.5px solid #e5e7eb;
	border-radius: 10px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	transition: border-color 0.15s;
}

.mck-sg-widget .bw-sg-addon-card:hover {
	border-color: var(--bw-color, #b91c1c);
}

.mck-sg-widget .bw-sg-addon-card-added {
	border-color: #16a34a;
	background: #f0fdf4;
}

.mck-sg-widget .bw-sg-addon-name {
	font-size: 0.8125rem;
	font-weight: 600;
	color: #1f2937;
	line-height: 1.3;
}

.mck-sg-widget .bw-sg-addon-price {
	font-size: 0.875rem;
	font-weight: 700;
	color: #374151;
}

.mck-sg-widget .bw-sg-addon-toggle {
	margin-top: auto;
	background: transparent;
	border: 1.5px solid var(--bw-color, #b91c1c);
	color: var(--bw-color, #b91c1c);
	font-size: 0.8125rem;
	font-weight: 600;
	padding: 6px 10px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.mck-sg-widget .bw-sg-addon-card-added .bw-sg-addon-toggle {
	background: #16a34a;
	border-color: #16a34a;
	color: #fff;
}

.mck-sg-widget .bw-sg-addon-toggle:hover {
	opacity: 0.85;
}
