/**
 * Блок послуг «вкладки» #main-services (2026-10-29). Разметка: template-parts/home/services.php, данные: inc/wa-services.php,
 * JS: assets/js/wa-services.js. Макет: services-task.zip (ServicesTabs.dc.html — 1440, ServicesTabsMobile.dc.html — 390).
 * Подключается на главной и городах (city.php). Ширина — сетка сайта: 1400px, на ≤1400 — 90%, на ≤767 — поля 16px.
 * Неактивные панели — hidden="until-found" (в HTML; браузер раскрывает их при Ctrl+F) — display у панели не задаём.
 */

.wa-svc {
	padding: 80px 0;
	background: #f5f8fb;
	overflow-x: clip; /* лента чипсов (−5vw) не даёт горизонтальный скролл страницы при полосе прокрутки */
	font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color: #1d2433;
}

.wa-svc__wrap {
	width: 1400px;
	max-width: 100%;
	margin: 0 auto;
}

/* ---------- шапка блока ---------- */
.wa-svc__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px 40px;
	flex-wrap: wrap;
}

.wa-svc__title {
	margin: 0;
	font-family: Montserrat, Arial, sans-serif;
	font-weight: 700;
	font-size: 40px;
	line-height: 1.15;
	letter-spacing: -.01em;
	text-transform: none;
	color: #14233a;
}

.wa-svc__lead {
	margin: 12px 0 0;
	font-size: 17px;
	line-height: 1.55;
	color: #4b5563;
}

/* ---------- вкладки ---------- */
.wa-svc__tabs {
	display: inline-flex;
	gap: 4px;
	padding: 5px;
	background: #fff;
	border: 1px solid #e1e8ef;
	border-radius: 16px;
}

.wa-svc .wa-svc__tab {
	height: 46px;
	padding: 0 18px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	font-family: Montserrat, Arial, sans-serif;
	font-weight: 600;
	font-size: 15px;
	color: #36404f;
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}

.wa-svc .wa-svc__tab:hover { background: #f1f6fa; color: #14233a; }
.wa-svc .wa-svc__tab.is-active { background: #1a72a8; color: #fff; }

.wa-svc .wa-svc__tab:focus-visible,
.wa-svc .wa-svc__card:focus-visible,
.wa-svc .wa-svc__panel:focus-visible,
.wa-svc .wa-svc__fill-btn:focus-visible,
.wa-svc .wa-svc__cta-btn:focus-visible {
	outline: 2px solid #1a72a8;
	outline-offset: 2px;
}

.wa-svc__count {
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	box-sizing: border-box;
	border-radius: 999px;
	background: #eaf1f6;
	color: #4b5563;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wa-svc__tab.is-active .wa-svc__count { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- панели ---------- */
.wa-svc__panel { border-radius: 20px; }
.wa-svc__panel:not([hidden]) { animation: wa-svc-fade .2s ease-out; }

@keyframes wa-svc-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* название категории — для скринридеров; без JS показывается (noscript в inc/wa-services.php) */
.wa-svc__group-title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	font-family: Montserrat, Arial, sans-serif;
	font-weight: 700;
	font-size: 22px;
	color: #14233a;
}

.wa-svc__grid {
	margin: 36px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.wa-svc__grid > li { display: flex; margin: 0; padding: 0; }
.wa-svc__grid > li::before { content: none; }

/* ---------- карточка ---------- */
.wa-svc .wa-svc__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #e3e9ef;
	border-radius: 20px;
	padding: 24px 24px 22px;
	color: #1d2433;
	text-decoration: none;
	-webkit-user-select: auto;
	user-select: auto;
	transition: transform .3s cubic-bezier(.2, .7, .3, 1), box-shadow .3s, border-color .3s;
}

.wa-svc__card-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.wa-svc__icon {
	width: 52px;
	height: 52px;
	flex: none;
	border-radius: 15px;
	background: #eaf4fa;
	color: #1a72a8;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .3s, color .3s;
}

.wa-svc__badge {
	height: 26px;
	padding: 0 10px;
	border-radius: 999px;
	background: #eef8e2;
	color: #3f7a0a;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

.wa-svc__badge .wa-icon { fill: currentColor; stroke: none; }

.wa-svc__name {
	display: block;
	margin: 20px 0 8px;
	font-family: Montserrat, Arial, sans-serif;
	font-weight: 700;
	font-size: 19px;
	line-height: 1.3;
	color: #14233a;
}

.wa-svc__desc {
	display: block;
	font-size: 15px;
	line-height: 1.55;
	color: #4b5563;
}

.wa-svc__bottom {
	margin-top: auto;
	padding-top: 22px;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
}

.wa-svc__from {
	display: block;
	font-size: 12px;
	color: #5b6472;
}

.wa-svc__price {
	font-family: Montserrat, Arial, sans-serif;
	font-weight: 700;
	font-size: 22px;
	color: #14233a;
	white-space: nowrap;
}

.wa-svc__go {
	width: 42px;
	height: 42px;
	flex: none;
	margin-left: auto;
	box-sizing: border-box;
	border-radius: 999px;
	border: 1px solid #d5dde6;
	color: #1a72a8;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .3s, color .3s, border-color .3s;
}

.wa-svc__chev { display: none; color: #1a72a8; }

@media (hover: hover) and (min-width: 768px) {
	.wa-svc .wa-svc__card:hover {
		color: #1d2433;
		transform: translateY(-4px);
		box-shadow: 0 18px 40px rgba(15, 23, 42, .10);
		border-color: #cfe1ee;
	}
	.wa-svc__card:hover .wa-svc__icon { background: #1a72a8; color: #fff; }
	.wa-svc__card:hover .wa-svc__go { background: #1a72a8; border-color: #1a72a8; color: #fff; }
}

/* ---------- заполнитель «Індивідуальний проєкт»: только если в ряду дыра (--d: 3 колонки, --t: 2) ---------- */
.wa-svc .wa-svc__fill {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	box-sizing: border-box;
	border: 1.5px dashed #b9d3e6;
	border-radius: 20px;
	background: #eef6fb;
	padding: 28px;
}

@media (min-width: 1200px) {
	.wa-svc .wa-svc__fill--d { display: flex; }
}

.wa-svc__fill-icon {
	width: 44px;
	height: 44px;
	border-radius: 13px;
	background: #fff;
	color: #1a72a8;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wa-svc__fill-title {
	margin: 18px 0 8px;
	font-family: Montserrat, Arial, sans-serif;
	font-weight: 700;
	font-size: 19px;
	line-height: 1.3;
	color: #14233a;
}

.wa-svc__fill-text {
	margin: 0;
	font-size: 15px;
	line-height: 1.55;
	color: #4b5563;
}

.wa-svc .wa-svc__fill-btn {
	margin-top: 18px;
	height: 42px;
	padding: 0 16px;
	border: 1px solid #1a72a8;
	border-radius: 12px;
	background: #fff;
	color: #1a72a8;
	font-family: Montserrat, Arial, sans-serif;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
}

.wa-svc .wa-svc__fill-btn:hover { background: #1a72a8; color: #fff; }

/* ---------- общая CTA ---------- */
.wa-svc__cta {
	margin-top: 28px;
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 22px 24px 22px 28px;
	background: #fff;
	border: 1px solid #e3e9ef;
	border-radius: 20px;
}

.wa-svc__cta-icon {
	width: 48px;
	height: 48px;
	flex: none;
	border-radius: 14px;
	background: #eef8e2;
	color: #3f7a0a;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wa-svc__cta-text { flex: 1; min-width: 0; }

.wa-svc__cta-title {
	margin: 0;
	font-family: Montserrat, Arial, sans-serif;
	font-weight: 700;
	font-size: 18px;
	color: #14233a;
}

.wa-svc__cta-desc {
	margin: 3px 0 0;
	font-size: 15px;
	line-height: 1.5;
	color: #4b5563;
}

.wa-svc .wa-svc__cta-btn {
	height: 50px;
	padding: 0 22px;
	flex: none;
	border: 0;
	border-radius: 14px;
	background: #7dc91b;
	color: #0e2a06;
	font-family: Montserrat, Arial, sans-serif;
	font-weight: 700;
	font-size: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: pointer;
}

.wa-svc .wa-svc__cta-btn:hover { background: #6fb915; color: #0e2a06; }

/* ---------- ≤1400: сетка сайта 90% ---------- */
/* ширина контента 1400; ниже 1440 — поля 20px, ниже 1024 — 16px (края всех блоков совпадают, 2026-10-29) */
@media (max-width: 1439px) {
	.wa-svc__wrap { width: calc(100% - 40px); }
}
@media (max-width: 1023px) {
	.wa-svc__wrap { width: calc(100% - 32px); }
}

/* ---------- 768–1199: 2 колонки, вкладки под заголовком ---------- */
@media (max-width: 1199px) {
	.wa-svc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.wa-svc .wa-svc__fill--t { display: flex; }
}

/* ---------- ≤1023: вкладки — чипсы в одну строку со скроллом ---------- */
@media (max-width: 1023px) {
	.wa-svc__head { display: block; }
	.wa-svc__tabs {
		display: flex;
		gap: 8px;
		margin: 24px -5vw 0; /* лента выходит под край экрана: поле = 5vw (обёртка 90%) */
		padding: 2px 5vw 4px;
		background: none;
		border: 0;
		border-radius: 0;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
	}
	.wa-svc__tabs::-webkit-scrollbar { display: none; }
	.wa-svc .wa-svc__tab {
		flex: none;
		height: 42px;
		padding: 0 15px;
		border: 1px solid #d9e3ec;
		border-radius: 999px;
		background: #fff;
		font-size: 14px;
		gap: 7px;
	}
	.wa-svc .wa-svc__tab:hover { background: #fff; }
	.wa-svc .wa-svc__tab.is-active { background: #1a72a8; border-color: #1a72a8; color: #fff; }
	.wa-svc__count { min-width: 0; height: auto; padding: 0; background: none; color: inherit; opacity: .65; }
	.wa-svc__tab.is-active .wa-svc__count { background: none; }
	.wa-svc__grid { margin-top: 24px; }
}

/* ---------- мобилка ≤767: компактные строки, без заполнителя ---------- */
@media (max-width: 767px) {
	.wa-svc { padding: 48px 0; }
	.wa-svc__wrap { width: auto; padding: 0 16px; }
	.wa-svc__title { font-size: 27px; line-height: 1.2; letter-spacing: 0; }
	.wa-svc__lead { margin-top: 10px; font-size: 15px; line-height: 1.5; }
	.wa-svc__tabs { margin: 22px -16px 0; padding: 2px 16px 4px; }

	.wa-svc__grid { margin-top: 18px; grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.wa-svc .wa-svc__fill,
	.wa-svc .wa-svc__fill--d,
	.wa-svc .wa-svc__fill--t { display: none; }

	.wa-svc .wa-svc__card {
		display: grid;
		grid-template-columns: 56px minmax(0, max-content) 1fr 18px; /* иконка 40 + зазор 16 */
		grid-template-areas:
			"icon name badge chev"
			"icon desc desc chev"
			"icon cost cost chev";
		align-items: center;
		padding: 16px;
		border-radius: 16px;
	}
	.wa-svc__card-top,
	.wa-svc__bottom { display: contents; }
	.wa-svc__icon {
		grid-area: icon;
		align-self: start;
		width: 40px;
		height: 40px;
		border-radius: 12px;
	}
	.wa-svc__icon .wa-icon { width: 20px; height: 20px; }
	.wa-svc__name { grid-area: name; margin: 0; font-size: 16px; }
	.wa-svc__badge {
		grid-area: badge;
		justify-self: start;
		height: auto;
		margin-left: 6px;
		padding: 2px 7px;
		font-size: 11px;
	}
	.wa-svc__badge .wa-icon { display: none; }
	.wa-svc__desc { grid-area: desc; margin-top: 3px; font-size: 13px; line-height: 1.45; }
	.wa-svc__cost { grid-area: cost; margin-top: 8px; }
	.wa-svc__from { display: inline; font-size: 12px; }
	.wa-svc__price { font-size: 15px; }
	.wa-svc__go { display: none; }
	.wa-svc__chev { display: flex; grid-area: chev; margin-left: 8px; }

	.wa-svc__cta {
		margin-top: 16px;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 20px;
		border-radius: 18px;
	}
	.wa-svc__cta-icon { display: none; }
	.wa-svc__cta-title { font-size: 17px; }
	.wa-svc__cta-desc { margin-top: 4px; font-size: 14px; }
	.wa-svc .wa-svc__cta-btn { margin-top: 14px; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.wa-svc__panel:not([hidden]) { animation: none; }
	.wa-svc .wa-svc__card,
	.wa-svc__icon,
	.wa-svc__go { transition: none; }
	.wa-svc .wa-svc__card:hover { transform: none; }
}
