/* ==========================================================================
   M36 Terminbuchung (embedded) – Figma 66:749 / 67:691
   Desktop: one framed box, 340 info | 558 calendar | 300 times.
   The wizard itself comes from btw-terminbuchung; its layout is re-arranged
   here with flexbox (plugin colours via the variables in css/project.css).
   The plugin is never patched – only overridden from the theme.
   ========================================================================== */

/* Own elements only – the wizard keeps its field spacing */
section.m36_terminbuchung .m36_terminbuchung_main > .m36_text_container p,
section.m36_terminbuchung .m36_info p,
section.m36_terminbuchung .m36_info ul {
	margin: 0;
}

section.m36_terminbuchung .m36_untertitel_container + .m36_titel_container {
	padding-top: 0;
}

section.m36_terminbuchung .m36_text_container {
	max-width: 640px;
	font-size: 1.25rem;
	line-height: 1.65;
	color: var(--btw_grau);
}

section.m36_terminbuchung .m36_text_container p {
	color: inherit;
}

/* ---------- Frame: info column + wizard ---------- */
section.m36_terminbuchung .m36_buchung {
	display: flex;
	margin-top: 56px;
	border: 1px solid var(--btw_schwarz);
}

section.m36_terminbuchung .m36_info {
	flex: 0 0 340px;
	min-width: 0;
	padding: 32px;
	border-right: 1px solid var(--btw_linie);
}

section.m36_terminbuchung .m36_info_bild_container {
	position: relative;
	width: 56px;
	height: 56px;
	overflow: hidden;
	background-color: var(--btw_linie);
}

section.m36_terminbuchung .m36_info_bild {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 15%;
}

section.m36_terminbuchung .m36_info_zeile {
	padding-top: 20px;
	font-size: 0.8125rem;
	line-height: 1.65;
	color: var(--btw_grau);
}

section.m36_terminbuchung .m36_info_titel {
	margin: 0;
	padding-top: 6px;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

section.m36_terminbuchung .m36_info_titel_mobil,
section.m36_terminbuchung .m36_info_zeile_mobil {
	display: none;
}

section.m36_terminbuchung .m36_info_punkte {
	padding: 20px 0 0;
	list-style: none;
}

section.m36_terminbuchung .m36_info_punkt {
	position: relative;
	margin: 0;
	padding: 6px 0 6px 20px;
	font-size: 0.875rem;
	line-height: 1.65;
}

section.m36_terminbuchung .m36_info_punkt::before {
	content: '';
	position: absolute;
	left: 0;
	top: calc(6px + 0.825em - 4px);
	width: 8px;
	height: 8px;
	background-color: var(--btw_schwarz);
}

section.m36_terminbuchung .m36_info_text_container {
	padding-top: 20px;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--btw_grau);
}

section.m36_terminbuchung .m36_info_text_container p {
	color: inherit;
}

section.m36_terminbuchung .m36_wizard {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 486px; /* Figma box height – no jump when the plugin script arrives */
}

section.m36_terminbuchung .m36_fehler {
	padding: 32px;
	font-size: 0.9375rem;
}

/* ---------- Wizard: neutral frame, Figma look ---------- */
section.m36_terminbuchung .btw_tb {
	font-size: 0.875rem;
}

section.m36_terminbuchung .btw_tb_progress {
	display: none; /* not in Figma */
}

section.m36_terminbuchung .btw_tb_error {
	margin: 32px 32px 0;
}

section.m36_terminbuchung .btw_tb_card {
	padding: 32px;
	border: 0;
	background: transparent;
	box-shadow: none;
}

section.m36_terminbuchung .btw_tb_card--booking {
	display: flex;
	padding: 0;
	overflow: visible;
}

section.m36_terminbuchung .btw_tb_card--booking > * {
	padding: 32px;
}

/* The info column replaces the plugin's own side panel */
section.m36_terminbuchung [data-btw-tb-aside] {
	display: none;
}

section.m36_terminbuchung .btw_tb_cal {
	flex: 1 1 auto;
	min-width: 0;
}

section.m36_terminbuchung .btw_tb_cal .btw_tb_step_title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Month head: title left, arrows right (Figma) */
section.m36_terminbuchung .btw_tb_cal_head {
	justify-content: flex-start;
	gap: 8px;
	margin-bottom: 20px;
}

section.m36_terminbuchung .btw_tb_cal_title {
	order: -1;
	flex: 1 1 auto;
	font-size: 1rem;
	line-height: 1.65;
	text-align: left;
	letter-spacing: 0;
}

section.m36_terminbuchung .btw_tb .btw_tb_nav {
	position: relative;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border: 1px solid var(--btw_linie);
	border-radius: 0;
	background: var(--btw_flaeche); /* solid, so the blend block turns it black */
	color: var(--btw_schwarz);
	font-size: 0.875rem;
	line-height: 1;
}

section.m36_terminbuchung .btw_tb_nav svg {
	display: none;
}

section.m36_terminbuchung .btw_tb_nav[data-btw-tb-prev]::before {
	content: '←';
}

section.m36_terminbuchung .btw_tb_nav[data-btw-tb-next]::before {
	content: '→';
}

section.m36_terminbuchung .btw_tb_nav:disabled {
	color: var(--btw_hellgrau);
}

/* Calendar: 7 columns, gap 6, days 44 high */
section.m36_terminbuchung .btw_tb_cal_grid {
	max-width: none;
}

section.m36_terminbuchung .btw_tb_cal_row {
	display: flex;
	gap: 6px;
}

section.m36_terminbuchung .btw_tb_cal_row + .btw_tb_cal_row {
	margin-top: 6px;
}

section.m36_terminbuchung .btw_tb_cal_dow,
section.m36_terminbuchung .btw_tb_cal_cell {
	flex: 1 1 0;
	min-width: 0;
	padding: 0;
}

section.m36_terminbuchung .btw_tb_cal_dow {
	padding: 6px 0;
	font-size: 0.6875rem;
	font-weight: 400;
	line-height: 1.65;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--btw_grau);
}

section.m36_terminbuchung .btw_tb .btw_tb_day {
	width: 100%;
	max-width: none;
	height: 44px;
	border-radius: 0;
	background: transparent;
	color: var(--btw_hellgrau);
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.65;
	transition: none;
}

section.m36_terminbuchung .btw_tb .btw_tb_day.is-free {
	background: var(--btw_flaeche);
	color: var(--btw_schwarz);
	font-weight: 700;
}

section.m36_terminbuchung .btw_tb .btw_tb_day.is-free:focus-visible {
	box-shadow: none;
	outline: 2px solid var(--btw_schwarz);
	outline-offset: 2px;
}

section.m36_terminbuchung .btw_tb .btw_tb_day.is-selected,
section.m36_terminbuchung .btw_tb .btw_tb_day.is-selected:hover {
	background: var(--btw_schwarz);
	color: var(--btw_weiss);
}

section.m36_terminbuchung .btw_tb_day.is-today::after {
	display: none; /* not in Figma */
}

section.m36_terminbuchung .btw_tb_tz {
	justify-content: flex-start;
	margin-top: 16px;
	font-size: 0.75rem;
	line-height: 1.65;
	color: var(--btw_grau);
}

section.m36_terminbuchung .btw_tb_tz svg {
	display: none;
}

section.m36_terminbuchung .btw_tb_tz span::before {
	content: 'Zeitzone: ';
}

/* Times */
section.m36_terminbuchung .btw_tb_card--booking .btw_tb_slots {
	flex: 0 0 300px;
	min-width: 0;
	border-top: 0;
	border-left: 1px solid var(--btw_linie);
}

section.m36_terminbuchung .btw_tb_slots[hidden] {
	display: none;
}

/* Side by side (xl+): the times column never makes the box taller than the
   calendar – contain:size takes it out of the height, the list scrolls instead */
@media all and (min-width: 1200px) {
	section.m36_terminbuchung [data-btw-tb-step="date"] .btw_tb_card--booking .btw_tb_slots {
		display: flex;
		flex-direction: column;
		contain: size;
		max-height: none;
	}

	section.m36_terminbuchung [data-btw-tb-step="date"] .btw_tb_slots_list {
		flex: 1 1 auto;
		min-height: 0;
		margin-right: -12px;
		padding-right: 12px;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		scrollbar-color: var(--btw_hellgrau) transparent;
	}
}

section.m36_terminbuchung .btw_tb_slots_title {
	margin: 0 0 20px;
	font-size: 1rem;
	line-height: 1.65;
}

section.m36_terminbuchung .btw_tb_slots_list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

section.m36_terminbuchung .btw_tb .btw_tb_slot {
	position: relative;
	flex: 0 0 auto;
	height: 48px;
	padding: 0 12px;
	border: 1px solid var(--btw_schwarz);
	border-radius: 0;
	background: var(--btw_flaeche); /* solid, so the blend block turns it black */
	color: var(--btw_schwarz);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.65;
	transition: none;
}

section.m36_terminbuchung .btw_tb_slot_end {
	display: none; /* Figma shows the start time only */
}

section.m36_terminbuchung .btw_tb_slot::after {
	content: '→ Weiter';
	display: none;
	padding-left: 0.5em;
}

/* ---------- Hover/focus: the project's invert block (transform + blend only) ---------- */
section.m36_terminbuchung :is(.btw_tb_nav, .btw_tb_day.is-free, .btw_tb_slot) {
	isolation: isolate;
	overflow: hidden;
}

section.m36_terminbuchung .btw_tb_slot::before,
section.m36_terminbuchung .btw_tb_day.is-free::before,
section.m36_terminbuchung .btw_tb_nav::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background-color: #fff;
	mix-blend-mode: difference;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--btw_speed) var(--btw_ease);
}

section.m36_terminbuchung .btw_tb_day.is-selected::before {
	display: none;
}

@media (hover: hover) {
	section.m36_terminbuchung :is(.btw_tb_slot:hover, .btw_tb_day.is-free:not(.is-selected):hover)::before,
	section.m36_terminbuchung .btw_tb_nav:hover:not(:disabled)::after {
		transform: scaleX(1);
	}

	section.m36_terminbuchung .btw_tb_slot:hover::after {
		display: inline;
	}

	/* Plugin hover colours (blue/grey) stay off */
	section.m36_terminbuchung .btw_tb .btw_tb_slot:hover,
	section.m36_terminbuchung .btw_tb .btw_tb_nav:hover:not(:disabled) {
		background: var(--btw_flaeche);
		color: var(--btw_schwarz);
	}

	section.m36_terminbuchung .btw_tb .btw_tb_day.is-free:not(.is-selected):hover {
		background: var(--btw_flaeche);
	}
}

section.m36_terminbuchung :is(.btw_tb_slot:focus-visible, .btw_tb_day.is-free:not(.is-selected):focus-visible)::before,
section.m36_terminbuchung .btw_tb_nav:focus-visible::after {
	transform: scaleX(1);
}

section.m36_terminbuchung .btw_tb_slot:focus-visible::after {
	display: inline;
}

section.m36_terminbuchung .btw_tb .btw_tb_slot:focus-visible,
section.m36_terminbuchung .btw_tb .btw_tb_nav:focus-visible {
	background: var(--btw_flaeche);
	color: var(--btw_schwarz);
	box-shadow: none;
	outline: 2px solid var(--btw_schwarz);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	section.m36_terminbuchung .btw_tb_slot::before,
	section.m36_terminbuchung .btw_tb_day.is-free::before,
	section.m36_terminbuchung .btw_tb_nav::after {
		transition: none;
	}
}

/* ---------- Later steps (form, confirmation): one column next to the info ---------- */
section.m36_terminbuchung [data-btw-tb-step="form"] .btw_tb_card--booking {
	flex-direction: column;
}

section.m36_terminbuchung [data-btw-tb-aside-form] {
	padding-bottom: 0;
	border: 0;
	background: transparent;
}

section.m36_terminbuchung [data-btw-tb-aside-form] > :not(.btw_tb_chosen) {
	display: none; /* name/photo/duration are in the info column already */
}

section.m36_terminbuchung .btw_tb_chosen {
	margin: 0;
}

section.m36_terminbuchung .btw_tb_back {
	margin: 0;
	padding: 0 32px 32px;
}

/* ---------- Up to xl: times below the calendar ---------- */
@media all and (max-width: 1199px) {
	section.m36_terminbuchung .m36_info {
		flex-basis: 280px;
	}

	section.m36_terminbuchung [data-btw-tb-step="date"] .btw_tb_card--booking {
		flex-direction: column;
	}

	section.m36_terminbuchung .btw_tb_card--booking .btw_tb_slots {
		flex: 0 0 auto;
		border-left: 0;
		border-top: 1px solid var(--btw_linie);
	}

	section.m36_terminbuchung .btw_tb_slots_list {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 8px;
	}

	section.m36_terminbuchung .btw_tb .btw_tb_slot {
		flex: 0 0 calc((100% - 16px) / 3);
	}
}

/* ---------- Tablet down: stacked (Figma mobile 67:691) ---------- */
@media all and (max-width: 991px) {
	section.m36_terminbuchung .m36_buchung {
		flex-direction: column;
	}

	section.m36_terminbuchung .m36_info {
		flex: 0 0 auto;
		padding: 20px;
		border-right: 0;
		border-bottom: 1px solid var(--btw_linie);
	}

	section.m36_terminbuchung .m36_info_kopf {
		display: flex;
		align-items: center;
		gap: 14px;
	}

	section.m36_terminbuchung .m36_info_bild_container {
		flex: 0 0 48px;
		width: 48px;
		height: 48px;
	}

	section.m36_terminbuchung .m36_info_kopf_text {
		flex: 1 1 auto;
		min-width: 0;
	}

	section.m36_terminbuchung :is(.m36_info_zeile, .m36_info_titel, .m36_info_punkte, .m36_info_text_container) {
		display: none;
	}

	section.m36_terminbuchung .m36_info_titel_mobil {
		display: block;
		font-size: 1rem;
		font-weight: 700;
		line-height: 1.65;
	}

	section.m36_terminbuchung .m36_info_zeile_mobil {
		display: block;
		font-size: 0.75rem;
		line-height: 1.5;
		color: var(--btw_grau);
	}

	section.m36_terminbuchung .m36_wizard {
		min-height: 0;
	}

	section.m36_terminbuchung .btw_tb_card,
	section.m36_terminbuchung .btw_tb_card--booking > * {
		padding: 20px;
	}

	section.m36_terminbuchung .btw_tb_card--booking {
		padding: 0;
	}

	section.m36_terminbuchung [data-btw-tb-aside-form] {
		padding-bottom: 0;
	}

	section.m36_terminbuchung .btw_tb_back {
		padding: 0 20px 20px;
	}

	section.m36_terminbuchung .btw_tb_error {
		margin: 20px 20px 0;
	}
}

@media all and (max-width: 767px) {
	section.m36_terminbuchung .m36_untertitel_container + .m36_titel_container {
		padding-top: 12px;
	}

	section.m36_terminbuchung .m36_text_container {
		padding-top: 16px;
		font-size: 1rem;
	}

	/* Figma mobile: white box, free days stay #f5f5f5 */
	section.m36_terminbuchung .m36_buchung {
		margin-top: 28px;
		background-color: var(--btw_weiss);
	}

	section.m36_terminbuchung .btw_tb .btw_tb_day {
		height: 38px;
	}

	section.m36_terminbuchung .btw_tb .btw_tb_nav,
	section.m36_terminbuchung .btw_tb .btw_tb_slot,
	section.m36_terminbuchung .btw_tb .btw_tb_slot:is(:hover, :focus-visible),
	section.m36_terminbuchung .btw_tb .btw_tb_nav:is(:hover, :focus-visible):not(:disabled) {
		background: var(--btw_weiss);
	}

	section.m36_terminbuchung .btw_tb_slots_title {
		margin-bottom: 12px;
	}

	section.m36_terminbuchung .btw_tb .btw_tb_slot {
		flex-basis: calc((100% - 8px) / 2);
	}
}
