/**
 * Book A Barber Core V3 component layer.
 *
 * This file intentionally sits after the legacy-compatible component sheet.
 * It supplies the V3 rhythm, states and accessibility affordances without
 * changing any public shortcode class names.
 */

:root {
	--bab-v3-surface: var(--bab-white, #fff);
	--bab-v3-surface-soft: color-mix(in srgb, var(--bab-paper, #f7f4ef) 84%, #fff);
	--bab-v3-text: var(--bab-ink, #111827);
	--bab-v3-muted: var(--bab-muted, #667085);
	--bab-v3-border: var(--bab-line, rgba(17, 24, 39, .12));
	--bab-v3-accent: var(--bab-red, #e63b43);
	--bab-v3-focus: var(--bab-blue, #3568ff);
	--bab-v3-radius: 24px;
	--bab-v3-shadow: 0 24px 70px rgba(15, 31, 53, .11);
}

:where(.bab-booking-experience, .bab-directory, .bab-dashboard, .bab-pos-control, .bab-auth-shell, .bab-contact-page, .bab-review-centre, .bab-verified-reviews) {
	color: var(--bab-v3-text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:where(.bab-booking-experience, .bab-directory, .bab-dashboard, .bab-pos-control, .bab-auth-shell, .bab-contact-page, .bab-review-centre, .bab-verified-reviews) *,
:where(.bab-booking-experience, .bab-directory, .bab-dashboard, .bab-pos-control, .bab-auth-shell, .bab-contact-page, .bab-review-centre, .bab-verified-reviews) *::before,
:where(.bab-booking-experience, .bab-directory, .bab-dashboard, .bab-pos-control, .bab-auth-shell, .bab-contact-page, .bab-review-centre, .bab-verified-reviews) *::after {
	box-sizing: border-box;
}

:where(.bab-button, .bab-choice, .bab-selection-item, .bab-service-option, .bab-time-grid button, .bab-date-strip button, .bab-dashboard-nav button, .bab-pos-tile, .bab-link-button, .bab-text-danger, .bab-favourite):focus-visible,
:where(.bab-booking-experience, .bab-dashboard, .bab-pos-control, .bab-auth-shell, .bab-review-centre) :where(input, select, textarea):focus-visible {
	outline: 3px solid color-mix(in srgb, var(--bab-v3-focus) 42%, transparent);
	outline-offset: 3px;
}

.bab-button {
	min-height: 44px;
	transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, opacity .18s ease;
}

.bab-button:active { transform: translateY(0) scale(.985); }
.bab-button[aria-busy="true"], .bab-button.is-loading { pointer-events: none; opacity: .64; }

/* Booking */
.bab-booking-experience { width: min(1180px, 100%); }
.bab-flow-card { isolation: isolate; border-color: color-mix(in srgb, var(--bab-v3-border) 86%, transparent); box-shadow: var(--bab-v3-shadow); }
.bab-flow-head { position: relative; z-index: 1; }
.bab-booking-stepper {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 8px;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
}
.bab-booking-stepper li { position: relative; display: grid; justify-items: center; gap: 7px; color: var(--bab-v3-muted); text-align: center; font-size: .7rem; font-weight: 750; }
.bab-booking-stepper li::before { content: ""; position: absolute; z-index: -1; top: 16px; left: calc(-50% + 18px); width: calc(100% - 4px); height: 2px; background: var(--bab-v3-border); }
.bab-booking-stepper li:first-child::before { display: none; }
.bab-booking-stepper i { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--bab-v3-border); border-radius: 50%; background: var(--bab-v3-surface-soft); color: inherit; font-style: normal; }
.bab-booking-stepper li.is-active { color: var(--bab-v3-accent); }
.bab-booking-stepper li.is-active i { border-color: var(--bab-v3-accent); background: var(--bab-v3-accent); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--bab-v3-accent) 12%, transparent); }
.bab-booking-stepper li.is-complete { color: var(--bab-v3-text); }
.bab-booking-stepper li.is-complete i { border-color: color-mix(in srgb, var(--bab-v3-accent) 45%, var(--bab-v3-border)); background: color-mix(in srgb, var(--bab-v3-accent) 10%, var(--bab-v3-surface)); }
.bab-booking-stepper li.is-complete::before { background: color-mix(in srgb, var(--bab-v3-accent) 55%, var(--bab-v3-border)); }
.bab-flow-step[aria-hidden="true"] { display: none; }
.bab-choice, .bab-selection-item, .bab-service-option, .bab-time-grid button, .bab-date-strip button { border-width: 1.5px; }
.bab-choice.is-active, .bab-selection-item.is-selected, .bab-service-option.is-active, .bab-time-grid button.is-active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bab-v3-accent) 10%, transparent); }
.bab-flow-message { min-height: 0; font-weight: 650; }
.bab-flow-message:not(:empty) { min-height: 48px; display: flex; align-items: center; }

/* Search and profile cards */
.bab-filter-bar { top: calc(var(--bab-header-offset, 76px) + 12px); border-color: color-mix(in srgb, var(--bab-v3-border) 82%, transparent); box-shadow: 0 12px 34px rgba(15, 31, 53, .08); }
.bab-barber-card { min-width: 0; border-radius: var(--bab-v3-radius); box-shadow: 0 18px 48px rgba(15, 31, 53, .08); }
.bab-barber-card__media { aspect-ratio: 4 / 3; height: auto; }
.bab-barber-card__body { display: grid; align-content: start; min-height: 245px; }
.bab-barber-card__body .bab-button { margin-top: auto; }
.bab-favourite { display: grid; place-items: center; }
.bab-favourite[aria-pressed="true"], .bab-favourite.is-active { color: var(--bab-v3-accent); }

/* Customer and professional dashboards */
.bab-dashboard, .bab-pos-control { border-color: var(--bab-v3-border); box-shadow: var(--bab-v3-shadow); }
.bab-dashboard-nav { position: relative; }
.bab-dashboard-nav nav button, .bab-pos-tile { min-height: 46px; }
.bab-dashboard-panel.is-active, .bab-pos-screen.is-active { animation: bab-v3-panel-in .24s ease both; }
@keyframes bab-v3-panel-in { from { opacity: 0; transform: translateY(8px); } }
.bab-dashboard-card, .bab-stat-grid article, .bab-pos-summary-strip article, .bab-pos-tile, .bab-floor-chair, .bab-team-card, .bab-service-editor { border-color: var(--bab-v3-border); box-shadow: 0 10px 28px rgba(15, 31, 53, .045); }
.bab-booking-card { transition: border-color .18s ease, box-shadow .18s ease; }
.bab-booking-card:hover { border-color: color-mix(in srgb, var(--bab-v3-accent) 26%, var(--bab-v3-border)); box-shadow: 0 10px 26px rgba(15, 31, 53, .06); }
.bab-status { border: 1px solid currentColor; }
.bab-pos-control-head { overflow: hidden; }
.bab-pos-tile { text-align: left; }
.bab-pos-tile:hover { border-color: color-mix(in srgb, var(--bab-v3-accent) 36%, var(--bab-v3-border)); transform: translateY(-2px); }
.bab-schedule-row:has(input[type="checkbox"]:not(:checked)) { opacity: .64; }
.bab-team-card { display: grid; align-content: start; gap: 14px; }
.bab-team-summary { display: flex; align-items: center; min-width: 0; gap: 12px; }
.bab-team-summary > div:last-child { display: grid; min-width: 0; gap: 3px; }
.bab-team-summary b, .bab-team-summary small { overflow-wrap: anywhere; }
.bab-team-links { display: flex; flex-wrap: wrap; gap: 14px; }
.bab-team-links .bab-link-button { font-size: .78rem; }
.bab-team-manage { border-top: 1px solid var(--bab-v3-border); }
.bab-team-manage summary { padding: 13px 0 0; color: var(--bab-v3-text); cursor: pointer; font-size: .8rem; font-weight: 850; }
.bab-team-manage form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 13px; }
.bab-team-manage label, .bab-team-photo-form label { display: grid; min-width: 0; gap: 5px; color: var(--bab-v3-muted); font-size: .7rem; font-weight: 800; }
.bab-team-manage :where(input, select), .bab-team-photo-form input { width: 100%; min-width: 0; min-height: 42px; padding: 9px 10px; border: 1px solid var(--bab-v3-border); border-radius: 10px; background: var(--bab-v3-surface-soft); color: var(--bab-v3-text); font: inherit; }
.bab-team-manage .bab-check-row, .bab-team-manage .bab-button { align-self: end; }
.bab-team-photo-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding-top: 13px; border-top: 1px solid var(--bab-v3-border); }

/* Authentication */
.bab-auth-shell { width: min(1120px, 100%); }
.bab-auth-card { border-color: var(--bab-v3-border); box-shadow: var(--bab-v3-shadow); }
.bab-auth-tabs { padding: 5px; }
.bab-auth-tabs button { min-height: 42px; }
.bab-auth-form :where(input, select, textarea) { min-height: 46px; }
.bab-auth-notice, .bab-google-message:not(:empty) { border-left: 4px solid var(--bab-v3-focus); }

/* Verified reviews */
.bab-review-centre, .bab-verified-reviews { width: min(1180px, 100%); margin: 28px auto; }
.bab-review-centre > header, .bab-verified-reviews > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.bab-review-centre > header h2, .bab-verified-reviews > header h2 { margin: 7px 0 0; font-size: clamp(1.6rem, 3vw, 2.5rem); }
.bab-review-centre > header p { max-width: 650px; color: var(--bab-v3-muted); }
.bab-review-centre__list { display: grid; gap: 12px; }
.bab-review-request { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(0, 1.35fr); gap: 22px; padding: 20px; border: 1px solid var(--bab-v3-border); border-radius: 20px; background: var(--bab-v3-surface); box-shadow: 0 10px 30px rgba(15, 31, 53, .05); }
.bab-review-request h3 { margin: 5px 0 0; }
.bab-review-request small { color: var(--bab-v3-muted); }
.bab-review-request form { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: end; }
.bab-review-request label { display: grid; gap: 6px; font-size: .78rem; font-weight: 800; }
.bab-review-request :where(select, textarea) { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--bab-v3-border); border-radius: 12px; background: var(--bab-v3-surface-soft); color: var(--bab-v3-text); font: inherit; }
.bab-review-request textarea { min-height: 76px; resize: vertical; }
.bab-review-state { align-self: center; margin: 0; padding: 11px 13px; border-radius: 12px; background: #fff7ed; color: #9a3412; font-weight: 800; }
.bab-review-state.is-approved { background: #ecfdf3; color: #067647; }
.bab-verified-reviews > header > strong { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 6px; text-align: right; }
.bab-verified-reviews > header > strong b { font-size: 2.2rem; line-height: 1; }
.bab-verified-reviews > header > strong span, .bab-review-stars { color: #f5a300; }
.bab-verified-reviews > header > strong small { grid-column: 1 / -1; color: var(--bab-v3-muted); }
.bab-verified-reviews__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.bab-verified-reviews__grid article { display: grid; align-content: start; min-height: 210px; padding: 20px; border: 1px solid var(--bab-v3-border); border-radius: 20px; background: var(--bab-v3-surface); }
.bab-verified-reviews blockquote { margin: 14px 0 20px; color: var(--bab-v3-text); font-size: 1rem; line-height: 1.62; }
.bab-verified-reviews article footer { display: grid; margin-top: auto; }
.bab-verified-reviews article footer span { color: var(--bab-v3-muted); font-size: .77rem; }

/* Accessible, non-blocking feedback and confirmation dialog */
.bab-toast-region { position: fixed; z-index: 100000; right: 18px; bottom: 18px; width: min(390px, calc(100vw - 36px)); display: grid; gap: 10px; pointer-events: none; }
.bab-toast { padding: 14px 16px; border: 1px solid var(--bab-v3-border); border-left: 4px solid var(--bab-v3-focus); border-radius: 14px; background: var(--bab-v3-surface); color: var(--bab-v3-text); box-shadow: 0 18px 55px rgba(0, 0, 0, .18); font-weight: 700; pointer-events: auto; animation: bab-v3-toast-in .2s ease both; }
.bab-toast.is-error { border-left-color: var(--bab-v3-accent); }
@keyframes bab-v3-toast-in { from { opacity: 0; transform: translateY(10px); } }
.bab-dialog-backdrop { position: fixed; z-index: 100001; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8, 15, 23, .64); backdrop-filter: blur(4px); }
.bab-dialog { width: min(460px, 100%); padding: 24px; border: 1px solid var(--bab-v3-border); border-radius: 22px; background: var(--bab-v3-surface); color: var(--bab-v3-text); box-shadow: 0 28px 90px rgba(0, 0, 0, .3); }
.bab-dialog h2 { margin: 0 0 8px; }
.bab-dialog p { margin: 0; color: var(--bab-v3-muted); }
.bab-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.bab-dark .bab-toast, .bab-dark .bab-dialog, .bab-dark .bab-review-request, .bab-dark .bab-verified-reviews__grid article { background: var(--bab-white); color: var(--bab-ink); border-color: var(--bab-line); }

/* Shop owner chair and service management */
.bab-floor-chair-top label { display: grid; gap: 3px; }
.bab-floor-chair-top input { width: 100%; min-width: 0; padding: 3px 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: inherit; font: inherit; font-weight: 850; }
.bab-floor-chair-top input:focus { border-bottom-color: var(--bab-v3-focus); outline: 0; }
.bab-floor-chair.is-off { opacity: .82; }
.bab-chair-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bab-chair-actions .bab-link-button, .bab-chair-actions .bab-text-danger { font-size: .76rem; }
.bab-shop-services-intro { margin-bottom: 14px; }
.bab-shop-services-intro h3, .bab-shop-services-intro p { margin: 0; }
.bab-shop-services-intro p { margin-top: 7px; color: var(--bab-v3-muted); }
.bab-shop-services-list { display: grid; gap: 16px; }
.bab-shop-service-card { margin: 0; }
.bab-shop-service-default { display: grid; gap: 14px; }
.bab-shop-service-default .bab-dashboard-card-head { margin: 0; }
.bab-shop-service-default-fields { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(115px, .6fr)); gap: 10px; }
.bab-shop-service-default-fields label, .bab-service-override-fields label { display: grid; min-width: 0; gap: 5px; color: var(--bab-v3-muted); font-size: .7rem; font-weight: 800; }
.bab-shop-service-default-fields input, .bab-shop-service-default-fields textarea, .bab-service-override-fields input { width: 100%; min-width: 0; min-height: 42px; padding: 9px 10px; border: 1px solid var(--bab-v3-border); border-radius: 10px; background: var(--bab-v3-surface-soft); color: var(--bab-v3-text); font: inherit; }
.bab-shop-service-default-fields textarea { min-height: 66px; resize: vertical; }
.bab-service-override-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--bab-v3-border); }
.bab-service-override-head h4, .bab-service-override-head p { margin: 0; }
.bab-service-override-head small { color: var(--bab-v3-muted); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.bab-service-override-head p { max-width: 360px; color: var(--bab-v3-muted); font-size: .76rem; }
.bab-service-override-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; margin-top: 13px; }
.bab-service-override { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px; border: 1px solid var(--bab-v3-border); border-radius: 14px; background: var(--bab-v3-surface-soft); }
.bab-service-override-barber { display: flex; align-items: center; min-width: 0; gap: 8px; }
.bab-service-override-barber .bab-barber-photo { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; }
.bab-service-override-barber strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.bab-service-override > .bab-check-row { justify-self: end; font-size: .74rem; }
.bab-service-override-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.bab-service-override .bab-link-button { justify-self: start; font-size: .74rem; }
.bab-time-grid button small { display: block; margin-top: 2px; font-size: .58rem; font-weight: 700; opacity: .8; }

@media (max-width: 920px) {
	.bab-booking-stepper span { display: none; }
	.bab-review-request { grid-template-columns: 1fr; }
	.bab-review-request form { grid-template-columns: 130px 1fr; }
	.bab-review-request form .bab-button { grid-column: 1 / -1; }
	.bab-verified-reviews__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
	.bab-booking-stepper { gap: 2px; margin-inline: -8px; }
	.bab-booking-stepper li::before { left: calc(-50% + 15px); }
	.bab-booking-stepper i { width: 30px; height: 30px; font-size: .72rem; }
	.bab-flow-card { border-radius: 22px; padding: 22px 18px; }
	.bab-flow-step { min-height: 280px; }
	.bab-choice-grid, .bab-form-grid { grid-template-columns: 1fr; }
	.bab-time-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.bab-review-centre > header, .bab-verified-reviews > header { align-items: flex-start; flex-direction: column; }
	.bab-review-request form, .bab-verified-reviews__grid { grid-template-columns: 1fr; }
	.bab-review-request form .bab-button { grid-column: auto; }
	.bab-dialog__actions { flex-direction: column-reverse; }
	.bab-dialog__actions .bab-button { width: 100%; }
	/* Services remain in normal document flow so all options are reachable with
	 * native page scrolling and no compact viewport traps the user's gesture. */
	.bab-service-picker { max-block-size: none; overflow: visible; overscroll-behavior: auto; padding: 2px 0 max(12px, env(safe-area-inset-bottom)); }
	.bab-service-picker:focus-within { outline: 0; }
	.bab-shop-service-default-fields, .bab-service-override-fields { grid-template-columns: 1fr; }
	.bab-service-override-head { align-items: start; flex-direction: column; }
	.bab-service-override-head p { max-width: none; }
	.bab-service-override { grid-template-columns: 1fr; }
	.bab-service-override > .bab-check-row { justify-self: start; }
	.bab-team-manage form, .bab-team-photo-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.bab-dashboard-panel.is-active, .bab-pos-screen.is-active, .bab-toast { animation: none; }
	.bab-button, .bab-pos-tile, .bab-booking-card { transition: none; }
}

/* Places API (New) Autocomplete Data API: keep the native Cut Mate input in
 * context and render an accessible prediction list below it. */
.bab-core-active .bab-place-field { position: relative; z-index: 18; min-width: 0; }
.bab-core-active .bab-location-autocomplete { min-width: 0; font-size: clamp(.875rem, .82rem + .16vw, 1rem); }
.bab-core-active .bab-place-predictions {
	position: absolute;
	z-index: 1002;
	inset-block-start: calc(100% + 7px);
	inset-inline-start: 0;
	box-sizing: border-box;
	inline-size: max(100%, min(380px, calc(100vw - 32px)));
	max-inline-size: min(430px, calc(100vw - 32px));
	max-block-size: min(330px, var(--bab-place-available, calc(100dvh - 190px)));
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--bab-v3-border, var(--bab-line));
	border-radius: 14px;
	background: var(--bab-v3-surface, var(--bab-white));
	box-shadow: var(--bab-shadow-lg, 0 16px 38px color-mix(in srgb, var(--bab-v3-text, var(--bab-ink)) 16%, transparent));
	color: var(--bab-v3-text, var(--bab-ink));
}
.bab-core-active .bab-place-predictions[hidden] { display: none; }
.bab-core-active .bab-place-prediction {
	appearance: none;
	width: 100%;
	min-height: 58px;
	display: grid;
	grid-template-columns: 24px minmax(0, 1fr);
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 0;
	border-block-end: 1px solid var(--bab-v3-border, var(--bab-line));
	background: var(--bab-v3-surface, var(--bab-white));
	color: var(--bab-v3-text, var(--bab-ink));
	font: inherit;
	font-size: .9375rem;
	line-height: 1.3;
	text-align: start;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.bab-core-active .bab-place-prediction:hover,
.bab-core-active .bab-place-prediction:focus-visible,
.bab-core-active .bab-place-prediction.is-active { background: color-mix(in srgb, var(--bab-v3-focus, var(--bab-green)) 9%, var(--bab-v3-surface, var(--bab-white))); outline: 0; }
.bab-core-active .bab-place-prediction__pin { color: var(--bab-v3-focus, var(--bab-green)); font-size: 1.1rem; text-align: center; }
.bab-core-active .bab-place-prediction strong,
.bab-core-active .bab-place-prediction small { display: block; overflow-wrap: anywhere; }
.bab-core-active .bab-composer-field .bab-place-prediction span,
.bab-core-active .bab-composer-field .bab-place-attribution span { color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: normal; text-transform: none; }
.bab-core-active .bab-place-prediction strong { font-weight: 780; }
.bab-core-active .bab-place-prediction small { margin-block-start: 3px; color: var(--bab-v3-muted, var(--bab-muted)); font-size: .8125rem; }
.bab-core-active .bab-place-attribution { min-height: 32px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 6px 10px; background: var(--bab-v3-surface, var(--bab-white)); color: var(--bab-v3-muted, var(--bab-muted)); font-size: .6875rem; }
.bab-core-active .bab-place-attribution img { width: auto; height: 14px; object-fit: contain; }
.bab-core-active .bab-location-fallback-message {
	display: block;
	max-width: 62ch;
	margin-block-start: 7px;
	color: var(--bab-v3-muted, var(--bab-muted));
	font-size: .76rem;
	font-weight: 650;
	line-height: 1.45;
	overflow-wrap: anywhere;
}
.bab-core-active .bab-composer-field .bab-location-fallback-message {
	color: var(--bab-v3-muted, var(--bab-muted));
	font-size: .76rem;
	font-weight: 650;
	letter-spacing: normal;
	text-transform: none;
}
@media (max-width: 700px) {
	.bab-core-active .bab-location-autocomplete { font-size: 1rem; }
	.bab-core-active .bab-place-field { z-index: 1003; }
	.bab-core-active .bab-place-predictions { inline-size: min(100%, calc(100vw - 24px)); max-inline-size: calc(100vw - 24px); max-block-size: min(290px, var(--bab-place-available, calc(100dvh - 150px))); scrollbar-gutter: stable; }
	.bab-core-active .bab-place-prediction { min-height: 54px; }
}
