/**
 * Nordstranda Bookings — Frontend Form + Calendar Styles
 *
 * @package NordstrandaBookings
 */

.ncb-booking-wrap {
	max-width: 680px;
	margin: 0 auto;
}

.ncb-booking-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.ncb-form-row--half {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.ncb-field label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #1d2327;
}

.ncb-req {
	color: #dc3545;
}

.ncb-field input,
.ncb-field select,
.ncb-field textarea {
	width: 100%;
	padding: 10px 14px;
	font-size: 15px;
	line-height: 1.5;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	background: #fff;
	color: #1d2327;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.ncb-field input:focus,
.ncb-field select:focus,
.ncb-field textarea:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
	outline: none;
}

.ncb-field textarea {
	resize: vertical;
	min-height: 80px;
}

.ncb-field select {
	appearance: auto;
}

/* Submit button inherits theme .btn-submit — only override disabled state */
.ncb-booking-form .btn-submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Feedback */
#ncb-feedback:empty {
	display: none;
}

.ncb-feedback {
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
}

.ncb-feedback--success {
	background: #d1e7dd;
	color: #0a3622;
	border: 1px solid #198754;
}

.ncb-feedback--error {
	background: #f8d7da;
	color: #842029;
	border: 1px solid #dc3545;
}

/* ── Calendar ─────────────────────────────────────────────────── */

.ncb-calendar-section {
	margin: 4px 0;
}

.ncb-cal-hint {
	padding: 32px 24px;
	text-align: center;
	color: #6c757d;
	background: #f8f9fa;
	border: 2px dashed #dee2e6;
	border-radius: 8px;
	font-size: 14px;
}

.ncb-cal-nav {
	display: flex;
	justify-content: space-between;
	margin-bottom: 12px;
}

.ncb-cal-nav button {
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	width: 36px;
	height: 36px;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #495057;
	transition: background 0.15s;
}

.ncb-cal-nav button:hover {
	background: #f0f0f0;
}

.ncb-cal-months {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.ncb-cal-month {
	border: 1px solid #e9ecef;
	border-radius: 8px;
	padding: 12px;
	background: #fff;
}

.ncb-cal-month-title {
	text-align: center;
	font-weight: 700;
	font-size: 15px;
	padding: 4px 0 10px;
	color: #1d2327;
}

.ncb-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.ncb-cal-header {
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	color: #6c757d;
	padding: 4px 0 6px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.ncb-cal-day {
	text-align: center;
	padding: 8px 2px;
	font-size: 14px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.12s, color 0.12s;
	user-select: none;
	line-height: 1;
}

.ncb-cal-day:hover:not(.ncb-cal-day--disabled):not(.ncb-cal-day--empty) {
	background: #e9ecef;
}

.ncb-cal-day--empty {
	cursor: default;
}

.ncb-cal-day--past {
	color: #ccc;
	cursor: default;
}

.ncb-cal-day--blocked {
	background: #f8d7da;
	color: #842029;
	cursor: not-allowed;
	text-decoration: line-through;
}

.ncb-cal-day--today {
	font-weight: 700;
	box-shadow: inset 0 0 0 2px #2271b1;
}

.ncb-cal-day--arrival,
.ncb-cal-day--departure {
	background: #198754 !important;
	color: #fff !important;
	font-weight: 700;
}

.ncb-cal-day--in-range {
	background: #d1e7dd;
	color: #0a3622;
}

/* Date summary */
#ncb-date-summary {
	margin-top: 12px;
	padding: 10px 14px;
	background: #d1e7dd;
	border: 1px solid #a3cfbb;
	border-radius: 6px;
	font-size: 14px;
	color: #0a3622;
	display: none;
}

/* Legend */
.ncb-cal-legend {
	display: flex;
	gap: 16px;
	margin-top: 10px;
	font-size: 12px;
	color: #6c757d;
	flex-wrap: wrap;
}

.ncb-cal-legend-item {
	display: flex;
	align-items: center;
	gap: 4px;
}

.ncb-cal-dot {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
}

.ncb-cal-dot--available {
	background: #fff;
	border: 1px solid #dee2e6;
}

.ncb-cal-dot--blocked {
	background: #f8d7da;
	border: 1px solid #dc3545;
}

.ncb-cal-dot--selected {
	background: #198754;
}

/* ── Theme integration (dark calendar on booking page) ───────── */

.booking-calendar-wrap #ncb-calendar .ncb-cal-months {
	gap: 1.5rem;
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-month {
	background: var(--dark, #2c3e3b);
	border-color: rgba(255,255,255,0.08);
	border-radius: 2px;
	padding: 1.4rem;
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-month-title {
	font-family: var(--ff-display, serif);
	color: #fff;
	font-size: 1.1rem;
	font-weight: 400;
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-header {
	color: rgba(255,255,255,0.4);
	font-size: 0.6rem;
	letter-spacing: 0.1em;
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-day {
	color: rgba(255,255,255,0.75);
	font-size: 0.82rem;
	border-radius: 2px;
	padding: 0.5rem 0;
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-day:hover:not(.ncb-cal-day--disabled):not(.ncb-cal-day--empty) {
	background: rgba(138,197,137,0.3);
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-day--past {
	color: rgba(255,255,255,0.2);
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-day--blocked {
	background: rgba(185, 75, 65, 0.2);
	color: rgba(255,255,255,0.3);
	text-decoration: line-through;
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-day--today {
	box-shadow: inset 0 0 0 2px rgba(138,197,137,0.6);
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-day--arrival,
.booking-calendar-wrap #ncb-calendar .ncb-cal-day--departure {
	background: var(--summer, #e6c862) !important;
	color: var(--dark, #2c3e3b) !important;
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-day--in-range {
	background: rgba(230,200,98,0.25);
	color: rgba(255,255,255,0.9);
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-nav button {
	width: 28px;
	height: 28px;
	background: rgba(255,255,255,0.1);
	border: none;
	border-radius: 2px;
	color: #fff;
	font-size: 0.8rem;
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-nav button:hover {
	background: rgba(255,255,255,0.2);
}

.booking-calendar-wrap #ncb-calendar .ncb-cal-hint {
	background: var(--dark, #2c3e3b);
	border-color: rgba(255,255,255,0.1);
	border-radius: 2px;
	color: rgba(255,255,255,0.5);
}

.booking-calendar-wrap .ncb-cal-dot--available {
	background: rgba(255,255,255,0.15);
	border-color: rgba(255,255,255,0.4);
}

.booking-calendar-wrap .ncb-cal-dot--blocked {
	background: rgba(185, 75, 65, 0.35);
	border-color: rgba(185, 75, 65, 0.6);
}

.booking-calendar-wrap .ncb-cal-dot--selected {
	background: var(--summer, #e6c862);
}

.booking-calendar-wrap .ncb-cal-legend {
	color: rgba(255,255,255,0.45);
}

/* Responsive */
@media (max-width: 600px) {
	.ncb-form-row--half {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.ncb-cal-months {
		grid-template-columns: 1fr;
	}

	.ncb-booking-form .btn-submit {
		width: 100%;
		text-align: center;
	}
}

/* ── Unit picker ─────────────────────────────────────────────
   Enhancement over the native <select>. Until initPicker() runs,
   the select is the control; .ncb-picker--ready swaps them, so a
   JS failure leaves a working form rather than an empty box. */

.ncb-picker { position: relative; }
.ncb-picker--ready .ncb-picker-native {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.ncb-picker-trigger {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 46px;
	padding: 0.7rem 0.9rem;
	border: 1px solid rgba(0,0,0,0.1);
	border-radius: 2px;
	background: var(--light, #f7f5f1);
	font-family: var(--ff-body, sans-serif);
	color: var(--dark, #1c2b28);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s;
}
.ncb-picker-trigger:hover { border-color: var(--spring-mid, #9dbccc); }
.ncb-picker-trigger[aria-expanded="true"] { border-color: var(--spring, #729cac); }
.ncb-picker-placeholder { font-size: 0.88rem; font-weight: 300; color: var(--mid, #4a5e5a); }
.ncb-picker-current { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; }
.ncb-picker-current-name {
	font-family: var(--ff-display, serif);
	font-size: 1.15rem;
	color: var(--dark, #1c2b28);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ncb-picker-current-place {
	font-size: 0.6rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--spring, #729cac);
	white-space: nowrap;
}
.ncb-picker-caret {
	flex: none;
	width: 12px;
	height: 12px;
	stroke: var(--mid, #4a5e5a);
	stroke-width: 1.6;
	fill: none;
	transition: transform 0.2s;
}
.ncb-picker-trigger[aria-expanded="true"] .ncb-picker-caret { transform: rotate(180deg); }

/* Tabular figures so the three numbers line up down the list — the one
   thing a native <option> can never do, and the reason for this component. */
.ncb-picker-stats {
	display: flex;
	gap: 0.85rem;
	flex: none;
	font-variant-numeric: tabular-nums;
}
.ncb-picker-stat {
	font-size: 0.74rem;
	color: var(--mid, #4a5e5a);
	white-space: nowrap;
}
.ncb-picker-stat b { font-weight: 500; color: var(--dark, #1c2b28); }

.ncb-picker-panel {
	position: absolute;
	z-index: 40;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid rgba(0,0,0,0.1);
	border-radius: 2px;
	box-shadow: 0 18px 44px rgba(28,43,40,0.18);
	overflow: hidden;
}
.ncb-picker-head {
	border-bottom: 1px solid rgba(0,0,0,0.07);
	padding: 0.8rem 0.85rem;
	display: grid;
	gap: 0.7rem;
}
.ncb-picker-search { position: relative; display: flex; align-items: center; }
.ncb-picker-search svg {
	position: absolute;
	left: 0.7rem;
	width: 15px;
	height: 15px;
	stroke: var(--mid, #4a5e5a);
	stroke-width: 1.6;
	fill: none;
}
.ncb-picker-search input {
	width: 100%;
	padding: 0.55rem 0.8rem 0.55rem 2.1rem;
	border: 1px solid rgba(0,0,0,0.1);
	border-radius: 2px;
	background: var(--light, #f7f5f1);
	font-family: var(--ff-body, sans-serif);
	font-size: 0.85rem;
	font-weight: 300;
	color: var(--dark, #1c2b28);
}
.ncb-picker-search input:focus { outline: none; border-color: var(--spring, #729cac); }

.ncb-picker-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ncb-picker-chip {
	padding: 0.34rem 0.72rem;
	border: 1px solid rgba(0,0,0,0.12);
	border-radius: 999px;
	background: #fff;
	font-family: var(--ff-body, sans-serif);
	font-size: 0.7rem;
	color: var(--mid, #4a5e5a);
	cursor: pointer;
	font-variant-numeric: tabular-nums;
	transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.ncb-picker-chip:hover { border-color: var(--spring-mid, #9dbccc); }
.ncb-picker-chip[aria-pressed="true"] {
	background: var(--dark, #1c2b28);
	border-color: var(--dark, #1c2b28);
	color: #fff;
}
.ncb-picker-chip-n { opacity: 0.55; margin-left: 0.3rem; }

.ncb-picker-list { max-height: 22rem; overflow-y: auto; padding: 0.35rem; }
.ncb-picker-list::-webkit-scrollbar { width: 6px; }
.ncb-picker-list::-webkit-scrollbar-thumb { background: var(--spring-mid, #9dbccc); border-radius: 3px; }
.ncb-picker-group {
	font-size: 0.6rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--spring, #729cac);
	padding: 0.9rem 0.85rem 0.45rem;
}
.ncb-picker-opt {
	width: 100%;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 1.2rem;
	padding: 0.7rem 0.85rem;
	border: none;
	background: none;
	border-radius: 2px;
	text-align: left;
	font-family: var(--ff-body, sans-serif);
	cursor: pointer;
}
.ncb-picker-opt:hover,
.ncb-picker-opt.is-cursor { background: var(--light, #f7f5f1); }
.ncb-picker-opt[aria-selected="true"] { background: var(--summer-pale, #d6edd5); }
.ncb-picker-opt-name {
	display: block;
	font-family: var(--ff-display, serif);
	font-size: 1.12rem;
	color: var(--dark, #1c2b28);
	line-height: 1.25;
}
.ncb-picker-opt-desc {
	display: block;
	font-size: 0.74rem;
	color: var(--mid, #4a5e5a);
	line-height: 1.5;
	margin-top: 0.1rem;
}
.ncb-picker-opt--group {
	border-top: 1px solid rgba(0,0,0,0.06);
	margin-top: 0.3rem;
	padding-top: 0.8rem;
}
.ncb-picker-opt--group .ncb-picker-opt-name { font-size: 0.98rem; }
.ncb-picker-empty {
	margin: 0;
	padding: 1.6rem 0.9rem;
	text-align: center;
	font-size: 0.82rem;
	color: var(--mid, #4a5e5a);
	font-style: italic;
}

@media (max-width: 600px) {
	.ncb-picker-trigger { flex-wrap: wrap; gap: 0.5rem; }
	.ncb-picker-opt { grid-template-columns: 1fr; gap: 0.55rem; }
	.ncb-picker-stats { gap: 0.7rem; }
}

/* Terms gate. The theme template styles its own copy; this covers the
   [nordstranda_booking] shortcode, which has no theme CSS behind it. */
.ncb-booking-form .terms-box {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	padding: 1rem 1.1rem;
	margin-top: 1.2rem;
	background: var(--light, #f7f5f1);
	border: 1px solid rgba(0,0,0,0.07);
	border-radius: 2px;
}
.ncb-booking-form .terms-box input {
	margin: 0.15rem 0 0;
	width: 16px;
	height: 16px;
	accent-color: var(--summer, #8ac589);
	flex: none;
}
.ncb-booking-form .terms-box label {
	font-size: 0.78rem;
	line-height: 1.6;
	color: var(--mid, #4a5e5a);
}
