.services-hero {
	margin: 6rem auto 3rem;
	padding: 10px 1.5rem 1px;
	max-width: 1080px;
	background: linear-gradient(135deg, #b3926e, #b3926e);
	border-radius: 32px;
	position: relative;
	overflow: hidden;
}
:root{
	--accent-beige: #E6D4BC;
	--accent-brown-dark: rgba(57,36,23,1.0);
	--accent-brown-medium: #B69B77;
	--popover-z: 150000; 
	--card-hover-z: 140000;
}

.services-hero::after {
	content: "";
	position: absolute;
	inset: 12% 8% auto;
	height: 260px;
	background: radial-gradient(circle at top right, #b3926e, transparent 60%);
	z-index: 0;
}

.services-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: stretch;
}

.services-hero__eyebrow {
	font-size: 0.9rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #41372a;
	font-weight: 600;
	
}

.services-hero__title {
	font-size: clamp(2rem, 4vw, 2.75rem);
	line-height: 1.1;
	color: #fff;
	font-weight: 700;
}

/* Make title span the available hero width (not limited by previous inner max-width) */
.services-hero__title {
	display: block;
	width: 100%;
	max-width: none;
	transform: translateY(-40px);
}

.services-hero__subtitle {
	font-size: 1.05rem;
	color: #41372a;
	line-height: 1.6;
	transform: translateY(-30px);
}

.services-categories {
	display: flex;
	flex-direction: column;
	gap: 4rem;
	margin: 0 auto 6rem;
	padding-inline: 1.5rem;
	max-width: 1180px;
}

.service-category {
	display: flex;
	flex-direction: column;
	scroll-margin-top: 120px;
}

.service-category__header {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.service-category__title {
	font-size: clamp(1.9rem, 3vw, 2.35rem);
	font-weight: 700;
	color: #524D46;
}

.service-category__description {
	font-size: 1.05rem;
	color: #4b5563;
	max-width: 720px;
	line-height: 1.65;
	transform: translateY(-50px);
}

.service-grid {
	display: grid;
		gap: 1.75rem;
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
		justify-content: center;
		justify-items: center;
		width: min(98%, 1240px);
		margin: 0 auto;
	}

.service-card {
	background: linear-gradient(160deg, #a7865f, #ffdebc 95%);
	border-radius: 22px;
		padding: 1.75rem 1.5rem;
		position: relative;
		overflow: visible;
		border: 1px solid rgba(59, 130, 246, 0.08);
		box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.35);
		transition: transform 0.25s ease, box-shadow 0.25s ease;
		cursor: pointer;
		z-index: 1; /* base stacking */
		min-height: 220px;
	}

.service-card.is-selected {
	border-color: rgba(107, 63, 43, 0.45);
	box-shadow: 0 36px 70px -32px rgba(107, 63, 43, 0.35);
}

.service-card.is-selected::after {
	content: "";
	position: absolute;
	top: 14px;
	right: 14px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: radial-gradient(circle at center, #fef7ed 40%, #6b3f2b 41%);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.65);
}

.service-card:focus-visible {
	outline: 3px solid rgba(59, 130, 246, 0.35);
	outline-offset: 4px;
}

.service-card:hover,
.service-card:focus,
.service-card:focus-within {
	transform: translateY(-6px);
	box-shadow: 0 30px 70px -30px rgba(15, 23, 42, 0.45);
	z-index: var(--card-hover-z); /* lift hovered card above neighbors */
}
.services-end-subtitle-service {
  color: #524D46;
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin: 0;
  font-weight: 700;
  text-align: center;
  padding: 0px 50px 0px 50px;
}
.service-card__face {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.9rem;
	min-height: 90px;
	color: #0f172a;
}

.service-card__icon {
	font-size: 2.5rem;
}

.service-card__icon--small {
	font-size: 1.4rem;
}

.service-card__name {
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
}

.service-card__summary {
	font-size: 0.9rem;
	color: #524D46;
	line-height: 1.4;
	max-height: 3.6rem;
	overflow: hidden;
}

.service-card__popover {
	position: absolute;
	left: 50%;
	top: calc(100% + 1rem);
	transform: translate(-50%, 8px);
	background: rgba(57,36,23,0.96); 
	color: var(--accent-beige);
	border-radius: 18px;
	padding: 1.25rem 1.4rem;
	min-width: 260px;
	max-width: min(360px, calc(100vw - 3rem));
	box-shadow: 0 30px 90px -30px rgba(8,6,4,0.6);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: var(--popover-z);
}

.service-card__popover::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 50%;
	transform: translateX(-50%);
	border-width: 0 12px 12px 12px;
	border-style: solid;
	border-color: transparent transparent #0f172a transparent;
}

.service-card:hover .service-card__popover,
.service-card:focus .service-card__popover,
.service-card:focus-within .service-card__popover {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.service-card__popover-inner {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}



.service-card__popover-header {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.service-card__popover-title {
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--accent-beige);
}

.service-card__popover-text {
	font-size: 0.95rem;
	line-height: 1.55;
	color: rgba(230,212,188,0.95);
}

.service-card__popover-list {
	margin: 0;
	padding-left: 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.service-card__popover-list li {
	font-size: 0.9rem;
	color: rgba(230,212,188,0.95);
	line-height: 1.45;
}

.services-selection {
	position: fixed;
	top: 120px;
	left: clamp(1rem, 4vw, 2.5rem);
	width: min(340px, calc(100vw - 2rem));
	z-index: 180000;
	/* slide in from the left */
	transform: translateX(-120%);
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
	pointer-events: none;
}

.services-selection.is-visible {
	transform: translateX(0);
	opacity: 1;
	pointer-events: auto;
}

.services-selection__inner {
	background: #6b3f2b;
	color: #f9f5ef;
	border-radius: 22px;
	box-shadow: 0 30px 70px -30px rgba(10, 8, 6, 0.55);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 150px);
	transform: translateX(-25px);
}

.services-selection__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	padding: 1.25rem 1.5rem 1rem;
}

.services-selection__titles {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.services-selection__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
}

.services-selection__subtitle {
	margin: 0;
	font-size: 0.9rem;
	color: rgba(249, 245, 239, 0.75);
}

.services-selection__clear {
	background: rgba(249, 245, 239, 0.12);
	border: 1px solid rgba(249, 245, 239, 0.25);
	color: rgba(249, 245, 239, 0.9);
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.services-selection__clear:hover,
.services-selection__clear:focus-visible {
	background: rgba(249, 245, 239, 0.22);
	color: #fff;
}

.services-selection__content {
	padding: 0.5rem 1.5rem 1rem;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.services-selection__empty {
	margin: 0;
	font-size: 0.95rem;
	color: rgba(249, 245, 239, 0.7);
}

.services-selection__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.services-selection__item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.75rem;
	background: rgba(249, 245, 239, 0.08);
	border-radius: 14px;
	padding: 0.85rem 0.95rem;
}

.services-selection__item-info {
	flex: 1 1 auto;
}

.services-selection__item-title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
}

.services-selection__item-meta {
	margin: 0.35rem 0 0;
	font-size: 0.8rem;
	color: rgba(249, 245, 239, 0.65);
}

.services-selection__remove {
	background: transparent;
	border: none;
	color: rgba(249, 245, 239, 0.65);
	font-size: 0.85rem;
	cursor: pointer;
	padding: 0.15rem 0.25rem;
}

.services-selection__footer {
	margin-top: auto;
	padding: 1rem 1.5rem 1.4rem;
}

.services-selection__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 87%;
	padding: 0.85rem 1.2rem;
	border-radius: 999px;
	background: linear-gradient(135deg, #6b3f2b, #a56c44);
	color: #fef7ed;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.95rem;
	letter-spacing: 0.01em;
	transition: filter 0.2s ease, transform 0.2s ease;
}

.services-selection__cta:hover,
.services-selection__cta:focus-visible {
	filter: brightness(1.05);
	transform: translateY(-1px);
}

@media (max-width: 1200px) {
	.services-selection {
		top: auto;
		bottom: 2rem;
		left: clamp(1rem, 3vw, 2rem);
	}

	.services-selection__inner {
		max-height: 400px;
	}
}

@media (min-width:1024px) and (max-width:1285px){
	.services-categories{
		max-width: min(740px, calc(100% - 7rem));
		margin: 0 auto 4rem;
	}
	.service-grid{
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
		gap: 0.9rem;
		justify-content: center;
	}
	.service-card{
		padding: 0.25rem 0.7rem;
		min-height: 85px;
	}
	.service-card__face{
		min-height: 70px;
	}
	.services-selection{
		top: 110px;
		left: clamp(0.4rem, 0.8vw, 0.65rem);
		width: min(220px, calc(100vw - 2rem));
	}
}

@media (min-width:1286px) and (max-width:1400px){
	.services-categories{
		max-width: min(980px, calc(100% - 6rem));
		padding-inline: 0.5rem;
		gap: 1.4rem;
		margin: 0 auto 4rem;
	}
	.service-grid{
		gap: 1rem;
		grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	}
	.service-card{
		padding: 0.8rem 0.9rem;
		min-height: 120px;
	}
	.service-card__face{
		min-height: 90px;
	}
}

@media (max-width:1023px){
	.services-selection{
		top: auto;
		bottom: 20px;
		left: 1rem;
		transform: translateY(120%);
		width: calc(100% - 2rem);
	}
	.services-selection.is-visible{
		transform: translateY(0);
	}
	.services-selection__inner{
		transform: none;
		max-height: 70vh;
	}
}

@media (max-width: 768px) {
	.services-hero {
		margin-top: 4rem;
		padding: 3.5rem 1.25rem 2.5rem;
	}

	.services-categories {
		gap: 3rem;
	}

	.service-grid {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
		gap: 1.25rem;
	}

	.service-card {
		padding: 1.5rem 1.35rem 1.2rem;
	}
}

@media (hover: none) {
	.service-card {
		transform: none !important;
		box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.45);
	}

	.service-card__popover {
		position: static;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
		background: rgba(15, 23, 42, 0.96);
		margin-top: 1rem;
	}

	.service-card__popover::before {
		display: none;
	}
}

@media (max-width: 480px) {
	.services-hero__title {
		font-size: 1.9rem;
	}

	.services-hero__subtitle {
		font-size: 0.98rem;
	}

	.service-card__face {
		min-height: 0;
		gap: 0.75rem;
	}

	.service-card__popover {
		padding: 1.1rem 1.2rem;
	}
}

@media (min-width:1024px) and (max-width:1400px){
	.services-categories{
		max-width: min(760px, calc(100% - 7rem));
		padding-inline: 0.25rem;
		margin: 0 auto 3.5rem;
	}
	.service-grid{
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
		gap: 0.8rem;
		justify-content: center;
	}
	.service-card{
		padding: 0.45rem 0.8rem;
		min-height: 105px;
	}
	.service-card__face{
		min-height: 80px;
	}
}
