/**
 * The Concierge — floating widget chrome (VISUAL SHELL ONLY).
 *
 * A persistent launcher on every page that opens the Concierge panel in place,
 * like a real agent widget — no page navigation. Presentational only; the panel
 * body is the shared `.hov-concierge` markup (panel.php), styled by the block's
 * style.css which the provider enqueues alongside this file.
 *
 * Tokens come from the theme (never hard-coded).
 */

.hov-concierge-widget {
	position: fixed;
	z-index: 9990;
	font-family: var( --wp--preset--font-family--body );

	/* How far the launcher (and desktop panel) sit off the bottom edge.
	   DEFAULT = ride low: a small gap that clears the iPhone home indicator.
	   That's the right spot when there is no in-page bottom nav — plain web
	   pages, and inside the Median app (the theme's web tab bar auto-hides there
	   and Median draws its own native bar below the webview).
	   When the theme's `.tabbar` IS on screen (app screens in a mobile browser),
	   widget.js measures it and lifts the launcher to sit just above it. */
	--hov-concierge-gap: 0.9rem;
	--hov-concierge-offset: calc( var( --hov-concierge-gap ) + env( safe-area-inset-bottom, 0px ) );
}

/* ── The floating launcher ─────────────────────────────────────────────────── */
.hov-concierge-widget__launcher {
	position: fixed;
	right: 1.25rem;
	bottom: var( --hov-concierge-offset );
	z-index: 9991;
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 1rem 0.5rem 0.5rem;
	background: #fff;
	border: 1px solid var( --wp--preset--color--linen, #ede7df );
	border-radius: 999px;
	box-shadow: 0 10px 30px rgba( 71, 72, 82, 0.22 ), 0 2px 8px rgba( 71, 72, 82, 0.12 );
	cursor: pointer;
	color: var( --wp--preset--color--outerspace, #474852 );
	font: inherit;
	transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.hov-concierge-widget__launcher:hover {
	transform: translateY( -1px );
	box-shadow: 0 14px 36px rgba( 71, 72, 82, 0.28 ), 0 3px 10px rgba( 71, 72, 82, 0.14 );
}

.hov-concierge-widget__launcher-label {
	font-family: var( --wp--preset--font-family--label, 'Public Sans', sans-serif );
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* The launcher crest (portrait or bell mark). */
.hov-concierge-widget__launcher .hov-concierge-crest {
	width: 2.4rem;
	height: 2.4rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	border-radius: 50%;
	overflow: hidden;
	background: var( --wp--preset--color--outerspace, #474852 );
	color: var( --wp--preset--color--soft-ivory, #f8f5f1 );
}

.hov-concierge-widget__launcher .hov-concierge-crest__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hov-concierge-widget__launcher .hov-concierge-crest__bell {
	width: 55%;
	height: 55%;
}

/* Reveal on scroll: the launcher stays out of the way on first paint (so it never
   covers a hero), then slides in once she scrolls into the page; it tucks away
   again when she scrolls back up past that point. `is-revealed` is toggled by
   widget.js from the scroll position. */
.hov-concierge-widget:not( .is-revealed ):not( .is-open ) .hov-concierge-widget__launcher {
	opacity: 0;
	transform: translateY( 1.5rem );
	pointer-events: none;
}

/* Hide the launcher while the panel is open. */
.hov-concierge-widget.is-open .hov-concierge-widget__launcher {
	opacity: 0;
	pointer-events: none;
}

/* ── Backdrop ──────────────────────────────────────────────────────────────── */
.hov-concierge-widget__backdrop {
	position: fixed;
	inset: 0;
	z-index: 9990;
	background: rgba( 44, 45, 52, 0.38 );
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.hov-concierge-widget.is-open .hov-concierge-widget__backdrop {
	opacity: 1;
	pointer-events: auto;
}

/* ── The panel ─────────────────────────────────────────────────────────────── */
.hov-concierge-widget__panel {
	position: fixed;
	z-index: 9992;
	right: 1.25rem;
	bottom: var( --hov-concierge-offset );
	width: min( 24rem, calc( 100vw - 2.5rem ) );
	max-height: min( 42rem, calc( 100vh - var( --hov-concierge-offset ) - 1.5rem ) );
	overflow-y: auto;
	background: var( --wp--preset--color--soft-ivory, #f8f5f1 );
	border: 1px solid var( --wp--preset--color--linen, #ede7df );
	border-radius: 1.4rem;
	box-shadow: 0 24px 60px rgba( 71, 72, 82, 0.32 ), 0 6px 16px rgba( 71, 72, 82, 0.16 );
	opacity: 0;
	transform: translateY( 12px ) scale( 0.98 );
	transform-origin: bottom right;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.hov-concierge-widget__panel::-webkit-scrollbar {
	display: none;
}

.hov-concierge-widget.is-open .hov-concierge-widget__panel {
	opacity: 1;
	transform: translateY( 0 ) scale( 1 );
	pointer-events: auto;
}

.hov-concierge-widget__close {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	z-index: 2;
	width: 2rem;
	height: 2rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var( --wp--preset--color--linen, #ede7df );
	border-radius: 50%;
	background: var( --wp--preset--color--soft-ivory, #f8f5f1 );
	color: var( --wp--preset--color--graphite, #63646e );
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.hov-concierge-widget__close:hover {
	border-color: var( --wp--preset--color--sulking-room-pink, #c19690 );
	color: var( --wp--preset--color--outerspace, #474852 );
}

/* Inside the widget the panel body should fill the sheet, not centre a column. */
.hov-concierge-widget__panel .hov-concierge {
	max-width: none;
	margin: 0;
	padding: 2rem 1.25rem 1.75rem;
	background: transparent;
}

/* Trim the closing "preview" note in the widget — the launcher context makes
   the demo framing obvious, and it keeps the panel tight. */
.hov-concierge-widget__panel .hov-concierge__note {
	display: none;
}

/* ── Mobile: a bottom sheet that slides up ─────────────────────────────────── */
@media ( max-width: 34rem ) {
	.hov-concierge-widget__panel {
		right: 0;
		left: 0;
		bottom: 0;
		width: auto;
		max-height: 88vh;
		border-radius: 1.4rem 1.4rem 0 0;
		transform: translateY( 100% );
		transform-origin: bottom center;
		padding-bottom: env( safe-area-inset-bottom, 0px );
	}

	.hov-concierge-widget.is-open .hov-concierge-widget__panel {
		transform: translateY( 0 );
	}
}

/* Respect reduced-motion. */
@media ( prefers-reduced-motion: reduce ) {
	.hov-concierge-widget__launcher,
	.hov-concierge-widget__backdrop,
	.hov-concierge-widget__panel {
		transition: none;
	}
}
