/**
 * WooCommerce Booking Form — front-end styles
 *
 * BEM naming under the .wcbf- namespace.
 * No !important. No inline styles injected by JS (except transient show/hide
 * which uses CSS classes toggled by JS).
 *
 * @package WCBF
 */

/* ==========================================================================
   Form wrapper
   ========================================================================== */

.wcbf-form-wrap {
	position: relative;
	max-width: 800px;
	margin: 0 auto;
	font-family: inherit;
	color: inherit;
}

/* ==========================================================================
   Generic field
   ========================================================================== */

.wcbf-field {
	margin-bottom: 1rem;
}

.wcbf-field label {
	display: block;
	margin-bottom: 0.25rem;
	font-weight: 600;
	font-size: 0.9rem;
}

.wcbf-field input[type="text"],
.wcbf-field input[type="email"],
.wcbf-field input[type="tel"],
.wcbf-field input[type="number"],
.wcbf-field input[type="time"],
.wcbf-field input[type="date"],
.wcbf-field select {
	display: block;
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1rem;
	line-height: 1.5;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s ease;
}

.wcbf-field input:focus,
.wcbf-field select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wcbf-field--error input,
.wcbf-field--error select {
	border-color: #cc0000;
}

.wcbf-required {
	color: #cc0000;
	margin-left: 2px;
}

.wcbf-error {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.8rem;
	color: #cc0000;
	min-height: 1em;
}

/* ==========================================================================
   Widget headings
   ========================================================================== */

.wcbf-widget-heading {
	margin: 1.5rem 0 0.75rem;
	font-size: 1.1rem;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 0.25rem;
}

/* ==========================================================================
   Out-of-stock badge
   ========================================================================== */

.wcbf-out-of-stock-badge {
	display: inline-block;
	margin-left: 10px;
	padding: 2px 8px;
	background: #d63638;
	color: #fff;
	font-size: 0.75em;
	font-weight: 600;
	border-radius: 3px;
	vertical-align: middle;
	letter-spacing: 0.02em;
}

.wcbf-stock-count {
	display: inline-block;
	margin-left: 8px;
	font-size: 0.8em;
	font-weight: 400;
	color: #2e7d32;
	vertical-align: middle;
}

/* ==========================================================================
   Quantity spinner
   ========================================================================== */

.wcbf-qty-wrap {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.wcbf-qty-label {
	font-weight: 600;
	font-size: 0.9rem;
	margin: 0;
}

.wcbf-qty-input {
	width: 80px;
	padding: 0.4rem 0.5rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1rem;
	text-align: center;
}

/* ==========================================================================
   Room repeater
   ========================================================================== */

.wcbf-room-rows {
	margin-top: 0.5rem;
}

.wcbf-room-row {
	background: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 1rem;
	margin-bottom: 1rem;
}

/* Check-in / Check-out side by side */
.wcbf-dates-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
}

.wcbf-guest-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

/* Calendar icon on date inputs — override the generic .wcbf-field input rule */
.wcbf-field input.wcbf-date-input,
input.wcbf-date-input {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.6rem center;
	background-size: 16px 16px;
	padding-right: 2.2rem;
	cursor: pointer;
}

.wcbf-room-price-preview {
	font-size: 0.9rem;
	color: #555;
	margin-top: 0.5rem;
	font-style: italic;
}

/* ==========================================================================
   Transfer repeater
   ========================================================================== */

.wcbf-transfer-rows {
	margin-top: 0.5rem;
}

.wcbf-transfer-row {
	background: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 1rem;
	margin-bottom: 1rem;
}

.wcbf-transfer-leg {
	margin-bottom: 1rem;
}

.wcbf-transfer-leg h4 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	color: #0073aa;
}

.wcbf-transfer-leg--hidden {
	display: none;
}

.wcbf-departure-toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0.75rem 0;
	font-weight: 600;
	cursor: pointer;
}

.wcbf-departure-note {
	font-size: 0.85rem;
	color: #666;
	font-style: italic;
	margin-bottom: 0.75rem;
}

/* Auto-calculated vehicle summary — read-only label shown below persons input */
.wcbf-vehicle-summary {
	margin: 0.25rem 0 0.75rem;
	font-size: 0.9rem;
	color: #0073aa;
	font-weight: 600;
}

/* ==========================================================================
   Extra service
   ========================================================================== */

.wcbf-service-wrap {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.wcbf-service-label {
	font-weight: 600;
	font-size: 0.9rem;
}

/* ==========================================================================
   Invoice type toggle
   ========================================================================== */

.wcbf-invoice-type fieldset {
	border: none;
	padding: 0;
	margin: 0 0 1rem;
}

.wcbf-invoice-type legend {
	font-weight: 600;
	margin-bottom: 0.5rem;
}

.wcbf-radio-label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-right: 1.5rem;
	cursor: pointer;
}

/* Private fields — shown by default; JS removes --visible modifier when company is selected */
.wcbf-private-fields {
	display: none;
	padding: 1rem;
	background: #f7f7f7;
	border: 1px solid #ddd;
	border-radius: 6px;
	margin-top: 0.5rem;
}

.wcbf-private-fields--visible {
	display: block;
}

/* Company fields — hidden by default; JS adds --visible modifier */
.wcbf-company-fields {
	display: none;
	padding: 1rem;
	background: #f0f7ff;
	border: 1px solid #b3d4f5;
	border-radius: 6px;
	margin-top: 0.5rem;
}

.wcbf-company-fields--visible {
	display: block;
}

/* ==========================================================================
   Notes textarea
   ========================================================================== */

.wcbf-notes-field textarea.wcbf-notes-textarea {
	display: block;
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1rem;
	line-height: 1.5;
	font-family: inherit;
	background: #fff;
	box-sizing: border-box;
	resize: vertical;
	transition: border-color 0.15s ease;
}

.wcbf-notes-field textarea.wcbf-notes-textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* ==========================================================================
   Price summary
   ========================================================================== */

.wcbf-price-summary {
	margin: 2rem 0;
}

.wcbf-price-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.wcbf-price-table th,
.wcbf-price-table td {
	padding: 0.5rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid #e0e0e0;
}

.wcbf-price-table thead th {
	background: #f0f0f0;
	font-weight: 700;
}

.wcbf-price-col {
	text-align: right;
	white-space: nowrap;
}

.wcbf-price-total th,
.wcbf-price-total td {
	font-weight: 700;
	font-size: 1.05rem;
	border-top: 2px solid #0073aa;
	border-bottom: none;
}

/* ==========================================================================
   Submit button
   ========================================================================== */

.wcbf-submit-wrap {
	margin-top: 1.5rem;
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.wcbf-submit-btn {
	display: inline-block;
	padding: 0.75rem 2rem;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.wcbf-submit-btn:hover {
	background: #005a87;
}

.wcbf-submit-btn:disabled {
	background: #aaa;
	cursor: not-allowed;
}

/* Spinner — CSS-only rotating ring */
.wcbf-submit-spinner {
	display: none;
	width: 20px;
	height: 20px;
	border: 3px solid #ccc;
	border-top-color: #0073aa;
	border-radius: 50%;
}

.wcbf-submit-spinner--active {
	display: inline-block;
	animation: wcbf-spin 0.7s linear infinite;
}

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

.wcbf-submit-error {
	width: 100%;
	color: #cc0000;
	font-size: 0.9rem;
}

/* ==========================================================================
   Honeypot — visually hidden but not display:none (bots detect that)
   ========================================================================== */

.wcbf-hp {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ==========================================================================
   Pikaday date picker overrides — keep within wcbf namespace
   ========================================================================== */

.pika-single {
	font-family: inherit;
	font-size: 0.9rem;
	border-radius: 6px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
	border: 1px solid #d0d0d0;
	background: #fff;
	z-index: 9999;
	padding: 0;
	width: 280px;
}

/* Ensure the calendar pops above other form elements.
   When bound:true + container is used, Pikaday appends the calendar
   inside the container div and shows/hides it on focus/blur.
   We must NOT set display:none on .pika-single globally — Pikaday
   manages visibility itself via the 'is-hidden' class. */
.pika-single.is-bound {
	position: absolute;
}

.pika-single.is-hidden {
	display: none;
}

/* The field wrapper needs relative positioning so the calendar
   is positioned relative to the input, not the page. */
.wcbf-field {
	position: relative;
}

/* ---- Header (month/year + nav arrows) ---- */
.pika-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.6rem 0.75rem;
	background: #0073aa;
	color: #fff;
	border-radius: 6px 6px 0 0;
}

/* Month and year selects — styled as plain text buttons */
.pika-title select {
	appearance: none;
	-webkit-appearance: none;
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.35);
	border-radius: 4px;
	color: #fff;
	font-weight: 700;
	font-size: 0.9rem;
	padding: 0.2rem 0.5rem;
	cursor: pointer;
	margin: 0 2px;
}

.pika-title select:hover,
.pika-title select:focus {
	background: rgba(255,255,255,0.25);
	outline: none;
}

/* Prev / Next arrow buttons */
.pika-prev,
.pika-next {
	display: inline-block;
	width: 28px;
	height: 28px;
	background: rgba(255,255,255,0.15) no-repeat center center;
	background-size: 14px 14px;
	border: 1px solid rgba(255,255,255,0.35);
	border-radius: 4px;
	cursor: pointer;
	text-indent: -9999px;
	overflow: hidden;
	opacity: 1;
	flex-shrink: 0;
}

.pika-prev {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M7 1L3 5l4 4' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.pika-next {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M3 1l4 4-4 4' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.pika-prev:hover,
.pika-next:hover {
	background-color: rgba(255,255,255,0.3);
}

.pika-prev.is-disabled,
.pika-next.is-disabled {
	opacity: 0.3;
	cursor: default;
}

/* ---- Day-of-week header row ---- */
.pika-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}

.pika-table th {
	color: #888;
	font-size: 0.75rem;
	font-weight: 600;
	text-align: center;
	padding: 0.4rem 0;
	border-bottom: 1px solid #eee;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* ---- Day cells ---- */
.pika-table td {
	padding: 2px;
}

.pika-button {
	display: block;
	width: 100%;
	padding: 0.45rem 0;
	background: #fff;
	border: none;
	border-radius: 4px;
	text-align: center;
	font-size: 0.88rem;
	color: #333;
	cursor: pointer;
	transition: background 0.1s ease, color 0.1s ease;
}

.pika-button:hover {
	background: #e8f4fb;
	color: #0073aa;
}

.is-today .pika-button {
	color: #0073aa;
	font-weight: 700;
	background: #f0f8ff;
}

.is-selected .pika-button {
	background: #0073aa;
	color: #fff;
	font-weight: 700;
	box-shadow: none;
}

.is-disabled .pika-button,
.pika-button[disabled] {
	color: #ccc;
	cursor: default;
	background: #fff;
}

/* ---- Footer padding ---- */
.pika-table tbody tr:last-child td {
	padding-bottom: 6px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media ( max-width: 600px ) {
	.wcbf-dates-row {
		grid-template-columns: 1fr;
	}

	.wcbf-guest-fields {
		grid-template-columns: 1fr;
	}

	.wcbf-qty-wrap {
		flex-wrap: wrap;
	}

	.wcbf-submit-wrap {
		flex-direction: column;
		align-items: flex-start;
	}
}
