/**
 * Frontend Booking UI — Product Page Styles
 *
 * Styles the 3-step booking flow on WooCommerce product pages:
 *   - Session selector dropdown
 *   - Quantity stepper
 *   - Participant accordion forms
 *   - Booking summary panel
 *
 * @package JescoBooking
 */

/* =============================================================================
   Booking UI container
   ============================================================================= */
.jcb-booking-ui {
	margin: 20px 0;
}

/* =============================================================================
   Steps
   ============================================================================= */
.jcb-step {
	margin-bottom: 24px;
}

.jcb-step-title {
	font-size: 1.1em;
	font-weight: 600;
	margin: 0 0 12px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.jcb-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #0073aa;
	color: #fff;
	font-size: 14px;
	font-weight: bold;
	flex-shrink: 0;
	line-height: 1;
}

/* =============================================================================
   Session selector
   ============================================================================= */
.jcb-sessions-loading {
	color: #777;
	font-style: italic;
}

.jcb-session-select {
	width: 100%;
	cursor: pointer;
	font-size: 16px;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}

/* =============================================================================
   Quantity stepper
   ============================================================================= */
.jcb-qty-stepper {
	display: inline-flex;
	align-items: stretch;
}

.jcb-qty-minus,
.jcb-qty-plus {
	width: 36px;
	height: 36px;
	border: 1px solid #ddd;
	background: #f7f7f7;
	cursor: pointer;
	font-size: 1.2em;
	line-height: 1;
	border-radius: 4px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.1s ease;
}

.jcb-qty-minus:hover,
.jcb-qty-plus:hover {
	background: #e9e9e9;
}

.jcb-qty-stepper input[type="number"] {
	width: 60px;
	text-align: center;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
	border-left: none;
	border-right: none;
	height: 36px;
	margin: 0;
	padding: 0 4px;
	-moz-appearance: textfield;
}

.jcb-qty-stepper input[type="number"]::-webkit-inner-spin-button,
.jcb-qty-stepper input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.jcb-qty-note {
	margin: 6px 0 0;
	font-size: 0.85em;
	color: #777;
}

/* =============================================================================
   Participant accordion blocks
   ============================================================================= */
.jcb-participant-block {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	margin-bottom: 10px;
	overflow: hidden;
}

.jcb-participant-header {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	background: #f9f9f9;
	gap: 10px;
	user-select: none;
}

.jcb-participant-label {
	font-weight: 600;
	flex: 1;
}

.jcb-p-status {
	font-size: 0.8em;
	color: #777;
}

.jcb-participant-toggle {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.95em;
	margin-left: auto;
	padding: 0 4px;
	color: #555;
}

.jcb-participant-body {
	padding: 16px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* =============================================================================
   Form fields
   ============================================================================= */
.jcb-field-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.jcb-label {
	font-size: 0.9em;
	font-weight: 500;
}

.jcb-required {
	color: #dc3232;
	margin-left: 2px;
}

.jcb-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

/* Date inputs: keep appearance:none for consistent sizing (the native
   picker still opens on tap on iOS/Android). Style the value text so
   the field doesn't collapse when empty or filled. */
input[type="date"].jcb-input {
	height: 40px;
	min-height: 40px;
	line-height: 24px;
	max-width: 100%;
	-webkit-padding-end: 10px;
	-webkit-padding-start: 10px;
}

input[type="date"].jcb-input::-webkit-date-and-time-value {
	text-align: left;
}

/* Placeholder-like color when no date is selected (WebKit). */
input[type="date"].jcb-input:invalid {
	color: #999;
}

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

.jcb-input.jcb-error,
.jcb-input.jcb-input-invalid {
	border-color: #dc3232;
}

.jcb-field-error {
	display: block;
	color: #dc3232;
	font-size: 0.82em;
	margin-top: 4px;
	line-height: 1.3;
}

textarea.jcb-input {
	resize: vertical;
	min-height: 70px;
}

.jcb-checkbox-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.9em;
	cursor: pointer;
}

.jcb-checkbox-label input[type="checkbox"] {
	width: auto;
	margin: 0;
}

/* =============================================================================
   Booking summary
   ============================================================================= */
.jcb-booking-summary {
	margin-top: 20px;
	padding: 16px 20px;
	background: #f8f8f8;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
}

.jcb-booking-summary h4 {
	margin: 0 0 10px;
	font-size: 1em;
	font-weight: 600;
}

.jcb-booking-summary p {
	margin: 0 0 4px;
	font-size: 0.9em;
}

/* =============================================================================
   Utility
   ============================================================================= */
.jcb-muted {
	color: #777;
}

/* =============================================================================
   Session range notification
   ============================================================================= */
.jcb-range-notification {
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	padding: 10px 14px;
	margin: 8px 0;
	font-size: 0.9em;
	color: #856404;
	line-height: 1.4;
}

.jcb-session-range-picker {
	margin-bottom: 12px;
}

/* =============================================================================
   Selects — custom appearance
   ============================================================================= */
.jcb-field-group select {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	background: #fff;
	height: 40px;
	min-height: 40px;
	line-height: 24px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

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

/* =============================================================================
   Responsive — stack to single column on small screens
   ============================================================================= */
@media ( max-width: 600px ) {
	.jcb-participant-body {
		grid-template-columns: 1fr;
	}
}
