/**
 * FLC Bike Hire — booking form styles.
 *
 * Uses the theme's design tokens (var(--colour-*) / var(--font-*) etc.) with
 * hard fallbacks so the form still looks right if the plugin is ever used with
 * a different theme. Scoped under .flc-booking.
 */

.flc-booking {
	--flc-green-dark:  var(--colour-green-dark, #3B5D49);
	--flc-green-light: var(--colour-primary, #7AA83F);
	--flc-text:        var(--colour-text, #353431);
	--flc-muted:       var(--colour-text-muted, #555550);
	--flc-bg:          var(--colour-white, #ffffff);
	--flc-off:         var(--colour-off-white, #f4ede1);
	--flc-border:      var(--colour-border, #e8e8e4);
	--flc-radius:      var(--radius-lg, 16px);
	--flc-pill:        var(--radius-md, 24px);
	--flc-shadow:      var(--shadow-md, 0 4px 12px rgba(0,0,0,0.10));
	--flc-font-head:   var(--font-heading, 'Plus Jakarta Sans', sans-serif);
	--flc-font-body:   var(--font-body, 'Source Sans 3', Arial, sans-serif);

	/* Break out of the theme's narrow (768px) page-content column and centre
	   in the viewport, capped at 1240px — without transforms, so the sticky
	   summary keeps working. */
	width: min(1240px, calc(100vw - 2rem));
	max-width: none;
	margin-left: calc(50% - min(620px, calc(50vw - 1rem)));

	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 2rem;
	align-items: start;
	font-family: var(--flc-font-body);
	color: var(--flc-text);
}

@media (max-width: 880px) {
	.flc-booking {
		grid-template-columns: 1fr;
		/* Drop the breakout; flow normally in the content column. */
		width: auto;
		margin-left: 0;
	}
}

.flc-booking__main { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
/* The [hidden] attribute must beat the display rules above when we swap to the
   confirmation screen. */
.flc-booking__main[hidden],
.flc-summary[hidden] { display: none; }

/* The widget usually renders inside the theme's .entry-content, whose prose
   styles add bullet indents/margins to any <ul>. Reset within our scope so
   lists (size popup, summary) align flush. */
.flc-booking ul,
.flc-booking ol {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.flc-booking li { margin: 0 !important; }

/* Hide the theme's page title on the booking page — the form has its own
   step headings. This stylesheet only loads where the [flc_booking_form]
   shortcode is present, so it's scoped to the booking page automatically. */
.page-header { display: none; }

/* ----- Steps ----- */

.flc-step {
	background: var(--flc-bg);
	border: 1px solid var(--flc-border);
	border-radius: var(--flc-radius);
	padding: 1.5rem;
}

.flc-step__title {
	font-family: var(--flc-font-head);
	font-size: 1.25rem;
	margin: 0 0 .5rem;
	display: flex;
	align-items: center;
	gap: .6rem;
}

.flc-step__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.8rem;
	height: 1.8rem;
	border-radius: 50%;
	background: var(--flc-green-light);
	color: #fff;
	font-size: .95rem;
	flex: none;
}

.flc-step__hint { color: var(--flc-muted); margin: 0 0 1rem; font-size: .95rem; }

/* ----- Date input ----- */

.flc-date-input {
	width: 100%;
	padding: .85rem 1rem;
	border: 1px solid var(--flc-border);
	border-radius: var(--flc-pill);
	font-size: 1rem;
	font-family: inherit;
	background: var(--flc-off);
	cursor: pointer;
}

.flc-days {
	margin-top: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .75rem;
	flex-wrap: wrap;
}
.flc-days__label { font-weight: 600; }
.flc-days__control .flc-qty__input { width: 3rem; font-weight: 600; }
.flc-days__control .flc-qty__btn { width: 2.4rem; height: 2.4rem; font-size: 1.25rem; }

.flc-daycount {
	margin: .9rem 0 0;
	font-weight: 600;
	color: var(--flc-green-dark);
	text-align: center;
}

/* ----- Fleet cards ----- */

.flc-fleet__status { color: var(--flc-muted); margin: 0 0 1rem; }

.flc-fleet {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}
@media (max-width: 1024px) { .flc-fleet { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .flc-fleet { grid-template-columns: 1fr; } }

.flc-card {
	border: 1px solid var(--flc-border);
	border-radius: var(--flc-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: var(--flc-bg);
}

.flc-card__media {
	height: 200px;
	background: var(--flc-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: .5rem;
}
/* Fixed height + contain so every card's image area lines up and the whole
   bike stays visible. !important overrides the theme's .entry-content img
   { height: auto } rule that otherwise breaks the alignment. */
.flc-card__media img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
	display: block;
}

.flc-card__body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }

.flc-card__title { font-family: var(--flc-font-head); font-size: 1.1rem; margin: 0; }
.flc-card__title small { display: block; font-weight: 400; font-size: .85rem; color: var(--flc-muted); }

.flc-card__price { margin: 0; font-weight: 700; color: var(--flc-green-dark); }
.flc-card__price span { font-weight: 400; color: var(--flc-muted); font-size: .85rem; }

/* ----- Card click + select CTA / badge ----- */

.flc-card[role="button"] { cursor: pointer; transition: box-shadow .2s ease, transform .2s ease; }
.flc-card[role="button"]:hover { box-shadow: var(--flc-shadow); transform: translateY(-2px); }
.flc-card[role="button"]:focus-visible { outline: 2px solid var(--flc-green-light); outline-offset: 2px; }
.flc-card.is-out { opacity: .55; }
.flc-card.is-selected { border-color: var(--flc-green-light); box-shadow: 0 0 0 1px var(--flc-green-light); }

.flc-card__footer { margin-top: auto; padding-top: .35rem; }
.flc-card__cta {
	display: inline-flex; align-items: center; gap: .35rem;
	font-weight: 700; font-size: .9rem;
	color: var(--flc-green-dark);
}
.flc-card[role="button"]:not(.is-selected) .flc-card__cta::after { content: "\203A"; font-size: 1.15em; line-height: 1; }
.flc-card.is-selected .flc-card__cta {
	background: var(--flc-green-light); color: #fff;
	padding: .3rem .75rem; border-radius: var(--flc-pill);
}
.flc-card.is-out .flc-card__cta { color: #b32d2e; }

/* ----- Quantity stepper (shared by the size popup) ----- */

.flc-qty { display: inline-flex; align-items: center; border: 1px solid var(--flc-border); border-radius: var(--flc-pill); overflow: hidden; background: #fff; flex: none; }
.flc-qty__btn {
	width: 2rem; height: 2rem; border: 0; background: #fff; cursor: pointer;
	font-size: 1.1rem; line-height: 1; color: var(--flc-green-dark);
}
.flc-qty__btn:hover { background: var(--flc-off); }
.flc-qty__input {
	width: 2.5rem; text-align: center; border: 0; font-size: 1rem; font-family: inherit;
	-moz-appearance: textfield;
}
.flc-qty__input::-webkit-outer-spin-button,
.flc-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ----- Form ----- */

.flc-form { display: flex; flex-direction: column; gap: 1rem; }
.flc-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 540px) { .flc-form__row { grid-template-columns: 1fr; } }

.flc-field { display: flex; flex-direction: column; gap: .35rem; }
.flc-field__label { font-weight: 600; font-size: .9rem; }
.flc-field__req { color: var(--flc-green-light); }
.flc-field__optional { color: var(--flc-muted); font-weight: 400; }

.flc-field input,
.flc-field textarea {
	padding: .7rem .9rem;
	border: 1px solid var(--flc-border);
	border-radius: 12px;
	font-size: 1rem;
	font-family: inherit;
	background: var(--flc-off);
	color: var(--flc-text);
}
.flc-field input:focus,
.flc-field textarea:focus { outline: 2px solid var(--flc-green-light); outline-offset: 1px; }

/* Honeypot — visually hidden. */
.flc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ----- Buttons ----- */

.flc-btn {
	display: inline-block;
	padding: .85rem 1.75rem;
	border: 0;
	border-radius: var(--flc-pill);
	font-family: var(--flc-font-head);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s ease;
}
.flc-btn--primary { background: var(--flc-green-light); color: #fff; }
.flc-btn--primary:hover { background: var(--flc-green-dark); }
.flc-btn--primary:disabled { opacity: .6; cursor: default; }

/* ----- Feedback ----- */

.flc-form__feedback { margin: 0; padding: .8rem 1rem; border-radius: 12px; font-weight: 600; }
.flc-form__feedback--success { background: rgba(122,168,63,.15); color: var(--flc-green-dark); }
.flc-form__feedback--error { background: rgba(179,45,46,.1); color: #b32d2e; }

/* ----- Summary ----- */

.flc-summary {
	position: sticky;
	/* Clear the sticky site header (top row + nav row) so it doesn't slide
	   under it on scroll. */
	top: calc(var(--header-height, 70px) + var(--nav-row-height, 46px) + 1rem);
	background: var(--flc-green-dark);
	color: #fff;
	border-radius: var(--flc-radius);
	padding: 1.5rem;
}
@media (max-width: 880px) { .flc-summary { position: static; } }

.flc-summary__title { font-family: var(--flc-font-head); margin: 0 0 1rem; font-size: 1.2rem; color: var(--flc-off); }
.flc-summary__dates { font-size: .95rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: .15rem; }
.flc-summary__days { color: rgba(255,255,255,.7); font-size: .85rem; }

.flc-summary__lines { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.flc-summary__lines li {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: .15rem .5rem;
	padding-bottom: .75rem;
	border-bottom: 1px solid rgba(255,255,255,.18);
}
.flc-summary__line-name { font-weight: 600; }
.flc-summary__line-name em { font-style: normal; color: rgba(255,255,255,.8); }
.flc-summary__line-price { text-align: right; font-weight: 700; }
.flc-summary__line-calc { grid-column: 1 / -1; font-size: .8rem; color: rgba(255,255,255,.65); }

.flc-summary__line-controls { grid-column: 1 / -1; display: flex; align-items: center; gap: .75rem; margin-top: .15rem; }
.flc-qty--sm { background: #fff; }
.flc-qty--sm .flc-qty__btn { width: 1.7rem; height: 1.7rem; font-size: 1rem; }
.flc-qty__val { min-width: 1.6rem; padding: 0 .25rem; text-align: center; font-weight: 600; color: var(--flc-green-dark); }
.flc-summary__remove {
	background: none; border: 0; padding: 0; cursor: pointer;
	font-family: inherit; font-size: .8rem; text-decoration: underline;
	color: rgba(255,255,255,.7);
}
.flc-summary__remove:hover { color: #fff; }

.flc-summary__total {
	display: flex; justify-content: space-between; align-items: baseline;
	font-family: var(--flc-font-head); font-size: 1.1rem; margin: 0 0 1rem;
}
.flc-summary__total-val { font-size: 1.5rem; font-weight: 800; }

.flc-summary__note { font-size: .8rem; color: rgba(255,255,255,.75); margin: 0; line-height: 1.5; }

/* ----- Confirmation screen ----- */

.flc-confirmation {
	grid-column: 1 / -1;
	text-align: center;
	background: var(--flc-bg);
	border: 1px solid var(--flc-border);
	border-radius: var(--flc-radius);
	padding: 3rem 2rem;
}
.flc-confirmation[hidden] { display: none; }
.flc-confirmation__icon {
	width: 64px; height: 64px; line-height: 64px;
	margin: 0 auto 1rem;
	border-radius: 50%;
	background: var(--flc-green-light);
	color: #fff;
	font-size: 2rem;
	font-weight: 700;
}
.flc-confirmation__title { font-family: var(--flc-font-head); color: var(--flc-green-dark); margin: 0 0 .75rem; font-size: 1.6rem; }
.flc-confirmation__msg { font-size: 1.05rem; line-height: 1.6; max-width: 540px; margin: 0 auto 1rem; }
.flc-confirmation__note { color: var(--flc-muted); margin: 0 auto 1.75rem; max-width: 540px; }

/* ----- Size popup (modal) ----- */

.flc-modal[hidden] { display: none; }
.flc-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.flc-modal__backdrop { position: absolute; inset: 0; background: rgba(20,35,15,.55); }
.flc-modal__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(460px, 100%);
	max-height: 85vh;
	background: var(--flc-bg);
	border-radius: var(--flc-radius);
	padding: 1.5rem;
	box-shadow: var(--flc-shadow);
}
.flc-modal__close {
	position: absolute; top: .75rem; right: .75rem;
	width: 2rem; height: 2rem; border: 0; border-radius: 50%;
	background: var(--flc-off); color: var(--flc-text);
	font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.flc-modal__close:hover { background: var(--flc-border); }
.flc-modal__title { font-family: var(--flc-font-head); margin: 0 1.75rem 0 0 !important; font-size: 1.2rem; flex: none; }
.flc-modal__price { color: var(--flc-green-dark); font-weight: 700; margin: .2rem 0 1rem !important; flex: none; }

/* The size list is the only part that scrolls; the title and Done button stay
   pinned, so Done is always visible. */
.flc-modal__sizes {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: .5rem;
}

.flc-msize {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: .55rem .7rem;
	border: 1px solid var(--flc-border);
	border-radius: 12px;
	background: var(--flc-off);
}
.flc-msize.is-out { opacity: .55; }
.flc-msize__info { display: flex; flex-direction: column; gap: .1rem; }
.flc-msize__label { font-weight: 600; }
.flc-msize__height { color: var(--flc-muted); font-size: .8rem; }
.flc-msize__out { color: #b32d2e; font-weight: 600; font-size: .85rem; }
.flc-modal__done { flex: none; width: 100%; margin-top: 1rem; }

/* ----- flatpickr: always-open inline calendar ----- */

/* The text input is redundant in inline mode (the calendar is always visible
   and the day count reads back the selection). */
.flc-booking .flc-date-input { display: none; }

.flc-booking .flatpickr-calendar.inline {
	width: 100%;
	max-width: 520px;
	margin: .5rem auto 0;
	box-shadow: var(--flc-shadow);
	border-radius: 12px;
	padding-bottom: .25rem;
}
/* Let the day grid fill the wider calendar. */
.flc-booking .flatpickr-calendar.inline .flatpickr-innerContainer,
.flc-booking .flatpickr-calendar.inline .flatpickr-rContainer,
.flc-booking .flatpickr-calendar.inline .flatpickr-days,
.flc-booking .flatpickr-calendar.inline .dayContainer {
	width: 100%;
	min-width: 100%;
	max-width: 100%;
}
.flc-booking .flatpickr-calendar.inline .flatpickr-day {
	max-width: none;
	height: 46px;
	line-height: 46px;
	border-radius: 10px;
}
.flc-booking .flatpickr-calendar.inline .flatpickr-weekday { font-size: .8rem; }
.flc-booking .flatpickr-calendar.inline .flatpickr-current-month,
.flc-booking .flatpickr-calendar.inline .flatpickr-monthDropdown-months { font-size: 1.05rem; }

/* ----- flatpickr brand tweaks ----- */

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
	background: var(--colour-primary, #7AA83F);
	border-color: var(--colour-primary, #7AA83F);
}
.flatpickr-day.inRange {
	background: rgba(122,168,63,.18);
	border-color: rgba(122,168,63,.18);
	box-shadow: none;
	border-radius: 0;
}
.flc-booking .flatpickr-calendar.inline .flatpickr-day.startRange { border-radius: 10px 0 0 10px; }
.flc-booking .flatpickr-calendar.inline .flatpickr-day.endRange { border-radius: 0 10px 10px 0; }
.flatpickr-day.today { border-color: var(--colour-green-dark, #3B5D49); }
