/**
 * Feeling Yachty — app-style booking UI (product page).
 * Pairs with assets/theme/booking-ui.js. See that file's header for why this
 * is a skin over the original fields rather than a replacement for them.
 */

/* Declared on :root, NOT on .fy-bui — the add-on panel (#fy-addons) is a
   SIBLING of this UI, not a child of it, so scoping the variables to .fy-bui
   left every var() inside the add-on cards undefined. An undefined var makes
   the whole declaration invalid at computed-value time, which silently
   dropped the card background, border and radius. */
:root {
	--bui-ink: #1b1240;
	--bui-muted: #6b7280;
	--bui-line: #e6e3f0;
	--bui-card: #ffffff;
	--bui-accent: #d600d6;
	--bui-accent-2: #7c3aed;
	--bui-teal: #14b8a6;
	--bui-radius: 16px;
}

.fy-bui {
	margin: 0 0 22px;
	font-family: inherit;
	color: var(--bui-ink);
}

/* The native controls this UI drives. Kept in the DOM and fully functional —
   WooCommerce resolves variations from them and they still submit. */
.fy-bui-replaced-row,
.fy-bui-hidden-select {
	display: none !important;
}

/* ---------- section ---------- */
.fy-bui-sec {
	margin: 0 0 20px;
}

.fy-bui-sec__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 10px;
}

.fy-bui-sec__title {
	margin: 0;
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--bui-ink);
	line-height: 1.2;
}

.fy-bui-swipe {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--bui-accent);
	white-space: nowrap;
	transition: opacity .2s ease;
}

.fy-bui-swipe.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.fy-bui-month {
	text-align: center;
	margin: 0 0 10px;
}

.fy-bui-month__label {
	font-size: 16px;
	font-weight: 800;
	color: var(--bui-ink);
}

/* ---------- scrollable rail ---------- */
.fy-bui-rail {
	position: relative;
	display: flex;
	align-items: center;
	gap: 6px;
}

.fy-bui-track {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-behavior: auto;          /* see fleet.css — smooth breaks scrollLeft writes */
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 4px 2px 6px;
	flex: 1 1 auto;
	min-width: 0;
}

.fy-bui-track::-webkit-scrollbar {
	display: none;
}

.fy-bui-arrow {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--bui-accent), var(--bui-accent-2));
	color: #fff;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(214, 0, 214, .28);
	transition: transform .15s ease, opacity .2s ease;
}

.fy-bui-arrow:hover {
	transform: translateY(-1px);
}

/* Collapsed, not just faded: on a 375px phone the two arrows were still
   holding 68px of a 318px row even while invisible, squeezing the pills that
   the customer actually swipes. */
/* Collapsed, not just faded: on a 375px phone the two arrows were still
   holding 68px of a 318px row even while invisible, squeezing the pills the
   customer actually swipes. padding must go to zero as well — under
   border-box the theme's own button padding otherwise keeps a ~32px floor
   under the element no matter what width says. */
.fy-bui-arrow.is-hidden {
	opacity: 0;
	pointer-events: none;
	width: 0;
	min-width: 0;
	padding: 0;
	margin: 0;
	border: 0;
	overflow: hidden;
}

/* ---------- pills ---------- */
.fy-bui-pill {
	flex: 0 0 auto;
	border: 1px solid var(--bui-line);
	background: var(--bui-card);
	color: var(--bui-ink);
	border-radius: 999px;
	padding: 10px 18px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: background .18s ease, color .18s ease, border-color .18s ease,
		transform .15s ease, box-shadow .18s ease;
}

.fy-bui-pill:hover:not(:disabled):not(.is-active) {
	border-color: var(--bui-accent);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(23, 32, 51, .08);
}

.fy-bui-pill.is-active {
	background: var(--bui-accent);
	border-color: var(--bui-accent);
	color: #fff;
	box-shadow: 0 8px 20px rgba(214, 0, 214, .32);
}

.fy-bui-pill:disabled,
.fy-bui-pill.is-disabled {
	opacity: .38;
	cursor: not-allowed;
	text-decoration: line-through;
}

.fy-bui-pill:focus-visible,
.fy-bui-arrow:focus-visible,
.fy-bui-step:focus-visible {
	outline: 3px solid var(--bui-accent-2);
	outline-offset: 2px;
}

/* Day pills stack the weekday over the date number. */
.fy-bui-pill--day {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 58px;
	padding: 9px 12px;
	border-radius: 14px;
}

.fy-bui-pill__dow {
	font-size: 11.5px;
	font-weight: 700;
	color: var(--bui-muted);
	text-transform: none;
	letter-spacing: .02em;
}

.fy-bui-pill__num {
	font-size: 19px;
	font-weight: 800;
	line-height: 1.1;
}

.fy-bui-pill--day.is-active .fy-bui-pill__dow {
	color: rgba(255, 255, 255, .85);
}

/* Charter length: the chosen one reads as a solid, confirmed choice. */
.fy-bui-sec--length .fy-bui-pill.is-active {
	background: #1b1240;
	border-color: var(--bui-accent);
	box-shadow: 0 0 0 2px rgba(214, 0, 214, .35), 0 8px 20px rgba(27, 18, 64, .28);
}

.fy-bui-sec--length .fy-bui-pill.is-active::after {
	content: " ✓";
	font-weight: 800;
}

/* ---------- stepper ---------- */
.fy-bui-stepper {
	display: inline-flex;
	align-items: center;
	gap: 14px;
}

.fy-bui-step {
	width: 44px;
	height: 44px;
	flex: 0 0 auto;
	border: 1px solid var(--bui-line);
	border-radius: 12px;
	background: #f3f4f8;
	color: var(--bui-ink);
	font-size: 20px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.fy-bui-step:hover:not(:disabled) {
	border-color: var(--bui-accent);
	background: #fff;
	transform: translateY(-1px);
}

.fy-bui-step:disabled {
	opacity: .35;
	cursor: not-allowed;
}

.fy-bui-stepper__val {
	min-width: 62px;
	text-align: center;
	line-height: 1.15;
}

.fy-bui-stepper__num {
	display: block;
	font-size: 20px;
	font-weight: 800;
	color: var(--bui-ink);
}

.fy-bui-stepper__unit {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: var(--bui-muted);
}

.fy-bui-stepper--sm .fy-bui-step {
	width: 36px;
	height: 36px;
	font-size: 17px;
}

.fy-bui-stepper--sm .fy-bui-stepper__num {
	font-size: 17px;
}

/* ---------- add-ons ---------- */
.fy-bui-addons .fy-addons__title {
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--bui-accent-2);
	margin: 0 0 4px;
}

.fy-bui-addons .fy-addons__intro {
	font-size: 13px;
	color: var(--bui-muted);
	margin: 0 0 14px;
}

.fy-bui-addons .fy-addon {
	background: var(--bui-card);
	border: 1.5px solid var(--bui-line);
	border-radius: var(--bui-radius);
	padding: 14px 16px;
	margin: 0 0 10px;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.fy-bui-addons .fy-addon.is-on {
	border-color: var(--bui-accent);
	box-shadow: 0 0 0 1px rgba(214, 0, 214, .25), 0 8px 22px rgba(214, 0, 214, .10);
}

.fy-bui-addons .fy-addon.is-blocked {
	opacity: .55;
}

/* Name + price on the left, switch pushed to the right. */
.fy-bui-addons .fy-addon__row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 2px 10px;
	margin: 0;
	cursor: pointer;
}

.fy-bui-addons .fy-addon__label {
	order: 1;
	flex: 1 1 auto;
	font-size: 16px;
	font-weight: 800;
	color: var(--bui-ink);
	min-width: 0;
}

.fy-bui-addons .fy-addon__price {
	order: 3;
	flex: 1 1 100%;
	font-size: 14px;
	font-weight: 800;
	color: var(--bui-accent);
}

/* The checkbox itself becomes the switch — no markup change, so the label
   click target, the name attribute and addons.js's handlers all still work. */
.fy-bui-addons .fy-addon__check {
	order: 2;
	flex: 0 0 auto;
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	width: 52px;
	height: 30px;
	margin: 0;
	border-radius: 999px;
	background: #dcdce6;
	border: none;
	cursor: pointer;
	transition: background .2s ease;
}

.fy-bui-addons .fy-addon__check::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
	transition: transform .2s ease;
}

.fy-bui-addons .fy-addon__check:checked {
	background: linear-gradient(90deg, var(--bui-accent), var(--bui-teal));
}

.fy-bui-addons .fy-addon__check:checked::after {
	transform: translateX(22px);
}

.fy-bui-addons .fy-addon__check:disabled {
	opacity: .4;
	cursor: not-allowed;
}

.fy-bui-addons .fy-addon__check:focus-visible {
	outline: 3px solid var(--bui-accent-2);
	outline-offset: 2px;
}

.fy-bui-addons .fy-addon__note,
.fy-bui-addons .fy-addon__cap,
.fy-bui-addons .fy-addon__blocked {
	font-size: 12.5px;
	color: var(--bui-muted);
	margin: 6px 0 0;
	line-height: 1.45;
}

.fy-bui-addons .fy-addon__blocked {
	color: #b45309;
	font-weight: 700;
}

.fy-bui-addons .fy-addon__hours,
.fy-bui-addons .fy-addon__qty {
	margin: 12px 0 0;
}

.fy-bui-addons .fy-addon__variant-wrap {
	margin: 10px 0 0;
}

.fy-bui-addons .fy-addon__variant {
	width: 100%;
	max-width: 320px;
	border: 1px solid var(--bui-line);
	border-radius: 10px;
	padding: 9px 12px;
	font: inherit;
	font-size: 14px;
	background: #fff;
	color: var(--bui-ink);
}

.fy-bui-addons .fy-addons__total {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 12px;
	margin: 14px 0 0;
	padding: 14px 16px;
	border-radius: var(--bui-radius);
	background: linear-gradient(120deg, #fff5fd, #f3e8ff);
	border: 1px solid rgba(214, 0, 214, .18);
	font-size: 14px;
	font-weight: 700;
	color: var(--bui-ink);
}

.fy-bui-addons .fy-addons__total strong {
	font-size: 16px;
	color: var(--bui-accent);
}

.fy-bui-addons .fy-addons__later {
	color: var(--bui-muted);
	font-weight: 600;
}

/* The arrival note, relocated under the start-time strip. */
.fy-bui .fy-arrival-note {
	margin: 12px 0 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: #4c1d95;
	background: #f5f3ff;
	border-left: 3px solid var(--bui-accent-2);
	border-radius: 0 10px 10px 0;
	padding: 10px 12px;
}

@media (max-width: 480px) {
	.fy-bui-sec__title { font-size: 16px; }
	.fy-bui-pill { padding: 9px 15px; font-size: 13.5px; }
	.fy-bui-pill--day { min-width: 54px; }
	.fy-bui-addons .fy-addon { padding: 13px 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.fy-bui *,
	.fy-bui-addons * {
		transition: none !important;
	}
}

/* ------------------------------------------------------------------
 * Specificity guards.
 *
 * The storefront theme styles bare `button` elements (border, radius,
 * background) and WooCommerce styles `.fy-addon` rows directly. Both were
 * beating the plain single-class rules above on real product pages, which
 * left selected pills white instead of magenta. Re-stating the state rules
 * scoped to the container IDs puts them at (1,2,0) so nothing in a theme
 * can quietly undo a selection the customer just made.
 * ---------------------------------------------------------------- */
#fy-bui .fy-bui-pill {
	background: var(--bui-card);
	border: 1px solid var(--bui-line);
	color: var(--bui-ink);
}

#fy-bui .fy-bui-pill.is-active {
	background: var(--bui-accent);
	border-color: var(--bui-accent);
	color: #fff;
}

#fy-bui .fy-bui-sec--length .fy-bui-pill.is-active {
	background: #1b1240;
	border-color: var(--bui-accent);
}

#fy-bui .fy-bui-pill--day.is-active .fy-bui-pill__dow {
	color: rgba(255, 255, 255, .85);
}

#fy-bui .fy-bui-arrow {
	background: linear-gradient(135deg, var(--bui-accent), var(--bui-accent-2));
	border: none;
	color: #fff;
}

#fy-bui .fy-bui-step {
	background: #f3f4f8;
	border: 1px solid var(--bui-line);
	color: var(--bui-ink);
}

#fy-addons.fy-bui-addons .fy-addon {
	background: var(--bui-card);
	border: 1.5px solid var(--bui-line);
	border-radius: var(--bui-radius);
	padding: 14px 16px;
	margin: 0 0 10px;
}

#fy-addons.fy-bui-addons .fy-addon:first-of-type {
	border-top: 1.5px solid var(--bui-line);
}

#fy-addons.fy-bui-addons .fy-addon.is-on {
	border-color: var(--bui-accent);
}

#fy-addons.fy-bui-addons .fy-addon__check {
	appearance: none;
	-webkit-appearance: none;
	background: #dcdce6;
	border: none;
	width: 52px;
	height: 30px;
	border-radius: 999px;
}

#fy-addons.fy-bui-addons .fy-addon__check:checked {
	background: linear-gradient(90deg, var(--bui-accent), var(--bui-teal));
}

/* Prompt shown until a guest count is picked — WooCommerce blocks add-to-cart
   without it, and "—" alone doesn't read as an outstanding action. */
#fy-bui .fy-bui-hint {
	margin: 8px 0 0;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--bui-accent-2);
}
#fy-bui .fy-bui-hint[hidden] { display: none; }

/* ---------- month strip (navigates the day strip) ---------- */
#fy-bui .fy-bui-months {
	margin: 0 0 10px;
}

#fy-bui .fy-bui-month-pill {
	padding: 7px 14px;
	font-size: 13px;
	border-radius: 999px;
}

/* Selecting a month is navigation, not a booking choice — so it reads as a
   quieter "you are here" than the magenta a chosen DAY gets. */
#fy-bui .fy-bui-month-pill.is-active {
	background: #f3e8ff;
	border-color: var(--bui-accent-2);
	color: var(--bui-accent-2);
	box-shadow: none;
}

#fy-bui .fy-bui-months .fy-bui-arrow {
	width: 28px;
	height: 28px;
	font-size: 10px;
	box-shadow: 0 3px 9px rgba(124, 58, 237, .25);
}

/* ------------------------------------------------------------------
 * Belt-and-braces: hide the theme's own date/time fields in pure CSS.
 *
 * The JS in booking-ui.js does this too, but it has to FIND the elements
 * first — and on a page builder that emits one copy per breakpoint, a
 * selector can miss the copy that only exists on phones. CSS has no such
 * problem: an attribute selector matches every copy, on every breakpoint,
 * with no timing involved.
 *
 * Only applied on single-product pages where the replacement pickers were
 * actually built (body.fy-bui-active, set by the JS), so a page without the
 * new UI never loses its original fields.
 * ---------------------------------------------------------------- */
body.fy-bui-active input[name="booking_date"],
body.fy-bui-active input[name="fy_booking_date"],
body.fy-bui-active select[name="charter_start_time"],
body.fy-bui-active select[name="fy_charter_start_time"],
body.fy-bui-active input#booking_date,
body.fy-bui-active select#charter_start_time {
	display: none !important;
}

/* The decorative wrapper a builder puts around the control, up to three
   levels. :has() is supported by every current browser; older ones simply
   fall back to the JS path above.

   The depth limit is NOT what makes this safe. On the live theme the field
   sits at  form.cart > div.manjit-date-field > input , so a two-level match
   selects the FORM ITSELF and takes the variation dropdowns, the quantity
   box and Add to Cart down with it — the whole product unbuyable. What
   actually keeps this in its lane is the guard list: never hide an element
   that contains a purchase control. Keep those :not() clauses attached to
   any selector added here. */
body.fy-bui-active :is(
	:has(> input[name="booking_date"]),
	:has(> * > input[name="booking_date"]),
	:has(> * > * > input[name="booking_date"]),
	:has(> select[name="charter_start_time"]),
	:has(> * > select[name="charter_start_time"]),
	:has(> * > * > select[name="charter_start_time"])
):not(form):not(:has(form)):not(:has(.variations)):not(:has(.single_add_to_cart_button)):not(:has(.quantity)):not(:has(.fy-bui)):not(:has(#fy-addons)) {
	display: none !important;
}

/* A caption sitting BEFORE that wrapper as a sibling — the "Select Date" /
   "Charter Start Time" text. :has() gives CSS a previous-sibling match. */
body.fy-bui-active label:has(+ * input[name="booking_date"]),
body.fy-bui-active span:has(+ * input[name="booking_date"]),
body.fy-bui-active label:has(+ * select[name="charter_start_time"]),
body.fy-bui-active span:has(+ * select[name="charter_start_time"]),
body.fy-bui-active label[for="booking_date"],
body.fy-bui-active label[for="charter_start_time"] {
	display: none !important;
}

/* The plugin's own date/start-time inputs (FY_Fleet_Woo::render_schedule_fields).
   Visible only if JavaScript never runs, so the page still lets someone pick a
   date; once the pickers are built they are the interface and these are just
   the values being posted. */
body.fy-bui-active .fy-native-schedule { display: none !important; }
.fy-native-schedule__row { margin: 0 0 10px; }
.fy-native-schedule label { display: block; font-weight: 700; font-size: 13px; }
.fy-native-schedule input, .fy-native-schedule select { display: block; margin-top: 4px; }
