/**
 * WolfWeb Booking — front-end form styles.
 * Uses theme fonts/colors via inheritance and CSS variables with sensible fallbacks.
 * Desktop (≥641px): 2-column CSS grid; mobile: single column.
 * Touch targets sized for ~375px (iOS Safari / Android Chrome).
 */

.wwb-booking {
	/* Opaque border with >= 3:1 contrast on the white field and on light page backgrounds. */
	--wwb-border: color-mix(in srgb, currentColor 65%, #fff);
	--wwb-field-bg: #fff;
	--wwb-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23444' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	--wwb-error: #b42318;
	--wwb-error-bg: #fef3f2;
	--wwb-ok: #027a48;
	--wwb-ok-bg: #ecfdf3;
	--wwb-muted: color-mix(in srgb, currentColor 55%, transparent);
	--wwb-radius: 0.4rem;
	--wwb-gap: 1rem;
	--wwb-control-min-h: 2.75rem;
	max-width: 42rem;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

.wwb-booking *,
.wwb-booking *::before,
.wwb-booking *::after {
	box-sizing: border-box;
}

.wwb-booking__intro {
	margin: 0 0 1.25rem;
	line-height: 1.5;
}

.wwb-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wwb-gap);
	align-items: start;
}

.wwb-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
}

.wwb-field--full,
.wwb-actions {
	grid-column: 1 / -1;
}

.wwb-field label {
	font-weight: 600;
	font-size: 0.95em;
}

.wwb-req {
	color: var(--wwb-error);
}

.wwb-optional {
	font-weight: 400;
	opacity: 0.75;
}

.wwb-field input[type="text"],
.wwb-field input[type="email"],
.wwb-field input[type="tel"],
.wwb-field input[type="date"],
.wwb-field select,
.wwb-field textarea {
	width: 100%;
	max-width: 100%;
	min-height: var(--wwb-control-min-h);
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--wwb-border, #858585);
	border-radius: var(--wwb-radius);
	background: var(--wwb-field-bg, #fff);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	color: inherit;
	/* 16px minimum avoids iOS Safari zoom-on-focus. */
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	-webkit-appearance: none;
	appearance: none;
	touch-action: manipulation;
}

/* appearance: none drops the native arrow, so draw one (higher specificity than theme resets). */
.wwb-booking .wwb-form .wwb-field select {
	padding-right: 2.5rem;
	background-image: var(--wwb-select-arrow);
	background-repeat: no-repeat;
	background-position: right 0.9rem center;
	background-size: 12px 8px;
	cursor: pointer;
}

.wwb-field textarea {
	min-height: 6.5rem;
	resize: vertical;
}

.wwb-field input[type="date"],
.wwb-field .wwb-input-date {
	display: block;
	min-height: 3rem;
	/* Keep native picker usable; prevent theme overflow clipping on narrow viewports. */
	min-width: 0;
}

.wwb-field input[type="date"]::-webkit-calendar-picker-indicator {
	cursor: pointer;
	padding: 0.35rem;
	margin-left: 0.25rem;
	opacity: 0.85;
}

.wwb-field input:focus-visible,
.wwb-field select:focus-visible,
.wwb-field textarea:focus-visible {
	outline: 2px solid color-mix(in srgb, currentColor 70%, transparent);
	outline-offset: 1px;
}

/* Must beat ".wwb-field input[type=…]" above and Elementor kit field styles. */
.wwb-booking .wwb-form .wwb-field.wwb-field--error input,
.wwb-booking .wwb-form .wwb-field.wwb-field--error select,
.wwb-booking .wwb-form .wwb-field.wwb-field--error textarea {
	border-color: var(--wwb-error);
	box-shadow: 0 0 0 1px var(--wwb-error);
}

.wwb-field__error {
	margin: 0;
	color: var(--wwb-error);
	font-size: 0.875em;
}

.wwb-field--check label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-weight: 500;
	line-height: 1.4;
	min-height: 2.5rem;
}

.wwb-field--check input[type="checkbox"] {
	margin-top: 0.2rem;
	flex-shrink: 0;
	width: 1.15rem;
	height: 1.15rem;
	touch-action: manipulation;
}

.wwb-check__text {
	min-width: 0;
}

.wwb-check__text a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wwb-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.wwb-actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.75rem;
	margin-top: 0.25rem;
}

.wwb-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	width: 100%;
	min-height: 3rem;
	padding: 0.9rem 1.25rem;
	border: 1px solid currentColor;
	border-radius: var(--wwb-radius);
	background: color-mix(in srgb, currentColor 8%, transparent);
	color: inherit;
	font: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.wwb-submit:hover {
	opacity: 0.92;
}

.wwb-submit:disabled,
.wwb-submit.is-busy {
	opacity: 0.75;
	cursor: wait;
}

.wwb-submit__busy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
}

.wwb-submit__busy[hidden],
.wwb-submit__idle[hidden] {
	display: none !important;
}

.wwb-spinner {
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: wwb-spin 0.7s linear infinite;
	flex-shrink: 0;
}

@keyframes wwb-spin {
	to {
		transform: rotate(360deg);
	}
}

.wwb-alert {
	padding: 0.9rem 1rem;
	border-radius: var(--wwb-radius);
	line-height: 1.5;
	margin-bottom: 1rem;
}

.wwb-alert--error {
	background: var(--wwb-error-bg);
	color: var(--wwb-error);
	border: 1px solid color-mix(in srgb, var(--wwb-error) 25%, transparent);
}

.wwb-alert--success {
	background: var(--wwb-ok-bg);
	color: var(--wwb-ok);
	border: 1px solid color-mix(in srgb, var(--wwb-ok) 25%, transparent);
	margin-bottom: 0;
}

@media (max-width: 640px) {
	.wwb-form {
		grid-template-columns: 1fr;
	}

	.wwb-field--full,
	.wwb-actions {
		grid-column: auto;
	}

	.wwb-submit {
		width: 100%;
		min-height: 3.25rem;
		font-size: 1.1rem;
	}

	.wwb-field input[type="date"],
	.wwb-field .wwb-input-date {
		min-height: 3.15rem;
	}
}

/* Deposit (aanbetaling) */
.wwb-deposit-note {
	margin: 0;
	font-size: 0.95em;
}
.wwb-booking--payment .wwb-alert + .wwb-alert {
	margin-top: 12px;
}
.wwb-payment__saved {
	margin: 16px 0 8px;
}
.wwb-payment__summary {
	width: 100%;
	max-width: 520px;
	border-collapse: collapse;
	margin: 0 0 16px;
}
.wwb-payment__summary th,
.wwb-payment__summary td {
	text-align: left;
	padding: 6px 8px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	font-weight: normal;
}
.wwb-payment__summary th {
	width: 40%;
	opacity: 0.8;
}
