﻿/* ==========================================================================
   Техномаг — дополнения темы.
   WordPress-структура, каталог, страница товара, адаптивность,
   поддержка настроек оформления и новые интерфейсные элементы.
   ========================================================================== */

/* ---------- База WordPress ---------- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--bg);
	clip: auto !important;
	clip-path: none;
	color: var(--ink);
	display: block;
	font-size: 14px;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

body.admin-bar .header {
	top: 32px;
}

body.admin-bar .mobile-menu {
	padding-top: calc(32px + var(--header-h) + 24px);
}

@media (max-width: 782px) {
	body.admin-bar .header {
		top: 46px;
	}

	body.admin-bar .mobile-menu {
		padding-top: calc(46px + var(--header-h) + 24px);
	}
}

/* Логотипы для светлой и тёмной темы */
.logo {
	display: inline-flex;
	align-items: center;
}

.logo img {
	display: block;
}

.logo__img--for-light,
.logo__img--for-dark {
	display: none !important;
}

html[data-theme="light"] .logo__img--for-light,
html[data-theme="dark"] .logo__img--for-dark {
	display: block !important;
}

/* Контраст текста на акцентных плашках */
::selection {
	color: var(--on-accent);
}

.btn--accent,
.section-head__index span,
.hero__mark,
.ticker,
.skip-link,
.mobile-bar__btn--accent {
	color: var(--on-accent);
}

.btn--accent:hover {
	color: var(--ink-fixed);
}

html[data-theme="light"] .btn--ghost:hover {
	color: var(--on-accent);
}

html[data-theme="light"] .hero__facts b,
html[data-theme="light"] .why__num,
html[data-theme="light"] .mobile-menu__link span {
	color: var(--on-accent);
}

/* Иконки преимуществ */
.why__icon {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	margin-bottom: 10px;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: var(--bg);
	overflow: hidden;
}

.why__icon img {
	max-width: 26px;
	max-height: 26px;
	object-fit: contain;
}

/* ---------- CTA: темы и фоновое изображение ---------- */
.cta--accent {
	background: var(--yellow);
	color: var(--on-accent);
}

.cta--accent .cta__kicker {
	color: color-mix(in srgb, var(--on-accent) 62%, transparent);
}

.cta--accent .cta__lead {
	color: color-mix(in srgb, var(--on-accent) 74%, transparent);
}

.cta--accent .cta__title span {
	background: var(--ink-fixed);
	color: var(--yellow);
}

.cta--accent .btn--dark {
	background: var(--on-accent);
	color: var(--on-accent-inverse);
}

.cta--accent .btn--dark-outline {
	border-color: color-mix(in srgb, var(--on-accent) 35%, transparent);
	color: var(--on-accent);
}

.cta--accent .btn--dark-outline:hover {
	background: color-mix(in srgb, var(--on-accent) 8%, transparent);
}

.cta--dark {
	background: #0a0a09;
	color: #f4f4ef;
}

.cta--dark::before {
	background-image: linear-gradient(to right, rgba(255, 255, 255, .06) 1px, transparent 1px);
}

.cta--dark .cta__kicker {
	color: rgba(244, 244, 239, .58);
}

.cta--dark .cta__lead {
	color: rgba(244, 244, 239, .72);
}

.cta--dark .cta__title span {
	background: var(--yellow);
	color: var(--on-accent);
}

.cta--dark .btn--dark {
	background: var(--yellow);
	color: var(--on-accent);
}

.cta--dark .btn--dark-outline {
	border-color: rgba(244, 244, 239, .35);
	color: #f4f4ef;
}

.cta--dark .btn--dark-outline:hover {
	background: rgba(255, 255, 255, .1);
}

.cta--dark .cta__badge {
	background: var(--yellow);
	color: var(--on-accent);
}

.cta--light {
	background: #f5f5f1;
	color: #0a0a09;
}

.cta--light::before {
	background-image: linear-gradient(to right, rgba(10, 10, 9, .07) 1px, transparent 1px);
}

.cta--light .cta__kicker {
	color: rgba(10, 10, 9, .58);
}

.cta--light .cta__lead {
	color: rgba(10, 10, 9, .72);
}

.cta--light .cta__title span {
	background: var(--ink-fixed);
	color: var(--yellow);
}

.cta--has-bg {
	background: #0a0a09;
	color: #f4f4ef;
	isolation: isolate;
}

.cta__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	opacity: .48;
	z-index: -2;
}

.cta--has-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(10, 10, 9, .88) 0%, rgba(10, 10, 9, .48) 60%, rgba(10, 10, 9, .55) 100%),
		linear-gradient(0deg, rgba(10, 10, 9, .35), rgba(10, 10, 9, .35));
	z-index: -1;
	pointer-events: none;
}

.cta--has-bg::before {
	z-index: 1;
	background-image: linear-gradient(to right, rgba(255, 255, 255, .07) 1px, transparent 1px);
}

.cta--has-bg .cta__inner {
	z-index: 2;
}

.cta--has-bg .cta__kicker {
	color: rgba(244, 244, 239, .62);
}

.cta--has-bg .cta__lead {
	color: rgba(244, 244, 239, .78);
}

.cta--has-bg .cta__title span {
	background: var(--yellow);
	color: var(--on-accent);
}

.cta--has-bg .btn--dark {
	background: var(--yellow);
	color: var(--on-accent);
}

.cta--has-bg .btn--dark-outline {
	border-color: rgba(244, 244, 239, .4);
	color: #f4f4ef;
}

.cta--has-bg .btn--dark-outline:hover {
	background: rgba(255, 255, 255, .12);
}

.cta--has-bg .cta__badge {
	background: var(--yellow);
	color: var(--on-accent);
}

/* ---------- Подвал и социальные сети ---------- */
.footer__social,
.contact-social {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

.footer__social-link {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 50%;
	color: #d9d9d1;
	transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}

.footer__social-link:hover {
	background: var(--yellow);
	border-color: var(--yellow);
	color: var(--on-accent);
	transform: translateY(-2px);
}

.social-icon {
	display: block;
	fill: currentColor;
}

.contact-social {
	gap: 12px;
	margin-top: 4px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
}

.contact-social__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ink-2);
	transition: color .2s var(--ease);
}

.contact-social__link:hover {
	color: var(--yellow);
}

html[data-theme="light"] .contact-social__link:hover {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--yellow);
}

.footer__contacts a,
.footer__contacts p {
	overflow-wrap: anywhere;
}

/* ---------- Главная: состояние без изображения ---------- */
.hero__inner--text-only {
	grid-template-columns: 1fr;
}

.hero__inner--text-only .hero__lead {
	max-width: 60ch;
}

/* ---------- Контакты ---------- */
.contacts--no-map {
	grid-template-columns: minmax(0, 1fr);
	max-width: 760px;
}

.contacts__extra {
	margin-top: 26px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
	color: var(--ink-2);
	font-size: 13.5px;
	max-width: 76ch;
}

.contacts__map-placeholder {
	width: 100%;
	height: clamp(320px, 34vw, 470px);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background:
		radial-gradient(circle at 50% 35%, rgba(var(--yellow-rgb), .13), transparent 55%),
		var(--bg-2);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	padding: 24px;
	color: var(--ink-2);
}

.contacts__map-placeholder strong {
	font-family: var(--font-display);
	font-size: clamp(20px, 2vw, 26px);
	text-transform: uppercase;
	color: var(--ink);
	line-height: 1.2;
}

.contacts__map-placeholder p {
	font-size: 12.5px;
	max-width: 36ch;
}

.contacts__map-pin {
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: var(--yellow);
	color: var(--on-accent);
	margin-bottom: 6px;
}

/* Служебная подсказка для администратора */
.tm-editor-empty {
	margin: 24px 0;
	padding: 14px 18px;
	border: 1px dashed rgba(var(--yellow-rgb), .55);
	border-radius: var(--radius);
	background: rgba(var(--yellow-rgb), .07);
	color: var(--ink-2);
	font-size: 13px;
}

.tm-editor-empty a {
	color: var(--yellow);
	text-decoration: underline;
}

/* ---------- Служебное ---------- *//* ---------- Адаптивность новых блоков ---------- */
@media (max-width: 1024px) {
	.bento--auto {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-areas: none;
	}

	.catalog-hero__inner {
		grid-template-columns: 1fr;
	}

	.catalog-hero__media {
		min-height: 180px;
		justify-content: flex-start;
	}

	.catalog-hero__media img {
		max-height: 180px;
	}

	.product {
		grid-template-columns: 1fr;
	}

	.product-gallery__main {
		min-height: clamp(300px, 55vw, 500px);
	}

	.product-details {
		grid-template-columns: 1fr;
	}

	.catalog-grid .tv-card:nth-child(3) {
		grid-column: auto;
	}

	.catalog-grid .tv-card:nth-child(3) .tv-card__media {
		aspect-ratio: 4 / 3;
	}
}

@media (max-width: 860px) {
	.cta__bg {
		opacity: .36;
	}

	.product-info__title {
		font-size: clamp(30px, 7vw, 46px);
	}

	.post-card {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 700px) {
	.bento--auto {
		grid-template-columns: 1fr;
		grid-template-areas: none;
	}

	.bento--auto .bento__item,
	.bento--auto .bento__item:first-child {
		grid-column: auto;
		min-height: 210px;
	}

	.bento--auto .bento__item .bento__media,
	.bento--auto .bento__item:first-child .bento__media {
		right: -6%;
		bottom: -8%;
		width: 48%;
		height: 94%;
	}

	.bento--auto .bento__title,
	.bento--auto .bento__text,
	.bento--auto .bento__item:first-child .bento__title,
	.bento--auto .bento__item:nth-child(2) .bento__title {
		max-width: 62%;
	}

	.catalog-nav {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		padding-bottom: 4px;
	}

	.catalog-nav::-webkit-scrollbar {
		display: none;
	}

	.catalog-nav__item {
		flex: none;
	}

	.product-info__meta {
		grid-template-columns: 1fr;
	}

	.product-specs > div {
		grid-template-columns: 1fr;
		gap: 4px;
	}

	.product-gallery__thumb {
		width: 62px;
		height: 62px;
	}

	.contacts__map-placeholder {
		height: 340px;
	}

	.cta__bg {
		opacity: .3;
	}

	.simple-page__head h1 {
		font-size: clamp(30px, 9vw, 42px);
	}
}

@media (max-width: 420px) {
	.product-info__actions .btn,
	.catalog-empty__actions .btn,
	.error-404__actions .btn {
		flex: 1 1 100%;
	}
}

/* Уважаем настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
	.cta__bg,
	.product-gallery__main img {
		animation: none;
	}
}