/* ============================================================
   UPPER REACH WINERY — BOOKING POP-UP
   Top-anchored panel holding the Website Globals booking widget.
   Opened by .ur-booking-popup, or by a link to #book.

   Sizes are in px on purpose: this theme sets the root font size
   to 10px, so rem values come out far smaller than expected.
   ============================================================ */

/* Anything wearing the trigger class is clickable, button or not. */
.ur-booking-popup {
	cursor: pointer;
}

/* Some themes drop [hidden] handling; make sure it sticks. */
.ur-bp[hidden] {
	display: none !important;
}

.ur-bp {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	/*
	 * Anchored to the top, not centred. The booking widget resizes its
	 * own iframe as the guest moves between steps; a centred panel would
	 * re-centre itself on every resize and slide the close button out from
	 * under the cursor. Pinned to the top, only the bottom edge moves.
	 */
	align-items: flex-start;
	justify-content: center;
	/* Extra room at the top for the close button overhanging the corner. */
	padding: 56px 24px 24px;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.ur-bp.is-open {
	opacity: 1;
}

.ur-bp__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 25, 15, 0.65);
}

.ur-bp__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 680px;
	/* Sizes to the widget, up to a cap; beyond that the body scrolls. */
	max-height: calc(100vh - 80px);
	background: #ffffff;
	border-radius: 4px;
	/* Visible so the close button can hang off the corner. */
	overflow: visible;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
	transform: translateY(12px);
	transition: transform 0.25s ease;
}

.ur-bp.is-open .ur-bp__dialog {
	transform: none;
}

/* ---- Close button ----------------------------------------
   Hangs off the dialog's top-right corner, over the backdrop, so it
   stays put while the widget loads, resizes and scrolls. The
   !important flags stop theme button resets from moving or
   restyling it.
   ---------------------------------------------------------- */

.ur-bp .ur-bp__close,
.ur-bp button.ur-bp__close {
	position: absolute !important;
	top: -20px !important;
	right: -20px !important;
	left: auto !important;
	bottom: auto !important;
	float: none !important;
	margin: 0 !important;
	z-index: 3;
	width: 44px !important;
	height: 44px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	border: 2px solid #ffffff !important;
	border-radius: 50% !important;
	background: var(--fl-global-dark-green, #3d591e) !important;
	color: #ffffff !important;
	line-height: 1 !important;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
	cursor: pointer;
	transform: none !important;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.ur-bp .ur-bp__close:hover,
.ur-bp button.ur-bp__close:hover {
	background: #2c4115 !important;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.ur-bp .ur-bp__close:focus-visible {
	outline: 2px solid var(--fl-global-light-green, #9ec936);
	outline-offset: 3px;
}

.ur-bp .ur-bp__close svg {
	width: 20px;
	height: 20px;
	fill: #ffffff;
	pointer-events: none;
}

/* ---- Widget area -----------------------------------------
   Clips the widget to the rounded corners and scrolls when the
   widget outgrows the panel. No top strip: the close button lives
   outside the panel now.
   ---------------------------------------------------------- */

.ur-bp__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	padding: 0;
	border-radius: 4px;
	box-sizing: border-box;
}

.ur-bp__body iframe {
	display: block;
	width: 100%;
	min-height: 540px;
	border: 0;
}

/* Shown until the widget hydrates on first open. */
.ur-bp__spinner {
	width: 32px;
	height: 32px;
	margin: 64px auto;
	border: 2px solid rgba(0, 0, 0, 0.12);
	border-top-color: var(--fl-global-light-green, #9ec936);
	border-radius: 50%;
	animation: ur-bp-spin 0.8s linear infinite;
}

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

/* ---- Page behind the overlay -----------------------------
   Locking the page scroll removes the scrollbar, which would shift
   the whole layout sideways. --ur-bp-sbw is set by the JS to the
   scrollbar's width and given back as padding.
   ---------------------------------------------------------- */

html.ur-bp-open,
html.ur-bp-open body {
	overflow: hidden !important;
}

html.ur-bp-open body {
	padding-right: var( --ur-bp-sbw, 0px );
}

/* ---- Phones: the panel takes the screen ------------------- */

@media (max-width: 600px) {

	.ur-bp {
		padding: 0;
	}

	.ur-bp__dialog {
		max-width: none;
		max-height: none;
		height: 100%;
		border-radius: 0;
	}

	.ur-bp__body {
		border-radius: 0;
	}

	/* Nothing to overhang on a full-screen panel; tuck it inside. */
	.ur-bp .ur-bp__close,
	.ur-bp button.ur-bp__close {
		top: 12px !important;
		right: 12px !important;
	}
}

@media (prefers-reduced-motion: reduce) {

	.ur-bp,
	.ur-bp__dialog {
		transition: none;
	}

	.ur-bp__spinner {
		animation-duration: 2s;
	}
}
