/* WP Booking System Extension – front-end */

:root {
	--wpbs-ext-forest: #2f5d3a;
	--wpbs-ext-forest-soft: #e8f0ea;
	--wpbs-ext-ink: #1f2a24;
	--wpbs-ext-muted: #5d6b63;
	--wpbs-ext-line: #d7e0d9;
	--wpbs-ext-bg: #f7faf7;
	--wpbs-ext-warn: #8a5a12;
}

.wpbs-ext-resources-dots {
	position: absolute;
	bottom: 3px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 3px;
	justify-content: center;
	flex-wrap: wrap;
	max-width: calc(100% - 4px);
	padding: 0 2px;
	z-index: 2;
}

.wpbs-date {
	position: relative;
	padding-bottom: 15px !important;
}

.wpbs-ext-resource-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
	border: 1px solid rgba(0, 0, 0, 0.12);
}

.wpbs-ext-dots-loading {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.82);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
	font-weight: 600;
	color: #333;
	text-align: center;
	padding: 10px;
	pointer-events: none;
}

.wpbs-ext-dots-legend {
	margin: 12px 0 16px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
	font-size: 13px;
	line-height: 1.35 !important;
	clear: both;
}

.wpbs-ext-dots-legend-item {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	background: #fafafa;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	line-height: 1.35 !important;
	white-space: nowrap;
}

.wpbs-ext-dots-legend-color {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.wpbs-ext-dots-legend-label {
	display: inline !important;
	line-height: 1.35 !important;
	white-space: nowrap;
	position: static !important;
}

/* WPBS side legend uses line-height:0 — never inherit that onto our chips */
.wpbs-legend .wpbs-ext-dots-legend,
.wpbs-legend .wpbs-ext-dots-legend-item,
.wpbs-legend .wpbs-ext-dots-legend-label {
	line-height: 1.35 !important;
}

/* Native WPBS legend: longer labels (e.g. "Ośrodek zarezerwowany") wrap to two
   lines, but the core CSS sets line-height:0 which makes them overlap.
   Restore a proper line-height and align the label next to the icon. */
.wpbs-legend .wpbs-legend-item {
	line-height: 1.35 !important;
	vertical-align: top;
}

.wpbs-legend .wpbs-legend-item-name {
	line-height: 1.35 !important;
	vertical-align: top;
}

.wpbs-calendars-wrapper.wpbs-legend-position-side .wpbs-legend .wpbs-legend-item {
	line-height: 1.35 !important;
	margin-bottom: 10px;
}

.wpbs-main-wrapper {
	position: relative;
}

.wpbs-form-container.wpbs-ext-form-hidden {
	display: none !important;
}

/* Wider booking page */
body.page-id-28 #skip-content.container,
body.page-template-default.page-id-28 #skip-content.container {
	max-width: min(1320px, 96vw);
}

/* Two-column booking layout */
.wpbs-ext-layout-top {
	display: block;
}

.wpbs-ext-layout-cal,
.wpbs-ext-layout-full {
	min-width: 0;
}

.wpbs-ext-wide-layout .wpbs-form-container {
	max-width: none !important;
	padding-top: 0 !important;
	width: 100%;
}

.wpbs-ext-wide-layout .wpbs-ext-form-shell {
	margin-top: 0;
}

.wpbs-ext-layout-full {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin-top: 8px;
}

@media (min-width: 992px) {
	.wpbs-ext-wide-layout.wpbs-ext-form-open > .wpbs-ext-layout-top {
		display: grid;
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
		gap: 1.5rem 2rem;
		align-items: start;
	}

	.wpbs-ext-wide-layout.wpbs-ext-form-open .wpbs-ext-layout-cal .wpbs-calendars-wrapper.wpbs-legend-position-side {
		padding-right: 0;
	}

	.wpbs-ext-wide-layout.wpbs-ext-form-open .wpbs-ext-layout-cal .wpbs-legend {
		position: static;
		width: auto;
		margin-top: 12px;
	}

	/* Form start sits beside calendar; lower sections span full page width */
	.wpbs-ext-wide-layout.wpbs-ext-form-open .wpbs-ext-layout-full {
		width: calc(200% + 2rem);
		max-width: none;
		margin-left: calc(-100% - 2rem);
		margin-top: 1.25rem;
		padding-top: 0.25rem;
	}

	.wpbs-ext-wide-layout.wpbs-ext-form-open .wpbs-ext-layout-full .wpbs-ext-section,
	.wpbs-ext-wide-layout.wpbs-ext-form-open .wpbs-ext-layout-full .wpbs-form-submit-button,
	.wpbs-ext-wide-layout.wpbs-ext-form-open .wpbs-ext-layout-full .wpbs-form-field-submit {
		max-width: none;
	}
}

@media (max-width: 991px) {
	.wpbs-ext-wide-layout .wpbs-ext-layout-full {
		width: 100%;
		margin-left: 0;
	}
}

/* Form shell */
.wpbs-ext-form-shell {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: 8px 0 20px;
}

.wpbs-ext-dates-banner:empty {
	display: none;
}

.wpbs-ext-dates-banner:not(:empty) {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: var(--wpbs-ext-forest-soft);
	border: 1px solid var(--wpbs-ext-line);
	border-radius: 10px;
	color: var(--wpbs-ext-ink);
	font-size: 14px;
	font-weight: 600;
}

.wpbs-ext-section {
	background: #fff;
	border: 1px solid var(--wpbs-ext-line);
	border-radius: 12px;
	padding: 16px 16px 18px;
	box-shadow: 0 1px 0 rgba(31, 42, 36, 0.03);
}

.wpbs-ext-section-head {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 14px;
}

.wpbs-ext-section-head h3 {
	margin: 0 0 2px;
	font-size: 17px;
	line-height: 1.25;
	color: var(--wpbs-ext-ink);
}

.wpbs-ext-section-head p {
	margin: 0;
	font-size: 13px;
	color: var(--wpbs-ext-muted);
}

.wpbs-ext-step {
	display: none !important;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--wpbs-ext-forest);
	color: #fff;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
}

.wpbs-ext-resource-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
}

.wpbs-ext-resource-card,
.wpbs-ext-toggle-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1.5px solid var(--wpbs-ext-line);
	border-radius: 10px;
	background: var(--wpbs-ext-bg);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
	user-select: none;
}

.wpbs-ext-resource-card:hover,
.wpbs-ext-toggle-card:hover {
	border-color: #a9c2b0;
}

.wpbs-ext-resource-card.is-selected,
.wpbs-ext-toggle-card.is-selected {
	border-color: var(--wpbs-ext-forest);
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--wpbs-ext-forest);
}

.wpbs-ext-resource-card.wpbs-ext-resource-disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
	text-decoration: none;
}

.wpbs-ext-resource-card input,
.wpbs-ext-toggle-card input,
.wpbs-ext-segment input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.wpbs-ext-resource-card-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	flex: 1;
}

.wpbs-ext-resource-text {
	font-weight: 650;
	color: var(--wpbs-ext-ink);
	font-size: 14px;
}

.wpbs-ext-resource-hint {
	font-size: 12px;
	color: var(--wpbs-ext-muted);
}

.wpbs-ext-resource-check {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 1.5px solid #b7c4bb;
	flex-shrink: 0;
	background: #fff;
}

.wpbs-ext-resource-card.is-selected .wpbs-ext-resource-check {
	border-color: var(--wpbs-ext-forest);
	background: var(--wpbs-ext-forest);
	box-shadow: inset 0 0 0 3px #fff;
}

.wpbs-ext-toggle-card {
	margin-top: 12px;
	font-weight: 600;
	color: var(--wpbs-ext-ink);
}

.wpbs-ext-field-tent-count {
	margin-top: 12px;
	padding: 12px;
	border-radius: 10px;
	background: #fff8e8;
	border: 1px solid #f0dfb4;
}

.wpbs-ext-field-tent-count[hidden],
.wpbs-ext-meal-custom[hidden],
.wpbs-ext-invoice-fields[hidden] {
	display: none !important;
}

.wpbs-ext-field-tent-count > label {
	display: block;
	font-weight: 650;
	margin-bottom: 6px;
	color: var(--wpbs-ext-warn);
}

.wpbs-ext-inline-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.wpbs-ext-inline-row input[type="number"] {
	width: 96px;
}

.wpbs-ext-field-hint {
	margin: 0;
	font-size: 13px;
	color: var(--wpbs-ext-muted);
}

.wpbs-ext-grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

@media (max-width: 640px) {
	.wpbs-ext-grid-2 {
		grid-template-columns: 1fr;
	}
}

.wpbs-ext-segmented {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 12px;
}

@media (max-width: 720px) {
	.wpbs-ext-segmented {
		grid-template-columns: 1fr;
	}
}

.wpbs-ext-segment {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 10px 8px;
	border: 1.5px solid var(--wpbs-ext-line);
	border-radius: 10px;
	background: var(--wpbs-ext-bg);
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	color: var(--wpbs-ext-ink);
	transition: border-color 0.15s, background 0.15s;
}

.wpbs-ext-segment.is-selected {
	border-color: var(--wpbs-ext-forest);
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--wpbs-ext-forest);
}

.wpbs-ext-meal-counts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 12px;
}

@media (max-width: 640px) {
	.wpbs-ext-meal-counts {
		grid-template-columns: 1fr;
	}
}

.wpbs-ext-meal-counts label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
}

.wpbs-ext-invoice-fields {
	margin: 12px 0;
	padding: 12px;
	border-radius: 10px;
	background: var(--wpbs-ext-bg);
	border: 1px solid var(--wpbs-ext-line);
}

.wpbs-ext-form-shell .wpbs-form-field {
	margin-bottom: 12px;
}

.wpbs-ext-form-shell .wpbs-form-field-label label {
	font-weight: 650;
	color: var(--wpbs-ext-ink);
}

.wpbs-ext-form-shell input[type="text"],
.wpbs-ext-form-shell input[type="email"],
.wpbs-ext-form-shell input[type="tel"],
.wpbs-ext-form-shell input[type="number"],
.wpbs-ext-form-shell input[type="datetime-local"],
.wpbs-ext-form-shell textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border: 1.5px solid var(--wpbs-ext-line);
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.wpbs-ext-form-shell input:focus,
.wpbs-ext-form-shell textarea:focus {
	outline: none;
	border-color: var(--wpbs-ext-forest);
	box-shadow: 0 0 0 3px rgba(47, 93, 58, 0.12);
}

.wpbs-form-container .wpbs-form-field-submit,
.wpbs-form-container .wpbs-form-submit-button {
	margin-top: 8px;
	/* Always render at the very bottom, below every other section. */
	order: 9999;
	width: 100%;
}

.wpbs-form-container .wpbs-form-field-submit input[type="submit"],
.wpbs-form-container .wpbs-form-submit-button button[type="submit"],
.wpbs-form-container button[type="submit"] {
	background: var(--wpbs-ext-forest) !important;
	border-color: var(--wpbs-ext-forest) !important;
	border-radius: 10px !important;
	padding: 12px 22px !important;
	font-weight: 700 !important;
}

/* Tooltip bubble */
.wpbs-ext-day-tooltip {
	display: none;
	position: absolute;
	z-index: 40;
	left: 50%;
	bottom: calc(100% + 8px);
	transform: translateX(-50%);
	min-width: 180px;
	max-width: 260px;
	background: #fff;
	color: #222;
	border: 1px solid #ddd;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	padding: 10px 12px;
	font-size: 12px;
	line-height: 1.4;
	text-align: left;
	pointer-events: none;
}

.wpbs-ext-day-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -6px;
	border: 6px solid transparent;
	border-top-color: #fff;
	filter: drop-shadow(0 1px 0 #ddd);
}

.wpbs-date:hover .wpbs-ext-day-tooltip,
.wpbs-date.wpbs-ext-tooltip-open .wpbs-ext-day-tooltip {
	display: block;
}

.wpbs-ext-day-tooltip strong {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
}

.wpbs-ext-day-tooltip ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wpbs-ext-day-tooltip li {
	margin: 0 0 6px;
}

.wpbs-ext-day-tooltip .wpbs-ext-tip-meta {
	color: #666;
	font-size: 11px;
}
