/* ============================================================================
   YPonton — Прайс-лист (/price/) — брендовый рескин
   Скоуп: body.yp-price-page. Только CSS/JS, post_content не трогаем.
   Токены совпадают с product-card.css (Montserrat/Manrope, оранжевый #f78e1f).
   Фаза 1: типографика, шапка, секции, таблицы. (TOC/поиск/PDF — отдельные фазы.)
   ========================================================================== */

.yp-price-page {
	--yp-navy:        #0d1b33;
	--yp-orange:      #f78e1f;
	--yp-orange-2:    #e07e12;
	--yp-orange-dark: #c9761a;
	--yp-tint:        #fdeede;
	--yp-tint-2:      #fff5ea;
	--yp-text:        #3f4a5c;
	--yp-muted:       #6b7688;
	--yp-faint:       #8a93a2;
	--yp-border:      #e6eaf0;
	--yp-border-2:    #eef1f5;
	--yp-bg-soft:     #fbfcfe;
	--yp-bg-soft-2:   #f6f8fb;
	--yp-shadow:      0 16px 40px rgba(13,27,51,.08);
	--yp-font-head:   'Montserrat','Onest',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
	--yp-font-body:   'Manrope','Onest',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

/* --- контейнер / общий фон --------------------------------------------- */
.yp-price-page .article-post .entry-content {
	max-width: 1200px;
	margin-inline: auto;
	font-family: var(--yp-font-body);
	color: var(--yp-text);
	font-size: 15px;
	line-height: 1.6;
}

/* --- шапка страницы ----------------------------------------------------- */
.yp-price-page .entry-content > h1,
.yp-price-page .article-post h1 {
	font-family: var(--yp-font-head);
	font-weight: 800;
	font-size: 40px;
	line-height: 1.1;
	color: var(--yp-navy);
	letter-spacing: -.01em;
	margin: 8px 0 14px;
}

/* вводный абзац «Цены актуальны…» → инфо-карточка (класс ставит JS; fallback до JS — первый прямой <p>) */
.yp-price-page .yp-price-lead,
.yp-price-page .entry-content > p.wp-block-paragraph:first-of-type,
.yp-price-page .entry-content > p:first-of-type {
	background: var(--yp-bg-soft-2);
	border: 1px solid var(--yp-border);
	padding: 16px 20px;
	color: var(--yp-muted);
	font-size: 14.5px;
	margin: 0 0 28px;
}
.yp-price-page .entry-content p a {
	color: var(--yp-orange-dark);
	font-weight: 600;
	text-decoration: none;
}
.yp-price-page .entry-content p a:hover { color: var(--yp-orange); text-decoration: underline; }

/* --- заголовки категорий (H2) ------------------------------------------ */
.yp-price-page .entry-content h2 {
	font-family: var(--yp-font-head);
	font-weight: 800;
	font-size: 25px;
	line-height: 1.2;
	color: var(--yp-navy);
	margin: 46px 0 18px;
	padding: 0 0 12px 16px;
	position: relative;
	border-bottom: 2px solid var(--yp-border);
}
.yp-price-page .entry-content h2::before {
	content: "";
	position: absolute;
	left: 0; top: 4px; bottom: 16px;
	width: 5px;
	border-radius: 3px;
	background: var(--yp-orange);
}

/* --- подкатегории (H3) -------------------------------------------------- */
.yp-price-page .entry-content h3 {
	font-family: var(--yp-font-head);
	font-weight: 700;
	font-size: 17px;
	color: var(--yp-navy);
	margin: 28px 0 10px;
	padding-left: 16px;
	position: relative;
}
.yp-price-page .entry-content h3::before {
	content: "";
	position: absolute;
	left: 0; top: 7px;
	width: 7px; height: 7px;
	border-radius: 50%;
	background: var(--yp-orange);
}

/* --- таблицы прайса ----------------------------------------------------- */
.yp-price-page .entry-content table {
	width: 100% !important;
	border-collapse: separate;
	border-spacing: 0;
	margin: 0 0 22px;
	background: #fff;
	border: 1px solid var(--yp-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: var(--yp-shadow);
	font-size: 14.5px;
}
.yp-price-page .entry-content table td {
	padding: 14px 20px;
	border: 0;
	border-bottom: 1px solid var(--yp-border-2);
	vertical-align: top;
	text-align: left;
	color: var(--yp-text);
}
/* зебра + hover */
.yp-price-page .entry-content table tr:nth-child(even) td { background: var(--yp-bg-soft); }
.yp-price-page .entry-content table tr:hover td { background: var(--yp-tint-2); }
.yp-price-page .entry-content table tr:last-child td { border-bottom: 0; }

/* первая ячейка — наименование + описание + список вариантов */
.yp-price-page .entry-content table td:first-child { width: auto; }
.yp-price-page .entry-content table td:first-child > strong,
.yp-price-page .entry-content table td:first-child strong:first-child {
	color: var(--yp-navy);
	font-weight: 700;
	font-size: 15px;
}
/* ссылки-варианты (идут через <br>• <a>) */
.yp-price-page .entry-content table td a {
	color: var(--yp-navy);
	font-weight: 500;
	text-decoration: underline;
	text-decoration-color: rgba(13,27,51,.35);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color .15s, text-decoration-color .15s;
}
.yp-price-page .entry-content table td a:hover {
	color: var(--yp-orange);
	text-decoration-color: var(--yp-orange);
}

/* ячейка цены — последняя колонка */
.yp-price-page .entry-content table td:last-child {
	font-family: var(--yp-font-head);
	font-weight: 800;
	font-size: 15.5px;
	color: var(--yp-navy);
	text-align: right;
	white-space: nowrap;
	width: 1%;
	vertical-align: middle;
}

/* --- баннеры «Акция!/Внимание!» = blockquote с оранжевым градиентом ------ */
.yp-price-page .entry-content blockquote.wp-block-quote {
	border: 0 !important;
	border-radius: 14px;
	padding: 18px 22px !important;
	margin: 22px 0 26px;
	font-family: var(--yp-font-body);
	font-weight: 600;
	box-shadow: 0 14px 34px rgba(247,142,31,.22);
	/* инлайновый градиент из редактора не трогаем */
}
.yp-price-page .entry-content blockquote.wp-block-quote p { margin: 0; color: #fff; }
.yp-price-page .entry-content blockquote.wp-block-quote strong { color: #fff; }
/* «Акция!/Внимание!» — редакторский красный mark плохо читается на оранжевом → белый */
.yp-price-page .entry-content blockquote.wp-block-quote mark,
.yp-price-page .entry-content blockquote.wp-block-quote .has-vivid-red-color {
	color: #fff !important;
	background: transparent !important;
	font-weight: 800;
}
.yp-price-page .entry-content blockquote.wp-block-quote a {
	color: #fff !important;
	text-decoration: underline;
	font-weight: 700;
}

/* --- кнопки действий (Печать / PDF) — плагин ppb + свои ------------------ */
.yp-price-page .ppbPrintPage { margin: 0; }
.yp-price-page .wp-block-ppb-print-page button,
.yp-price-page .ppbPrintPage button {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	font-family: var(--yp-font-head) !important;
	font-weight: 700 !important;
	font-size: 14px !important;
	color: var(--yp-navy) !important;
	background: #fff !important;
	border: 1.5px solid var(--yp-border) !important;
	border-radius: 10px !important;
	padding: 11px 20px !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: border-color .15s, color .15s, background .15s;
	text-decoration: none !important;
	width: auto !important;
}
.yp-price-page .wp-block-ppb-print-page button:hover,
.yp-price-page .ppbPrintPage button:hover {
	border-color: var(--yp-orange) !important;
	color: var(--yp-orange) !important;
	background: var(--yp-tint) !important;
	box-shadow: none !important;
}

/* --- форма связи внизу -------------------------------------------------- */
.yp-price-page .entry-content h2 + form,
.yp-price-page .entry-content form input[type="text"],
.yp-price-page .entry-content form input[type="email"],
.yp-price-page .entry-content form input[type="tel"],
.yp-price-page .entry-content form textarea {
	font-family: var(--yp-font-body);
}

/* ============================ АДАПТИВ =================================== */
@media (max-width: 768px) {
	.yp-price-page .entry-content { font-size: 14px; }
	.yp-price-page .article-post h1,
	.yp-price-page .entry-content > h1 { font-size: 30px; }
	.yp-price-page .entry-content h2 { font-size: 21px; margin-top: 34px; }
	.yp-price-page .entry-content h3 { font-size: 16px; }
	/* строка прайса в 2 «этажа»: наименование сверху, цена снизу-справа */
	.yp-price-page .entry-content table,
	.yp-price-page .entry-content table tbody,
	.yp-price-page .entry-content table tr,
	.yp-price-page .entry-content table td { display: block; width: 100% !important; }
	.yp-price-page .entry-content table td:first-child { padding-bottom: 6px; }
	.yp-price-page .entry-content table td:last-child {
		text-align: left;
		border-top: 1px dashed var(--yp-border);
		padding-top: 8px;
		font-size: 16px;
		color: var(--yp-orange-dark);
	}
	.yp-price-page .entry-content table tr { border-bottom: 1px solid var(--yp-border-2); }
	.yp-price-page .entry-content table tr:last-child { border-bottom: 0; }
}

/* ============================================================================
   ФАЗА 2 — липкое оглавление (TOC) + scrollspy. Грид [TOC | контент] строит JS.
   ========================================================================== */
.yp-price-page .yp-price-layout {
	display: grid;
	grid-template-columns: 258px minmax(0, 1fr);
	gap: 36px;
	align-items: start;
}
.yp-price-page .yp-price-body { min-width: 0; }

/* якорный отступ (шапка не липкая → небольшой) */
.yp-price-page .entry-content h2,
.yp-price-page .entry-content h3 { scroll-margin-top: 20px; }

/* липкий сайдбар. ВАЖНО: тема ставит overflow:hidden на .site (анти-горизонт-скролл),
   что ломает position:sticky у потомков. На странице прайса горизонтального переполнения нет →
   безопасно вернуть overflow:visible только тут. */
.yp-price-page.wp-singular .site,
body.yp-price-page .site { overflow: visible; }

.yp-price-page .yp-price-toc {
	position: sticky;
	top: 20px;
	align-self: start;
}
.yp-price-page .yp-price-toc__toggle { display: none; }
.yp-price-page .yp-price-toc__nav {
	background: #fff;
	border: 1px solid var(--yp-border);
	border-radius: 14px;
	box-shadow: var(--yp-shadow);
	padding: 10px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
}
.yp-price-page .yp-price-toc__head {
	font-family: var(--yp-font-head);
	font-weight: 800;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--yp-faint);
	padding: 8px 12px 12px;
}
.yp-price-page .yp-price-toc__list { list-style: none; margin: 0; padding: 0; }
.yp-price-page .yp-price-toc__item a {
	display: block;
	padding: 7px 12px;
	color: var(--yp-text);
	text-decoration: none;
	font-size: 13.5px;
	line-height: 1.3;
	transition: background .12s, color .12s, border-color .12s;
}
.yp-price-page .yp-price-toc__item a:hover { background: var(--yp-bg-soft-2); color: var(--yp-navy); }
.yp-price-page .yp-price-toc__item--h2 a {
	font-family: var(--yp-font-head);
	font-weight: 700;
	font-size: 14px;
	color: var(--yp-navy);
	margin-top: 4px;
}
.yp-price-page .yp-price-toc__item--h3 a { padding-left: 22px; color: var(--yp-muted); }
.yp-price-page .yp-price-toc__item.is-active > a {
	background: var(--yp-tint);
	color: #f78e1f;
	font-weight: 700;
	border-left: 4px solid;
}

/* мобильный: TOC → липкая сворачивающаяся панель сверху */
@media (max-width: 980px) {
	.yp-price-page .yp-price-layout { grid-template-columns: 1fr; gap: 0; }
	.yp-price-page .yp-price-toc {
		position: sticky;
		top: 0;
		z-index: 30;
		margin: 0 0 18px;
		background: #fff;
		padding: 8px 0;
	}
	.yp-price-page .yp-price-toc__toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		width: 100%;
		font-family: var(--yp-font-head);
		font-weight: 700;
		font-size: 15px;
		color: var(--yp-navy);
		background: #fff;
		border: 1.5px solid var(--yp-border);
		border-radius: 12px;
		padding: 13px 16px;
		cursor: pointer;
	}
	.yp-price-page .yp-price-toc__toggle svg { width: 20px; height: 20px; transition: transform .2s; }
	.yp-price-page .yp-price-toc.is-open .yp-price-toc__toggle svg { transform: rotate(180deg); }
	.yp-price-page .yp-price-toc__toggle:hover { border-color: var(--yp-orange); color: var(--yp-orange); }
	.yp-price-page .yp-price-toc__nav {
		display: none;
		margin-top: 8px;
		max-height: 60vh;
	}
	.yp-price-page .yp-price-toc.is-open .yp-price-toc__nav { display: block; }
	.yp-price-page .yp-price-toc__head { display: none; }
}

/* ============================================================================
   ФАЗА 3 — поиск/фильтр по прайсу
   ========================================================================== */
.yp-price-page .yp-hidden { display: none !important; }

.yp-price-page .yp-price-search {
	position: sticky;
	top: 20px;
	z-index: 15;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 52px;
	margin: 0 0 22px;
	padding: 0 14px;
	background: #fff;
	border: 1.5px solid var(--yp-border);
	border-radius: 12px;
	box-shadow: var(--yp-shadow);
}
.yp-price-page .yp-price-search:focus-within { border-color: var(--yp-orange); }
.yp-price-page .yp-price-search__ico { width: 20px; height: 20px; color: var(--yp-faint); flex: 0 0 auto; }
.yp-price-page .yp-price-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	border: 0;
	outline: 0;
	background: transparent;
	font-family: var(--yp-font-body);
	font-size: 15px;
	color: var(--yp-navy);
}
.yp-price-page .yp-price-search__input::placeholder { color: var(--yp-faint); }
.yp-price-page .yp-price-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.yp-price-page .yp-price-search__clear {
	flex: 0 0 auto;
	width: 26px; height: 26px;
	border: 0;
	border-radius: 50%;
	background: var(--yp-bg-soft-2);
	color: var(--yp-muted);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.yp-price-page .yp-price-search__clear:hover { background: var(--yp-tint); color: var(--yp-orange-dark); }

.yp-price-page .yp-price-noresults {
	padding: 28px;
	text-align: center;
	color: var(--yp-muted);
	background: var(--yp-bg-soft-2);
	border: 1px dashed var(--yp-border-2);
	border-radius: 14px;
	font-size: 15px;
}
.yp-price-page .yp-price-toc__item.is-empty { opacity: .3; pointer-events: none; }

@media (max-width: 980px) {
	.yp-price-page .yp-price-search { position: static; }
}

/* Планшет 768–1199: тема капает контент в bootstrap-контейнер 720/960px (→ на 980px контент всего 630px,
   огромные поля). Как на карточке товара — расширяем контент на всю ширину с боковыми паддингами. */
@media (min-width: 768px) and (max-width: 1199px) {
	.yp-price-page #content.site-content.fixed {
		max-width: none;
		margin-left: auto;
		margin-right: auto;
		padding-left: 24px;
		padding-right: 24px;
	}
}

/* ============================================================================
   ФАЗА 5 — PDF/печать: кнопка «Скачать PDF» + брендовый печатный документ
   ========================================================================== */
/* прячем штатную кнопку плагина «Печать страницы» — заменяем своей */
.yp-price-page .wp-block-ppb-print-page,
.yp-price-page .ppbPrintPage { display: none; }
/* печатный заголовок виден только в print */
.yp-price-page .yp-price-printhead { display: none; }

.yp-price-page .yp-price-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin: -4px 0 22px;
}
.yp-price-page .yp-price-actions__pdf {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-family: var(--yp-font-head);
	font-weight: 700;
	font-size: 14.5px;
	color: #fff !important;
	background: var(--yp-orange) !important;
	border: 0 !important;
	border-radius: 11px;
	padding: 12px 22px;
	cursor: pointer;
	transition: background .15s;
}
.yp-price-page .yp-price-actions__pdf svg { width: 19px; height: 19px; }
.yp-price-page .yp-price-actions__pdf:hover { background: var(--yp-orange-2) !important; }
/* вторичная кнопка «Печать страницы» — слева от «Скачать PDF» */
.yp-price-page .yp-price-actions__print {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-family: var(--yp-font-head);
	font-weight: 700;
	font-size: 14.5px;
	color: var(--yp-navy) !important;
	background: #fff !important;
	border: 1.5px solid var(--yp-border) !important;
	border-radius: 11px;
	padding: 12px 22px;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}
.yp-price-page .yp-price-actions__print svg { width: 19px; height: 19px; }
.yp-price-page .yp-price-actions__print:hover { border-color: #f78e1f !important; color: #f78e1f !important; }
/* подсказка уходит влево, кнопки прижимаются вправо (PDF — крайняя правая) */
.yp-price-page .yp-price-actions__hint { font-size: 13px; color: var(--yp-faint); margin-right: auto; }
/* иконка поиска — только контур (тема принудительно заливает svg-фигуры) */
.yp-price-page .yp-price-search__ico circle,
.yp-price-page .yp-price-search__ico ellipse { fill: none !important; }
@media (max-width: 560px) {
	.yp-price-page .yp-price-actions { flex-direction: column; align-items: stretch; }
	.yp-price-page .yp-price-actions__pdf,
	.yp-price-page .yp-price-actions__print { width: 100%; justify-content: center; }
	.yp-price-page .yp-price-actions__hint { display: none; }
}

@media print {
	@page { margin: 14mm 12mm; }

	/* скрыть всю обвязку сайта и интерактив */
	.yp-price-page .site > header.yp-header,
	.yp-price-page .site > .block-after-site,
	.yp-price-page .site > .site-footer-container,
	.yp-price-page .site > .scrolltop,
	.yp-price-page .skip-link,
	.yp-price-page .clearfy-cookie,
	.yp-price-page [class*="chaty"],
	.yp-price-page .wpp-overlay,
	.yp-price-page .yp-drawer,
	.yp-price-page .yp-quiz-overlay,
	.yp-price-page .article-meta,
	.yp-price-page .yp-price-toc,
	.yp-price-page .yp-price-search,
	.yp-price-page .yp-price-actions,
	.yp-price-page .wp-block-ppb-print-page,
	.yp-price-page .ppbPrintPage,
	.yp-price-page .yp-print-hide,
	.yp-price-page h1.page-title { display: none !important; }

	.yp-price-page .yp-price-layout { display: block !important; }
	.yp-price-page .entry-content { max-width: none !important; margin: 0 !important; font-size: 11px; color: #000; }

	/* печатный заголовок-документ */
	.yp-price-page .yp-price-printhead {
		display: block !important;
		border-bottom: 2.5px solid #f78e1f;
		padding-bottom: 10px;
		margin-bottom: 16px;
	}
	.yp-price-page .yp-price-printhead__brand { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 20px; color: #0d1b33; letter-spacing: .02em; }
	.yp-price-page .yp-price-printhead__title { font-size: 13px; color: #0d1b33; margin-top: 2px; }
	.yp-price-page .yp-price-printhead__meta { font-size: 11px; color: #444; margin-top: 6px; }

	/* вводный абзац — читабельно без фона */
	.yp-price-page .yp-price-lead {
		background: none !important;
		color: #000 !important;
		border: 1px solid #ccc !important;
		border-left: 3px solid #f78e1f !important;
		font-size: 10.5px;
		padding: 10px 12px !important;
	}
	.yp-price-page .yp-price-lead a { color: #000 !important; }

	/* заголовки категорий */
	.yp-price-page .entry-content h2 { font-size: 15px; color: #0d1b33; break-after: avoid; margin: 16px 0 8px; padding-left: 10px; border-bottom: 1px solid #ccc; }
	.yp-price-page .entry-content h2::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.yp-price-page .entry-content h3 { font-size: 12.5px; color: #0d1b33; break-after: avoid; margin: 12px 0 6px; }

	/* таблицы */
	.yp-price-page .entry-content figure.wp-block-table,
	.yp-price-page .entry-content table { break-inside: auto; }
	.yp-price-page .entry-content table { box-shadow: none !important; border: 1px solid #bbb; font-size: 10px; }
	.yp-price-page .entry-content table tr { break-inside: avoid; }
	.yp-price-page .entry-content table td { padding: 5px 9px; border-bottom: 1px solid #ddd; color: #000; }
	.yp-price-page .entry-content table td:last-child { color: #0d1b33; font-weight: 800; }
	.yp-price-page .entry-content table td a { color: #000 !important; text-decoration: none; }

	/* баннеры «Акция!/Внимание!» — фон не печатается → тёмный текст + оранж. рамка */
	.yp-price-page .entry-content blockquote.wp-block-quote {
		background: none !important;
		box-shadow: none !important;
		border: 1.5px solid #f78e1f !important;
		border-radius: 8px;
		break-inside: avoid;
	}
	.yp-price-page .entry-content blockquote.wp-block-quote,
	.yp-price-page .entry-content blockquote.wp-block-quote p,
	.yp-price-page .entry-content blockquote.wp-block-quote strong,
	.yp-price-page .entry-content blockquote.wp-block-quote mark,
	.yp-price-page .entry-content blockquote.wp-block-quote .has-vivid-red-color { color: #000 !important; }
}
