/* Текстовые страницы, статьи и служебные экраны — в токенах темы (main.css :root). */

.page-content { max-width: 860px; padding: 8px 4px 40px; color: var(--ink-2); font-size: 15.5px; line-height: 1.7; }
.page-content > h1 { margin: 0 0 22px; color: var(--ink); font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.page-content h2 { margin: 34px 0 12px; color: var(--ink); font-size: 21px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
.page-content h3 { margin: 26px 0 10px; color: var(--ink); font-size: 17px; font-weight: 600; }
.page-content p { margin: 0 0 14px; }
.page-content ul, .page-content ol { margin: 0 0 16px; padding-left: 22px; }
.page-content li { margin-bottom: 6px; }
.page-content a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--surface-3); }
.page-content a:hover { text-decoration-color: var(--ink); }
.page-content table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14.5px; }
.page-content th, .page-content td { padding: 10px 12px; border-bottom: 1px solid var(--surface-3); text-align: left; vertical-align: top; }
.page-content th { color: var(--ink); font-weight: 600; background: var(--surface-2); }
.page-content img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.page-content .has-text-align-center { text-align: center; }

.page-lead { margin: -8px 0 28px; color: var(--muted); font-size: 16px; max-width: 640px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 0 0 30px; }
.info-card { padding: 22px 22px 20px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--surface-3); }
.info-card__icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; margin-bottom: 14px;
	border-radius: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--surface-3); }
.info-card__icon svg { width: 20px; height: 20px; }
.info-card h3 { margin: 0 0 6px; color: var(--ink); font-size: 16px; font-weight: 600; }
.info-card p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.info-card__big { display: block; margin-top: 8px; color: var(--ink); font-size: 20px; font-weight: 700; text-decoration: none !important; }

.steps { counter-reset: step; list-style: none; padding: 0 !important; margin: 0 0 30px !important; display: grid; gap: 12px; }
.steps > li { counter-increment: step; position: relative; padding: 18px 20px 18px 64px; border-radius: var(--radius-lg); background: var(--surface-2); margin: 0 !important; }
.steps > li::before { content: counter(step); position: absolute; left: 20px; top: 18px; width: 30px; height: 30px; border-radius: 50%;
	background: var(--ink); color: var(--dark-ink); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.steps h3 { margin: 2px 0 6px; }
.steps p { margin: 0; }

.notice-box { padding: 18px 20px; border-radius: var(--radius-lg); background: var(--badge-orange-bg); color: var(--badge-orange-fg); margin: 0 0 24px; }
.notice-box b { color: inherit; }

.post-meta { color: var(--muted); font-size: 13.5px; margin: -12px 0 22px; }
.post-cover { margin: 0 0 24px; }
.post-cover img { width: 100%; height: auto; border-radius: var(--radius-lg); }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.post-tags a { padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; text-decoration: none; }

.cart-page { max-width: 900px; }
.cart-page .cart-full { background: transparent; }
/* Внутри .page-content ссылки подчёркнуты и красятся в ink, а у списка есть отступы — для корзины это лишнее */
.page-content .cart-full__list { margin: 0; padding: 0; }
.page-content .cart-full__item { margin: 0; }
.page-content a.cart-full__info { text-decoration: none; }
.page-content a.cart-full__checkout, .page-content a.cart-full__checkout:hover { color: var(--dark-ink); text-decoration: none; }

/* Страница заказа: состояние, таблица состава, реквизиты, переписка */
.order-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -12px 0 18px; font-size: 13.5px; color: var(--muted); }
.state-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.state-badge--green { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.state-badge--orange { background: var(--badge-orange-bg); color: var(--badge-orange-fg); }
.state-badge--blue { background: var(--badge-blue-bg); color: var(--badge-blue-fg); }
.state-badge--red { background: var(--badge-red-bg); color: var(--badge-red-fg); }
.state-badge--gray { background: var(--badge-gray-bg); color: var(--badge-gray-fg); }
.order-page .info-card p + p { margin-top: 6px; }
.order-page .info-card .cart-full__checkout { margin-top: 12px; }
.order-page .info-card .cart-full__checkout + p, .order-page .info-card form + p { margin-top: 12px; }
.order-page .woocommerce-error, .order-page .woocommerce-message { margin: 0 0 16px; }
.order-note { margin: -6px 0 14px; font-size: 13px; color: var(--muted); }
.order-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 22px 0 0; }

.order-table { margin-bottom: 8px; }
.order-table .num { text-align: right; white-space: nowrap; }
.order-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); }
.order-table tbody td { vertical-align: middle; }
.order-table__sum { font-weight: 600; color: var(--ink); }
.order-table tfoot td { color: var(--ink-2); }
.order-table .order-table__total td { border-bottom: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.order-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.order-item .cart-full__thumb { flex: none; width: 34px; }
.order-item__text { display: flex; flex-direction: column; min-width: 0; gap: 2px; font-weight: 500; line-height: 1.35; }
.order-item__text a { color: var(--ink); text-decoration: none; }
.order-item__text a:hover { text-decoration: underline; }
.order-item__sku { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.order-bank { max-width: 640px; }
.order-bank th { width: 220px; white-space: nowrap; }

.order-page .thread { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.order-page .thread > li { margin: 0; }
.order-page .msg { max-width: 88%; padding: 10px 14px; border-radius: var(--radius-lg); font-size: 14px; line-height: 1.55; }
.order-page .msg.in { align-self: flex-end; background: var(--surface-2); }
.order-page .msg.out { align-self: flex-start; background: var(--ink); color: var(--dark-ink); }
.order-page .msg.sys { align-self: stretch; max-width: none; text-align: center; background: var(--badge-gray-bg); color: var(--badge-gray-fg); }
.order-page .msg.none { align-self: stretch; max-width: none; padding: 0; background: none; color: var(--muted); }
.order-page .msg a { color: inherit; }
.order-page .msg-head { margin-bottom: 4px; font-size: 11.5px; opacity: .7; }
.order-page .msg-gal { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.order-page .msg-gal:empty, .order-page .msg-files:empty { display: none; }
.order-page .msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.order-page .gal-item { display: block; width: 84px; height: 84px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.order-page .gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.order-form { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.order-form textarea { width: 100%; min-height: 96px; padding: 12px 14px; border: 1px solid transparent; border-radius: var(--radius-md); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.5; resize: vertical; }
.order-form textarea::placeholder { color: var(--muted); }
.order-form textarea:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.order-form__files { font-size: 12.5px; color: var(--muted); }
.order-form__files input { font: inherit; color: var(--ink-2); }
.order-form__files input::file-selector-button { margin-right: 10px; height: 34px; padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink); font: 600 12px var(--font-sans); cursor: pointer; }
.order-form__files input::file-selector-button:hover { background: var(--grey-lo); }
.order-form .cart-full__checkout { align-self: flex-start; }
/* Увеличение фото из переписки — одно окно на страницу */
.zoomdlg { max-width: min(1100px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: var(--radius-md); background: var(--ink); position: relative; }
.zoomdlg::backdrop { background: rgba(11, 12, 15, .8); }
.zoomdlg img { display: block; max-width: min(1100px, 96vw); max-height: 86vh; object-fit: contain; margin: 0 auto; }
.zoomdlg p { margin: 0; padding: 8px 14px; color: #ccc; font-size: 12px; }
.zoomdlg button { position: absolute; width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); background: rgba(0, 0, 0, .45); color: var(--dark-ink); font: 300 30px/1 var(--font-sans); cursor: pointer; }
.zoomdlg .zclose { top: 8px; right: 8px; }
.zoomdlg .zprev { left: 8px; top: 45%; }
.zoomdlg .znext { right: 8px; top: 45%; }
html:has(dialog[open]) { overflow: hidden; }

@media (max-width: 640px) {
	.order-page .msg { max-width: 94%; }
	.order-form textarea { font-size: 16px; }
	.order-form .cart-full__checkout, .order-actions .cart-full__checkout { height: 44px; }
	.order-table thead { display: none; }
	.order-table, .order-table tbody, .order-table tfoot { display: block; }
	.order-table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 0 0 8px; padding: 12px; border-radius: var(--radius-md); background: var(--surface-2); }
	.order-table tbody td { display: block; padding: 0; border: 0; background: none; }
	.order-table tbody td.order-table__name { flex: 0 0 100%; }
	.order-table tbody td[data-label]::before { content: attr(data-label) ": "; font-size: 12px; font-weight: 400; color: var(--muted); }
	.order-table tbody td.order-table__sum { margin-left: auto; }
	.order-table tfoot tr { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; }
	.order-table tfoot td { display: block; padding: 0; border: 0; }
	.order-bank th, .order-bank td { display: block; width: auto; padding: 4px 0; border: 0; background: none; }
	.order-bank th { padding-top: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
	.order-bank tr { display: block; border-bottom: 1px solid var(--surface-3); padding-bottom: 8px; }
}
.stub { max-width: 640px; padding: 28px; border-radius: var(--radius-lg); background: var(--surface-2); }
.stub h1 { margin-top: 0; }
.stub .button-dark { display: inline-block; margin-top: 10px; padding: 12px 22px; border-radius: 10px; background: var(--ink-hover); color: var(--dark-ink) !important; text-decoration: none !important; font-weight: 600; }

/* ---------- Логотип: пиксельный огонёк + пиксельный адрес (генерирует _tools/pixel_flame.py) ---------- */
.sidebar__logo-link { gap: 10px; align-items: flex-start; }
/* Оптическое выравнивание: верх огонька = верх пиксельного адреса, низ = базовая линия 2-й строки подписи.
   Огонёк 48 px (12 px сетки × 4); отступ под адресом подобран замером так, чтобы базовая линия легла на 48 px. */
.sidebar__logo-mark { width: 48px; height: 48px; }
.sidebar__logo-mark .bp-flame { width: 48px; height: 48px; }
.sidebar__logo-text { justify-content: flex-start; }
.sidebar__logo-host { line-height: 0; margin: 0; }
.sidebar__logo-host .bp-wordmark { display: block; height: 14px; width: auto; margin: 0 0 var(--bp-logo-gap, 7.5px); }
.sidebar__logo-slogan { font-size: 11.5px; line-height: 15px; font-weight: 500; color: #9a9ea9; letter-spacing: .01em; white-space: nowrap; }

/* ---------- Модалка «Каталог»: мега-меню в 2 колонки ---------- */
.modal-panel__body--mega { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 0; }
.modal-panel__body--mega .catalog-panels,
.modal-panel__body--mega .catalog-panel:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.catalog-mega { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 10px; }

/* Левая колонка — разделы */
.catalog-mega__list { list-style: none; margin: 0; padding: 0 4px 12px 0; overflow-y: auto; scrollbar-width: thin; }
.catalog-mega__whole {
	display: flex; align-items: center; gap: 10px; margin-bottom: 6px; padding: 11px 10px; border-radius: 10px;
	background: var(--ink); color: var(--dark-ink); font-size: 13.5px; font-weight: 600; line-height: 1.25; text-decoration: none; transition: background .12s;
}
.catalog-mega__whole:hover { background: var(--ink-hover); color: var(--dark-ink); }
.catalog-mega__whole span { flex: 1; min-width: 0; }
.catalog-mega__whole svg { flex: none; width: 16px; height: 16px; }
.catalog-mega__item {
	display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 10px;
	color: var(--ink-2); font-size: 13.5px; line-height: 1.25; transition: background .12s, color .12s;
}
.catalog-mega__item:hover, .catalog-mega__item.is-active { background: var(--surface); color: var(--ink); }
.catalog-mega__item.is-active { font-weight: 600; box-shadow: 0 1px 2px rgba(15, 17, 22, .05); }
.catalog-mega__thumb { flex: none; width: 30px; height: 40px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.catalog-mega__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.catalog-mega__name { flex: 1; min-width: 0; }
.catalog-mega__chev { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--muted); }
.catalog-mega__chev svg { width: 14px; height: 14px; }
.catalog-mega__item.is-active .catalog-mega__chev { color: var(--ink); }

/* Правая колонка — подкатегории на всю высоту */
.catalog-mega__side { min-height: 0; overflow-y: auto; scrollbar-width: thin; background: var(--surface); border-radius: var(--radius-lg); padding: 12px 12px 16px; }
.catalog-mega__pane[hidden] { display: none; }
.catalog-mega__back { display: none; }
.catalog-mega__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; color: var(--ink); }
.catalog-mega__title { font-size: 14px; font-weight: 700; letter-spacing: -.005em; line-height: 1.25; }
.catalog-mega__all { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.catalog-mega__all svg { width: 13px; height: 13px; }
.catalog-mega__head:hover .catalog-mega__all { color: var(--ink); }
.catalog-mega__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 8px; }
.catalog-mega__card { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.catalog-mega__img { display: block; aspect-ratio: 3 / 4; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); }
.catalog-mega__img img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .3s ease; }
.catalog-mega__card:hover img, .catalog-mega__cover:hover img { transform: scale(1.04); }
.catalog-mega__card-name { font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.catalog-mega__card-count { font-size: 10.5px; color: var(--muted); margin-top: -2px; }
.catalog-mega__cover { display: block; max-width: 140px; aspect-ratio: 3 / 4; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.catalog-mega__cover img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .3s ease; }

/* Телефон/планшет: одна колонка, подкатегории открываются поверх списка со стрелкой «назад» */
@media (max-width: 960px) {
	/* в теме панель модалки прозрачная — на телефоне сквозь неё просвечивала страница */
	.modal-panel { background: var(--bg); border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 17, 22, .18); }
	.catalog-mega { grid-template-columns: 1fr; }
	.catalog-mega__side { display: none; }
	.catalog-mega.is-sub-open .catalog-mega__list { display: none; }
	.catalog-mega.is-sub-open .catalog-mega__side { display: block; }
	.catalog-mega__back { display: inline-flex; align-items: center; gap: 2px; margin: -4px 0 12px -4px; padding: 4px; border: 0; background: none; color: var(--ink-2); font: 600 13px var(--font-sans); cursor: pointer; }
	.catalog-mega__back svg { width: 14px; height: 14px; }
	.catalog-mega__item.is-active:not(:hover) { background: none; box-shadow: none; font-weight: 400; }
}
