/**
 * Fresh Home Cleaning Agency — premium layer.
 * Mobile drawer fixes, form wizard, app-style tab bar, polish.
 */

/* ---------------------------------------------------------
 * 1. Mobile drawer fix
 * Root cause: backdrop-filter on .fhc-header creates a containing
 * block, so the position:fixed nav drawer was trapped inside the
 * header. Disable the filter on mobile and lift the drawer.
 * ------------------------------------------------------- */
@media (max-width: 960px) {
	/* Keep the entire header stacking context above the body-level backdrop.
	 * Otherwise the backdrop paints over the drawer and makes it look blurred. */
	body.fhc-nav-open .fhc-header,
	body.fhc-nav-open.fhc-sticky .fhc-header {
		z-index: 12000 !important;
	}

	.fhc-header,
	body.fhc-sticky .fhc-header {
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
		background: var(--fhc-surface, #fff) !important;
	}

	.fhc-nav {
		background: var(--fhc-surface, #fff) !important;
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
		z-index: 12000 !important;
		box-shadow: -24px 0 60px rgba(0, 0, 0, .25);
		overflow-y: auto;
		overscroll-behavior: contain;
		padding-bottom: 32px;
	}

	.fhc-nav-backdrop {
		z-index: 11900 !important;
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
		background: rgba(11, 18, 32, .55) !important;
	}

	/* Nothing behind the drawer should be blurred or filtered. */
	body.fhc-nav-open .fhc-site,
	body.fhc-nav-open #page,
	body.fhc-nav-open .fhc-main { filter: none !important; }

	.fhc-menu a {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 14px 4px;
		border-bottom: 1px solid var(--fhc-border, rgba(0, 0, 0, .08));
		font-weight: 600;
	}

	.fhc-menu a::after {
		content: "\f054"; /* chevron-right */
		font-family: "Font Awesome 6 Free";
		font-weight: 900;
		font-size: .72rem;
		opacity: .45;
	}

	.fhc-nav__cta { margin-top: 18px; width: 100%; justify-content: center; }

	.fhc-nav__panel { margin-top: 18px; display: grid; gap: 6px; }

	.fhc-nav__panel-link {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 12px 14px;
		border-radius: 14px;
		background: var(--fhc-surface-soft, rgba(0, 0, 0, .04));
		font-size: .92rem;
		font-weight: 600;
		text-decoration: none;
		color: inherit;
	}

	.fhc-nav__panel-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.fhc-nav__panel-link .fa-solid.fa-chevron-right { flex: none; font-size: .7rem; opacity: .4; }
	.fhc-nav__panel-link:hover { background: var(--fhc-primary, #17b978); color: var(--fhc-on-primary, #fff); }

	/* Floating CTAs must not cover the drawer. */
	body.fhc-nav-open .fhc-whatsapp-float,
	body.fhc-nav-open .fhc-tabbar { display: none !important; }
}

@media (min-width: 961px) {
	.fhc-nav__panel { display: none; }
}

/* ---------------------------------------------------------
 * 2. Form wizard
 * ------------------------------------------------------- */
.fhc-wizard__head { margin-bottom: 18px; }

.fhc-wizard__bar {
	height: 8px;
	border-radius: 999px;
	background: var(--fhc-surface-soft, rgba(0, 0, 0, .07));
	overflow: hidden;
}

.fhc-wizard__bar span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--fhc-primary, #17b978), var(--fhc-accent, #0f9b6c));
	transition: width .35s ease;
}

.fhc-wizard__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-top: 10px;
	font-size: .85rem;
}

.fhc-wizard__label { font-weight: 700; }
.fhc-wizard__count { color: var(--fhc-muted-fg, #6b7280); }

.fhc-wizard-step { display: none; }
.fhc-wizard-step.is-active { display: block; animation: fhc-fade .25s ease both; }

@keyframes fhc-fade {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

.fhc-wizard__nav {
	display: flex;
	gap: 12px;
	margin-top: 22px;
}

.fhc-wizard__nav {
	align-items: stretch;
	flex-wrap: nowrap;
}

.fhc-wizard__nav .fhc-btn { flex: 1 1 0; min-width: 0; justify-content: center; }
.fhc-wizard__nav .fhc-btn--ghost { flex: 0 0 auto; padding-left: 18px; padding-right: 18px; }

/* The submit button lives inside the nav row on the final step. */
.fhc-wizard__submit {
	flex: 1 1 0;
	min-width: 0;
	margin: 0 !important;
	display: flex;
}

.fhc-wizard__submit .fhc-btn { width: 100%; justify-content: center; }

/* Hidden steps/buttons must never take up space. */
.fhc-wizard__nav [hidden],
.fhc-wizard-step[hidden],
.fhc-field[hidden],
.fhc-quote-box[hidden],
[hidden] { display: none !important; }

.fhc-wizard__summary {
	display: grid;
	gap: 10px;
	padding: 18px;
	border-radius: 18px;
	background: var(--fhc-review-bg, #f6f8fb);
	color: var(--fhc-review-fg, #0c2340);
	border: 1px solid var(--fhc-review-border, rgba(0, 0, 0, .08));
}

.fhc-wizard__summary-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	font-size: .92rem;
	padding-bottom: 8px;
	border-bottom: 1px dashed var(--fhc-review-border, rgba(0, 0, 0, .1));
}

.fhc-wizard__summary-row:last-child { border-bottom: 0; padding-bottom: 0; }
.fhc-wizard__summary-row dt { color: var(--fhc-review-label, #5a6474); }
.fhc-wizard__summary-row dd { margin: 0; font-weight: 600; text-align: right; color: var(--fhc-review-fg, #0c2340); }

.fhc-field.has-error input,
.fhc-field.has-error select,
.fhc-field.has-error textarea { border-color: #e5484d !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, .15); }

.fhc-field__error { display: block; margin-top: 6px; color: #e5484d; font-size: .8rem; font-weight: 600; }

/* Estimate box sticks to the last booking step */
.fhc-form--booking .fhc-quote-box { border-radius: 18px; }

/* ---------------------------------------------------------
 * 3. App-style bottom tab bar (mobile only)
 * ------------------------------------------------------- */
.fhc-tabbar { display: none; }

@media (max-width: 782px) {
	.fhc-tabbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9000;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		align-items: end;
		gap: 2px;
		padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
		background: var(--fhc-surface, #fff);
		border-top: 1px solid var(--fhc-border, rgba(0, 0, 0, .08));
		box-shadow: 0 -10px 30px rgba(0, 0, 0, .1);
		transition: transform .3s ease;
	}

	.fhc-tabbar.is-hidden { transform: translateY(120%); }

	.fhc-tabbar__item {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 4px;
		padding: 4px 2px;
		font-size: .66rem;
		font-weight: 700;
		text-decoration: none;
		color: var(--fhc-muted-fg, #6b7280);
	}

	.fhc-tabbar__item i { font-size: 1.05rem; }
	.fhc-tabbar__item.is-active { color: var(--fhc-primary, #17b978); }

	.fhc-tabbar__book {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 52px;
		height: 52px;
		margin-top: -26px;
		border-radius: 50%;
		background: linear-gradient(135deg, var(--fhc-primary, #17b978), var(--fhc-accent, #0f9b6c));
		color: var(--fhc-on-primary, #fff);
		box-shadow: 0 12px 28px rgba(23, 185, 120, .45);
	}

	.fhc-tabbar__item--book { color: var(--fhc-primary, #17b978); }
	.fhc-tabbar__book i { font-size: 1.25rem; }

	body { padding-bottom: 72px; }
	.fhc-whatsapp-float { bottom: 92px !important; }
}

/* ---------------------------------------------------------
 * 4. Premium polish
 * ------------------------------------------------------- */
.fhc-btn { border-radius: var(--fhc-radius-pill, 999px); transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.fhc-btn--primary { box-shadow: 0 12px 28px -14px rgba(23, 185, 120, .8); }
.fhc-btn:hover { transform: translateY(-1px); }

.fhc-form input[type="text"],
.fhc-form input[type="email"],
.fhc-form input[type="tel"],
.fhc-form input[type="number"],
.fhc-form input[type="date"],
.fhc-form input[type="password"],
.fhc-form select,
.fhc-form textarea {
	border-radius: 14px;
	padding: 12px 14px;
}

.fhc-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border-radius: 999px;
	border: 1px solid var(--fhc-border, rgba(0, 0, 0, .1));
	background: var(--fhc-surface, #fff);
	cursor: pointer;
	transition: border-color .18s ease, background .18s ease;
}

.fhc-check:has(input:checked) {
	border-color: var(--fhc-primary, #17b978);
	background: rgba(23, 185, 120, .1);
}

.fhc-card,
.fhc-service,
.fhc-package { border-radius: 22px; }

/* ---------------------------------------------------------
 * 4. Wizard step sizing — short steps (e.g. "When") kept the
 *    same width/height as the rest of the flow.
 * ------------------------------------------------------- */
.fhc-booking-layout > .fhc-form,
.fhc-form[data-fhc-wizard] {
	width: 100%;
	min-width: 0;
	max-width: 760px;
	box-sizing: border-box;
}

.fhc-form[data-fhc-wizard] .fhc-wizard-step.is-active {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-height: 460px;
	width: 100%;
}

.fhc-form[data-fhc-wizard] .fhc-wizard-step .fhc-field,
.fhc-form[data-fhc-wizard] .fhc-wizard-step .fhc-field-group {
	width: 100%;
	max-width: none;
}

.fhc-form[data-fhc-wizard] .fhc-wizard-step .fhc-field input,
.fhc-form[data-fhc-wizard] .fhc-wizard-step .fhc-field select,
.fhc-form[data-fhc-wizard] .fhc-wizard-step .fhc-field textarea {
	width: 100%;
	box-sizing: border-box;
}

.fhc-form[data-fhc-wizard] .fhc-wizard-step textarea { min-height: 96px; }

@media (max-width: 600px) {
	.fhc-form[data-fhc-wizard] .fhc-wizard-step.is-active { min-height: 0; }
}

/* ---------------------------------------------------------
 * 5. Smarter extras / add-on cards
 * ------------------------------------------------------- */
.fhc-check--card {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	padding: 14px 16px 14px 44px;
	border-radius: 16px;
	border: 1px solid var(--fhc-border, rgba(0, 0, 0, .1));
	background: var(--fhc-surface, #fff);
	cursor: pointer;
	text-align: left;
	transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.fhc-check--card:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15, 23, 42, .07); }

.fhc-check--card input[type="checkbox"] {
	position: absolute;
	left: 14px;
	top: 15px;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--fhc-primary, #17b978);
}

.fhc-check--card .fhc-check__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.fhc-check--card .fhc-check__label {
	font-weight: 600;
	line-height: 1.3;
}

.fhc-check--card .fhc-check__price {
	font-size: .85rem;
	font-weight: 700;
	color: var(--fhc-primary, #17b978);
}

.fhc-check--card.is-checked,
.fhc-check--card:has(input:checked) {
	border-color: var(--fhc-primary, #17b978);
	background: rgba(23, 185, 120, .09);
	box-shadow: inset 0 0 0 1px var(--fhc-primary, #17b978);
}

.fhc-check--card:focus-visible {
	outline: 2px solid var(--fhc-primary, #17b978);
	outline-offset: 2px;
}

/* ---------------------------------------------------------
 * Optional extras — sub-categories + custom tick controls
 * ------------------------------------------------------- */
.fhc-extras {
	display: block;
	margin-top: 6px;
}

.fhc-extras__group + .fhc-extras__group { margin-top: 18px; }

.fhc-extras__group { display: block; }

.fhc-extras__heading {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px;
	font-size: .74rem;
	font-weight: 800;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--fhc-muted, #5a6474);
}

.fhc-extras__heading::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--fhc-border, rgba(15, 23, 42, .12));
}

.fhc-extras .fhc-checkgroup,
.fhc-checkgroup {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 10px;
	align-items: stretch;
}

.fhc-checkgroup .fhc-check.fhc-check--card {
	position: relative;
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 14px 16px;
	border: 1.5px solid var(--fhc-border, rgba(15, 23, 42, .12));
	border-radius: 16px;
	background: var(--fhc-white, #fff);
	box-shadow: none;
	cursor: pointer;
	text-align: left;
	box-sizing: border-box;
	transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.fhc-checkgroup .fhc-check.fhc-check--card:hover {
	border-color: var(--fhc-mint, #17b978);
	background: rgba(var(--fhc-primary-rgb, 23, 185, 120), .05);
	transform: translateY(-1px);
}

/* Native input is visually hidden but still focusable / accessible. */
.fhc-checkgroup .fhc-check.fhc-check--card > input[type="checkbox"],
.fhc-checkgroup .fhc-check.fhc-check--card > input[type="radio"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	opacity: 0;
	pointer-events: none;
	appearance: none;
	-webkit-appearance: none;
}

.fhc-checkgroup .fhc-check.fhc-check--card > .fhc-check__box {
	flex: 0 0 auto;
	position: relative;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	border: 1.5px solid var(--fhc-border, rgba(15, 23, 42, .22));
	border-radius: 6px;
	background: var(--fhc-white, #fff);
	transition: border-color .18s ease, background .18s ease;
}

.fhc-checkgroup .fhc-check.fhc-check--card > input[type="radio"] + .fhc-check__box { border-radius: 50%; }

.fhc-checkgroup .fhc-check.fhc-check--card > .fhc-check__box::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(.4);
	opacity: 0;
	transition: opacity .15s ease, transform .15s ease;
}

.fhc-checkgroup .fhc-check.fhc-check--card > input:checked + .fhc-check__box {
	border-color: var(--fhc-mint, #17b978);
	background: var(--fhc-mint, #17b978);
}

.fhc-checkgroup .fhc-check.fhc-check--card > input:checked + .fhc-check__box::after {
	opacity: 1;
	transform: rotate(45deg) scale(1);
}

.fhc-checkgroup .fhc-check.fhc-check--card > input:focus-visible + .fhc-check__box {
	outline: 2px solid var(--fhc-mint, #17b978);
	outline-offset: 3px;
}

.fhc-checkgroup .fhc-check.fhc-check--card .fhc-check__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.fhc-checkgroup .fhc-check.fhc-check--card .fhc-check__label {
	font-weight: 700;
	font-size: .93rem;
	line-height: 1.35;
	color: var(--fhc-navy, #101a34);
}

.fhc-checkgroup .fhc-check.fhc-check--card .fhc-check__price {
	font-size: .85rem;
	font-weight: 700;
	color: var(--fhc-mint-dark, #0f8f5c);
}

.fhc-checkgroup .fhc-check.fhc-check--card.is-checked,
.fhc-checkgroup .fhc-check.fhc-check--card:has(input:checked) {
	border-color: var(--fhc-mint, #17b978);
	background: rgba(var(--fhc-primary-rgb, 23, 185, 120), .09);
	box-shadow: 0 6px 18px rgba(var(--fhc-primary-rgb, 23, 185, 120), .16);
}

@media (max-width: 520px) {
	.fhc-extras .fhc-checkgroup,
	.fhc-checkgroup { grid-template-columns: 1fr; }
}
