/* Chancery Book Consultation — Frontend v2.2.2 */

/* ── Trigger button ── */
.chbc-btn-wrap { display: block; }

.chbc-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 30px;
	background-color: #A62461;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .01em;
	border-radius: 14px;
	border: none;
	cursor: pointer;
	font-family: inherit;
	line-height: 1;
	transition: background-color 200ms ease, transform 180ms ease, box-shadow 200ms ease;
	box-shadow: 0 4px 20px rgba(166,36,97,.35);
}
.chbc-btn:hover {
	background-color: #8c1d52;
	transform: translateY(-2px);
	box-shadow: 0 8px 28px rgba(166,36,97,.45);
}
.chbc-btn svg { flex-shrink: 0; }

/* ── Overlay ── */
.chbc-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 380ms cubic-bezier(.4,0,.2,1);
}
.chbc-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

/* Backdrop fades in separately for a layered feel */
.chbc-overlay-bg {
	position: absolute;
	inset: 0;
	background: rgba(10,5,20,.72);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	cursor: pointer;
	opacity: 0;
	transition: opacity 380ms cubic-bezier(.4,0,.2,1);
}
.chbc-overlay.is-open .chbc-overlay-bg { opacity: 1; }

/* ── Modal — enters with spring bounce ── */
.chbc-modal {
	position: relative;
	z-index: 2;
	background: #fff;
	border-radius: 24px;
	width: 100%;
	max-width: 960px;
	max-height: 90vh;
	overflow-y: auto;
	overflow-x: hidden;
	box-shadow:
		0 0 0 1px rgba(0,0,0,.06),
		0 8px 24px rgba(0,0,0,.12),
		0 32px 80px rgba(0,0,0,.28);
	transform: scale(.94) translateY(32px);
	opacity: 0;
	transition:
		transform 480ms cubic-bezier(.34,1.18,.64,1),
		opacity   320ms cubic-bezier(.4,0,.2,1);
	scrollbar-width: thin;
	scrollbar-color: rgba(0,0,0,.1) transparent;
}
.chbc-overlay.is-open .chbc-modal {
	transform: scale(1) translateY(0);
	opacity: 1;
}

/* Closing — snappy exit */
.chbc-overlay:not(.is-open) .chbc-modal {
	transition:
		transform 220ms cubic-bezier(.4,0,1,1),
		opacity   200ms cubic-bezier(.4,0,1,1);
}

/* ── Modal header ── */
.chbc-modal-head {
	position: sticky;
	top: 0;
	background: #fff;
	padding: 28px 28px 0;
	z-index: 10;
	border-radius: 24px 24px 0 0;
}
.chbc-modal-head-inner {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding-bottom: 20px;
	border-bottom: 1px solid #f0f0f0;
}
.chbc-modal-title {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.03em;
	color: #0a0a0a;
	line-height: 1.1;
}
.chbc-modal-sub {
	font-size: 13px;
	color: #6b7280;
	margin-top: 6px;
	line-height: 1.5;
}
.chbc-close-btn {
	width: 36px; height: 36px;
	border-radius: 50%;
	border: 1.5px solid #e5e7eb;
	background: #f3f4f6;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	margin-left: 16px;
	margin-top: 2px;
	transition: background 180ms ease, border-color 180ms ease;
	font-family: inherit;
}
.chbc-close-btn:hover { background: #e5e7eb; border-color: #d1d5db; }

/* ── Location grid ── */
.chbc-locations {
	display: grid;
	gap: 16px;
	padding: 24px 28px 28px;
}
.chbc-grid-1 { grid-template-columns: 1fr; }
.chbc-grid-2 { grid-template-columns: repeat(2, 1fr); }
.chbc-grid-3 { grid-template-columns: repeat(3, 1fr); }
.chbc-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Modal width snaps to card count ── */
.chbc-modal.chbc-cols-1 { max-width: 400px; }
.chbc-modal.chbc-cols-2 { max-width: 620px; }
.chbc-modal.chbc-cols-3 { max-width: 860px; }
.chbc-modal.chbc-cols-4 { max-width: 1060px; }

/* ── Location card ── */
.chbc-loc-card {
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	overflow: hidden;
	transition: border-color 250ms ease, box-shadow 250ms ease, transform 250ms ease;
	/* Staggered fade-up per card */
	opacity: 0;
	animation: chbcCardIn 420ms cubic-bezier(.34,1.1,.64,1) forwards;
}
.chbc-loc-card:nth-child(1) { animation-delay: 120ms; }
.chbc-loc-card:nth-child(2) { animation-delay: 180ms; }
.chbc-loc-card:nth-child(3) { animation-delay: 240ms; }
.chbc-loc-card:nth-child(4) { animation-delay: 300ms; }

.chbc-loc-card:hover {
	border-color: #A62461;
	box-shadow: 0 6px 28px rgba(166,36,97,.13);
	transform: translateY(-2px);
}

@keyframes chbcCardIn {
	from { opacity: 0; transform: translateY(14px) scale(.98); }
	to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Map thumbnail ── */
.chbc-map-wrap {
	position: relative;
	height: 140px;
	background: #e8eaed;
	overflow: hidden;
}
.chbc-map-wrap iframe {
	width: 100%; height: 100%;
	border: none;
	pointer-events: none;
	display: block;
}
.chbc-map-overlay { position: absolute; inset: 0; cursor: default; }
.chbc-map-pin {
	position: absolute;
	top: 10px;
	right: 10px;
	background-color: #A62461;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 100px;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(166,36,97,.35);
}

/* ── Card body ── */
.chbc-loc-body { padding: 16px; }
.chbc-loc-name {
	font-size: 14px;
	font-weight: 700;
	color: #0a0a0a;
	letter-spacing: -.01em;
	line-height: 1.2;
	margin-bottom: 4px;
}
.chbc-loc-addr {
	font-size: 11px;
	color: #9ca3af;
	line-height: 1.4;
	margin-bottom: 14px;
}
.chbc-loc-actions { display: flex; flex-direction: column; gap: 7px; }
.chbc-loc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 9px 12px;
	border-radius: 9px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .01em;
	cursor: pointer;
	text-decoration: none;
	font-family: inherit;
	border: none;
	width: 100%;
	transition: background-color 180ms ease, transform 150ms ease;
	line-height: 1;
}
.chbc-loc-btn:active { transform: scale(.98); }
.chbc-loc-btn svg { flex-shrink: 0; width: 13px; height: 13px; }

.chbc-btn-enquiry { background-color: #fdf2f8; color: #A62461; }
.chbc-btn-enquiry:hover { background-color: #fce7f3; color: #A62461; }

.chbc-btn-call { background-color: #f0fdf4; color: #16a34a; }
.chbc-btn-call:hover { background-color: #dcfce7; color: #16a34a; }

.chbc-btn-book { background-color: #A62461; color: #fff; }
.chbc-btn-book:hover { background-color: #8c1d52; color: #fff; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
	.chbc-btn, .chbc-overlay, .chbc-overlay-bg, .chbc-modal, .chbc-loc-card {
		transition: none;
		animation: none;
		opacity: 1;
		transform: none;
	}
}

/* ── Responsive ── */
@media (max-width: 900px) {
	.chbc-grid-4 { grid-template-columns: repeat(2, 1fr); }
	.chbc-modal.chbc-cols-4 { max-width: 660px; }
}
@media (max-width: 768px) {
	.chbc-grid-3 { grid-template-columns: repeat(2, 1fr); }
	.chbc-modal-head { padding: 20px 20px 0; }
	.chbc-locations { padding: 16px 20px 20px; }
	.chbc-overlay { padding: 12px; }
	.chbc-modal { max-width: calc(100vw - 24px) !important; max-height: 95vh; border-radius: 20px; }
	.chbc-modal-head { border-radius: 20px 20px 0 0; }
}
@media (max-width: 520px) {
	.chbc-grid-4, .chbc-grid-3, .chbc-grid-2 { grid-template-columns: 1fr; }
	.chbc-map-wrap { height: 120px; }
	.chbc-modal-title { font-size: 19px; }
	.chbc-overlay { padding: 8px; }
}
