/* Страница /certificates/ — короткий текст под H1 + ряд превью файлов.
 * Превью — копия .lf-pd-tabs__cert-* (детальная страница товара) под отдельным префиксом,
 * чтобы страница не зависела от изменений в шаблоне детальной карточки. */

.lf-cert-page {
	width: 100%;
	padding: 0 0 clamp(32px, 6vw, 72px);
	font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: #0a0a0a;
}

/* Текст под заголовком страницы — Rubik 400 18px */
.lf-cert-page__text {
	margin: 0 0 clamp(14px, 1.6vw, 22px);
	font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-weight: 400;
	font-size: 18px;
	line-height: 1.5;
	color: #0a0a0a;
}

.lf-cert-page__text p {
	margin: 0 0 1em;
}

.lf-cert-page__text p:last-child {
	margin-bottom: 0;
}

/* ───── Сетка превью — копия .lf-pd-tabs__cert-grid (горизонтальный скролл) ───── */

.lf-cert-page__grid {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: clamp(8px, 1.2vw, 14px);
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.lf-cert-page__grid::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

/* Обёртка со скроллом и полосой прокрутки снизу.
 * Стиль полосы — копия .lf-cat-root__mega-bar из каталога (4px высота, скруглённая).
 * Полоса появляется только когда сетка переполнена (JS снимает атрибут hidden).
 * Правило одно — никаких дублей в media queries. */
.lf-cert-page__scroll {
	position: relative;
	width: 100%;
}

.lf-cert-page__bar {
	position: relative;
	width: 100%;
	height: 4px;
	margin-top: 12px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.06);
	box-sizing: border-box;
	touch-action: none;
	cursor: pointer;
}

.lf-cert-page__bar[hidden] {
	display: none !important;
}

.lf-cert-page__bar-thumb {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	min-width: 20px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.38);
	box-sizing: border-box;
	cursor: grab;
	touch-action: none;
	transition: background 0.15s ease;
}

.lf-cert-page__bar-thumb:hover {
	background: rgba(0, 0, 0, 0.52);
}

.lf-cert-page__bar-thumb.is-dragging {
	cursor: grabbing;
	background: rgba(0, 0, 0, 0.52);
}

.lf-cert-page__item {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
}

.lf-cert-page__btn,
.lf-cert-page__btn:focus,
.lf-cert-page__btn:focus-visible,
.lf-cert-page__btn:hover {
	display: block;
	width: 280px;
	max-width: min(280px, 36vw);
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	text-align: left;
	text-decoration: none;
	color: inherit;
	box-shadow: none;
	outline: none;
}

.lf-cert-page__preview {
	position: relative;
	display: block;
	width: 280px;
	max-width: min(280px, 36vw);
	aspect-ratio: 210 / 297;
	overflow: hidden;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
	background: #fff;
	box-shadow: none;
	outline: none;
	box-sizing: border-box;
}

.lf-cert-page__preview--pdf {
	background: #fff;
}

.lf-cert-page__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	box-sizing: border-box;
	border: 0;
	outline: 0;
	background: transparent;
}

/* Canvas-превью PDF через PDF.js — те же правила, что для .lf-pd-tabs__cert-canvas */
.lf-cert-page__canvas {
	display: block;
	width: 100%;
	height: 100%;
	background: #fff;
}

.lf-cert-page__fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font: 600 20px/1 "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: rgba(0, 0, 0, 0.55);
	background: #fff;
}

/* ───── Адаптив — те же брейкпоинты, что на детальной странице товара ───── */

@media (max-width: 950.98px) {
	.lf-cert-page__text {
		font-size: 17px;
	}

	.lf-cert-page__btn,
	.lf-cert-page__btn:focus,
	.lf-cert-page__btn:focus-visible,
	.lf-cert-page__btn:hover,
	.lf-cert-page__preview {
		width: 240px;
		max-width: min(240px, 46vw);
	}

	.lf-cert-page__fallback {
		font-size: 22px;
	}
}

@media (max-width: 575px) {
	.lf-cert-page__text {
		font-size: 16px;
	}

	.lf-cert-page__btn,
	.lf-cert-page__btn:focus,
	.lf-cert-page__btn:focus-visible,
	.lf-cert-page__btn:hover,
	.lf-cert-page__preview {
		width: 200px;
		max-width: min(200px, 52vw);
	}

	.lf-cert-page__fallback {
		font-size: 20px;
	}
}

@media (max-width: 425.98px) {
	.lf-cert-page__text {
		font-size: 15px;
	}

	.lf-cert-page__btn,
	.lf-cert-page__btn:focus,
	.lf-cert-page__btn:focus-visible,
	.lf-cert-page__btn:hover,
	.lf-cert-page__preview {
		width: 170px;
		max-width: min(170px, 58vw);
	}

	.lf-cert-page__fallback {
		font-size: 18px;
	}
}
