/* ═══════════════════════════════════════════════════════
   SAR Travel Booking – Termine + Ansprechpartner
   ═══════════════════════════════════════════════════════ */

.sar-travel-booking {
	margin: 48px 0;
	scroll-margin-top: 100px; /* Sprungziel #sar-travel-dates: Offset fuer Sticky-Header */
}

/* ─── Titel ─── */

.sar-booking-title {
	margin: 0 0 24px;
}

/* ─── Zweispaltiges Layout ─── */

.sar-booking-layout {
	display: block;
}

/* ═══════════════════════════════════════════════════════
   Termine (linke Spalte)
   ═══════════════════════════════════════════════════════ */

.sar-booking-year {
	margin: 24px 0 12px;
}

.sar-booking-year:first-child {
	margin-top: 0;
}

/* ─── Einzelner Termin ─── */

.sar-booking-date {
	display: grid;
	grid-template-columns: 1fr auto;       /* links: Inhalt | rechts: Preis+Button */
	align-items: center;                    /* rechte Seite vertikal zentriert */
	column-gap: 12px;
	border-bottom: 1px solid #e8e8e8;
	padding: 12px 0;
}

.sar-booking-date:last-of-type {
	border-bottom: none;
}

/* hidden-Attribut muss das Grid-Display schlagen, sonst greift die
   7-Termine-Begrenzung (render.php setzt ab dem 8. Termin [hidden]) nicht. */
.sar-booking-date[hidden] {
	display: none;
}

/* Linke Spalte: Status + Datum + Unterzeilen */
.sar-booking-date__main {
	grid-column: 1;
	min-width: 0;
}

/* Rechte Spalte: Preis + Button (vertikal zentriert via align-items am Grid) */
.sar-booking-date__aside {
	grid-column: 2;
	display: flex;
	align-items: center;
	gap: 8px;
	justify-self: end;
}

/* Aufklapp-Panels (Kombi/Kurzverlauf) über die volle Breite unter main+aside */
.sar-booking-combo-panel,
.sar-booking-itin-panel {
	grid-column: 1 / -1;
}

.sar-booking-date__row {
	display: grid;
	grid-template-columns: 36px 1fr;        /* Status | Datum */
	align-items: center;
	gap: 8px;
}

/* Status-Icon */
.sar-booking-date__status {
	line-height: 1;
}

/* Status-Markierungen in den Termin-Zeilen auf 32x32px. */
.sar-booking-date__status .sar-booking-icon {
	width: 32px;
	height: 32px;
}

/* Legenden-Symbole kompakter halten, damit die Legende in eine Zeile passt. */
.sar-booking-legend__item .sar-booking-icon {
	width: 20px;
	height: 20px;
}

/* Datum */
.sar-booking-date__range {
	display: flex;
	align-items: center;
	gap: 4px;
}

.sar-booking-date__info {
	background: none;
	border: none;
	cursor: help;
	padding: 0;
}


/* Dauer + Preis (+ optionale „inkl."-Zeilen darunter) */
.sar-booking-date__details {
	text-align: right;
	white-space: nowrap;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
}

.sar-booking-date__inclusions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.sar-booking-date__inclusion {
	font-size: 12px;
	font-weight: 400;
	color: #6a6f76;
	line-height: 1.3;
}

/* EZ-Zuschlag-Zeile unter dem Preis (nur wenn ezzuschlag > 0) */
.sar-booking-date__ez {
	font-size: 12px;
	font-weight: 400;
	color: #6a6f76;
	line-height: 1.3;
	white-space: normal;
}

/* Buchen-Button: Größe/Padding/Schrift kommen von Neves Standard-Button
   (Klassen button button-primary, Customizer-gesteuert). Hier wird nur
   Farbe + Layout in der Spalte gesetzt; die Selektoren sind bewusst
   spezifischer als Neves .button.button-primary. */
/* Buttons werden nativ/zentral über die Theme-.button-Klasse gestylt –
   bewusst KEINE eigene Basis-Definition pro Block hier. */

/* Ausgebucht-Alternative: Reisefinder im selben Zeitraum (dunkelblau,
   sonst identisch zum normalen Buchen-Button) */
/* Nur Layout; Farben kommen jetzt von der globalen Klasse .button-grey */
.sar-booking-dates .sar-booking-date__btn--alt.button {
	font-size: 12px;
	line-height: 1.2;
	text-align: center;
}

/* Aktions-Buttons in der Termin-Spalte einheitlich breit:
   „Buchen"/„Anfragen" und „Weitere Reisen…" bekommen dieselbe Breite. */
.sar-booking-dates .sar-booking-date__btn.button {
	width: 130px;
	flex: 0 0 auto;
	text-align: center;
	box-sizing: border-box;
}

.sar-booking-dates .sar-booking-date__btn--disabled.button,
.sar-booking-dates .sar-booking-date__btn--disabled.button:hover {
	background: #bbb;
	cursor: not-allowed;
}

/* Unterzeilen (Variante, Notiz, Reiseleitung) – bündig mit dem Datum
   (36px Icon-Spalte + 8px Gap). Jede (gewollte) Zeile ist ein eigener
   __sub-line-Span (sar_tb_sub_lines, render.php): der Anstrich sitzt
   absolut links, automatische Umbrüche rücken dadurch hängend unter den
   Textanfang ein, und jeder <br>-Umbruch der PMs bekommt einen eigenen
   Anstrich. */
.sar-booking-date__sub {
	margin-top: 4px;
	padding-left: 44px;
	font-size: 13px;
	line-height: 1.4;
	color: #50575e;
}
.sar-booking-date__sub-line {
	display: block;
	position: relative;
	padding-left: 14px;
}
/* Zeile beginnt mit Anführungszeichen: Zeichen hängt in den Einzug,
   damit die Buchstaben aller Zeilen auf einer Linie stehen. */
.sar-booking-date__sub-line--q {
	text-indent: -10px;
}
.sar-booking-date__sub-line::before {
	content: '–';
	position: absolute;
	left: 0;
	top: 0;
}

/* „Alle Termine anzeigen" (pro Jahr, ab dem 8. Termin), mittig, Toggle */
.sar-booking-show-all {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 10px auto 4px;
	padding: 4px 12px;
	background: none;
	border: none;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: #1a4d2e;
}

.sar-booking-year-group .sar-booking-show-all:hover,
.sar-booking-year-group .sar-booking-show-all:focus,
.sar-booking-year-group .sar-booking-show-all:active {
	text-decoration: underline;
	background: none;
	color: #1a4d2e;
}

.sar-booking-show-all__chevron {
	transition: transform 0.2s ease;
}

.sar-booking-show-all[aria-expanded="true"] .sar-booking-show-all__chevron {
	transform: rotate(180deg);
}

/* Allgemeine Termin-Bemerkung */
.sar-booking-dates-note {
	margin-top: 16px;
}

/* ═══════════════════════════════════════════════════════
   Kombireisen
   ═══════════════════════════════════════════════════════ */

.sar-booking-combis {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 2px solid #e8e8e8;
}

.sar-booking-combis__title {
	margin: 0 0 12px;
}

.sar-booking-combis__subtitle {
	margin: 12px 0 8px;
}

.sar-booking-combis__list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.sar-booking-combis__list li {
	padding: 6px 0;
	border-bottom: 1px solid #f0f0f0;
}

.sar-booking-combis__list a {
	text-decoration: none;
}

.sar-booking-combis__list a:hover {
	color: #e87722;
}

.sar-booking-combis__list small {
	margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════
   Legende
   ═══════════════════════════════════════════════════════ */

.sar-booking-legend {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 2px solid #e8e8e8;
}

.sar-booking-legend__title {
	margin: 0 0 12px;
}

/* Kleinere Schrift + kompakte Abstaende, damit die Legende auf dem Desktop
   in eine Zeile passt. */
.sar-booking-legend__items {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	font-size: 0.8em;
}

.sar-booking-legend__item {
	display: flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   Wunschtermine
   ═══════════════════════════════════════════════════════ */

.sar-booking-wish-dates {
	margin-bottom: 24px;
}

.sar-booking-wish-date__heading {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 10px;
	color: #1d2327;
}

.sar-booking-wish-date__picker {
	font-size: 14px;
	font-weight: 400;
	padding: 6px 12px;
	border: 1px solid #c3c4c7;
	border-radius: 0;
	width: 120px;
	text-align: center;
	cursor: pointer;
	background: #fff;
	color: #1d2327;
	transition: border-color 0.15s;
}

.sar-booking-wish-date__picker:hover,
.sar-booking-wish-date__picker:focus {
	border-color: #1a4d2e;
	outline: none;
}

.sar-booking-wish-date__label {
	font-weight: 600;
	color: #50575e;
}

/* Nach Datumswahl: Label raus, berechneter Zeitraum rein */
.sar-booking-date--wish.has-date .sar-booking-wish-date__label {
	display: none;
}

.sar-booking-date--wish .sar-booking-date__range-text {
	display: none;
}

.sar-booking-date--wish.has-date .sar-booking-date__range-text {
	display: inline;
}

.sar-booking-date__btn--private {
	white-space: nowrap;
}

/* Gesperrte Icons (Wunschtermin ohne Datum) und ausgegraute Icons
   (Kurzreiseverlauf bei aktiver Kombi-Auswahl), PDF 2.6.4.1/2.6.4.2 */
.sar-icon-locked,
.sar-icon-disabled {
	opacity: 0.3;
	pointer-events: none;
	cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════
   Icons in der Terminzeile (Info/Kurzverlauf + Puzzle)
   ═══════════════════════════════════════════════════════ */

.sar-booking-date__itin-toggle,
.sar-booking-date__combo-toggle {
	background: none;
	border: none;
	cursor: pointer;
	color: #646970;
	padding: 2px 6px 2px 2px;
	vertical-align: middle;
	border-radius: 3px;
	line-height: 1;
	transition: color 0.15s, background 0.15s;
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

/* „Kombi"-Label neben dem Puzzle-Icon (erbt die Button-Farbe) */
.sar-combo-toggle__label {
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	display: inline-flex;
	align-items: center;
}

.sar-booking-date__itin-toggle:hover,
.sar-booking-date__itin-toggle[aria-expanded="true"] {
	color: #1a4d2e;
	background: #edf7f0;
}

.sar-booking-date__combo-toggle:hover {
	color: #1a4d2e;
	background: #edf7f0;
}

/* Aktives Puzzle: blau (PDF 2.6.4.2) */
.sar-booking-date__combo-toggle[aria-expanded="true"] {
	color: #0056b3;
	background: #e8f1fb;
}

/* „(kombiniert)"-Hinweis (PDF 2.6.4.3) */
.sar-combo-kombiniert {
	color: #0056b3;
	font-weight: 700;
	font-size: 13px;
	margin-left: 4px;
	white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   Kurzreiseverlauf-Panel
   ═══════════════════════════════════════════════════════ */

.sar-booking-itin-panel {
	background: #f8faf9;
	border: 1px solid #d5ddd8;
	border-radius: 6px;
	margin: 8px 0 4px;
	padding: 12px 20px;
}

.sar-booking-itin-panel__list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
	line-height: 1.6;
}

.sar-booking-itin-panel__day {
	font-weight: 600;
	color: #1a4d2e;
}

/* ═══════════════════════════════════════════════════════
   Kombibaukasten
   ═══════════════════════════════════════════════════════ */

.sar-booking-combo-panel {
	background: #f8faf9;
	border: 1px solid #d5ddd8;
	border-radius: 6px;
	margin: 8px 0 4px;
	padding: 16px 20px;
}

.sar-combo-selected:not(:empty) {
	margin-bottom: 20px;
}

.sar-combo-section__title {
	font-size: 14px;
	font-weight: 700;
	margin: 14px 0 8px;
	color: #1d2327;
}

.sar-combo-section__title:first-child {
	margin-top: 0;
}

/* Eine Baukasten-Zeile: Aktion | Datum | Titel/Variante */
.sar-combo-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid #e8ede9;
	font-size: 14px;
}

.sar-combo-row:last-child {
	border-bottom: none;
}

.sar-combo-row--main {
	background: #edf7f0;
	border-radius: 4px;
	margin: 0 -8px;
	padding: 8px;
}

.sar-combo-row__action {
	flex-shrink: 0;
	width: 24px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: transform 0.15s;
}

/* Hover: nur Zoom, kein Hintergrund (Theme-Button-Hover neutralisieren) */
.sar-booking-combo-panel .sar-combo-row__action:hover,
.sar-booking-combo-panel .sar-combo-row__action:focus {
	transform: scale(1.15);
	background: transparent;
	border: none;
	box-shadow: none;
	outline: none;
}

.sar-combo-row__action--spacer {
	cursor: default;
	pointer-events: none;
}

.sar-combo-row__dates {
	min-width: 140px;
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.sar-combo-row__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.sar-combo-row__name {
	color: #1a4d2e;
	font-weight: 600;
	text-decoration: none;
}

.sar-combo-row__name:hover {
	text-decoration: underline;
}

.sar-combo-row__variant,
.sar-combo-row__label {
	font-size: 12px;
	color: #646970;
}

/* ═══════════════════════════════════════════════════════
   Modal (Anfrage-Hinweis + Reset-Warnung), PDF 2.6.4.5/2.6.4.6
   ═══════════════════════════════════════════════════════ */

.sar-booking-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
}

.sar-booking-modal.is-open {
	display: flex;
}

.sar-booking-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

.sar-booking-modal__content {
	position: relative;
	background: #fff;
	padding: 30px;
	border-radius: 8px;
	width: 90%;
	max-width: 500px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.sar-booking-modal__title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 15px;
	color: #1d2327;
}

.sar-booking-modal__text {
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 25px;
	color: #50575e;
}

.sar-booking-modal__buttons {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

/* Buttons: native WP-/SAR-Button-Klassen (button button-primary / button-secondary)
   greifen direkt. Nur der Abbrechen-Button bekommt eine eigene Optik:
   hellgrau mit sar-navy-blauem Text, im Hover sar-navy-blau mit weißem Text. */
.sar-booking-modal__btn--cancel.button {
	background: #f2f2f2;
	border-color: #f2f2f2;
	color: #1a3a5c;
}
.sar-booking-modal__btn--cancel.button:hover,
.sar-booking-modal__btn--cancel.button:focus {
	background: #1a3a5c;
	border-color: #1a3a5c;
	color: #fff;
}

/* „Offener Termin" = nativer Primary-Button, „Private Reise" = Secondary
   (Klassen .button.button-primary / .button.button-secondary am Link). */

/* ─── Responsive ─── */

@media (max-width: 600px) {
	.sar-booking-date {
		grid-template-columns: 1fr;
	}

	/* Reihenfolge mobil: Inhalt, dann aufklappbare Panels (Kurzreise-
	   verlauf/Kombi-Baukasten), Preis + Button bilden IMMER den Abschluss
	   des Termins. Grid-Auto-Placement folgt der order-Reihenfolge. */
	.sar-booking-date__main {
		order: 1;
	}

	.sar-booking-date > .sar-booking-itin-panel,
	.sar-booking-date > .sar-booking-combo-panel {
		order: 2;
	}

	.sar-booking-date__aside {
		order: 3;
		grid-column: 1;
		justify-self: stretch;
		margin-top: 8px;
		flex-direction: column;
		align-items: flex-end;
		gap: 6px;
	}

	/* Preis/EZ bleiben rechtsbuendig (Desktop-Regel), Button kompakt
	   rechts mit reduziertem Padding statt voller Breite. Der Weissraum
	   links vom Button ist gewollt. */
	.sar-booking-dates .sar-booking-date__btn.button {
		padding: 5px 12px;
	}

	.sar-booking-legend__items {
		flex-direction: column;
		gap: 8px;
	}

	/* Kombibaukasten mobil: Bausteine als gestapelte Karten,
	   Aktion rechts, Datum über dem Titel (PDF 2.6.3) */
	.sar-booking-combo-panel {
		padding: 12px;
	}

	.sar-combo-row {
		flex-wrap: wrap;
		position: relative;
		padding-right: 40px;
	}

	.sar-combo-row__action {
		position: absolute;
		right: 4px;
		top: 50%;
		transform: translateY(-50%);
		width: 32px;
	}

	.sar-booking-combo-panel .sar-combo-row__action:hover,
	.sar-booking-combo-panel .sar-combo-row__action:focus {
		transform: translateY(-50%) scale(1.1);
		background: transparent;
	}

	.sar-combo-row__action svg {
		width: 28px;
		height: 28px;
	}

	.sar-combo-row__dates {
		min-width: 0;
		width: 100%;
	}

	.sar-combo-row__info {
		width: 100%;
	}
}

/* ─── Experimentell (?color=true): Termin-Zeilen im Status-Farbton (0.3) ───
   Farben = dieselben CSS-Variablen wie die Status-Icons. */
.sar-booking-dates--colorized .sar-booking-date--bookable,
.sar-booking-dates--colorized .sar-booking-date--guaranteed-next {
	background: color-mix(in srgb, var(--custom-4) 10%, transparent);
}

.sar-booking-dates--colorized .sar-booking-date--guaranteed {
	background: color-mix(in srgb, var(--custom-5) 10%, transparent);
}

.sar-booking-dates--colorized .sar-booking-date--few-left {
	background: color-mix(in srgb, var(--nv-c-1) 10%, transparent);
}

.sar-booking-dates--colorized .sar-booking-date--sold-out {
	background: color-mix(in srgb, var(--custom-3) 10%, transparent);
}

/* Variante ?color=sw: alle Zeilen einheitlich grau (überschreibt die
   Status-Farben oben; nutzt sonst dasselbe Layout wie --colorized). */
.sar-booking-dates--sw .sar-booking-date,
.sar-booking-dates--sw .sar-booking-date--bookable,
.sar-booking-dates--sw .sar-booking-date--guaranteed-next,
.sar-booking-dates--sw .sar-booking-date--guaranteed,
.sar-booking-dates--sw .sar-booking-date--few-left,
.sar-booking-dates--sw .sar-booking-date--sold-out {
	background: #eeeeee55;
}

/* Dauer/Preis fett + Abstand zum Button + Karten-Layout: gilt jetzt für ALLE
   Varianten (normal, ?color=true, ?color=sw). Nur die Hintergrund-Tönung oben
   bleibt auf --colorized/--sw beschränkt. */
.sar-booking-dates .sar-booking-date__details {
	font-weight: 600;
	padding-right: 20px;
	color: #50575e;
	font-size: 16px;
}

/* Karten-Layout (Padding ohne Trennlinie) nur in den eingefärbten Varianten;
   die normale Variante behält ihre border-bottom-Linie zwischen den Terminen. */
.sar-booking-dates--colorized .sar-booking-date {
	padding: 14px 18px;
	border-bottom: none;
	border-radius: 6px;
}

/* Trenner zwischen Terminen: weißer Abstand (statt dünner grauer Linie) */
.sar-booking-dates--colorized .sar-booking-date + .sar-booking-date {
	margin-top: 10px;
}

/* Mehr Luft über Folge-Jahres-Überschriften (z. B. „Termine 2027"), alle Varianten */
.sar-booking-dates .sar-booking-year-group + .sar-booking-year-group {
	margin-top: 44px;
}
