/* ============================================================
   Responsive polish: планшеты, телефоны, все ориентации и режимы.
   Подключается последним слоем поверх mobile-premium.
   ============================================================ */

/* ---------- Планшет 701–980: две колонки вместо трёх тесных ---------- */
@media (min-width: 701px) and (max-width: 980px) {
	.doc-grid,
	.doc-grid.doc-grid--archive {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: clamp(14px, 2.4vw, 20px);
	}
	.srv-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: clamp(14px, 2.4vw, 20px);
	}
	.news-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.doc-grid .doc-card__link {
		grid-template-columns: minmax(0, 1fr);
	}
	.doc-grid .doc-card__media {
		width: 100%;
	}
	.srv-card__title {
		font-size: 1.12rem;
		line-height: 1.18;
	}
}

/* ---------- Тап-таргеты: телефон, планшет, сенсор ---------- */
@media (pointer: coarse), (max-width: 1024px) {
	.crumbs a,
	.crumbs span {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}
	.crumbs {
		row-gap: 2px;
	}
	.chips .chip,
	.chip {
		min-height: 44px;
		padding-block: 10px;
	}
	.search__chips a {
		min-height: 44px;
		padding-block: 8px;
	}
	.price-tools .btn,
	.price-tools .price-search,
	.price-tools .price-filter,
	.price-tools .price-print {
		min-height: 44px;
	}
	.filterbar__reset,
	.filterbar--sticky input[type="search"],
	.filterbar--sticky select {
		min-height: 44px;
	}
	.hdr__phone .phone,
	.ftr__link,
	.ftr__route {
		min-height: 44px;
	}
	.ftr__link,
	.ftr__route {
		display: inline-flex;
		align-items: center;
	}
}

/* Базовый минимум для крошек даже на десктопе: 21 px не проходил WCAG 2.5.8 */
.crumbs a,
.crumbs span {
	min-height: 24px;
	display: inline-flex;
	align-items: center;
}

/* ---------- Планшет/телефон: формы и фильтры не зажаты ---------- */
@media (max-width: 900px) {
	.form-grid {
		grid-template-columns: minmax(0, 1fr);
	}
	.price-tools {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: stretch;
		gap: 10px;
	}
	.price-tools .price-search {
		grid-column: 1 / -1;
	}
	.price-tools .btn,
	.price-tools .price-filter {
		width: 100%;
	}
}

/* ---------- Телефон: боковые отступы фильтров и прайса ---------- */
@media (max-width: 600px) {
	.chips {
		scroll-padding-inline: var(--gutter);
	}
	.chips::after {
		content: "";
		flex: 0 0 2px;
	}
	.price-tools {
		grid-template-columns: minmax(0, 1fr);
	}
	.price-tools .price-search {
		grid-column: auto;
		min-width: 0;
	}
	.chip {
		font-size: .75rem;
	}
}

/* ---------- Короткий ландшафт: заставка, cookie и панели помещаются ---------- */
@media (orientation: landscape) and (max-height: 560px) {
	#sp7-intro {
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	.intro__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, .58fr);
		gap: clamp(14px, 2.2vw, 24px);
		min-height: 100dvh;
		padding-block: 18px;
		align-content: center;
	}
	.intro__stage {
		width: min(27vw, 150px);
		margin: 0;
	}
	.intro__brand {
		font-size: clamp(2.4rem, 7.2vw, 3.6rem);
	}
	.intro__sub {
		margin-top: 10px;
		font-size: .62rem;
		letter-spacing: .08em;
	}
	.intro__rule {
		margin: 12px 0 8px;
	}
	.intro__place {
		font-size: .72rem;
	}
	.intro__hint {
		margin-top: 12px;
		font-size: .55rem;
	}
	.intro__foot {
		display: none;
	}
	.cookie {
		left: 10px;
		right: 10px;
		width: auto;
		bottom: 10px;
		max-height: calc(100dvh - 20px);
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	.cookie__in {
		padding: 12px 14px;
	}
	.cookie__actions {
		position: sticky;
		bottom: -1px;
		z-index: 2;
		background: var(--paper);
		padding: 8px 0 2px;
	}
	.cookie p {
		font-size: .78rem;
		line-height: 1.4;
	}
	.a11y__panel,
	.a11y--open .a11y__panel {
		max-height: calc(100dvh - 24px);
		overflow-y: auto;
		overscroll-behavior: contain;
		bottom: 12px;
		top: auto;
	}
	.search__box {
		max-height: calc(100dvh - 20px);
		overflow-y: auto;
		padding: 18px;
	}
	.search__form input {
		min-height: 48px;
	}
	.mmenu {
		overflow-y: auto;
		overscroll-behavior: contain;
		max-height: 100dvh;
	}
	.mbar {
		padding-bottom: calc(6px + env(safe-area-inset-bottom));
	}
	.mbar .btn,
	.mbar__call {
		min-height: 44px;
	}
	body {
		padding-bottom: calc(62px + env(safe-area-inset-bottom));
	}
}

/* ---------- Очень узкий телефон: заголовки и кнопки без переносов-ломаний ---------- */
@media (max-width: 360px) {
	.page-hero h1,
	.sec-title {
		overflow-wrap: anywhere;
	}
	.btn {
		padding-inline: 1em;
	}
	.topbar__group--end {
		gap: 8px;
	}
	.hdr__actions {
		gap: 8px;
	}
}

/* ---------- Крупный текст (режимы доступности 150–200%) ---------- */
html.font-150 .price-tools,
html.font-175 .price-tools,
html.font-200 .price-tools,
html.font-150 .filterbar,
html.font-175 .filterbar,
html.font-200 .filterbar {
	flex-wrap: wrap;
}
html.font-175 .chips,
html.font-200 .chips {
	flex-wrap: wrap;
	overflow-x: visible;
}
html.font-175 .hdr__in,
html.font-200 .hdr__in {
	flex-wrap: wrap;
	row-gap: 8px;
}
html.font-175 .hdr__actions,
html.font-200 .hdr__actions {
	margin-left: 0;
}
html.font-175 .doc-grid,
html.font-200 .doc-grid,
html.font-175 .srv-grid,
html.font-200 .srv-grid,
html.font-175 .news-grid,
html.font-200 .news-grid {
	grid-template-columns: minmax(0, 1fr);
}
html.font-175 .form-grid,
html.font-200 .form-grid {
	grid-template-columns: minmax(0, 1fr);
}
html.font-175 .crumbs,
html.font-200 .crumbs {
	flex-wrap: wrap;
	row-gap: 4px;
}

/* ---------- Высокий контраст и системные режимы ---------- */
@media (prefers-contrast: more) {
	:root {
		--line: #8c8f94;
		--line-2: #6b7a73;
	}
	.btn,
	.chip,
	.doc-card,
	.srv-card,
	.news-card,
	.price-group,
	.filterbar,
	.cookie {
		border-width: 2px;
	}
	:focus-visible {
		outline-width: 4px;
	}
}

@media (forced-colors: active) {
	.btn,
	.chip,
	.doc-card,
	.srv-card,
	.news-card,
	.price-group,
	.filterbar,
	.cookie,
	.doc-card__badge,
	.search__box {
		border: 1px solid ButtonText;
		forced-color-adjust: auto;
	}
	.btn--primary {
		border: 2px solid ButtonText;
	}
	:focus-visible {
		outline: 3px solid Highlight;
		outline-offset: 3px;
	}
}

/* ---------- Печать: карточки и документы не рвутся ---------- */
@media print {
	.mbar,
	.cookie,
	.a11y,
	.to-top,
	.read-progress,
	.mmenu,
	.crumbs,
	.page-hero__actions,
	.filterbar,
	.chips,
	.price-tools {
		display: none !important;
	}
	.doc-card,
	.srv-card,
	.news-card,
	.review-card,
	.price-group,
	.cert-card {
		break-inside: avoid;
		page-break-inside: avoid;
	}
	body {
		padding-bottom: 0 !important;
	}
}


/* ---------- Контрастный режим: подписи и элементы управления остаются читаемыми ---------- */
html.contrast .page-hero__lead,
html.contrast .page-hero__meta,
html.contrast .price-tools,
html.contrast .chips,
html.contrast .filterbar,
html.contrast .cookie p,
html.contrast .form-hint,
html.contrast .field__label,
html.contrast .form-note,
html.contrast .sec-lead,
html.contrast .muted {
	color: #e8e8e8 !important;
}
html.contrast .chip,
html.contrast .search__chips a,
html.contrast .price-tools .btn,
html.contrast .filterbar__reset {
	background: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
}
html.contrast .chip.is-active,
html.contrast .chip[aria-current="true"],
html.contrast .chip[aria-pressed="true"] {
	background: #ffd400 !important;
	color: #000 !important;
	border-color: #ffd400 !important;
}
html.contrast .search__box input,
html.contrast .search__box .search__form input,
html.contrast .filterbar input,
html.contrast .filterbar select,
html.contrast .price-search,
html.contrast .price-filter {
	background: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
}
html.contrast .topbar__phone .phone,
html.contrast .hdr__phone {
	color: #ffd400 !important;
}


/* ---------- Телефон: поиск не сжимает поле ввода ---------- */
@media (max-width: 600px) {
	.search__box .search__form {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 44px;
		gap: 8px;
		align-items: center;
	}
	.search__box .search__form input {
		grid-column: 1 / -1;
		width: 100%;
		min-height: 52px;
		font-size: 1rem;
	}
	.search__box .search__form .btn {
		grid-column: 1;
		width: 100%;
		min-height: 48px;
	}
	.search__box .search__form .search__close {
		grid-column: 2;
		width: 44px;
		height: 44px;
		min-height: 44px;
	}
}

/* ---------- Короткий ландшафт: меню компактнее ---------- */
@media (orientation: landscape) and (max-height: 560px) {
	.mmenu {
		padding-block: 14px 18px;
	}
	.mmenu__top {
		padding-bottom: 10px;
	}
	.mmenu__search {
		min-height: 44px;
		margin-top: 10px;
	}
	.mmenu__list > li > a {
		padding-block: 9px;
		font-size: clamp(1.1rem, 2.4vw, 1.35rem);
	}
	.mmenu__quick {
		padding-bottom: 10px;
	}
	.mmenu__quick a {
		padding-block: 8px;
	}
}


/* ---------- Крупные тап-таргеты на всех ширинах ---------- */
.crumbs a,
.crumbs span {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}
.topbar__item,
.topbar__link,
.topbar__emergency,
.topbar__a11y,
.topbar__lang a,
.topbar__lang span {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}
@media (min-width: 761px) {
	.hdr__phone {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}
}
.price-tools .btn,
.price-tools .price-search,
.price-tools .price-filter,
.price-tools .price-print {
	min-height: 44px;
}
.chip,
.search__chips a {
	min-height: 44px;
}
.ftr__cta-actions .ftr__link,
.ftr__route {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}
.hero__links a,
.hero__note a {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}
.skip {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.ftr__col a,
.ftr__meta-links a,
.ftr__contact-row a {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}
.price-note .link-arrow {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}


/* ---------- Явный индикатор фокуса для утилити-строки и логотипа ---------- */
.skip:focus,
.topbar a:focus,
.topbar button:focus,
.hdr a:focus,
.hdr button:focus,
.logo:focus,
.mbar a:focus,
.mbar button:focus {
	outline: 3px solid var(--copper);
	outline-offset: 3px;
}
html.contrast .skip:focus,
html.contrast .topbar a:focus,
html.contrast .topbar button:focus,
html.contrast .hdr a:focus,
html.contrast .hdr button:focus,
html.contrast .logo:focus,
html.contrast .mbar a:focus,
html.contrast .mbar button:focus {
	outline-color: #ffd400;
}
.topbar__lang a {
	min-width: 44px;
	justify-content: center;
}
