/* Hamed Booking — patient booking page. Colours follow the Hamed theme. */
.hmc-booking {
	--hmc-primary: #52a0b1;
	--hmc-primary-dark: #3d8797;
	--hmc-primary-soft: #e8f3f6;
	--hmc-accent: #e1556f;
	--hmc-ink: #1b263b;
	--hmc-muted: #6b7280;
	--hmc-line: #e3e8ec;
	--hmc-soft: #f1f7fa;
	--hmc-radius: 12px;

	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	margin: 0 auto 48px;
	max-width: 1080px;
	color: var(--hmc-ink);
	font-size: 15px;
	line-height: 1.6;
}
@media (min-width: 992px) {
	.hmc-booking { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
	.hmc-summary { position: sticky; top: 110px; }
}
.hmc-booking *,
.hmc-booking *::before,
.hmc-booking *::after { box-sizing: border-box; }
.hmc-booking [hidden] { display: none !important; }
.hmc-booking p { margin: 0; }
.hmc-booking :focus-visible { outline: 3px solid var(--hmc-primary); outline-offset: 2px; }

/* summary */
.hmc-summary {
	background: #fff;
	border: 1px solid var(--hmc-line);
	border-radius: var(--hmc-radius);
	padding: 16px;
}
.hmc-summary__doctor { display: flex; align-items: center; gap: 12px; }
.hmc-summary__photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--hmc-soft); }
.hmc-summary__name { font-weight: 700; font-size: 16px; }
.hmc-summary__meta { color: var(--hmc-muted); font-size: 13px; }
.hmc-summary__list { margin: 14px 0 0; border-top: 1px dashed var(--hmc-line); padding-top: 10px; }
.hmc-summary__list > div,
.hmc-done__list > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.hmc-summary__list dt,
.hmc-done__list dt { color: var(--hmc-muted); font-weight: 400; }
.hmc-summary__list dd,
.hmc-done__list dd { margin: 0; font-weight: 600; text-align: end; }

/* flow */
.hmc-flow {
	background: #fff;
	border: 1px solid var(--hmc-line);
	border-radius: var(--hmc-radius);
	padding: 16px;
	min-width: 0;
}
@media (min-width: 768px) { .hmc-flow { padding: 24px; } }

.hmc-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 20px; padding: 0; counter-reset: none; }
.hmc-steps li {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	padding-bottom: 10px;
	border-bottom: 3px solid var(--hmc-line);
	color: var(--hmc-muted);
	font-size: 13px;
	font-weight: 600;
}
.hmc-steps li span {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--hmc-soft);
	font-size: 12px;
	flex-shrink: 0;
}
.hmc-steps li[aria-current] { color: var(--hmc-ink); border-color: var(--hmc-primary); }
.hmc-steps li[aria-current] span { background: var(--hmc-primary); color: #fff; }
.hmc-steps li.is-done { border-color: var(--hmc-primary); }
.hmc-steps li.is-done span { background: var(--hmc-primary-soft); color: var(--hmc-primary-dark); }
@media (max-width: 480px) { .hmc-steps li { font-size: 12px; gap: 6px; } }

.hmc-h { font-size: 20px; font-weight: 700; margin: 0 0 16px; color: var(--hmc-ink); }
.hmc-h:focus { outline: none; }

/* One-tap shortcut to the first free time. */
.hmc-earliest {
	display: block;
	width: 100%;
	margin: -4px 0 16px;
	padding: 10px 14px;
	border: 1px dashed var(--hmc-primary);
	border-radius: 8px;
	background: var(--hmc-primary-soft);
	color: var(--hmc-primary-dark);
	font: inherit;
	font-weight: 600;
	text-align: start;
	cursor: pointer;
}
.hmc-earliest:hover { background: #d9edf2; }

.hmc-alert {
	margin-bottom: 16px;
	padding: 12px 14px;
	border-radius: 8px;
	background: #fdecef;
	color: #9b2c40;
	font-weight: 600;
}

/* picker */
.hmc-picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 768px) { .hmc-picker { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }

.hmc-cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hmc-cal__title { font-weight: 700; }
.hmc-cal__nav {
	width: 40px;
	height: 40px;
	border: 1px solid var(--hmc-line);
	border-radius: 50%;
	background: #fff;
	color: var(--hmc-ink);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
[dir="rtl"] .hmc-cal__nav span { display: inline-block; transform: scaleX(-1); }
.hmc-cal__nav:disabled { opacity: .35; cursor: default; }
.hmc-cal__week,
.hmc-cal__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.hmc-cal__week span { text-align: center; color: var(--hmc-muted); font-size: 12px; padding: 4px 0; }
.hmc-cal__days[aria-busy="true"] { opacity: .5; }
.hmc-day {
	aspect-ratio: 1;
	min-height: 40px;
	border: 0;
	border-radius: 8px;
	background: var(--hmc-primary-soft);
	color: var(--hmc-primary-dark);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	transition: background-color .15s;
}
.hmc-day:hover { background: #d3e9ef; }
.hmc-day:disabled { background: transparent; color: #c2c8cf; font-weight: 400; cursor: default; }
.hmc-day.is-selected { background: var(--hmc-primary); color: #fff; }

.hmc-times__day { font-weight: 700; margin-bottom: 8px; }
/* Long days (e.g. the 24-hour clinic) scroll inside the list, not the page. */
.hmc-times [data-hmc-slots] {
	position: relative; /* offsetParent for scrolling a time into view. */
	max-height: 340px;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 6px 8px;
	margin: 0 -6px;
	scrollbar-width: thin;
	/* Shadow at an edge while more times are hidden there. */
	background:
		linear-gradient(#fff 30%, rgba(255, 255, 255, 0)) top / 100% 24px no-repeat local,
		linear-gradient(rgba(255, 255, 255, 0), #fff 70%) bottom / 100% 24px no-repeat local,
		radial-gradient(farthest-side at 50% 0, rgba(27, 38, 59, .14), transparent) top / 100% 10px no-repeat scroll,
		radial-gradient(farthest-side at 50% 100%, rgba(27, 38, 59, .14), transparent) bottom / 100% 10px no-repeat scroll;
}
@media (min-width: 992px) { .hmc-times [data-hmc-slots] { max-height: 400px; } }
.hmc-times__group {
	position: sticky;
	top: 0;
	z-index: 1;
	margin: 0;
	padding: 10px 0 6px;
	background: #fff;
	color: var(--hmc-muted);
	font-size: 13px;
	font-weight: 600;
}
.hmc-times__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hmc-slot {
	min-height: 44px;
	border: 1px solid var(--hmc-line);
	border-radius: 8px;
	background: #fff;
	color: var(--hmc-ink);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}
.hmc-slot:hover { border-color: var(--hmc-primary); }
.hmc-slot:disabled { background: var(--hmc-soft); border-color: var(--hmc-soft); color: #aab3bb; text-decoration: line-through; cursor: default; }
.hmc-slot.is-selected { background: var(--hmc-primary); border-color: var(--hmc-primary); color: #fff; }
.hmc-empty { color: var(--hmc-muted); padding: 12px; background: var(--hmc-soft); border-radius: 8px; }

/* fields */
.hmc-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .hmc-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hmc-field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.hmc-field--wide { grid-column: 1 / -1; }
.hmc-field label,
.hmc-field legend { font-weight: 600; font-size: 14px; padding: 0; margin: 0 0 6px; float: none; width: auto; }
.hmc-field small { color: var(--hmc-muted); font-weight: 400; }
.hmc-field input[type="text"],
.hmc-field input[type="tel"],
.hmc-field input[type="email"],
.hmc-field input[type="date"],
.hmc-field textarea {
	width: 100%;
	min-height: 46px;
	padding: 10px 12px;
	border: 1px solid #cfd8de;
	border-radius: 8px;
	background: #fff;
	color: var(--hmc-ink);
	font: inherit;
}
.hmc-field input[dir="ltr"] { text-align: left; }
[dir="rtl"] .hmc-field input[dir="ltr"]::placeholder { text-align: right; }
.hmc-field input:focus,
.hmc-field textarea:focus { border-color: var(--hmc-primary); outline: 2px solid var(--hmc-primary-soft); }
.hmc-field input[aria-invalid="true"],
.hmc-field textarea[aria-invalid="true"] { border-color: var(--hmc-accent); background: #fff8f9; }
.hmc-field__error { color: #b8324b; font-size: 13px; }

.hmc-choice { display: flex; gap: 8px; }
.hmc-choice label { flex: 1; margin: 0; position: relative; }
.hmc-choice input,
.hmc-pay__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.hmc-choice span {
	display: grid;
	place-items: center;
	min-height: 46px;
	padding: 0 10px;
	border: 1px solid #cfd8de;
	border-radius: 8px;
	font-weight: 600;
	text-align: center;
}
.hmc-choice input:checked + span { border-color: var(--hmc-primary); background: var(--hmc-primary-soft); color: var(--hmc-primary-dark); }
.hmc-choice input:focus-visible + span,
.hmc-pay__option input:focus-visible + span { outline: 3px solid var(--hmc-primary); outline-offset: 2px; }

/* payment */
.hmc-pay { display: grid; gap: 10px; border: 0; padding: 0; margin: 0 0 16px; }
.hmc-pay__option { position: relative; margin: 0; }
.hmc-pay__option span {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 16px;
	border: 1px solid #cfd8de;
	border-radius: 10px;
}
.hmc-pay__option small,
.hmc-pay__note small { color: var(--hmc-muted); }
.hmc-pay__option input:checked + span { border: 2px solid var(--hmc-primary); background: var(--hmc-primary-soft); padding: 13px 15px; }
.hmc-pay__note {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 12px;
	padding: 14px 16px;
	margin-bottom: 16px;
	border-radius: 10px;
	background: var(--hmc-soft);
}
.hmc-pay__note small { flex-basis: 100%; }
.hmc-consent label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.hmc-consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--hmc-primary); flex-shrink: 0; }
.hmc-consent a { color: var(--hmc-primary-dark); text-decoration: underline; }

.hmc-hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* actions */
.hmc-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@media (max-width: 767px) {
	.hmc-actions {
		position: sticky;
		bottom: 0;
		margin: 24px -16px -16px;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
		background: #fff;
		border-top: 1px solid var(--hmc-line);
		border-radius: 0 0 var(--hmc-radius) var(--hmc-radius);
	}
	.hmc-actions .hmc-btn { flex: 1; }

	/* Keep the theme's floating WhatsApp button clear of the sticky action bar. */
	.whatsapp-float { bottom: 96px !important; }
}
.hmc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 28px;
	border: 1px solid var(--hmc-primary);
	border-radius: 8px;
	background: var(--hmc-primary);
	color: #fff;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s;
}
.hmc-btn:hover { background: var(--hmc-primary-dark); color: #fff; text-decoration: none; }
.hmc-btn:disabled { opacity: .5; cursor: not-allowed; }
.hmc-btn[aria-busy="true"] { cursor: progress; }
.hmc-btn--ghost { background: #fff; color: var(--hmc-primary-dark); }
.hmc-btn--ghost:hover { background: var(--hmc-primary-soft); color: var(--hmc-primary-dark); }

/* confirmation */
.hmc-booking--done { grid-template-columns: minmax(0, 1fr) !important; max-width: 560px; }
.hmc-done {
	background: #fff;
	border: 1px solid var(--hmc-line);
	border-radius: var(--hmc-radius);
	padding: 28px 20px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.hmc-done .hmc-h { margin: 0; }
.hmc-done__icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #e3f3ea;
	color: #1f7a4d;
	font-size: 26px;
	font-weight: 700;
}
.hmc-done__icon.is-pending { background: #fbefd6; color: #9a5b00; }
.hmc-done__text { color: var(--hmc-muted); max-width: 44ch; }
.hmc-done__list { width: 100%; margin: 8px 0; text-align: start; border: 1px solid var(--hmc-line); border-radius: 10px; padding: 6px 14px; }
.hmc-done__list > div + div { border-top: 1px solid var(--hmc-line); }
.hmc-done__list > div { padding: 9px 0; }

.hmc-test-banner {
	max-width: 1080px;
	margin: 0 auto 16px;
	padding: 10px 14px;
	border-radius: 8px;
	background: #fbefd6;
	color: #6e4a00;
	font-weight: 600;
	font-size: 14px;
	text-align: center;
}

/* loading */
.hmc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes hmc-spin { to { transform: rotate(360deg); } }
@keyframes hmc-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.hmc-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: hmc-spin .7s linear infinite;
	vertical-align: -3px;
	margin-inline-end: 8px;
	flex-shrink: 0;
}
.hmc-skel,
.hmc-day.is-loading {
	background: linear-gradient(90deg, #eef3f5 25%, #f8fafb 50%, #eef3f5 75%);
	background-size: 200% 100%;
	animation: hmc-shimmer 1.2s ease-in-out infinite;
	border-radius: 8px;
}
.hmc-day.is-loading { color: transparent; }
.hmc-skel { display: block; }
.hmc-skel--label { width: 80px; height: 14px; margin: 12px 0 8px; }
.hmc-skel--slot { height: 44px; }
.hmc-cal__days { position: relative; }
.hmc-cal__days[aria-busy="true"]::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 34px;
	height: 34px;
	border: 3px solid var(--hmc-primary-soft);
	border-top-color: var(--hmc-primary);
	border-radius: 50%;
	animation: hmc-spin .7s linear infinite;
}
.hmc-widget { display: flex; align-items: center; }

/* invalid radio groups */
fieldset[aria-invalid="true"] .hmc-choice span { border-color: var(--hmc-accent); }
.hmc-consent[aria-invalid="true"] span,
.hmc-field__error { animation: none; }

/* online payment */
.hmc-pay-panel { width: 100%; text-align: start; display: flex; flex-direction: column; gap: 12px; }
.hmc-hold {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 8px;
	background: #fbefd6;
	color: #6e4a00;
}
.hmc-hold b { font-size: 18px; font-variant-numeric: tabular-nums; }
.hmc-pay__legend { font-weight: 700; margin-bottom: 8px; float: none; width: auto; font-size: 15px; padding: 0; }
.hmc-pay input:disabled + span { opacity: .6; }
.hmc-widget { min-height: 24px; color: var(--hmc-muted); }
.hmc-widget .wpwl-form { max-width: 100%; margin: 0; }

@media (prefers-reduced-motion: reduce) {
	.hmc-booking * { transition: none !important; }
	.hmc-skel,
	.hmc-day.is-loading { animation: none; }
	.hmc-spinner,
	.hmc-cal__days[aria-busy="true"]::after { animation-duration: 2s; }
}

/* doctor chooser (booking page opened without a doctor) */
.hmc-booking.hmc-chooser { display: block; }
.hmc-chooser > .hmc-h { margin: 0 0 16px; }
.hmc-chooser__nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.hmc-chooser__nav a {
	padding: 6px 14px;
	border: 1px solid var(--hmc-line);
	border-radius: 999px;
	background: #fff;
	color: var(--hmc-primary-dark);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
.hmc-chooser__nav a:hover { background: var(--hmc-primary-soft); text-decoration: none; }
.hmc-chooser__group { margin: 0 0 28px; scroll-margin-top: 120px; }
.hmc-chooser__title { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.hmc-chooser__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 640px) { .hmc-chooser__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .hmc-chooser__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hmc-pick {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--hmc-line);
	border-radius: var(--hmc-radius);
	color: var(--hmc-ink);
	text-decoration: none;
	transition: border-color .15s, box-shadow .15s;
}
.hmc-pick:hover { border-color: var(--hmc-primary); box-shadow: 0 4px 14px rgba(27, 38, 59, .08); color: var(--hmc-ink); text-decoration: none; }
.hmc-pick__photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--hmc-soft); }
.hmc-pick__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hmc-pick__name { font-weight: 700; }
.hmc-pick__meta,
.hmc-pick__price { color: var(--hmc-muted); font-size: 13px; }
.hmc-pick__go {
	flex-shrink: 0;
	padding: 6px 12px;
	border-radius: 8px;
	background: var(--hmc-primary);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
}
