.sbb-widget {
	max-width: 640px;
	margin: 0 auto;
	font-size: 16px;
}

/* Keine eigene Breitenbeschränkung - die Ergebnisseite braucht Platz für zwei Monatskalender
   nebeneinander; die Breite ergibt sich aus dem umgebenden Seiten-Container, nicht aus dem Widget. */
.sbb-widget.sbb-search-result-widget {
	max-width: none;
}

/* Manche Theme-Stylesheets setzen eigene, spezifischere display-Regeln, die das native
   [hidden]-Verhalten überschreiben (z.B. "leerer weißer Fleck" durch das eigentlich verborgene
   Popup/die Schritte) - hier explizit erzwungen, unabhängig vom Theme. */
.sbb-widget [hidden] {
	display: none !important;
}

.sbb-widget .sbb-field-row {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: end;
	margin-bottom: 16px;
}

.sbb-widget .sbb-field-row label {
	display: flex;
	flex-direction: column;
	font-size: 0.9em;
	gap: 4px;
}

.sbb-widget input[type="date"],
.sbb-widget input[type="number"],
.sbb-widget input[type="text"],
.sbb-widget input[type="email"],
.sbb-widget input[type="tel"],
.sbb-widget textarea {
	padding: 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.sbb-widget .sbb-checkin,
.sbb-widget .sbb-checkout {
	width: 8.5em;
	cursor: pointer;
	background: #fff;
}

.sbb-widget .sbb-guest-count-label {
	width: max-content;
}

.sbb-widget .sbb-guest-count {
	width: 3.5em;
	text-align: center;
}

.sbb-widget .sbb-btn-primary {
	background: #3b7835;
	border: none;
	color: #fff;
	font-size: 15px;
	padding: 15px 30px;
	border-radius: 5px;
	cursor: pointer;
}

.sbb-widget .sbb-btn-primary:hover,
.sbb-widget .sbb-btn-primary:focus {
	background-color: #d7865d;
	color: #fff;
}

.sbb-widget .sbb-btn-secondary {
	background: #fff;
	border: 2px solid #3b7835;
	color: #3b7835;
	font-size: 15px;
	padding: 13px 28px;
	border-radius: 5px;
	cursor: pointer;
}

.sbb-widget .sbb-btn-secondary:hover,
.sbb-widget .sbb-btn-secondary:focus {
	background: #f3f8f3;
}

.sbb-widget .sbb-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px 24px;
	margin-bottom: 8px;
}

.sbb-widget .sbb-form-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 14px;
}

.sbb-widget .sbb-form-field-wide {
	grid-column: 1 / -1;
}

.sbb-widget .sbb-form-field label {
	font-size: 0.9em;
}

.sbb-widget .sbb-form-field label.sbb-required {
	font-weight: 700;
}

.sbb-widget .sbb-form-field textarea {
	min-height: 5em;
}

@media (max-width: 600px) {
	.sbb-widget .sbb-form-grid {
		grid-template-columns: 1fr;
	}

	/* Anreise/Abreise sind jetzt schmal genug, um zusammen in eine Zeile zu passen (siehe
	   .sbb-checkin/.sbb-checkout oben) - Gäste + Suchen fallen auf Mobile in eine zweite Zeile;
	   ohne das hier bleibt dort viel Leerraum rechts vom Button. Der Button füllt ihn stattdessen. */
	.sbb-widget .sbb-search-button {
		flex: 1 1 auto;
	}
}

.sbb-widget .sbb-form-hint {
	font-size: 0.85em;
	color: #777;
	margin-top: -4px;
	margin-bottom: 16px;
}

/* Zurück (links) / Weiter (rechts) - Buttons stehen dafür in dieser Reihenfolge im Markup
   (sbb-btn-secondary zuerst, sbb-btn-primary zuletzt), space-between schiebt sie an die Ränder. */
.sbb-widget .sbb-result-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
}

.sbb-widget .sbb-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.sbb-widget .sbb-calendar {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	max-width: 420px;
	margin: 12px 0;
}

.sbb-widget .sbb-calendar-month-label {
	grid-column: 1 / -1;
	font-weight: 600;
	margin-top: 8px;
}

.sbb-widget .sbb-day {
	text-align: center;
	padding: 6px 0;
	border-radius: 4px;
	font-size: 0.85em;
}

.sbb-widget .sbb-day-blocked {
	background: #f2d7d7;
	color: #a33;
	text-decoration: line-through;
}

.sbb-widget .sbb-day-free {
	background: #eef7ee;
}

.sbb-widget .sbb-day-past {
	background: #f2f2f2;
	color: #aaa;
}

.sbb-widget .sbb-datepicker-popup {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
	margin-top: 6px;
	background: #fff;
	color: #333;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	padding: 16px;
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	width: max-content;
	max-width: calc(100vw - 32px);
}

.sbb-widget .sbb-datepicker-month {
	display: grid;
	grid-template-columns: repeat(7, 2em);
	gap: 2px;
}

.sbb-widget .sbb-datepicker-nav {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 600;
	margin-bottom: 6px;
}

.sbb-widget .sbb-datepicker-nav-btn {
	font-size: 16px;
	line-height: 1;
	padding: 4px 12px;
}

.sbb-widget .sbb-datepicker-nav-btn:disabled {
	opacity: 0.4;
	cursor: default;
	background: #3b7835;
	color: #fff;
}

.sbb-widget .sbb-datepicker-weekday {
	text-align: center;
	font-size: 0.75em;
	color: #888;
	padding-bottom: 4px;
}

.sbb-widget .sbb-datepicker-day {
	position: relative;
	text-align: center;
	padding: 6px 0;
	border-radius: 4px;
	font-size: 0.85em;
	cursor: pointer;
	color: #3b7835;
}

.sbb-widget .sbb-datepicker-day-number {
	display: block;
}

/* Preis pro Nacht, klein und rechts unten in der Zelle - nur für buchbare Tage gerendert (siehe
   search-result-widget.js), damit blockierte/vergangene Tage nicht mit Preisen verwirren. */
.sbb-widget .sbb-datepicker-day-price {
	position: absolute;
	right: 3px;
	bottom: 1px;
	font-size: 0.7em;
	line-height: 1;
	color: #6a8f68;
	pointer-events: none;
}

.sbb-widget .sbb-datepicker-day-selected .sbb-datepicker-day-price {
	color: #eaf3ea;
}

.sbb-widget .sbb-datepicker-day:hover {
	background: #dcece2;
}

.sbb-widget .sbb-datepicker-day-empty {
	visibility: hidden;
}

.sbb-widget .sbb-datepicker-day-disabled {
	background: #f2d7d7;
	color: #a33;
	text-decoration: line-through;
	cursor: not-allowed;
	pointer-events: none;
}

.sbb-widget .sbb-datepicker-day-past {
	background: #f2f2f2;
	color: #aaa;
	cursor: not-allowed;
	pointer-events: none;
}

.sbb-widget .sbb-datepicker-day-in-range {
	background: #dcece2;
}

.sbb-widget .sbb-datepicker-day-selected {
	background: #3b7835;
	color: #fff;
}

.sbb-widget .sbb-message {
	min-height: 1.2em;
	color: #a33;
}

.sbb-widget .sbb-price-breakdown {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 12px;
	margin-bottom: 16px;
}

.sbb-widget .sbb-price-breakdown dt,
.sbb-widget .sbb-price-breakdown dd {
	margin: 0;
}

.sbb-widget .sbb-price-breakdown dt {
	color: #555;
}

.sbb-widget .sbb-price-breakdown dd {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* dt/dd tragen die Klasse selbst (siehe addRow() in search-result-widget.js), nicht ein
   umschließendes Element - ".sbb-total dt"/".sbb-total dd" hätte hier nie etwas getroffen. */
.sbb-widget .sbb-price-breakdown dt.sbb-total,
.sbb-widget .sbb-price-breakdown dd.sbb-total {
	font-weight: 700;
	font-size: 1.15em;
	border-top: 1px solid #999;
	margin-top: 4px;
	padding-top: 8px;
}

.sbb-widget .sbb-price-breakdown .sbb-discount dt,
.sbb-widget .sbb-price-breakdown .sbb-discount dd {
	color: #2a7a2a;
}

.sbb-widget-placeholder {
	font-style: italic;
	color: #666;
}

/* Fortschrittsbalken (Datum / Apartment / Buchen) */

.sbb-widget .sbb-progress {
	display: flex;
	align-items: center;
	margin-bottom: 24px;
}

.sbb-widget .sbb-progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

.sbb-widget .sbb-progress-dot {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid #cfd8dc;
	box-sizing: border-box;
}

.sbb-widget .sbb-progress-label {
	font-size: 0.85em;
	font-weight: 600;
	color: #9aa5ab;
	white-space: nowrap;
}

.sbb-widget .sbb-progress-line {
	flex: 1 1 auto;
	height: 3px;
	background: #cfd8dc;
	margin: 0 8px;
	margin-bottom: 22px;
}

.sbb-widget .sbb-progress-step.is-complete .sbb-progress-dot {
	background: #3b7835;
	border-color: #3b7835;
}

.sbb-widget .sbb-progress-step.is-complete .sbb-progress-label {
	color: #333;
}

.sbb-widget .sbb-progress-step.is-current .sbb-progress-dot {
	border-color: #3b7835;
}

.sbb-widget .sbb-progress-step.is-current .sbb-progress-label {
	color: #3b7835;
}

.sbb-widget .sbb-progress-line.is-complete {
	background: #3b7835;
}

/* Info-Leiste mit Icons (Nächte / Gäste / Anreise / Abreise) */

.sbb-widget .sbb-info-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 32px;
	background: #f7f9f7;
	border: 1px solid #e5e9e5;
	border-radius: 10px;
	padding: 16px 20px;
	margin-bottom: 24px;
}

.sbb-widget .sbb-info-item {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #333;
}

.sbb-widget .sbb-info-item svg {
	color: #3b7835;
	flex-shrink: 0;
}

/* Ferienwohnung-Info (Titel, Bild, Beschreibung) */

.sbb-widget .sbb-apartment-info {
	margin-bottom: 24px;
}

.sbb-widget .sbb-apartment-title {
	margin-bottom: 12px;
}

.sbb-widget .sbb-apartment-body {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

.sbb-widget .sbb-apartment-image {
	flex: 0 0 260px;
	max-width: 100%;
}

.sbb-widget .sbb-apartment-image img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

.sbb-widget .sbb-apartment-description {
	flex: 1 1 280px;
	color: #444;
	line-height: 1.6;
}

/* Datumsleiste auf der Ergebnisseite: erst der immer sichtbare Zwei-Monats-Kalender (Preise!),
   darunter Anreise/Abreise/Gäste/Suchen - beides zusammen unter dem Fortschrittsbalken. */

.sbb-widget.sbb-search-result-widget .sbb-date-bar {
	margin-bottom: 16px;
}

.sbb-widget.sbb-search-result-widget .sbb-date-bar .sbb-field-row {
	justify-content: center;
}

.sbb-widget .sbb-inline-calendar {
	display: flex;
	gap: 32px;
	margin: 0 0 20px;
}

/* Etwas größere Kalendertage als im kompakten Start-Widget, damit der Preis unten rechts (siehe
   .sbb-datepicker-day-price) Platz hat - nur für die Ergebnisseite, das Start-Widget bleibt
   unverändert kompakt. */
.sbb-widget .sbb-inline-calendar .sbb-datepicker-month {
	flex: 1 1 0;
	grid-template-columns: repeat(7, minmax(2.6em, 1fr));
}

.sbb-widget .sbb-inline-calendar .sbb-datepicker-day {
	padding: 8px 0 12px;
}

@media (max-width: 600px) {
	.sbb-widget .sbb-inline-calendar {
		flex-wrap: wrap;
	}

	.sbb-widget .sbb-inline-calendar .sbb-datepicker-month {
		flex: 1 1 100%;
	}
}
