/* Портал ССГ. Токены и метрики — из дизайн-хендоффа, воспроизводятся точно. */

:root {
	--pri: #1b5cc8;
	--pri-hover: #164a9f;
	--dark: #0f2545;
	--dark-text: #b9c9e2;
	--bg: #f6f8fa;
	--line: #e3e8ee;
	--line-soft: #eef1f5;
	--accent: #f0f4f9;
	--ink: #171b21;
	--ink-2: #39434f;
	--muted: #5b6572;
	--grey: #8a93a1;
	--ok: #0e8a6c;
	--warn: #d9a01f;
	--err: #c23a3a;
	--r-btn: 6px;
	--r-card: 8px;
	--r-panel: 10px;
	--shadow: 0 4px 14px rgba(15, 37, 69, 0.08);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	font-family: 'IBM Plex Sans', Helvetica, Arial, sans-serif;
	color: var(--ink);
	-webkit-font-smoothing: antialiased;
}

a { color: var(--pri); text-decoration: none; }
a:hover { color: var(--pri-hover); text-decoration: underline; }

img { max-width: 100%; }

input, textarea, button, select { font-family: inherit; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 40px 0 56px; }

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: #fff;
	padding: 10px 16px;
	z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }

/* Верхняя полоса */
.topbar { background: var(--dark); color: var(--dark-text); font-size: 13px; }
.topbar__in {
	max-width: 1200px;
	margin: 0 auto;
	padding: 6px 24px;
	display: flex;
	gap: 24px;
	align-items: center;
}
.topbar__spacer { flex: 1; }
.topbar__link { color: var(--dark-text); }
.topbar__link:hover { color: #fff; }

/* Шапка */
.header {
	background: #fff;
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 40;
}
.header__in {
	max-width: 1200px;
	margin: 0 auto;
	padding: 14px 24px;
	display: flex;
	align-items: center;
	gap: 28px;
}
.header__actions { display: flex; gap: 10px; align-items: center; }

.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; color: inherit; }
.brand__mark {
	width: 42px;
	height: 42px;
	background: var(--pri);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.5px;
	border-radius: var(--r-btn);
	flex: none;
}
.brand__name { display: block; font-weight: 700; font-size: 16px; line-height: 1.1; }
.brand__sub { display: block; font-size: 12px; color: var(--muted); }

.nav { flex: 1; }
.nav__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__list a {
	display: block;
	padding: 8px 12px;
	font-size: 15px;
	font-weight: 500;
	color: var(--ink-2);
	border-radius: var(--r-btn);
}
.nav__list a:hover { background: var(--accent); color: var(--pri); text-decoration: none; }

/* Кнопки */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border-radius: var(--r-btn);
	font-size: 14px;
	font-weight: 600;
	padding: 10px 16px;
	cursor: pointer;
	border: 1px solid transparent;
	line-height: 1.2;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--pri); color: #fff; }
.btn--primary:hover { background: var(--pri-hover); color: #fff; }

.btn--outline { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn--outline:hover { border-color: var(--pri); color: var(--pri); }

.btn--white { background: #fff; color: var(--pri); }
.btn--white:hover { background: var(--accent); color: var(--pri); }

.btn--block { width: 100%; justify-content: center; }

.btn__badge {
	background: #fff;
	color: var(--pri);
	border-radius: 10px;
	font-size: 12px;
	font-weight: 700;
	padding: 1px 7px;
}

/* Переключатель «В запрос» */
.btn-toggle {
	background: var(--pri);
	color: #fff;
	border: 1px solid var(--pri);
	border-radius: var(--r-btn);
	font-size: 13px;
	font-weight: 600;
	padding: 7px 12px;
	cursor: pointer;
}
.btn-toggle:hover { background: var(--pri-hover); border-color: var(--pri-hover); }

.btn-toggle[aria-pressed='true'] {
	background: var(--accent);
	color: var(--pri);
	border-color: var(--pri);
}

.btn-toggle--lg { font-size: 14px; padding: 10px 16px; }

/* Hero */
.hero { background: #fff; }
.hero__in {
	max-width: 1200px;
	margin: 0 auto;
	padding: 64px 24px;
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 56px;
	align-items: center;
}
.eyebrow {
	font-family: 'IBM Plex Mono', ui-monospace, monospace;
	font-size: 13px;
	color: var(--pri);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin: 0 0 12px;
}
.hero__title { font-size: 42px; font-weight: 700; line-height: 1.15; margin: 0 0 16px; }
.hero__lead { font-size: 17px; color: var(--muted); line-height: 1.5; margin: 0 0 24px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__facts { font-size: 14px; color: var(--grey); margin: 20px 0 0; }

.hero__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.minicard {
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	padding: 12px;
	color: inherit;
	display: block;
}
.minicard:hover { border-color: var(--pri); text-decoration: none; color: inherit; }
.minicard__img { display: block; width: 100%; height: 88px; object-fit: contain; }
.minicard__name { display: block; font-size: 14px; font-weight: 600; margin-top: 8px; }

/* УТП */
.usp { padding: 8px 0 0; }
.usp__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.usp__card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; }
.usp__title { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.usp__text { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.5; }

/* Заголовки секций */
.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}
.section__title { font-size: 26px; font-weight: 700; margin: 0; }
.section__link { font-size: 14px; font-weight: 600; }

.page-title { font-size: 32px; font-weight: 700; margin: 8px 0 12px; }
.page-lead { font-size: 15px; color: var(--muted); margin: 0 0 28px; max-width: 760px; line-height: 1.55; }

/* Крошки */
.crumbs { font-size: 13px; color: var(--grey); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs__sep { color: var(--line); }

/* Категории */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	overflow: hidden;
	color: inherit;
	display: flex;
	flex-direction: column;
}
.cat-card:hover { border-color: var(--pri); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.cat-card__photo {
	display: block;
	height: 96px;
	background: var(--bg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
}
.cat-card__photo img { max-height: 100%; object-fit: contain; }
.cat-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cat-card__name { font-size: 15px; font-weight: 600; }
.cat-card__desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.cat-card__meta { font-size: 12.5px; color: var(--grey); margin-top: auto; padding-top: 6px; }

/* Подгруппы */
.subgroup { margin-bottom: 36px; }
.subgroup__head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.subgroup__title { font-size: 19px; font-weight: 700; margin: 0; }
.subgroup__rule { flex: 1; height: 1px; background: var(--line); }
.subgroup__count { font-size: 12.5px; color: var(--grey); }

/* Товары */
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.prod-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.prod-card:hover { border-color: var(--pri); box-shadow: var(--shadow); }
.prod-card__photo {
	height: 140px;
	background: var(--bg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
}
.prod-card__photo img { max-height: 100%; object-fit: contain; }
.prod-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.prod-card__sku {
	font-family: 'IBM Plex Mono', ui-monospace, monospace;
	font-size: 12px;
	color: var(--pri);
}
.prod-card__name { font-size: 16px; font-weight: 600; margin: 4px 0 6px; line-height: 1.3; }
.prod-card__name a { color: inherit; }
.prod-card__name a:hover { color: var(--pri); text-decoration: none; }
.prod-card__desc { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
.prod-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--line-soft);
}
.price { font-size: 14px; font-weight: 700; }

/* Страница товара */
.product {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-panel);
	padding: 28px;
	display: grid;
	grid-template-columns: 400px 1fr;
	gap: 40px;
	margin-top: 16px;
}
.product__photo {
	position: relative;
	width: 100%;
	min-height: 320px;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	cursor: zoom-in;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.product__photo img { max-height: 320px; object-fit: contain; }
.product__zoom {
	position: absolute;
	left: 12px;
	bottom: 12px;
	background: rgba(15, 37, 69, 0.75);
	color: #fff;
	font-size: 12px;
	padding: 4px 8px;
	border-radius: 4px;
}
.product__sku {
	font-family: 'IBM Plex Mono', ui-monospace, monospace;
	font-size: 12px;
	color: var(--pri);
}
.product__title { font-size: 28px; font-weight: 700; margin: 6px 0 12px; line-height: 1.2; }
.product__desc { font-size: 15.5px; color: var(--ink-2); line-height: 1.55; }

.specs { width: 100%; border-collapse: collapse; margin: 20px 0; }
.specs th,
.specs td {
	text-align: left;
	padding: 9px 0;
	border-bottom: 1px solid var(--line-soft);
	font-size: 14px;
	vertical-align: top;
}
.specs th { width: 220px; color: var(--muted); font-weight: 400; }
.specs td { font-weight: 600; }

.askbox { background: var(--accent); border-radius: var(--r-card); padding: 18px; margin-top: 20px; }
.askbox__price { font-size: 19px; font-weight: 700; }
.askbox__text { font-size: 13.5px; color: var(--muted); margin: 4px 0 14px; }
.askbox__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* CTA */
.cta { background: var(--dark); padding: 40px 0; }
.cta__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta__title { color: #fff; font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.cta__text { color: var(--dark-text); font-size: 14.5px; margin: 0; }

/* Подвал */
.footer { background: #fff; border-top: 1px solid var(--line); margin-top: 40px; }
.footer__in {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 24px;
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
	gap: 32px;
}
.footer__in--flat { display: block; padding: 14px 24px; }
.footer__desc { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin: 12px 0 0; }
.footer__title { font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; }
.footer__list--plain { color: var(--muted); }
.footer__bottom { border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--grey); }

/* Пустые состояния */
.empty {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	padding: 40px;
	color: var(--muted);
	font-size: 14.5px;
}

.prose { background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); padding: 32px; max-width: 860px; }
.prose p, .prose li { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.prose h2 { font-size: 22px; margin: 28px 0 10px; }

/* Корзина запроса */
.drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 37, 69, 0.45);
	z-index: 50;
}
.drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 420px;
	max-width: 100vw;
	background: #fff;
	box-shadow: -8px 0 30px rgba(15, 37, 69, 0.2);
	z-index: 51;
	display: flex;
	flex-direction: column;
}
.drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--line);
}
.drawer__title { font-size: 18px; font-weight: 700; margin: 0; }
.drawer__close {
	background: none;
	border: 0;
	font-size: 24px;
	line-height: 1;
	color: var(--muted);
	cursor: pointer;
	padding: 4px 8px;
	border-radius: var(--r-btn);
}
.drawer__close:hover { background: var(--accent); color: var(--pri); }
.drawer__body { padding: 18px 20px 28px; overflow-y: auto; flex: 1; }

.drawer__items { display: grid; gap: 10px; margin-bottom: 16px; }
.cart-item { display: flex; align-items: center; gap: 10px; }
.cart-item__img {
	width: 46px;
	height: 46px;
	object-fit: contain;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--r-btn);
	flex: none;
	padding: 3px;
}
.cart-item__sku {
	font-family: 'IBM Plex Mono', ui-monospace, monospace;
	font-size: 11px;
	color: var(--pri);
}
.cart-item__name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.cart-item__del {
	margin-left: auto;
	background: none;
	border: 0;
	color: var(--grey);
	font-size: 16px;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 4px;
	flex: none;
}
.cart-item__del:hover { background: var(--accent); color: var(--err); }

.drawer__hint {
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--r-btn);
	padding: 12px;
	font-size: 13px;
	color: var(--muted);
	margin-bottom: 16px;
}

/* Форма */
.form { display: grid; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.field { display: grid; gap: 5px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field__req { color: var(--err); }
.field input,
.field textarea {
	border: 1px solid #dbe1e8;
	border-radius: var(--r-btn);
	padding: 11px 12px;
	font-size: 14px;
	width: 100%;
}
.field input:focus,
.field textarea:focus { outline: 2px solid var(--pri); outline-offset: -1px; border-color: var(--pri); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-trap { position: absolute; left: -9999px; }

.form__error { color: var(--err); font-size: 13px; margin: 0; }
.form__note { font-size: 12px; color: var(--grey); margin: 0; line-height: 1.45; }

.drawer__success { text-align: center; padding: 24px 0; }
.success__icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--ok);
	color: #fff;
	font-size: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 14px;
}
.success__title { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.success__text { font-size: 14px; color: var(--muted); margin: 0 0 18px; line-height: 1.5; }

/* Лайтбокс */
.lightbox {
	position: fixed;
	inset: 0;
	background: rgba(15, 37, 69, 0.88);
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
}
.lightbox img {
	max-width: 90vw;
	max-height: 85vh;
	background: #fff;
	border-radius: var(--r-card);
	padding: 16px;
}
.lightbox__close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 0;
	background: #fff;
	color: var(--dark);
	font-size: 22px;
	cursor: pointer;
}

/* Адаптив */
@media (max-width: 1000px) {
	.hero__in { grid-template-columns: 1fr; gap: 32px; padding: 40px 24px; }
	.hero__title { font-size: 32px; }
	.usp__grid,
	.cat-grid { grid-template-columns: repeat(2, 1fr); }
	.prod-grid { grid-template-columns: repeat(2, 1fr); }
	.product { grid-template-columns: 1fr; gap: 24px; padding: 20px; }
	.footer__in { grid-template-columns: 1fr 1fr; }
	.header__in { flex-wrap: wrap; gap: 14px; }
	.nav { order: 3; width: 100%; }
	.nav__list { flex-wrap: wrap; }
}

@media (max-width: 620px) {
	.usp__grid,
	.cat-grid,
	.prod-grid,
	.footer__in,
	.field-row { grid-template-columns: 1fr; }
	.page-title { font-size: 26px; }
	.hero__title { font-size: 28px; }
	.brand__sub { display: none; }
	.specs th { width: 45%; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}

/* Preserve native hidden state for drawers, lightbox and button labels. */
[hidden] { display: none !important; }
body.admin-bar .drawer { top: 32px; }
@media (max-width: 782px) { body.admin-bar .drawer { top: 46px; } }

/* Keep navigation on its own row at tablet and mobile widths. */
@media (max-width: 1000px) { .nav { flex: 1 0 100%; } }
@media (max-width: 620px) { .header__actions { flex-wrap: wrap; } .topbar__in { flex-wrap: wrap; gap: 8px 16px; } }
