/*!
Theme Name: Teplo163
Theme URI: https://teplo163.ru/
Author: Teplo163
Author URI: https://teplo163.ru/
Description: Самостоятельная тема для teplo163.ru — Industrial B2B стиль для инженерной службы теплоснабжения. Никаких зависимостей от Pipey/Elementor. Mobile-first. WooCommerce-совместима.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: teplo163
Tags: industrial, business, b2b
*/

/* =========================================================================
   TEPLO163 — INDUSTRIAL B2B DESIGN SYSTEM (standalone)
   Mobile-first. Breakpoints: 480 / 768 / 1024 / 1280 / 1920.
   ========================================================================= */

/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: #0F172A;
	background: #FFFFFF;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
	max-width: 100vw;
}
/* Длинные слова/ссылки/badge не растягивают вьюпорт */
.t-prose, .t-container { overflow-wrap: anywhere; word-break: break-word; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; }

/* === CSS Variables === */
:root {
	/* Палитра */
	--t163-primary:        #0B1E3F;
	--t163-primary-700:    #11264D;
	--t163-secondary:      #1E3A6F;
	--t163-steel:          #64748B;
	--t163-cta:            #FF6B1A;
	--t163-cta-hover:      #E55A0F;
	--t163-emergency:      #DC2626;
	--t163-emergency-hover:#B91C1C;
	--t163-bg:             #FFFFFF;
	--t163-bg-soft:        #F1F5F9;
	--t163-bg-dark:        #0F172A;
	--t163-text:           #0F172A;
	--t163-text-soft:      #475569;
	--t163-border:         #E2E8F0;
	--t163-border-strong:  #CBD5E1;

	/* Размеры (мобильные базовые) */
	--t163-fs-h1: 28px;
	--t163-fs-h2: 24px;
	--t163-fs-h3: 20px;
	--t163-fs-h4: 18px;
	--t163-fs-body: 15px;
	--t163-fs-small: 13px;

	/* Радиусы и отступы */
	--t163-radius: 4px;
	--t163-radius-sm: 2px;
	--t163-section-pad-y: 48px;
	--t163-container-pad: 16px;
	--t163-container-max: 1280px;
	--t163-header-h: 64px;

	--t163-transition: 150ms ease-out;
}

@media (min-width: 480px) { :root { --t163-container-pad: 20px; } }
@media (min-width: 768px)  {
	:root {
		--t163-fs-h1: 36px; --t163-fs-h2: 28px; --t163-fs-h3: 22px;
		--t163-fs-body: 16px;
		--t163-section-pad-y: 72px;
		--t163-container-pad: 32px;
		--t163-header-h: 72px;
	}
}
@media (min-width: 1024px) {
	:root {
		--t163-fs-h1: 44px; --t163-fs-h2: 32px; --t163-fs-h3: 24px;
		--t163-section-pad-y: 96px;
		--t163-container-pad: 40px;
	}
}
@media (min-width: 1280px) { :root { --t163-fs-h1: 52px; --t163-fs-h2: 36px; --t163-section-pad-y: 120px; } }
@media (min-width: 1920px) { :root { --t163-fs-h1: 60px; --t163-container-pad: 48px; } }

/* === Container === */
.t-container {
	max-width: var(--t163-container-max);
	margin: 0 auto;
	padding-left: var(--t163-container-pad);
	padding-right: var(--t163-container-pad);
	width: 100%;
}

/* === Headings === */
h1, h2, h3, h4, h5, h6 {
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--t163-primary);
	margin: 0 0 0.5em;
}
h1 { font-size: var(--t163-fs-h1); }
h2 { font-size: var(--t163-fs-h2); }
h3 { font-size: var(--t163-fs-h3); }
h4 { font-size: var(--t163-fs-h4); font-weight: 700; }

p { margin: 0 0 1em; }
strong, b { font-weight: 700; }

a:not(.t-btn) { color: var(--t163-secondary); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
	a:not(.t-btn):hover { color: var(--t163-cta); }
}

ul, ol { padding-left: 1.2em; margin: 0 0 1em; }
li + li { margin-top: 0.25em; }

hr { border: 0; border-top: 1px solid var(--t163-border); margin: 32px 0; }

/* === Sections === */
.t-section { padding: var(--t163-section-pad-y) 0; background: var(--t163-bg); }
.t-section--soft { background: var(--t163-bg-soft); }
.t-section--dark { background: var(--t163-bg-dark); color: #fff; }
.t-section--dark h1, .t-section--dark h2, .t-section--dark h3 { color: #fff; }

/* === HEADER === */
.t-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: #fff;
	border-bottom: 1px solid var(--t163-border);
}
.t-header__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: var(--t163-header-h);
}
.t-logo {
	font-weight: 800;
	font-size: 20px;
	color: var(--t163-primary);
	text-decoration: none !important;
	flex-shrink: 0;
	letter-spacing: -0.02em;
}
.t-logo span { color: var(--t163-cta); }
@media (min-width: 1024px) { .t-logo { font-size: 24px; } }

.t-nav { display: none; flex: 1; }
@media (min-width: 1024px) {
	.t-nav { display: flex; gap: 24px; align-items: center; margin-left: 32px; }
	.t-nav a { color: var(--t163-text); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 4px; }
	.t-nav a:hover { color: var(--t163-cta); }
}

.t-header__actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.t-header__phone {
	display: none;
	color: var(--t163-primary) !important;
	font-weight: 700;
	text-decoration: none !important;
	font-size: 15px;
}
@media (min-width: 768px) {
	.t-header__phone { display: inline-flex; align-items: center; gap: 6px; }
}

/* Mobile menu toggle */
.t-burger {
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 10px;
	border-radius: var(--t163-radius);
}
.t-burger span { display: block; width: 22px; height: 2px; background: var(--t163-primary); transition: var(--t163-transition); }
.t-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.t-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.t-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (min-width: 1024px) { .t-burger { display: none; } }

/* Mobile drawer */
.t-drawer {
	position: fixed;
	inset: var(--t163-header-h) 0 0 0;
	background: #fff;
	z-index: 99;
	transform: translateX(100%);
	transition: transform 200ms ease-out;
	overflow-y: auto;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.t-drawer[data-open="true"] { transform: translateX(0); }
.t-drawer a {
	padding: 14px 0;
	border-bottom: 1px solid var(--t163-border);
	color: var(--t163-text);
	text-decoration: none;
	font-weight: 600;
	font-size: 18px;
}
.t-drawer .t-btn { margin-top: 16px; }
@media (min-width: 1024px) { .t-drawer { display: none !important; } }

/* === Buttons === */
.t-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 22px;
	min-height: 48px;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.2;
	text-decoration: none !important;
	border-radius: var(--t163-radius);
	border: 1px solid transparent;
	cursor: pointer;
	transition: background var(--t163-transition), color var(--t163-transition);
	-webkit-tap-highlight-color: transparent;
}
@media (min-width: 768px) { .t-btn { padding: 16px 26px; font-size: 16px; } }

.t-btn--cta { background: var(--t163-cta); color: #fff !important; }
.t-btn--cta:active { transform: translateY(1px); }
.t-btn--emergency { background: var(--t163-emergency); color: #fff !important; }
.t-btn--ghost { background: transparent; color: var(--t163-primary) !important; border-color: var(--t163-border-strong); }
.t-btn--full { width: 100%; }
.t-btn--sm { padding: 10px 16px; min-height: 40px; font-size: 14px; }

@media (hover: hover) and (pointer: fine) {
	.t-btn--cta:hover { background: var(--t163-cta-hover); }
	.t-btn--emergency:hover { background: var(--t163-emergency-hover); }
	.t-btn--ghost:hover { background: var(--t163-bg-soft); border-color: var(--t163-primary); }
	.t-hero .t-btn--ghost:hover,
	.t-section--dark .t-btn--ghost:hover {
		background: rgba(255,255,255,0.12) !important;
		border-color: rgba(255,255,255,0.85) !important;
		color: #fff !important;
	}
}

/* === HERO === */
.t-hero {
	background: linear-gradient(180deg, var(--t163-primary) 0%, var(--t163-primary-700) 100%);
	color: #fff;
	padding: 40px 0 48px;
}
@media (min-width: 768px) { .t-hero { padding: 64px 0 72px; } }
@media (min-width: 1024px) { .t-hero { padding: 88px 0 96px; } }

.t-hero h1 {
	color: #fff;
	max-width: 24ch;
	font-size: clamp(26px, 4.2vw, 42px);
	line-height: 1.15;
	letter-spacing: -0.015em;
	margin: 0 0 16px;
}
.t-hero h1 .t-h1-sub {
	display: block;
	margin-top: 8px;
	font-weight: 500;
	font-size: 0.55em;
	line-height: 1.35;
	color: rgba(255,255,255,0.85);
	letter-spacing: 0;
	max-width: 36ch;
}
@media (min-width: 768px) { .t-hero h1 .t-h1-sub { font-size: 0.5em; margin-top: 12px; } }

.t-hero__lead { color: rgba(255,255,255,0.85); font-size: 16px; line-height: 1.55; margin: 0 0 24px; max-width: 56ch; }
@media (min-width: 768px) { .t-hero__lead { font-size: 18px; margin-bottom: 32px; } }

.t-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.t-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 12px;
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(255,255,255,0.16);
	border-radius: var(--t163-radius);
	color: rgba(255,255,255,0.92);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.t-hero__cta { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 480px) { .t-hero__cta { flex-direction: row; flex-wrap: wrap; } }

/* === TRUST numbers === */
.t-trust__grid {
	display: grid; gap: 24px;
	grid-template-columns: repeat(2, 1fr);
	text-align: center;
}
@media (min-width: 768px) { .t-trust__grid { grid-template-columns: repeat(4, 1fr); gap: 32px; } }
.t-trust__num {
	font-weight: 800;
	font-size: 36px;
	line-height: 1;
	color: var(--t163-primary);
	font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) { .t-trust__num { font-size: 48px; } }
@media (min-width: 1024px) { .t-trust__num { font-size: 56px; } }
.t-trust__label { margin-top: 8px; font-size: 13px; color: var(--t163-text-soft); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

/* === CARD GRID === */
.t-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .t-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .t-grid--3 { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

.t-card {
	display: flex; flex-direction: column;
	padding: 24px;
	background: #fff;
	border: 1px solid var(--t163-border);
	border-radius: var(--t163-radius);
	height: 100%;
	text-decoration: none !important;
	color: inherit;
	transition: border-color var(--t163-transition);
}
@media (hover: hover) and (pointer: fine) {
	.t-card:hover { border-color: var(--t163-primary); }
}
.t-card__icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--t163-cta); margin-bottom: 16px; }
.t-card__title { font-weight: 700; font-size: 18px; line-height: 1.3; color: var(--t163-primary); margin: 0 0 8px; }
.t-card__desc { font-size: 14px; color: var(--t163-text-soft); margin: 0 0 16px; flex-grow: 1; }
.t-card__link { font-weight: 700; font-size: 14px; color: var(--t163-secondary); margin-top: auto; }
@media (hover: hover) and (pointer: fine) { .t-card:hover .t-card__link { color: var(--t163-cta); } }

/* === Hero with form/info two-col === */
.t-twocol { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .t-twocol { grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; } }

/* === SERVICE CONTENT (the inner pages) === */
.t-service-hero {
	background: linear-gradient(180deg, var(--t163-primary) 0%, var(--t163-primary-700) 100%);
	color: #fff;
	padding: 40px 0 56px;
}
@media (min-width: 768px) { .t-service-hero { padding: 64px 0 80px; } }
.t-service-hero h1 { color: #fff; font-size: clamp(24px, 4vw, 38px); max-width: 32ch; margin: 0 0 16px; }
.t-service-hero__crumb { font-size: 13px; color: rgba(255,255,255,0.6); margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.t-service-hero__crumb a { color: rgba(255,255,255,0.75) !important; text-decoration: none; }
.t-service-hero__lead { color: rgba(255,255,255,0.85); font-size: 16px; line-height: 1.55; margin: 0 0 24px; max-width: 64ch; }
@media (min-width: 768px) { .t-service-hero__lead { font-size: 17px; } }

.t-prose {
	max-width: 75ch;
	font-size: 16px;
	line-height: 1.7;
	color: var(--t163-text);
}
.t-prose p { margin: 0 0 1em; }
.t-prose h2 {
	font-size: 22px;
	line-height: 1.3;
	margin: 2.2em 0 0.8em;
	padding-top: 1.2em;
	border-top: 1px solid var(--t163-border);
	position: relative;
}
.t-prose h2::before {
	content: "";
	position: absolute;
	top: -1px; left: 0;
	width: 48px; height: 3px;
	background: var(--t163-cta);
}
.t-prose h3 { font-size: 18px; margin-top: 1.6em; }
.t-prose ul, .t-prose ol { padding-left: 1.4em; }
.t-prose ul li, .t-prose ol li { margin-bottom: 0.5em; }
.t-prose img { margin: 24px 0; border-radius: var(--t163-radius); }
.t-prose a { color: var(--t163-secondary); }

/* Нумерованный список — таймлайн этапов работ */
.t-prose ol {
	list-style: none;
	padding-left: 0;
	counter-reset: t-step;
	margin: 24px 0;
}
.t-prose ol > li {
	counter-increment: t-step;
	position: relative;
	padding: 4px 0 4px 52px;
	margin-bottom: 12px;
	min-height: 36px;
}
.t-prose ol > li::before {
	content: counter(t-step);
	position: absolute;
	left: 0; top: 0;
	width: 36px; height: 36px;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--t163-primary);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	border-radius: 50%;
	font-variant-numeric: tabular-nums;
}

/* Бейдж для нормативки (ФЗ/ГОСТ/СП/СНиП/Постановление) */
.t-law {
	display: inline;
	padding: 1px 6px;
	background: rgba(234, 88, 12, 0.08);
	color: var(--t163-cta);
	border-radius: 4px;
	font-weight: 600;
	font-size: 0.92em;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

.t-aside-card {
	background: var(--t163-bg-soft);
	border: 1px solid var(--t163-border);
	border-radius: var(--t163-radius);
	padding: 24px;
}
.t-aside-card h3 { margin-top: 0; font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--t163-text-soft); font-weight: 700; }
.t-aside-card dl { margin: 0; font-size: 14px; line-height: 1.7; }
.t-aside-card dt { font-weight: 600; color: var(--t163-text-soft); margin-top: 8px; }
.t-aside-card dd { margin: 0; }

/* === FOOTER === */
.t-footer { background: var(--t163-bg-dark); color: #cbd5e1; padding: 48px 0 24px; }
.t-footer__grid {
	display: grid; gap: 32px;
	grid-template-columns: 1fr;
}
@media (min-width: 768px) { .t-footer__grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; } }
.t-footer__col h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 16px; }
.t-footer__col ul { list-style: none; padding: 0; margin: 0; }
.t-footer__col li { margin: 0 0 10px; }
.t-footer__col a { color: #cbd5e1 !important; text-decoration: none; font-size: 14px; }
.t-footer__col a:hover { color: var(--t163-cta) !important; }
.t-footer__brand { font-weight: 800; font-size: 22px; color: #fff; margin: 0 0 12px; }
.t-footer__about { font-size: 14px; color: #94a3b8; line-height: 1.6; }
.t-footer__bottom {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid rgba(255,255,255,0.1);
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: space-between;
	font-size: 13px;
	color: #94a3b8;
}
.t-footer__bottom a { color: #94a3b8 !important; text-decoration: none; }
.t-footer__bottom a:hover { color: #fff !important; }

/* === STICKY EMERGENCY (mobile only) === */
.t-sticky-emergency {
	position: fixed; left: 0; right: 0; bottom: 0;
	z-index: 9990;
	display: flex;
	background: var(--t163-emergency);
	color: #fff !important;
	font-weight: 700;
	text-align: center;
	padding: 14px 16px;
	text-decoration: none !important;
	justify-content: center;
	align-items: center;
	gap: 8px;
	font-size: 15px;
}
@media (min-width: 768px) { .t-sticky-emergency { display: none !important; } }
@media (max-width: 767.98px) { body.has-sticky-emergency { padding-bottom: 56px; } }

/* === LIGHTBOX === */
.t-lightbox {
	position: fixed; inset: 0;
	z-index: 10000;
	background: rgba(15, 23, 42, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.t-lightbox.is-open { display: flex; }
.t-lightbox__img {
	display: block !important;
	width: auto !important;
	height: auto !important;
	max-width: min(95vw, 1800px) !important;
	max-height: 90vh !important;
	min-width: 60vw;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
@media (max-width: 768px) {
	.t-lightbox__img { min-width: 90vw; }
}
.t-lightbox__close,
.t-lightbox__prev,
.t-lightbox__next {
	position: absolute;
	background: rgba(255,255,255,0.1);
	border: 1px solid rgba(255,255,255,0.2);
	color: #fff;
	width: 44px; height: 44px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	display: flex; align-items: center; justify-content: center;
	transition: background var(--t163-transition);
}
@media (hover: hover) and (pointer: fine) {
	.t-lightbox__close:hover,
	.t-lightbox__prev:hover,
	.t-lightbox__next:hover { background: rgba(255,255,255,0.25); }
}
.t-lightbox__close { top: 16px; right: 16px; font-size: 28px; }
.t-lightbox__prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.t-lightbox__next  { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 480px) {
	.t-lightbox__prev { left: 8px; }
	.t-lightbox__next { right: 8px; }
}

/* === CF7 validation feedback === */
.wpcf7-response-output { margin-top: 1em !important; padding: 10px 14px !important; border-radius: 4px !important; font-size: 14px; }
.wpcf7-response-output:empty,
.wpcf7-response-output[aria-hidden="true"] { display: none !important; }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output { border: 1px solid #ffb900 !important; background: #fff8e1; color: #5d4a00; }
.wpcf7 form.sent .wpcf7-response-output { border: 1px solid #46b450 !important; background: #f0fff0; color: #1d5a23; }
.wpcf7 form.failed .wpcf7-response-output { border: 1px solid #dc3232 !important; background: #fff0f0; color: #7a1a1a; }
.wpcf7-not-valid-tip { color: #dc3232; font-size: 13px; margin-top: 4px; }

/* Согласие на ПД под кнопкой формы 1-клика */
.t-consent { font-size: 12px; color: var(--t163-text-soft); margin-top: 12px; line-height: 1.4; }
.t-consent a { color: var(--t163-secondary); text-decoration: underline; }

/* Кнопка submit в CF7-форме «Оформить заявку» (1-клик каталог) */
.wpcf7-form input[type="submit"],
.awooc-custom-order-wrap .wpcf7-form input[type="submit"] {
	background: var(--t163-cta) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 4px !important;
	padding: 14px 24px !important;
	font-weight: 700 !important;
	font-size: 15px !important;
	width: 100% !important;
	cursor: pointer;
	transition: background var(--t163-transition);
	text-transform: none;
	box-shadow: none;
	min-height: 48px;
}
@media (hover: hover) and (pointer: fine) {
	.wpcf7-form input[type="submit"]:hover,
	.awooc-custom-order-wrap .wpcf7-form input[type="submit"]:hover {
		background: #d94e0a !important;
	}
}
.wpcf7-form input[type="submit"]:disabled {
	opacity: 0.6;
	cursor: wait;
}
/* Поля формы 1-клика — крупнее на мобиле, легче читать */
.awooc-custom-order-wrap .wpcf7-form input[type="text"],
.awooc-custom-order-wrap .wpcf7-form input[type="tel"],
.awooc-custom-order-wrap .wpcf7-form input[type="email"] {
	padding: 14px 14px !important;
	font-size: 16px !important;
	min-height: 48px;
	border-radius: 4px;
}

/* Скролл-якорь не должен прятаться под sticky-шапкой */
.t-prose [id], .t-prose h2[id], .t-prose h3[id] { scroll-margin-top: 96px; }

/* === GLOBAL MODAL (CF7 success/error) === */
.t-modal {
	position: fixed; inset: 0;
	z-index: 11000;
	background: rgba(15, 23, 42, 0.6);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity .2s ease;
}
.t-modal.is-open { display: flex; opacity: 1; }
.t-modal__box {
	background: #fff;
	width: 100%;
	max-width: 420px;
	border-radius: 8px;
	padding: 28px 24px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
	position: relative;
	transform: scale(0.95);
	transition: transform .2s ease;
}
.t-modal.is-open .t-modal__box { transform: scale(1); }
.t-modal__close {
	position: absolute; top: 8px; right: 8px;
	width: 36px; height: 36px;
	background: transparent; border: 0;
	font-size: 28px; line-height: 1;
	color: var(--t163-text-soft);
	cursor: pointer;
}
.t-modal__icon {
	width: 56px; height: 56px;
	margin: 0 auto 12px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 50%;
	font-size: 32px;
	font-weight: 700;
	color: #fff;
	line-height: 1;
}
.t-modal--ok   .t-modal__icon { background: #16a34a; }
.t-modal--err  .t-modal__icon { background: #dc2626; }
.t-modal--warn .t-modal__icon { background: #f59e0b; }
.t-modal__title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	color: var(--t163-primary);
}
.t-modal__text {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--t163-text);
}
.t-modal__btn {
	background: var(--t163-cta);
	color: #fff;
	border: 0;
	padding: 12px 32px;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	min-width: 140px;
}
@media (hover: hover) and (pointer: fine) {
	.t-modal__btn:hover { background: var(--t163-cta-hover, #d94e0a); }
}
@media (max-width: 480px) {
	.t-modal__box { padding: 24px 20px; }
	.t-modal__title { font-size: 18px; }
	.t-modal__text { font-size: 14px; }
}

/* === FORMS (used for CF7) === */
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="search"],
input[type="number"], textarea, select {
	width: 100%; box-sizing: border-box;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 15px;
	background: #fff;
	color: var(--t163-text);
	border: 1px solid var(--t163-border-strong);
	border-radius: var(--t163-radius);
	transition: border-color var(--t163-transition);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--t163-secondary); }

/* === Image grids in content (services, cases, gallery) === */
.t-img-grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	margin: 24px 0;
}
@media (min-width: 768px) { .t-img-grid { gap: 16px; } }
.t-img-grid img {
	width: 100% !important;
	height: 220px !important;
	max-height: 260px;
	object-fit: cover;
	border-radius: var(--t163-radius);
	margin: 0 !important;
	display: block;
	background: var(--t163-bg-soft);
}

.t-img-single {
	margin: 24px 0;
	text-align: center;
}
.t-img-single img {
	max-width: 100%;
	height: auto;
	border-radius: var(--t163-radius);
	display: inline-block;
	margin: 0 auto;
}

/* Контент проза: одиночные img без обёртки тоже выглядят чисто */
.t-prose img {
	max-width: 100%;
	height: auto;
	border-radius: var(--t163-radius);
	margin: 24px 0;
}

/* Большая галерея — отдельный шаблон */
.t-photo-grid {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 480px) { .t-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 768px) { .t-photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .t-photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .t-photo-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.t-photo-grid__item {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--t163-radius);
	background: var(--t163-bg-soft);
	border: 1px solid var(--t163-border);
	min-width: 0;
	position: relative;
}
.t-photo-grid__item img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover;
	transition: transform 300ms ease-out;
	margin: 0 !important;
	border-radius: 0;
	display: block;
}
@media (hover: hover) and (pointer: fine) {
	.t-photo-grid__item:hover img { transform: scale(1.05); }
}

/* === Gallery content (page-gallery) === */
.t-gallery-content {
	max-width: var(--t163-container-max);
	margin: 0 auto;
}
.t-gallery-content h2, .t-gallery-content h3, .t-gallery-content h4, .t-gallery-content h5, .t-gallery-content h6 {
	margin-top: 48px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--t163-border);
	font-size: 22px;
	font-weight: 700;
	color: var(--t163-primary);
}
.t-gallery-content h2:first-child,
.t-gallery-content h3:first-child,
.t-gallery-content h4:first-child { margin-top: 0; }
@media (min-width: 768px) {
	.t-gallery-content h2, .t-gallery-content h3, .t-gallery-content h4 { font-size: 24px; }
}
.t-gallery-content p {
	color: var(--t163-text-soft);
	margin-bottom: 16px;
	max-width: 75ch;
}
.t-gallery-content > p:empty { display: none; }
.t-gallery-content .t-img-grid {
	margin: 16px 0 32px;
}

/* === WooCommerce minimal overrides === */
.woocommerce ul.products li.product { background: #fff; border: 1px solid var(--t163-border); border-radius: var(--t163-radius); padding: 16px; }
.woocommerce ul.products li.product .price { color: var(--t163-primary); font-weight: 700; }
.woocommerce-page .woocommerce-message,
.woocommerce-page .woocommerce-info { border-top-color: var(--t163-cta); background: var(--t163-bg-soft); }
.woocommerce a.button,
.woocommerce button.button,
.woocommerce-page button.button,
.woocommerce input.button {
	background: var(--t163-cta) !important;
	color: #fff !important;
	border-radius: var(--t163-radius);
	padding: 12px 22px;
}

/* === Utility === */
.t-mb-0 { margin-bottom: 0 !important; }
.t-mb-1 { margin-bottom: 8px; }
.t-mb-2 { margin-bottom: 16px; }
.t-mb-3 { margin-bottom: 24px; }
.t-mb-4 { margin-bottom: 32px; }
.t-mt-1 { margin-top: 8px; }
.t-mt-2 { margin-top: 16px; }
.t-mt-3 { margin-top: 24px; }
.t-mt-4 { margin-top: 32px; }
.t-text-center { text-align: center; }
.t-text-soft { color: var(--t163-text-soft); }

/* === Accessibility === */
:focus-visible { outline: 2px solid var(--t163-cta); outline-offset: 2px; }
.t-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
	html { scroll-behavior: auto; }
}
