/**
 * Bookings storefront: the [wix_book] flow (also "Book now"), its month
 * calendar, the return confirmation, and My Bookings. Loaded after
 * wix-frontend.css; every colour, radius and space is a design token
 * (wixhc-tokens.css).
 *
 * @package Headless_Connect_For_Wix
 */

/* ---------- flow ---------- */
.wixhc-book,
.wixhc-book * {
	font-family: inherit;
}
.wixhc-book--standalone,
.wixhc-book--drawer {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}
.wixhc-book--standalone { max-width: 720px; }

/* The flow in a drawer (opened from a service card's "Book now"). */
.wixhc-drawer--book { width: min(600px, 96vw); }
.wixhc-drawer--book .wixhc-drawer__body { padding: 16px 22px 28px; }
.wixhc-drawer--book .wixhc-drawer__title { font-size: 17px; }
body.wixhc-drawer-open { overflow: hidden; }

/* The chosen service, above every step after the first. */
.wixhc-bk__service {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	margin: 0 0 14px;
	border-radius: var(--wixhc-radius-l);
	background: var(--wixhc-surface-alt);
}
.wixhc-bk__service-img { width: 56px; height: 56px; border-radius: var(--wixhc-radius-m); object-fit: cover; flex: 0 0 auto; }
.wixhc-bk__service-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wixhc-bk__service-name { font-size: 15px; font-weight: 600; }
.wixhc-bk__service-meta { font-size: 13px; color: var(--wixhc-muted); }

.wixhc-bk__bar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.wixhc-bk__summary {
	margin: 0;
	color: var(--wixhc-muted);
	font-size: 14px;
}

.wixhc-root .wixhc-bk__back {
	min-height: 32px;
	padding: 0 var(--wixhc-space-3);
	font-size: var(--wixhc-font-size-s);
}

.wixhc-bk__title {
	margin: 4px 0 12px;
	font-size: 1.15em;
	font-weight: 700;
}

.wixhc-bk__options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 8px;
}

.wixhc-root .wixhc-bk__option {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	text-align: left;
	justify-content: flex-start;
	border-radius: var(--wixhc-radius-l);
	padding: var(--wixhc-space-3) var(--wixhc-space-4);
	gap: 4px;
}
.wixhc-root .wixhc-bk__option:hover { border-color: currentColor; background: var(--wixhc-surface); }

.wixhc-bk__option-name { font-weight: 600; text-wrap: balance; }
.wixhc-bk__option-meta {
	font-size: 0.85em;
	font-variant-numeric: tabular-nums;
	font-weight: 400;
	color: var(--wixhc-muted);
}

/* ---------- month calendar ---------- */
.wixhc-cal {
	max-width: 420px;
}

.wixhc-cal__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}

.wixhc-root .wixhc-cal__prev,
.wixhc-root .wixhc-cal__next {
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 18px;
	line-height: 1;
}

.wixhc-root .wixhc-cal__prev:disabled,
.wixhc-root .wixhc-cal__next:disabled {
	opacity: 0.35;
	cursor: default;
	transform: none;
}

.wixhc-cal__grid {
	display: grid;
	gap: 4px;
}

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

.wixhc-cal__dow {
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--wixhc-muted);
	text-transform: uppercase;
}

.wixhc-root .wixhc-cal__day {
	aspect-ratio: 1;
	min-width: 0;
	padding: 0;
	border-radius: var(--wixhc-radius-m);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.wixhc-cal__day.is-outside {
	visibility: hidden;
}

.wixhc-root .wixhc-cal__day:disabled {
	background: transparent;
	border-color: transparent;
	color: var(--wixhc-muted);
	opacity: 0.55;
	font-weight: 400;
	cursor: default;
	transform: none;
}

.wixhc-cal__day.is-today {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}
/* A dot under days that have free times; a quiet pulse while a month loads. */
.wixhc-root .wixhc-cal__day.is-available { position: relative; }
.wixhc-root .wixhc-cal__day.is-available::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 4px;
	width: 5px;
	height: 5px;
	margin-left: -2.5px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.7;
}
.wixhc-root .wixhc-cal__day.is-active::after { background: currentColor; opacity: 1; }
.wixhc-cal.is-loading .wixhc-cal__grid { animation: wixhc-pulse 1.1s ease-in-out infinite; }
.wixhc-cal.is-loading .wixhc-cal__day:not(.is-outside) { background: var(--wixhc-surface-alt); border-color: transparent; color: transparent; }
@keyframes wixhc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.wixhc-cal { max-width: none; }
.wixhc-root .wixhc-cal__title { font-size: 1.05em; font-weight: 700; }
.wixhc-root .wixhc-cal__prev,
.wixhc-root .wixhc-cal__next { width: 40px; height: 40px; border-radius: var(--wixhc-radius-pill); }

/* Times as chips, grouped by part of day; each group takes the full width. */
.wixhc-root .wixhc-book__slots { display: grid; gap: 14px; margin-top: 10px; }
.wixhc-book__period { margin: 0; }
.wixhc-book__period-title {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wixhc-muted);
}
.wixhc-book__chips {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
	gap: 8px;
}
.wixhc-root .wixhc-book__slot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 10px 8px;
	border-radius: var(--wixhc-radius-m);
	line-height: 1.2;
}
.wixhc-book__slot-time { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 0.95em; }
.wixhc-book__slot-staff { font-size: 11px; opacity: 0.85; }

/* Primary action with its hint; the review before Wix. */
.wixhc-book__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.wixhc-root .wixhc-book__confirm,
.wixhc-root .wixhc-book__checkout {
	min-height: var(--wixhc-control-h);
	padding: 0 var(--wixhc-space-5);
	border-radius: var(--wixhc-radius-control);
	font-weight: 600;
	background: var(--wixhc-brand);
	border-color: var(--wixhc-brand);
	color: var(--wixhc-on-brand);
}
.wixhc-root .wixhc-book__checkout:hover { background: var(--wixhc-brand-hover); border-color: var(--wixhc-brand-hover); }
.wixhc-root .wixhc-book__confirm:disabled { opacity: 0.45; cursor: not-allowed; }
.wixhc-book__hint, .wixhc-book__note { margin: 0; font-size: var(--wixhc-font-size-s); color: var(--wixhc-muted); }
.wixhc-book__hint[hidden] { display: none; }
.wixhc-bk__review {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 8px 18px;
	margin: 0;
	padding: var(--wixhc-space-4);
	border-radius: var(--wixhc-radius-l);
	border: 1px solid var(--wixhc-border);
}
.wixhc-bk__review dt { margin: 0; font-size: var(--wixhc-font-size-s); color: var(--wixhc-muted); }
.wixhc-bk__review dd { margin: 0; font-weight: 600; }
@media (max-width: 600px) {
	.wixhc-book__chips { grid-template-columns: repeat(3, 1fr); }
	.wixhc-bk__review { grid-template-columns: 1fr; gap: 2px 0; }
	.wixhc-bk__review dd { margin-bottom: 8px; }
}

.wixhc-root .wixhc-cal__day.is-active,
.wixhc-root .wixhc-mybk__tab.is-active {
	background: var(--wixhc-brand);
	border-color: var(--wixhc-brand);
	color: var(--wixhc-on-brand);
}

.wixhc-cal__day-title {
	margin: 12px 0 0;
	font-weight: 600;
}

.wixhc-cal__tz {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--wixhc-muted);
}

/* ---------- confirmation ---------- */
.wixhc-book-confirm {
	margin: 0 0 16px;
	padding: var(--wixhc-space-4);
	border: 1px solid var(--wixhc-success);
	border-radius: var(--wixhc-radius-l);
	background: var(--wixhc-success-soft);
}

.wixhc-book-confirm__title {
	display: block;
	font-size: 1.05em;
}

.wixhc-book-confirm__details {
	margin: 6px 0 0;
	color: var(--wixhc-muted);
}

.wixhc-book-confirm__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 10px;
}

.wixhc-book-confirm__ics {
	display: inline-flex;
	align-items: center;
	min-height: var(--wixhc-control-h-s);
	padding: 0 var(--wixhc-space-4);
	border: 1px solid var(--wixhc-border-strong);
	border-radius: var(--wixhc-radius-control);
	background: var(--wixhc-surface);
	color: var(--wixhc-ink);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.wixhc-book-confirm__ics:hover { border-color: currentColor; }

/* ---------- My Bookings ---------- */
.wixhc-mybk__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.wixhc-mybk__note {
	margin: 0 0 var(--wixhc-space-2);
	color: var(--wixhc-success);
}

.wixhc-mybk__note:empty,
.wixhc-mybk__msg:empty {
	display: none;
}

.wixhc-mybk__list {
	display: grid;
	gap: 10px;
}

.wixhc-mybk__item {
	padding: var(--wixhc-space-4) var(--wixhc-space-5);
	box-shadow: var(--wixhc-shadow-s);
	border: 1px solid var(--wixhc-border);
	border-radius: var(--wixhc-radius-l);
	background: var(--wixhc-surface);
	color: var(--wixhc-ink);
}

.wixhc-mybk__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
}

.wixhc-mybk__status {
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 3px 10px;
	border-radius: var(--wixhc-radius-pill);
	background: var(--wixhc-success-soft);
	color: var(--wixhc-success);
	white-space: nowrap;
}

.wixhc-mybk__status--canceled,
.wixhc-mybk__status--declined {
	background: var(--wixhc-danger-soft);
	color: var(--wixhc-danger);
}

.wixhc-mybk__when,
.wixhc-mybk__meta {
	margin: var(--wixhc-space-1) 0 0;
	color: var(--wixhc-muted);
	font-size: 0.875em;
}
/* The date is what a member scans for: full ink, a touch larger. */
.wixhc-mybk__when { color: inherit; font-size: 0.95em; font-weight: 500; font-variant-numeric: tabular-nums; }
.wixhc-mybk__head > :first-child { font-weight: 600; font-size: 1.05em; }

.wixhc-mybk__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.wixhc-root .wixhc-mybk__cancel {
	color: var(--wixhc-danger);
}

.wixhc-mybk__msg {
	margin: 8px 0 0;
	font-size: 0.875em;
}
