/*
 * Public booking calendar — month-grid + slot panel + request form
 * Scoped under .thrive-bk; styles inspired by the existing /book/
 * page mockup so the live version slots into Thrive's design language.
 */

/* The HTML5 `hidden` attribute needs an explicit `display:none` to
 * win against the `display: grid/flex` rules on .thrive-bk-cal-grid
 * + similar children. Scoped to the booking calendar so it doesn't
 * leak. */
.thrive-bk [hidden] { display: none !important; }

.thrive-bk {
	max-width: 1120px;
	margin: 0 auto;
	font-family: inherit;
	color: #0E0E10;
	--bk-navy: #00194C;
	--bk-navy-deep: #000F2D;
	--bk-navy-soft: rgba(0, 25, 76, 0.08);
	--bk-navy-line: rgba(0, 25, 76, 0.14);
	--bk-line: #E8E8E5;
	--bk-stroke: #828D9F;
	--bk-muted: #6B7280;
	--bk-muted-soft: #9CA3AF;
	--bk-off: #FAFAF7;
	--bk-rose: #F4EFE8;
	--bk-green: #1F7A4D;
	--bk-green-soft: #E6F4EE;
	--bk-red: #B42318;
}

.thrive-bk-intro h2 {
	margin: 0 0 6px;
	font-size: clamp(22px, 4vw, 30px);
	letter-spacing: -0.01em;
}
.thrive-bk-intro p {
	margin: 0 0 28px;
	color: var(--bk-muted);
	font-size: 14.5px;
	line-height: 1.55;
}

.thrive-bk-empty {
	padding: 32px 24px;
	background: var(--bk-off);
	border-radius: 12px;
	text-align: center;
	color: var(--bk-muted);
	font-size: 15px;
}
.thrive-bk-empty a { color: var(--bk-navy); font-weight: 600; }

/* ===== Layout: details | calendar | slots — 3-col on wide, stacked on narrow ===== */

.thrive-bk-layout {
	display: grid;
	grid-template-columns: 300px 1fr 300px;
	gap: 24px;
	align-items: start;
}
/* Cap the calendar's actual rendered width — sidebars get the rest
 * of the breathing room. Day cells stay readable around 56px each. */
.thrive-bk-cal {
	max-width: 440px;
	justify-self: start;
	width: 100%;
}

/* 2-col intermediate — details full-width on top, calendar + slots side
 * by side. Narrow band (860-980px) covering small laptops + tablet
 * landscape. Tablet portrait + phones fall through to the single-column
 * stack below. */
@media (max-width: 980px) {
	.thrive-bk-layout {
		grid-template-columns: 1fr 1fr;
	}
	.thrive-bk-details { grid-column: 1 / -1; }
	.thrive-bk-cal { max-width: none; }
}

/* Fully stack on tablet portrait + phones (≤860px to match the
 * site-wide mobile breakpoint). The previous 640px threshold left
 * phone-landscape + tablet-portrait viewports in the 2-col tier where
 * calendar + slots were cramped side-by-side. Stacked, the flow is:
 * details → calendar → (slots panel populates on day pick). */
@media (max-width: 860px) {
	.thrive-bk-layout { grid-template-columns: 1fr; gap: 18px; }
	.thrive-bk-details { grid-column: auto; }
	/* Drop the 280px min-height once stacked — otherwise the empty
	 * "Pick a day" hint card leaves a tall blank below the calendar
	 * before any day is picked. */
	.thrive-bk-slots-panel { min-height: auto; }
}

/* ===== Details pane (left sidebar) ===== */

.thrive-bk-details {
	background: white;
	border: 1px solid var(--bk-line);
	border-radius: 14px;
	padding: 22px 22px 20px;
}
.thrive-bk-detail-eyebrow {
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--bk-navy);
	font-weight: 700;
	margin-bottom: 6px;
}
.thrive-bk-detail-title {
	font-size: 18px;
	line-height: 1.3;
	letter-spacing: -0.01em;
	font-weight: 700;
	color: #0E0E10;
	margin-bottom: 18px;
}
.thrive-bk-detail-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 0;
	border-top: 1px solid var(--bk-line);
	font-size: 13px;
}
.thrive-bk-detail-row:first-of-type { border-top: none; padding-top: 0; }
.thrive-bk-detail-icon {
	flex-shrink: 0;
	color: var(--bk-navy);
	margin-top: 2px;
}
.thrive-bk-detail-row .label {
	display: block;
	font-size: 10.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bk-muted);
	font-weight: 600;
	margin-bottom: 2px;
}
.thrive-bk-detail-row .value {
	display: block;
	color: #0E0E10;
	font-weight: 500;
	line-height: 1.4;
}

.thrive-bk-hosted {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--bk-line);
}
.thrive-bk-hosted .label {
	font-size: 10.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bk-muted);
	font-weight: 600;
	margin-bottom: 8px;
}
.thrive-bk-avatar-row {
	display: flex;
	gap: 6px;
	margin-bottom: 10px;
}
.thrive-bk-avatar {
	width: 36px; height: 36px;
	border-radius: 50%;
	background: var(--bk-navy);
	color: white;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	border: 2px solid white;
	box-shadow: 0 0 0 1px var(--bk-line);
}
.thrive-bk-hosted-blurb {
	margin: 0;
	font-size: 12.5px;
	color: var(--bk-muted);
	line-height: 1.55;
}

/* Subtle in-calendar 1-BD notice (replaces the bigger amber banner). */
.thrive-bk-cal-rule {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px dashed var(--bk-line);
	font-size: 11.5px;
	line-height: 1.5;
	color: var(--bk-muted);
}
.thrive-bk-cal-rule svg { flex-shrink: 0; color: var(--bk-navy); margin-top: 1px; }
.thrive-bk-cal-rule a { color: var(--bk-navy); font-weight: 600; }

/* ===== Calendar ===== */

.thrive-bk-cal {
	background: white;
	border: 1px solid var(--bk-line);
	border-radius: 14px;
	padding: 18px 20px 16px;
}

.thrive-bk-cal-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}
.thrive-bk-cal-title {
	font-weight: 700;
	font-size: 16px;
	letter-spacing: -0.01em;
	color: #0E0E10;
}
.thrive-bk-nav-btn {
	background: white;
	border: 1px solid var(--bk-line);
	border-radius: 8px;
	width: 36px;
	height: 36px;
	font-size: 18px;
	font-weight: 600;
	color: var(--bk-navy);
	cursor: pointer;
	transition: all 0.12s;
}
.thrive-bk-nav-btn:hover:not(:disabled) {
	background: var(--bk-navy);
	color: white;
	border-color: var(--bk-navy);
}
.thrive-bk-nav-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.thrive-bk-cal-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	margin-bottom: 8px;
}
.thrive-bk-cal-weekdays span {
	text-align: center;
	font-size: 10.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bk-muted-soft);
	font-weight: 600;
	padding-bottom: 4px;
}

.thrive-bk-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.thrive-bk-day {
	background: white;
	border: 1px solid transparent;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: #0E0E10;
	padding: 0;
	aspect-ratio: 1 / 1;
	min-height: 40px;
	cursor: pointer;
	transition: all 0.12s;
	position: relative;
}
.thrive-bk-day:hover:not(:disabled) {
	background: var(--bk-navy-soft);
	border-color: var(--bk-navy-line);
}
.thrive-bk-day:disabled { cursor: not-allowed; }
.thrive-bk-day.is-outside { color: transparent; pointer-events: none; }
.thrive-bk-day.is-past    { color: var(--bk-muted-soft); }
.thrive-bk-day.is-today {
	font-weight: 700;
	color: var(--bk-navy);
	background: var(--bk-rose);
}
.thrive-bk-day.is-open {
	background: var(--bk-green-soft);
	color: var(--bk-green);
	font-weight: 700;
	border-color: var(--bk-green);
}
.thrive-bk-day.is-open:hover:not(:disabled) {
	background: var(--bk-green);
	color: white;
	border-color: var(--bk-green);
}
.thrive-bk-day.is-open.is-selected,
.thrive-bk-day.is-open[aria-pressed="true"] {
	background: var(--bk-navy);
	color: white;
	border-color: var(--bk-navy);
}

.thrive-bk-day.is-fullybooked {
	background: var(--bk-off);
	color: var(--bk-muted-soft);
	border: 1px solid var(--bk-line);
	text-decoration: line-through;
	cursor: pointer;
}
.thrive-bk-day.is-fullybooked:hover {
	background: var(--bk-navy-soft);
	color: var(--bk-muted);
	text-decoration: none;
}
.thrive-bk-day.is-fullybooked.is-selected,
.thrive-bk-day.is-fullybooked[aria-pressed="true"] {
	background: var(--bk-muted);
	color: white;
	border-color: var(--bk-muted);
	text-decoration: none;
}

/* Holiday — red-soft "office closed" treatment. Diagonal-stripe
 * pattern distinguishes it from gray fully-booked + amber today.
 * Universal convention: Canadian stat holidays render red on most
 * calendar apps. The custom tooltip (.thrive-bk-day[data-bk-tooltip])
 * below shows the holiday name instantly on hover (the title attr
 * also stays as an a11y fallback for assistive tech). */
.thrive-bk-day.is-holiday {
	background: repeating-linear-gradient(
		45deg,
		#FDECEA,
		#FDECEA 6px,
		#F8C5BF 6px,
		#F8C5BF 12px
	);
	color: var(--bk-red);
	border: 1px solid var(--bk-red);
	cursor: not-allowed;
	position: relative;
}
.thrive-bk-day.is-holiday:hover {
	background: #F8C5BF;
	color: var(--bk-red);
}

/* Custom instant-on-hover tooltip — overrides the OS-native title
 * attribute delay. Scoped to .thrive-bk so it can't leak. Positioned
 * above the cell with a tail, fades in. */
.thrive-bk-day[data-bk-tooltip]:hover::after {
	content: attr(data-bk-tooltip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #0E0E10;
	color: white;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
	padding: 5px 10px;
	border-radius: 6px;
	pointer-events: none;
	z-index: 10;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.thrive-bk-day[data-bk-tooltip]:hover::before {
	content: "";
	position: absolute;
	bottom: calc(100% + 3px);
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #0E0E10;
	pointer-events: none;
	z-index: 10;
}

.thrive-bk-cal-legend {
	display: flex;
	justify-content: center;
	gap: 18px;
	flex-wrap: wrap;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--bk-line);
	font-size: 11.5px;
	color: var(--bk-muted);
}
.thrive-bk-dot {
	display: inline-block;
	width: 9px; height: 9px;
	border-radius: 50%;
	margin-right: 4px;
	vertical-align: middle;
}
.thrive-bk-dot.dot-open        { background: var(--bk-green); }
.thrive-bk-dot.dot-today       { background: var(--bk-rose); border: 1px solid var(--bk-navy); }
.thrive-bk-dot.dot-fullybooked { background: var(--bk-muted-soft); }
.thrive-bk-dot.dot-holiday     { background: var(--bk-red); }
.thrive-bk-dot.dot-past        { background: var(--bk-muted-soft); }

/* ===== Slots panel ===== */

.thrive-bk-slots-panel {
	background: white;
	border: 1px solid var(--bk-line);
	border-radius: 14px;
	padding: 18px 20px;
	min-height: 280px;
}
.thrive-bk-slots-head {
	border-bottom: 1px solid var(--bk-line);
	padding-bottom: 12px;
	margin-bottom: 14px;
}
.thrive-bk-slots-day {
	display: block;
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--bk-muted);
	font-weight: 600;
	margin-bottom: 4px;
}
.thrive-bk-slots-date {
	display: block;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: #0E0E10;
}
.thrive-bk-slots-hint {
	margin: 0;
	font-size: 13px;
	color: var(--bk-muted);
	line-height: 1.5;
}
.thrive-bk-slot-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.thrive-bk-slot {
	background: white;
	border: 1px solid var(--bk-stroke);
	border-radius: 8px;
	padding: 11px 14px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: #0E0E10;
	cursor: pointer;
	text-align: left;
	transition: all 0.12s;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.thrive-bk-slot:hover {
	border-color: var(--bk-navy);
	background: var(--bk-navy-soft);
	color: var(--bk-navy);
}
.thrive-bk-slot:focus-visible {
	outline: 3px solid rgba(0, 25, 76, 0.25);
	outline-offset: 2px;
}

.thrive-bk-slot-time {
	font-weight: 700;
	font-size: 15px;
	letter-spacing: -0.005em;
}
.thrive-bk-slot-status {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
}

/* Available variant — green pill + nudge arrow */
.thrive-bk-slot.is-available .thrive-bk-slot-status {
	background: var(--bk-green-soft);
	color: var(--bk-green);
}
.thrive-bk-slot.is-available:hover {
	border-color: var(--bk-navy);
	background: var(--bk-navy-soft);
	color: var(--bk-navy);
}
.thrive-bk-slot.is-available:hover .thrive-bk-slot-status {
	background: var(--bk-navy);
	color: white;
}

/* Selected variant — navy filled pill, white text. Wins over
 * .is-available rules by class order in the markup. */
.thrive-bk-slot.is-selected,
.thrive-bk-slot.is-available.is-selected {
	background: var(--bk-navy);
	color: white;
	border-color: var(--bk-navy);
	box-shadow: 0 4px 12px rgba(0, 25, 76, 0.18);
	transform: translateY(-1px);
}
.thrive-bk-slot.is-selected:hover,
.thrive-bk-slot.is-available.is-selected:hover {
	background: var(--bk-navy-deep);
	color: white;
	border-color: var(--bk-navy-deep);
}
.thrive-bk-slot.is-selected .thrive-bk-slot-status {
	background: white;
	color: var(--bk-navy);
}
.thrive-bk-slot.is-selected::before {
	content: "✓";
	color: white;
	font-weight: 700;
	margin-right: 6px;
}

/* Booked variant — muted strikethrough, not clickable */
.thrive-bk-slot.is-booked {
	background: var(--bk-off);
	border-color: var(--bk-line);
	color: var(--bk-muted-soft);
	cursor: not-allowed;
}
.thrive-bk-slot.is-booked .thrive-bk-slot-time {
	text-decoration: line-through;
	color: var(--bk-muted-soft);
}
.thrive-bk-slot.is-booked .thrive-bk-slot-status {
	background: rgba(180, 35, 24, 0.08);
	color: var(--bk-red);
}

/* ===== Confirm + form ===== */

.thrive-bk-form { margin-top: 22px; }

/* The booking form carries the `thrive-contact-form-card` class so it
 * inherits the theme's well-tested form-field styling (inputs, labels,
 * required/optional badges, error states, honeypot hidden, etc.). But
 * we don't want the card chrome on top of the booking-widget shell,
 * so nullify the wrapper styling. */
.thrive-bk-form.thrive-contact-form-card {
	background: transparent;
	border: none;
	box-shadow: none;
	padding: 0;
}
@media (max-width: 760px) {
	.thrive-bk-form.thrive-contact-form-card { padding: 0; }
}

/* Submit button — theme rules target input[type=submit]; we use a
 * <button> element so define matching styles here, scoped to the
 * booking form so we can't bleed onto other pages. */
.thrive-bk-form .btn.btn-primary {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 16px 32px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 16px;
	font-family: inherit;
	border: 1px solid transparent;
	background: var(--bk-navy);
	color: #fff;
	cursor: pointer;
	line-height: 1;
	transition: transform 200ms cubic-bezier(.2,.7,.2,1), background 200ms ease, box-shadow 200ms ease;
	box-shadow: 0 1px 2px rgba(0, 25, 76, 0.04), 0 2px 6px rgba(0, 25, 76, 0.04);
}
.thrive-bk-form .btn.btn-primary:hover {
	background: var(--bk-navy-deep);
	transform: translateY(-1px);
}
.thrive-bk-form .btn.btn-primary:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.thrive-bk-summary {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	padding: 14px 18px;
	background: var(--bk-navy);
	color: white;
	border-radius: 12px;
	margin-bottom: 22px;
}
.thrive-bk-summary > div { flex: 1; }
.thrive-bk-summary-label {
	display: block;
	font-size: 10.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.65);
	font-weight: 600;
	margin-bottom: 4px;
}
.thrive-bk-summary strong {
	font-size: 15.5px;
	color: white;
	letter-spacing: -0.005em;
}
.thrive-bk-back {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	font-size: 12.5px;
	font-weight: 500;
	cursor: pointer;
	padding: 7px 12px;
	border-radius: 7px;
	font-family: inherit;
}
.thrive-bk-back:hover {
	background: white;
	color: var(--bk-navy);
	border-color: white;
}

.thrive-bk-form-fine {
	margin: 14px 0 0;
	font-size: 12px;
	color: var(--bk-muted);
	text-align: center;
}

/* ===== Thanks state ===== */

.thrive-bk-thanks {
	padding: 36px 28px;
	background: var(--bk-green-soft);
	border: 1px solid var(--bk-green);
	border-radius: 14px;
	text-align: center;
}
.thrive-bk-thanks h3 {
	margin: 0 0 10px;
	color: var(--bk-green);
	font-size: 24px;
	letter-spacing: -0.01em;
}
.thrive-bk-thanks p {
	margin: 0;
	color: var(--bk-green);
	font-size: 14.5px;
	line-height: 1.55;
}

/* ---- Mobile pass — tighten the booking widget on small viewports ---- */

@media (max-width: 760px) {
	.thrive-bk-intro h2 { font-size: 22px; }
	.thrive-bk-intro p  { margin-bottom: 18px; font-size: 14px; }

	.thrive-bk-details { padding: 18px 18px 16px; }
	.thrive-bk-detail-title { font-size: 17px; }

	.thrive-bk-cal { padding: 14px 14px 12px; }
	.thrive-bk-cal-grid { gap: 3px; }
	.thrive-bk-day { min-height: 38px; font-size: 13.5px; }

	.thrive-bk-slots-panel { padding: 16px 16px; min-height: auto; }
	.thrive-bk-slot { padding: 10px 12px; }

	.thrive-bk-summary { padding: 12px 14px; }
	.thrive-bk-summary strong { font-size: 14.5px; }
}

@media (max-width: 480px) {
	/* Stack the summary banner — "you're requesting" on top, change-time link below. */
	.thrive-bk-summary { flex-direction: column; align-items: stretch; gap: 10px; }
	.thrive-bk-back { align-self: flex-start; }

	/* Full-width pill on phones — easier tap target, matches LP forms. */
	.thrive-bk-form .btn.btn-primary {
		width: 100%;
		justify-content: center;
		padding: 14px 24px;
	}

	/* Calendar gets really tight here — pull padding + gap in further. */
	.thrive-bk-cal { padding: 12px 12px 10px; }
	.thrive-bk-cal-grid { gap: 2px; }
	.thrive-bk-day { min-height: 36px; font-size: 13px; }
	.thrive-bk-cal-weekdays span { font-size: 9.5px; }
	.thrive-bk-cal-title { font-size: 15px; }
	.thrive-bk-nav-btn { width: 32px; height: 32px; font-size: 16px; }
	.thrive-bk-cal-legend { gap: 12px; font-size: 10.5px; }

	/* Slot pill icons get a touch smaller for narrow widths. */
	.thrive-bk-slot-time { font-size: 14px; }
	.thrive-bk-slot-status { font-size: 10px; padding: 3px 7px; }

	/* Avatar row a bit smaller. */
	.thrive-bk-avatar { width: 32px; height: 32px; font-size: 11px; }

	/* Hosted-by blurb a touch smaller. */
	.thrive-bk-hosted-blurb { font-size: 12px; }
}

/* ============================================================
 * Event type chooser — shown when no ?type= is set.
 * Three cards (Intro / Discovery / Proposal review), styled
 * to match the booking calendar's visual language.
 * ============================================================ */

.thrive-bk-change-type {
	display: inline-block;
	margin-bottom: 12px;
	color: var(--bk-navy);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	opacity: 0.75;
	transition: opacity 120ms ease;
}
.thrive-bk-change-type:hover { opacity: 1; }

.thrive-bk-type-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
	margin-top: 24px;
}

.thrive-bk-type-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 24px;
	border: 1px solid #e1e5ec;
	border-radius: 12px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.thrive-bk-type-card:hover {
	border-color: var(--bk-navy);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px -10px rgba(15, 35, 95, 0.18);
}

.thrive-bk-type-duration {
	display: inline-block;
	align-self: flex-start;
	padding: 4px 10px;
	background: var(--bk-navy);
	color: #fff;
	border-radius: 100px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.thrive-bk-type-name {
	font-size: 20px;
	font-weight: 700;
	color: var(--bk-navy);
	margin-top: 4px;
}

.thrive-bk-type-desc {
	font-size: 14px;
	line-height: 1.5;
	color: #4a5260;
	flex: 1;
}

.thrive-bk-type-cta {
	font-size: 13px;
	font-weight: 600;
	color: var(--bk-navy);
	margin-top: 6px;
	opacity: 0.85;
}
.thrive-bk-type-card:hover .thrive-bk-type-cta { opacity: 1; }

@media (max-width: 540px) {
	.thrive-bk-type-grid { grid-template-columns: 1fr; }
	.thrive-bk-type-card { padding: 18px; }
}
