/* ==========================================================================
   TPMarket — основные стили
   1. Переменные и база   2. Шапка   3. Макет и сайдбар
   4. Каталог             5. Карточка товара   6. Контент и формы   7. Подвал
   ========================================================================== */

/* 1. Переменные и база ---------------------------------------------------- */
:root {
	--c-primary: #0d4f8b;
	--c-primary-dark: #0a3a68;
	--c-accent: #f08a00;
	--c-accent-dark: #d17600;
	--c-bg: #f3f6f9;
	--c-surface: #fff;
	--c-text: #1f2933;
	--c-muted: #5f6c7b;
	--c-border: #d9e1e8;
	--radius: 6px;
	--shadow: 0 2px 10px rgba(13, 79, 139, .08);
	--container: 1280px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--c-text); background: var(--c-bg); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; color: var(--c-primary-dark); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; padding: 10px 14px; background: #fff; }
.no-image { display: block; width: 100%; height: 100%; min-height: 120px; background: linear-gradient(135deg, #e8eef4, #f6f9fb); }

/* Кнопки */
.btn { display: inline-block; padding: 10px 18px; border: 2px solid transparent; border-radius: var(--radius); font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn--accent { background: var(--c-accent); color: #fff; }
.btn--accent:hover { background: var(--c-accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--c-primary); border-color: var(--c-primary); }
.btn--ghost:hover { background: var(--c-primary); color: #fff; }
.btn--sm { padding: 7px 12px; font-size: 14px; }

/* 2. Шапка ---------------------------------------------------------------- */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.site-header__top { display: grid; grid-template-columns: auto 1fr auto auto; gap: 24px; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.site-logo img, .site-logo .custom-logo { max-height: 70px; width: auto; display: block; }
.logo__text { font-size: 22px; font-weight: 800; color: var(--c-primary); }

.site-tagline { display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; color: var(--c-muted); text-transform: uppercase; letter-spacing: .02em; }
.site-tagline__org { color: var(--c-primary-dark); font-size: 15px; letter-spacing: .04em; }

.site-contacts { display: flex; gap: 28px; font-size: 14px; }
.site-contacts__label { display: block; font-size: 12px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; }
.site-contacts__phones a, .site-contacts__mail a { display: block; color: var(--c-text); font-weight: 600; }
.site-contacts__phones a:first-of-type { font-size: 18px; color: var(--c-primary); }

.nav-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--c-border); border-radius: var(--radius); background: #fff; cursor: pointer; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after { display: block; width: 22px; height: 2px; margin: 0 auto; background: var(--c-primary); content: ""; position: relative; }
.nav-toggle__bar::before { position: absolute; top: -7px; left: 0; }
.nav-toggle__bar::after { position: absolute; top: 7px; left: 0; }

/* Главное меню */
.main-nav { background: var(--c-primary); }
.main-nav__list { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.main-nav__list > li { position: relative; }
.main-nav__list a { display: block; padding: 14px 20px; color: #fff; font-weight: 600; text-decoration: none; }
.main-nav__list > li:hover > a, .main-nav__list > .current-menu-item > a, .main-nav__list > .current-menu-ancestor > a { background: var(--c-primary-dark); }
.main-nav__list .sub-menu { position: absolute; top: 100%; left: 0; z-index: 50; min-width: 280px; margin: 0; padding: 6px 0; list-style: none; background: #fff; border: 1px solid var(--c-border); box-shadow: var(--shadow); display: none; }
.main-nav__list li:hover > .sub-menu, .main-nav__list li:focus-within > .sub-menu { display: block; }
.main-nav__list .sub-menu a { padding: 9px 18px; color: var(--c-text); font-weight: 500; }
.sub-toggle { display: none; }
.main-nav__list .sub-menu a:hover { background: var(--c-bg); color: var(--c-primary); }

/* 3. Макет и сайдбар ------------------------------------------------------ */
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; padding-top: 24px; padding-bottom: 40px; align-items: start; }
.catalog-toggle { display: none; grid-column: 1 / -1; padding: 12px 16px; border: 0; border-radius: var(--radius); background: var(--c-accent); color: #fff; font-weight: 700; cursor: pointer; }
.content { min-width: 0; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow); }
.content:focus { outline: none; }

.sidebar { display: flex; flex-direction: column; gap: 18px; }
.side-block { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.side-block__title, .widget__title { margin: 0; padding: 12px 16px; background: var(--c-primary); color: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; }
.side-block .search-form { margin: 14px; }
.widget { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.widget img { display: block; width: 100%; }

/* Дерево каталога */
.cat-tree, .cat-tree ul { margin: 0; padding: 0; list-style: none; }
.cat-tree a { display: block; padding: 9px 16px; color: var(--c-text); font-size: 14.5px; line-height: 1.35; border-top: 1px solid var(--c-border); text-decoration: none; }
.cat-tree a:hover { background: var(--c-bg); color: var(--c-primary); }
.cat-tree li { position: relative; }
.cat-tree li.has-children > a { padding-right: 40px; }
.cat-tree ul.children { display: none; background: #f9fbfc; }
.cat-tree ul.children a { padding-left: 28px; font-size: 14px; }
.cat-tree ul.children ul.children a { padding-left: 40px; font-size: 13.5px; }
.cat-tree ul.children ul.children ul.children a { padding-left: 52px; }
.cat-tree li.is-open > ul.children, .cat-tree li.current-cat > ul.children, .cat-tree li.current-cat-ancestor > ul.children { display: block; }
.cat-tree li.current-cat > a, .cat-tree li.current-cat-ancestor > a { color: var(--c-primary); font-weight: 700; }
.cat-tree li.current-cat > a { background: #e9f1f9; box-shadow: inset 3px 0 0 var(--c-accent); }
.cat-tree__toggle { position: absolute; top: 0; right: 0; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--c-muted); cursor: pointer; }
.cat-tree__toggle::before { content: "+"; font-size: 20px; line-height: 40px; }
.cat-tree li.is-open > .cat-tree__toggle::before, .cat-tree li.current-cat > .cat-tree__toggle::before, .cat-tree li.current-cat-ancestor > .cat-tree__toggle::before { content: "–"; }

/* Список материалов */
.material-list { margin: 0; padding: 6px 0; list-style: none; columns: 2; }
.material-list a { display: block; padding: 6px 16px; color: var(--c-text); }
.material-list a:hover, .material-list .is-current a { color: var(--c-primary); font-weight: 700; }

/* 4. Каталог -------------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; }
.page-title { margin: 0; font-size: 28px; }
.section-title { margin: 32px 0 16px; padding-bottom: 8px; font-size: 21px; border-bottom: 2px solid var(--c-accent); display: inline-block; }
.home-section { margin-top: 12px; }
.intro .page-title { margin-bottom: .6em; font-size: 26px; }
.notice { padding: 14px 16px; background: #fff8ec; border-left: 4px solid var(--c-accent); }

.breadcrumbs { margin: 0 0 16px; font-size: 13.5px; color: var(--c-muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "→"; margin: 0 8px; color: var(--c-border); }
.breadcrumbs a { color: var(--c-muted); }

/* Плитка разделов */
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 0 0 24px; padding: 0; list-style: none; }
.term-card a { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; color: var(--c-text); text-decoration: none; transition: box-shadow .15s, border-color .15s; }
.term-card a:hover { border-color: var(--c-primary); box-shadow: var(--shadow); }
.term-card__img { display: block; aspect-ratio: 4 / 3; background: #f3f6f9; }
.term-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.term-card__title { padding: 12px 14px; font-weight: 600; font-size: 15px; line-height: 1.35; }

/* Карточки товаров */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-bottom: 24px; }
.product-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.product-card__img { display: block; aspect-ratio: 4 / 3; background: #f3f6f9; }
.product-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card__body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.product-card__title { margin: 0 0 8px; font-size: 16px; }
.product-card__title a { color: var(--c-primary-dark); }
.product-card__text { color: var(--c-muted); font-size: 14px; }
.product-card__foot { margin-top: auto; }
.product-card__price { display: block; margin-bottom: 10px; font-weight: 700; }
.product-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Лента на главной */
.featured { margin: 0 0 24px; }
.featured__list { display: flex; gap: 14px; margin: 0; padding: 0 0 8px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; }
.featured__item { flex: 0 0 200px; scroll-snap-align: start; }
.featured__item a { display: block; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; color: var(--c-text); text-decoration: none; }
.featured__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.featured__title { display: block; padding: 8px 10px; font-size: 13px; line-height: 1.3; }

.advantages { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.advantages__item a { display: flex; flex-direction: column; align-items: center; gap: 12px; height: 100%; padding: 22px 16px; text-align: center; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius); color: var(--c-text); }
.advantages__item a:hover { border-color: var(--c-primary); text-decoration: none; }
.advantages__icon { color: var(--c-primary); }

.news-list { margin: 0; padding: 0; list-style: none; }
.news-list__item { padding: 10px 0; border-bottom: 1px solid var(--c-border); }
.post-date { display: inline-block; margin-right: 10px; color: var(--c-muted); font-size: 13px; }
.more-link { font-weight: 600; }

/* 5. Карточка товара ------------------------------------------------------ */
.product-nav { display: flex; gap: 16px; font-size: 14px; }
.product__top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; margin-bottom: 28px; }
.gallery__main { display: block; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; background: #fff; cursor: zoom-in; }
.gallery__main img { display: block; width: 100%; height: auto; }
.gallery__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.gallery__thumb { display: block; width: 84px; padding: 0; border: 2px solid var(--c-border); border-radius: 4px; overflow: hidden; background: #fff; cursor: pointer; }
.gallery__thumb img { display: block; width: 100%; height: 64px; object-fit: cover; }
.gallery__thumb.is-active, .gallery__thumb:hover { border-color: var(--c-primary); }

.product__excerpt { margin-bottom: 14px; }
.product__registry { padding: 10px 14px; background: #eef6ee; border-left: 4px solid #3a9a4a; font-size: 14px; }
.product__price { margin: 14px 0; font-size: 24px; font-weight: 800; color: var(--c-primary-dark); }
.product__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.product__meta { margin-bottom: 6px; color: var(--c-muted); font-size: 14px; }

.tabs__nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; border-bottom: 2px solid var(--c-primary); }
.tabs__link { display: block; padding: 10px 18px; background: var(--c-bg); color: var(--c-text); font-weight: 600; border-radius: var(--radius) var(--radius) 0 0; text-decoration: none; }
.tabs__link.is-active { background: var(--c-primary); color: #fff; }
.tabs__panel { padding-top: 18px; }
.tabs__heading { font-size: 19px; }
/* С включённым JS показываем только активную вкладку и прячем заголовки панелей */
.tabs.is-enhanced .tabs__panel { display: none; }
.tabs.is-enhanced .tabs__panel.is-active { display: block; }
.tabs.is-enhanced .tabs__heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

.docs { padding-left: 1.1em; }
.docs li { margin-bottom: 6px; }

/* 6. Контент и формы ------------------------------------------------------ */
.entry { overflow-wrap: break-word; }
.entry img { border-radius: 4px; }
.entry h2 { margin-top: 1.6em; font-size: 22px; }
.entry h3 { margin-top: 1.4em; font-size: 18px; }
.entry a { text-decoration: underline; }
.entry .wp-block-image figcaption { color: var(--c-muted); font-size: 13px; }
.alignleft { float: left; margin: 0 20px 12px 0; }
.alignright { float: right; margin: 0 0 12px 20px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }

.table-scroll { max-width: 100%; margin-bottom: 1.2em; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.entry table, .specs { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.entry th, .entry td, .specs th, .specs td { padding: 8px 12px; border: 1px solid var(--c-border); text-align: left; vertical-align: top; }
.entry thead th, .entry tr:first-child th { background: var(--c-bg); }
.specs th[scope="row"] { width: 45%; background: #fafbfc; font-weight: 600; }
.specs__group th { background: var(--c-primary); color: #fff; }

.term-desc { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--c-border); }
.post-item { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--c-border); }
.post-item:not(:has(.post-item__img)) { grid-template-columns: 1fr; }
.post-item__title { margin: 4px 0 8px; font-size: 19px; }
.post-nav { display: flex; justify-content: space-between; margin-top: 28px; }
.pagination { margin: 24px 0 8px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { padding: 7px 13px; border: 1px solid var(--c-border); border-radius: var(--radius); color: var(--c-text); text-decoration: none; }
.pagination .page-numbers.current { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

.search-form { position: relative; display: flex; max-width: 420px; }
.search-form__input { flex: 1; min-width: 0; padding: 10px 44px 10px 12px; border: 1px solid var(--c-border); border-radius: var(--radius); background: #fff; }
.search-form__btn { position: absolute; top: 0; right: 0; width: 42px; height: 100%; border: 0; background: transparent; color: var(--c-primary); cursor: pointer; }

.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 24px; }
.contacts__list { margin: 0; }
.contacts__list dt { margin-top: 12px; color: var(--c-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.contacts__list dd { margin: 2px 0 0; font-weight: 600; }

/* Форма заявки */
.inq-form__row { margin-bottom: 14px; }
.inq-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inq-form label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.inq-form input[type="text"], .inq-form input[type="tel"], .inq-form input[type="email"], .inq-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--c-border); border-radius: var(--radius); background: #fff; }
.inq-form__hp { position: absolute; left: -9999px; }
.inq-form .inq-form__agree { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; font-weight: 400; font-size: 13px; color: var(--c-muted); }
.inq-form__status { min-height: 1.4em; margin: 12px 0 0; font-weight: 600; }
.inq-form__status.is-ok { color: #2e7d32; }
.inq-form__status.is-error { color: #b32d2e; }

/* Модальное окно */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal__overlay { position: absolute; inset: 0; background: rgba(10, 30, 50, .6); }
.modal__box { position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; padding: 26px 26px 22px; background: #fff; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal__title { margin-right: 30px; font-size: 21px; }
.modal__product { margin: -6px 0 14px; color: var(--c-muted); font-weight: 600; }
.modal__product:empty { display: none; }
.modal__close { position: absolute; top: 8px; right: 12px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 28px; line-height: 1; color: var(--c-muted); cursor: pointer; }
body.has-modal { overflow: hidden; }

.lightbox { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .85); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; }
.lightbox__close { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #1f2933; font-size: 30px; line-height: 1; cursor: pointer; }

/* 7. Подвал --------------------------------------------------------------- */
.site-footer { background: var(--c-primary-dark); color: #d6e3f0; font-size: 14px; }
.site-footer a { color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 28px; padding-top: 32px; padding-bottom: 24px; }
.site-footer__brand img { max-height: 56px; width: auto; display: block; padding: 6px 12px; background: #fff; border-radius: var(--radius); }
.site-footer__copy { margin-top: 12px; }
.footer-menu { margin: 0; padding: 0; list-style: none; }
.footer-menu li { margin-bottom: 8px; }
.site-footer__contacts p { margin-bottom: 8px; }
.site-footer__widgets { grid-column: 1 / -1; }
.site-footer__legal { padding-top: 16px; padding-bottom: 24px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: 12px; color: #9db4cb; }

/* Адаптив ----------------------------------------------------------------- */

/* Элементы только для мобильных — на десктопе скрыты */
.header-call, .sidebar__close, .buy-bar, .drawer-overlay { display: none; }

html { scroll-padding-top: 76px; -webkit-tap-highlight-color: rgba(13, 79, 139, .15); }
a, button, .btn, input, textarea, label { touch-action: manipulation; }

.site-footer__phones a { display: block; color: #fff; }
.site-footer__label { display: block; margin-bottom: 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #9db4cb; }

@keyframes tp-sheet { from { transform: translateY(100%); } to { transform: none; } }

/* Планшеты и узкие ноутбуки */
@media (max-width: 1100px) {
	.site-header__top { grid-template-columns: auto 1fr auto; }
	.site-tagline { display: none; }
	.site-contacts { justify-self: end; }
}

/* Планшеты и телефоны: шторка каталога, мобильное меню */
@media (max-width: 900px) {
	body.has-drawer { overflow: hidden; }

	/* Шапка: липкая, компактная, с кнопкой звонка */
	.site-header { position: sticky; top: 0; z-index: 700; }
	.site-header__top { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 8px 12px; }
	.site-logo { min-width: 0; }
	.site-logo img, .site-logo .custom-logo { width: auto; max-width: 100%; max-height: 44px; }
	.site-contacts { display: none; }
	.header-call { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c-accent); color: #fff; }
	.header-call:hover { background: var(--c-accent-dark); text-decoration: none; }
	.nav-toggle { display: block; }

	/* Главное меню */
	.main-nav { display: none; max-height: calc(100vh - 62px); max-height: calc(100dvh - 62px); overflow-y: auto; overscroll-behavior: contain; }
	.main-nav.is-open { display: block; }
	.main-nav .container { padding: 0; }
	.main-nav__list { flex-direction: column; }
	.main-nav__list a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-top: 1px solid rgba(255, 255, 255, .12); }
	.main-nav__list > li.menu-item-has-children { position: relative; }
	.main-nav__list > li.menu-item-has-children > a { padding-right: 64px; }
	.sub-toggle { display: block; position: absolute; top: 0; right: 0; width: 56px; height: 48px; border: 0; border-left: 1px solid rgba(255, 255, 255, .12); background: transparent; color: #fff; cursor: pointer; }
	.sub-toggle::before { content: ""; display: block; width: 9px; height: 9px; margin: -4px auto 0; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
	.is-sub-open > .sub-toggle::before { margin-top: 2px; transform: rotate(-135deg); }
	.main-nav__list .sub-menu { position: static; display: none; min-width: 0; border: 0; box-shadow: none; background: rgba(0, 0, 0, .14); }
	.main-nav__list li.is-sub-open > .sub-menu, .main-nav__list li.current-menu-ancestor > .sub-menu, .main-nav__list li.current-menu-parent > .sub-menu, .main-nav__list li.current-menu-item.menu-item-has-children > .sub-menu { display: block; }
	.main-nav__list .sub-menu a { padding-left: 32px; color: #fff; }

	/* Макет: контент во всю ширину экрана */
	.layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 12px; padding-bottom: 24px; }
	.content { margin: 0 -16px; padding: 16px; border-width: 1px 0; border-radius: 0; box-shadow: none; }
	.catalog-toggle { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0 -16px; padding: 0 16px; border: solid var(--c-border); border-width: 1px 0; border-radius: 0; background: #fff; color: var(--c-primary); font-size: 16px; text-align: left; }
	.catalog-toggle::before { content: ""; flex: none; width: 18px; height: 2px; background: currentColor; box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor; }

	/* Каталог — выезжающая шторка слева */
	.sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 800; display: flex; width: min(88vw, 360px); height: 100vh; height: 100dvh; padding: 12px 12px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; background: var(--c-bg); box-shadow: 4px 0 24px rgba(0, 0, 0, .25); transform: translateX(-105%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
	.sidebar.is-open { transform: none; visibility: visible; transition-delay: 0s; }
	.sidebar > * { flex: none; }
	.sidebar__close { display: block; align-self: flex-end; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--c-primary); font-size: 28px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
	.drawer-overlay { display: block; position: fixed; inset: 0; z-index: 750; background: rgba(10, 30, 50, .55); opacity: 0; pointer-events: none; transition: opacity .25s; }
	.drawer-overlay.is-visible { opacity: 1; pointer-events: auto; }

	.cat-tree a { display: flex; align-items: center; min-height: 48px; padding: 8px 16px; font-size: 15.5px; }
	.cat-tree li.has-children > a { padding-right: 52px; }
	.cat-tree__toggle { width: 48px; height: 48px; }
	.material-list a { display: flex; align-items: center; min-height: 44px; }
	.side-block .search-form { max-width: none; }
	.search-form__input { min-height: 48px; }
	.search-form__btn { width: 48px; }

	/* Хлебные крошки — одна строка с прокруткой */
	.breadcrumbs { margin: 0 -16px 8px; }
	.breadcrumbs ol { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px 0 24px; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(to right, transparent, #000 24px); mask-image: linear-gradient(to right, transparent, #000 24px); }
	.breadcrumbs ol::-webkit-scrollbar { display: none; }
	.breadcrumbs li { flex: none; display: flex; align-items: center; }
	.breadcrumbs a, .breadcrumbs span { display: inline-flex; align-items: center; min-height: 44px; }

	/* Заголовки и кнопки */
	.page-title { font-size: 22px; }
	.intro .page-title { font-size: 21px; }
	.section-title { margin-top: 24px; font-size: 19px; }
	.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
	.btn--sm { min-height: 44px; font-size: 15px; }
	.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
	.product-nav { width: 100%; justify-content: space-between; }
	.product-nav a { display: inline-flex; align-items: center; min-height: 44px; }
	.post-nav a { display: inline-block; padding: 12px 0; }
	.news-list__item { padding: 14px 0; }
	.docs a { display: inline-block; padding: 10px 0; }
	.product-card__title a { display: block; padding: 6px 0; }

	/* Главная: лента во всю ширину */
	.featured { margin: 0 -16px 16px; }
	.featured__list { padding: 0 16px 8px; }
	.featured__item { flex-basis: 160px; }

	/* Карточка товара */
	.product__top { gap: 16px; margin-bottom: 18px; }
	.gallery { margin: 0 -16px; }
	.gallery__main { border-width: 1px 0; border-radius: 0; }
	.gallery__thumbs { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
	.gallery__thumbs::-webkit-scrollbar { display: none; }
	.gallery__thumbs li { flex: none; scroll-snap-align: start; }
	.gallery__thumb { width: 76px; }
	.product__price { margin: 6px 0 12px; font-size: 22px; }
	.product__actions { display: none; }
	.single-product .site-footer { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

	/* Нижняя панель: позвонить + запросить цену */
	.buy-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 650; display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--c-border); box-shadow: 0 -4px 16px rgba(13, 79, 139, .12); }
	.buy-bar__call { flex: none; display: flex; align-items: center; justify-content: center; width: 52px; border: 2px solid var(--c-primary); border-radius: var(--radius); color: var(--c-primary); }
	.buy-bar .btn { flex: 1; min-height: 52px; font-size: 16px; }

	/* Вкладки — горизонтальная лента */
	.tabs { scroll-margin-top: 70px; }
	.tabs__nav { flex-wrap: nowrap; gap: 4px; margin: 0 -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.tabs__nav::-webkit-scrollbar { display: none; }
	.tabs__nav li { flex: none; }
	.tabs__link { display: flex; align-items: center; min-height: 48px; padding: 0 16px; white-space: nowrap; }

	/* Характеристики: параметр над значением */
	.specs, .specs tbody { display: block; }
	.specs tr { display: block; border-bottom: 1px solid var(--c-border); }
	.specs th, .specs td { display: block; border: 0; padding: 4px 12px; }
	.specs th[scope="row"] { width: 100%; padding-top: 10px; background: transparent; color: var(--c-muted); font-size: 13.5px; font-weight: 500; }
	.specs td { padding-bottom: 10px; font-weight: 600; }
	.specs__group th { padding: 10px 12px; }

	/* Широкие таблицы из контента: прокрутка с подсказкой-тенью по краям */
	.table-scroll { background: linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) 0 0 / 40px 100% no-repeat local, linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) 100% 0 / 40px 100% no-repeat local, radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 0 / 12px 100% no-repeat scroll, radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 100% 0 / 12px 100% no-repeat scroll; }
	.entry table { font-size: 13.5px; }

	/* Контакты и формы */
	.product__top, .contacts { grid-template-columns: minmax(0, 1fr); }
	.contacts { gap: 20px; }
	.site-footer__grid { grid-template-columns: 1fr; gap: 20px; }
	.post-item { grid-template-columns: 1fr; }
	.inq-form input[type="text"], .inq-form input[type="tel"], .inq-form input[type="email"], .inq-form textarea { min-height: 48px; font-size: 16px; }
	.inq-form .inq-form__agree { align-items: center; min-height: 44px; font-size: 13.5px; }
	.inq-form__agree input { flex: none; width: 22px; height: 22px; }
	.inq-form__submit { width: 100%; min-height: 52px; }

	/* Подвал */
	.footer-menu a, .site-footer__phones a, .site-footer__contacts p a { display: inline-flex; align-items: center; min-height: 44px; }
	.site-footer__phones a { display: flex; }
	.site-footer__contacts .btn { min-height: 48px; }

	.lightbox { touch-action: pinch-zoom; }
}

/* Телефоны */
@media (max-width: 560px) {
	.term-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.term-card__title { padding: 10px; font-size: 14px; overflow-wrap: anywhere; hyphens: auto; }
	.product-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.product-card__img { aspect-ratio: 16 / 9; }
	.product-card__text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
	.product-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
	.advantages { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.advantages__item a { padding: 14px 10px; font-size: 14px; }
	.inq-form__grid { grid-template-columns: 1fr; gap: 0; }
	.material-list { columns: 2; }

	/* Форма заявки — «шторка» снизу */
	.modal { align-items: flex-end; padding: 0; }
	.modal__box { max-width: none; max-height: 92vh; max-height: 92dvh; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; animation: tp-sheet .25s ease-out; }
	.modal__title { font-size: 19px; }
	.modal__close { top: 6px; right: 6px; width: 48px; height: 48px; }
}

/* Телефон в альбомной ориентации: шапка не липкая, чтобы не съедать экран */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
	.site-header { position: static; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; animation: none !important; }
}
@media print {
	.site-header, .sidebar, .site-footer, .catalog-toggle, .modal, .buy-bar, .product__actions, .breadcrumbs, .drawer-overlay { display: none !important; }
	.layout { display: block; }
	.content { margin: 0; padding: 0; border: 0; box-shadow: none; }
}
