.hx-slot-selector {
	margin: 16px 0;
	max-width: 420px;
}

.hx-slot-selector-label {
	font-weight: 600;
	margin-bottom: 8px;
}

.hx-slot-selector-label small {
	font-weight: 400;
	opacity: 0.7;
}

.hx-cal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.hx-cal-header button {
	background: none;
	border: 1px solid rgba(31, 13, 92, 0.2);
	border-radius: 6px;
	cursor: pointer;
	padding: 4px 10px;
	font-size: 16px;
	line-height: 1;
}

.hx-cal-header button:disabled {
	opacity: 0.3;
	cursor: default;
}

.hx-cal-month-label {
	font-weight: 700;
	text-transform: capitalize;
}

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

.hx-cal-weekday {
	font-size: 11px;
	font-weight: 600;
	text-align: center;
	opacity: 0.6;
	padding-bottom: 4px;
}

/* Compact by design: just a day number, background-tinted by that day's
   status (set inline by JS — dayBackground(), a solid color or a hard-split
   gradient when several statuses coexist that day) — the day's actual window
   options (there can be several, see HX_Slots::windows_for_duree()) live in
   the .hx-slot-window-panel below the grid, not stacked in here. */
.hx-cal-cell {
	min-height: 40px;
	border-radius: 6px;
	padding: 3px;
	font-size: 11px;
	background: transparent;
	border: 1px solid transparent;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	font-family: inherit;
	color: inherit;
}

.hx-cal-cell-empty {
	visibility: hidden;
}

.hx-cal-date {
	font-size: 11px;
	opacity: 0.65;
}

.hx-cal-cell.hx-cal-closed {
	background: #ececec;
}

.hx-cal-cell.hx-cal-past {
	opacity: 0.35;
}

/* White day-number text reads on all three status colors (same choice the
   pills already make against these backgrounds elsewhere in this file). */
.hx-cal-cell.hx-cal-has-slots .hx-cal-date {
	color: #fff;
	opacity: 0.9;
}

button.hx-cal-cell {
	cursor: pointer;
}

/* Not `background` — the inline status background (set by JS) always wins
   over a stylesheet rule, `:hover` included, so hover feedback comes from a
   filter instead, which layers on top of any background. */
button.hx-cal-cell:hover {
	filter: brightness(0.94);
}

.hx-cal-cell.hx-cal-active {
	border-color: #1f0d5c;
	box-shadow: 0 0 0 1px #1f0d5c;
}

/* Small corner dot: at least one window that day is already booked by this
   customer (see .hx-cal-pill-owned) — layered on top of the day's own
   capacity-based background rather than replacing it, since most such days
   still have other, bookable windows too. */
.hx-cal-cell.hx-cal-cell-owned {
	position: relative;
}
.hx-cal-cell.hx-cal-cell-owned::before {
	content: "";
	position: absolute;
	top: 3px;
	right: 3px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #1f0d5c;
	box-shadow: 0 0 0 1px #fff;
}

/* A full-day picker's confirmed pick (hx-full-day-selector.js) — a diagonal
   hatch laid over the cell's own status color, on top of the border above,
   so a chosen day reads as clearly different from every other one showing
   the exact same "open" green (there's no separate window-panel step to
   make that obvious the way the weekly-slot calendar's is-selected pills
   already do). `position:relative` here (not on the shared base
   `.hx-cal-cell` rule) since only this state needs a positioning context for
   the ::after overlay below. */
.hx-cal-cell.hx-cal-selected {
	position: relative;
	border-width: 1px;
	border-color: #000;
}

.hx-cal-cell.hx-cal-selected::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	background-image: repeating-linear-gradient(
		45deg,
		rgba(255, 255, 255, 0.65) 0px,
		rgba(255, 255, 255, 0.65) 3px,
		transparent 3px,
		transparent 8px
	);
}

.hx-cal-pill {
	display: block;
	width: 100%;
	border: none;
	border-radius: 4px;
	padding: 2px 4px;
	margin-bottom: 2px;
	font-size: 10px;
	line-height: 1.3;
	cursor: pointer;
	text-align: left;
	color: #fff;
}

.hx-cal-pill:disabled {
	cursor: default;
	opacity: 0.6;
}

/* Softer/pastel-leaning versions of the original vert/orange/rouge — still
   dark enough to keep the pill's white text (see .hx-cal-pill above)
   legible. Kept in sync by hand with the same three values duplicated in
   every STATUS_COLORS JS constant (hx-slot-selector.js, hx-event-selector.js,
   hx-full-day-selector.js, hx-admin-planning.js) — those set day-cell/grid
   backgrounds inline (they can mix several colors into one gradient/cell),
   these cover the legend swatches and the individual slot pills. */
.hx-cal-pill-open { background: #358563; }
.hx-cal-pill-few { background: #c67539; }
.hx-cal-pill-full { background: #b25a4f; }
/* "Vous y êtes déjà inscrit·e" — the "Mon compte" reschedule picker only
   (mark_own_bookings, see class-hx-slot-availability.php), informational
   rather than a capacity state, so a distinct brand color instead of
   another shade on the green/orange/red scale. */
.hx-cal-pill-owned { background: #1f0d5c; }

.hx-cal-pill.is-selected {
	outline: 2px solid #1f0d5c;
	outline-offset: 1px;
}

.hx-slot-window-panel {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid rgba(31, 13, 92, 0.1);
}

.hx-slot-window-prompt {
	margin: 0;
	font-size: 12px;
	opacity: 0.65;
}

/* The "still N to pick" line between the full-day calendar and its "Valider"
   button (see updateHint() in hx-full-day-selector.js) — bolder/colored than
   the plain .hx-slot-window-prompt style it started from so it reads as an
   active instruction right where the customer needs it, not a passive caption. */
.hx-full-day-hint {
	margin: 14px 0 4px;
	font-size: 13px;
	font-weight: 700;
	color: #1f0d5c;
	min-height: 1.2em; /* Reserves its line so the layout below doesn't jump when the text briefly clears. */
}

/* The dates ticked so far (updatePicked() in hx-full-day-selector.js) — right
   under the hint above, same wording/weight as the confirmed "Vos dates : …"
   summary shown once the picker is closed (.hx-slot-selection-summary),
   normal weight so it doesn't compete with the bold instruction above it. */
.hx-full-day-picked {
	margin: 0 0 10px;
	font-size: 13px;
	color: #1f0d5c;
	min-height: 1.2em;
}

#hx-full-day-confirm {
	display: block;
	min-width: 25%;
	margin: 0 auto;
}

.hx-slot-window-heading {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	text-transform: capitalize;
	color: #1f0d5c;
}

.hx-slot-window-list {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 6px;
}

.hx-slot-window-list .hx-cal-pill {
	width: auto;
	flex: 0 0 auto;
	font-size: 13px;
	padding: 9px 12px;
	border-radius: 8px;
	margin-bottom: 0;
}

.hx-cal-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 10px;
	font-size: 11px;
}

.hx-cal-legend span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.hx-cal-legend i {
	width: 10px;
	height: 10px;
	border-radius: 2px;
	display: inline-block;
}

.hx-cal-legend .hx-cal-pill-open { background: #358563; }
.hx-cal-legend .hx-cal-pill-few { background: #c67539; }
.hx-cal-legend .hx-cal-pill-full { background: #b25a4f; }
.hx-cal-legend .hx-cal-pill-owned { background: #1f0d5c; }
.hx-cal-legend .hx-cal-pill-closed { background: #ececec; border: 1px solid rgba(0,0,0,0.15); }

/* The small "owned" caption under a day's own time-window list (see
   hx-account-reschedule.js buildWindowsPanel()) — same swatch styling as
   the month-grid legend above, just its own copy so it can appear (or not)
   independently, right where it's actually relevant. */
.hx-cal-legend-window {
	margin-top: 8px;
	color: #666;
}

.hx-slot-selection-summary {
	margin-top: 10px;
	font-size: 16px;
}

/* :not(:empty) — no boxed "alert" look while there's nothing to show yet
   (e.g. before a duration is chosen on a variable product, renderSummary()
   leaves this blank). */
.hx-slot-selection-summary:not(:empty) {
	padding: 10px 14px;
	background: #eaf7ee;
	border: 1px solid #cdebd6;
	border-radius: 8px;
}

.hx-slot-selection-summary a {
	margin-left: 8px;
	font-size: 14px;
	color: #b3261e;
}

.hx-slot-selection-summary a:hover {
	color: #8f1e18;
}

/* Native WooCommerce "Ajouter au panier" button, force-disabled by
   hx-event-selector.js / hx-full-day-selector.js until a mandatory date
   selection is confirmed — a plain `disabled` attribute is also set, but WC
   Blocks can re-render the button (dropping it) faster than the class here,
   which a stylesheet rule always still applies regardless. `!important`
   because product-color theming (see the child theme's shop.css) sets this
   button's `background` with its own `!important`. */
.single_add_to_cart_button.hx-gate-disabled {
	opacity: 0.45 !important;
	cursor: not-allowed !important;
	pointer-events: none;
}

.hx-slot-open-button {
	background: #1f0d5c;
	color: #fff;
	border: none;
	border-radius: 32px;
	padding: 12px 28px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.2s, transform 0.15s;
}

.hx-slot-open-button:hover {
	background: #2d1585;
	transform: translateY(-1px);
}

.hx-slot-open-button:disabled {
	background: rgba(31, 13, 92, 0.3);
	cursor: not-allowed;
	transform: none;
}

/* Same boxed "alert" treatment as .hx-slot-selection-summary (green), just
   amber — shown while a variation/formule still needs picking before the
   date/slot picker can open. */
.hx-slot-variation-hint {
	margin-top: 8px;
	font-size: 16px;
	padding: 10px 14px;
	background: #fdf6e0;
	border: 1px solid #f0dfa0;
	border-radius: 8px;
	color: #6b5410;
}

/* Red alert variant — shown instead of the "Choisir..." button when a
   stage/événement has no active date configured at all, so the customer
   isn't sent into an empty picker to find that out. */
.hx-slot-no-dates-alert {
	margin-top: 8px;
	font-size: 16px;
	padding: 10px 14px;
	background: #fbeae9;
	border: 1px solid #f0c4c1;
	border-radius: 8px;
	color: #7a2822;
}

.hx-slot-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hx-slot-modal[hidden] {
	display: none;
}

.hx-slot-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 0, 0, 0.55);
}

.hx-slot-modal-box {
	position: relative;
	box-sizing: border-box; /* padding inside the width/height below, never on top of it */
	background: #fff;
	border-radius: 16px;
	padding: 60px 32px 32px; /* top: the close button's own row, above the calendar header's arrows */
	width: min(680px, 92vw);
	max-height: 88vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hx-slot-modal-close {
	position: absolute;
	top: 12px;
	right: 16px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: none;
	border: none;
	border-radius: 50%;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #1f0d5c;
}

.hx-slot-modal .hx-cal-cell {
	font-size: 12px;
}

@media (max-width: 600px) {
	.hx-slot-modal-box {
		width: 100%;
		height: 100vh;
		height: 100dvh; /* the visible height, browser toolbars excluded, where supported */
		max-height: none;
		border-radius: 0;
		/* Top padding leaves the close button its own row above the
		   calendar header, so it never sits on the "next month" arrow. */
		padding: calc(56px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
	}

	.hx-slot-modal-close {
		top: calc(10px + env(safe-area-inset-top, 0px));
		right: 10px;
		width: 40px;
		height: 40px;
		background: #f5f3f8;
	}
}
