/**
 * Accessibility corrections that must win after every page-specific layer.
 * The lighter brand blue remains available for large type and decoration;
 * interactive fills and small blue copy use the established darker pair.
 */

:root {
	--nevtech-action-blue: #3578bb;
	--nevtech-action-blue-hover: #245f9d;
	--nevtech-readable-blue: #326fae;
}

body.home .nevtech-home .nevtech-home-hero__actions .wp-block-button__link,
.nevtech-contact-section__button,
.nevtech-contact-grid ~ .nevtech-page-section--accent .wp-block-button__link,
body.error404 .wp-block-button__link,
body.single-product .nevtech-product-action--primary,
.nevtech-consumable-card .nevtech-product-action--primary {
	border-color: var(--nevtech-action-blue);
	background: var(--nevtech-action-blue);
	color: #fff;
}

body.home .nevtech-home .nevtech-home-hero__actions .wp-block-button__link:hover,
body.home .nevtech-home .nevtech-home-hero__actions .wp-block-button__link:focus-visible,
.nevtech-contact-section__button:hover,
.nevtech-contact-section__button:focus-visible,
.nevtech-contact-grid ~ .nevtech-page-section--accent .wp-block-button__link:hover,
.nevtech-contact-grid ~ .nevtech-page-section--accent .wp-block-button__link:focus-visible,
body.error404 .wp-block-button__link:hover,
body.error404 .wp-block-button__link:focus-visible,
body.single-product .nevtech-product-action--primary:hover,
body.single-product .nevtech-product-action--primary:focus-visible,
.nevtech-consumable-card .nevtech-product-action--primary:hover,
.nevtech-consumable-card .nevtech-product-action--primary:focus-visible {
	border-color: var(--nevtech-action-blue-hover);
	background: var(--nevtech-action-blue-hover);
	color: #fff;
}

.nevtech-contact-form label span,
.nevtech-request-dialog__eyebrow,
body.home .nevtech-home .nevtech-direction-card__index {
	color: var(--nevtech-readable-blue);
}

body.single-product .nevtech-product-sku,
body.single-product .nevtech-product-sku span {
	color: #5f6368;
}

.nevtech-catalog-branch__link.is-current .nevtech-catalog-branch__count {
	color: #5f6368;
}

.nevtech-search-results .wp-block-query-pagination a {
	color: var(--nevtech-action-blue-hover);
}

@media (max-width: 900px) and (min-width: 641px) {
	.nevtech-page-main,
	.nevtech-search-main,
	.nevtech-not-found-main {
		padding-right: 24px;
		padding-left: 24px;
	}

	.nevtech-page-main .wp-block-post-content > .nevtech-map {
		width: 100%;
		max-width: none;
	}
}

/* Поиск и отдельная страница запчастей используют ту же широкую оптическую
   ось, что H1 и основной каталог. Одинокая карточка остаётся по центру. */
.nevtech-search-results .wp-block-post-template {
	grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

.nevtech-search-results .wp-block-post-template > .wp-block-post {
	grid-column: span 2;
}

.nevtech-search-results .wp-block-post-template > .wp-block-post:nth-child(3n+1):last-child {
	grid-column: 3 / span 2;
}

.nevtech-search-results .wp-block-post-template > .wp-block-post:nth-child(3n+1):nth-last-child(2) {
	grid-column: 2 / span 2;
}

.nevtech-search-card .wp-block-post-title a,
.nevtech-search-card__link {
	position: relative;
}

.nevtech-search-card .wp-block-post-title a::after {
	position: absolute;
	inset: -12px -4px;
	content: "";
}

.nevtech-search-card__link::after {
	position: absolute;
	inset: -6px 0;
	content: "";
}

.nevtech-spares-quick-menu,
.nevtech-spares-catalog {
	box-sizing: border-box;
	width: min(100%, 1240px) !important;
	max-width: 1240px !important;
	margin-inline: auto !important;
}

.nevtech-not-found {
	text-align: center;
}

.nevtech-not-found h1 {
	margin-inline: auto;
}

.nevtech-not-found .wp-block-buttons {
	justify-content: center;
}

.nevtech-catalog-empty {
	box-sizing: border-box;
	max-width: 760px;
	margin: 32px auto 0 !important;
	padding: clamp(24px, 5vw, 48px);
	border-radius: 24px;
	text-align: center;
}

.nevtech-catalog-empty .wp-block-buttons {
	justify-content: center;
}

/* Пустой фактический результат не предлагает полноэкранный фильтр без опций
   и сортировку несуществующих карточек. Рубрикатор и следующий шаг остаются. */
body.nevtech-commerce:has(.nevtech-catalog-empty) .nevtech-catalog-product-filters,
body.nevtech-commerce:has(.nevtech-catalog-empty) .nevtech-catalog-toolbar {
	display: none;
}

@media (max-width: 900px) {
	.nevtech-search-results .wp-block-post-template {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	}

	.nevtech-search-results .wp-block-post-template > .wp-block-post,
	.nevtech-search-results .wp-block-post-template > .wp-block-post:nth-child(3n+1):last-child,
	.nevtech-search-results .wp-block-post-template > .wp-block-post:nth-child(3n+1):nth-last-child(2) {
		grid-column: auto / span 2;
	}

	.nevtech-search-results .wp-block-post-template > .wp-block-post:nth-child(2n+1):last-child {
		grid-column: 2 / span 2;
	}
}

@media (max-width: 640px) {
	body.home .nevtech-home .nevtech-direction-card__label,
	body.home .nevtech-home .nevtech-direction-card__index {
		height: auto;
		font-size: 12px !important;
		line-height: 15px !important;
	}

	body.home .nevtech-home .nevtech-direction-card__label {
		height: 15px;
		margin-bottom: 19px !important;
	}

	.nevtech-direction-card__links a,
	.nevtech-catalog-card__meta {
		font-size: 12px !important;
		line-height: 15px !important;
	}

	body.nevtech-commerce .nevtech-product-card__cta,
	.nevtech-consumable-card .nevtech-product-action {
		font-size: 14px;
		line-height: 16px;
	}
}

@media (max-width: 390px) {
	body.privacy-policy .nevtech-page-main > .wp-block-post-title {
		font-size: 32px !important;
		word-break: normal;
		overflow-wrap: normal;
		hyphens: none;
	}
}

@media (max-width: 360px) {
	body.privacy-policy .nevtech-page-main > .wp-block-post-title {
		font-size: 30px !important;
	}
}

@media (max-width: 340px) {
	.nevtech-search-results .wp-block-post-template {
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.nevtech-search-results .wp-block-post-template > .wp-block-post,
	.nevtech-search-results .wp-block-post-template > .wp-block-post:nth-child(3n+1):last-child,
	.nevtech-search-results .wp-block-post-template > .wp-block-post:nth-child(3n+1):nth-last-child(2),
	.nevtech-search-results .wp-block-post-template > .wp-block-post:nth-child(2n+1):last-child {
		grid-column: auto;
	}
}
