/* =========================================================
   Секція D: чипи послуг
   Макет «Startseite» → Leistungs-Chips: чипи перемикають
   панель з описом обраної послуги.
   ========================================================= */

.phm-chips {
	background: var(--phm-beige);
}

.phm-chips__inner {
	padding-block: var(--phm-section-y);
	text-align: center;
}

.phm-chips__title {
	margin: 0;
}

.phm-chips__grid {
	margin: 64px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: 16px;
}

.phm-chips__item {
	aspect-ratio: 1;
	background: var(--phm-white);
	border: 1px solid transparent;
	border-radius: var(--phm-radius);
	box-shadow: var(--phm-shadow-card);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 10px;
	margin: 0;
	font-family: inherit;
	cursor: pointer;
	transition:
		background-color var(--phm-dur) var(--phm-ease),
		border-color var(--phm-dur) var(--phm-ease);
}

/* Якщо описів немає, чип рендериться як <div> — не клікабельний */
div.phm-chips__item {
	cursor: default;
}

button.phm-chips__item:hover,
button.phm-chips__item:focus-visible {
	border-color: var(--phm-primary);
}

.phm-chips__item.is-active {
	background: var(--phm-mint);
	border-color: var(--phm-primary-dark);
}

.phm-chips .phm-chips__icon {
	width: 52px;
	height: 52px;
	object-fit: contain;
}

.phm-chips__label {
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--phm-text);
	text-align: center;
	/* Чип вузький (≈108px), без переносу довгі назви не вміщаються */
	hyphens: auto;
	-webkit-hyphens: auto;
	hyphenate-limit-chars: 14 6 4;
}

/* ---- Панель з описом обраної послуги ---- */

.phm-chips__detail {
	margin-top: 32px;
	background: var(--phm-white);
	border-radius: var(--phm-radius);
	box-shadow: var(--phm-shadow-card);
	padding: 56px 64px;
	text-align: center;
}

.phm-chips__detail[hidden] {
	display: none;
}

.phm-chips__detail-title {
	margin: 0;
	line-height: 1.4;
}

.phm-chips__detail-text {
	margin: 16px auto 0;
	font-size: var(--phm-body);
	line-height: var(--phm-body-lh);
	color: var(--phm-text);
	max-width: var(--phm-measure);
}

.phm-chips__detail-actions {
	margin-top: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 36px;
	flex-wrap: wrap;
}

.phm-chips__action {
	margin-top: 64px;
}

/* ---- Адаптив (ТЗ §5.1-D: 1024 → 4, 767 → 3, 480 → 2) ---- */

@media (max-width: 1024px) {
	.phm-chips__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 20px;
		margin-top: 48px;
	}

	.phm-chips__action {
		margin-top: 48px;
	}

	.phm-chips__detail {
		padding: 40px;
	}
}

@media (max-width: 767px) {
	.phm-chips__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 12px;
	}

	.phm-chips .phm-chips__icon {
		width: 44px;
		height: 44px;
	}

	.phm-chips__label {
		font-size: 12px;
	}

	.phm-chips__detail {
		padding: 28px 20px;
		margin-top: 24px;
	}

	.phm-chips__detail-actions {
		flex-direction: column;
		gap: 16px;
		align-items: stretch;
	}
}

@media (max-width: 480px) {
	.phm-chips__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
