/* =========================================================================
   Каркас: шапка, навигация, подвал, страницы.
   ========================================================================= */

.at-site { display: flex; flex-direction: column; min-height: 100vh; }
.at-main { flex: 1; padding-block: var(--at-space-md) var(--at-space-2xl); }
.home .at-main { padding-top: 0; }

/* ============================= шапка =================================== */
.at-topbar {
	background: var(--at-accent-dark);
	color: var(--at-surface);
	font-size: var(--at-size-2xs);
	font-family: var(--at-font-ui);
}
.at-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--at-space-sm);
	min-height: 34px;
	padding-block: 6px;
}
.at-topbar__message,
.at-topbar__links { display: flex; align-items: center; gap: 8px; }
.at-topbar__message .at-ico { width: 16px; height: 16px; color: var(--at-accent); }
.at-topbar a { color: inherit; text-decoration: none; }
.at-topbar a:hover { text-decoration: underline; }
.at-topbar__links { gap: var(--at-space-sm); flex-wrap: wrap; }
.at-topbar__offer { color: var(--at-accent); font-weight: 700; }
.at-topbar__menu { display: flex; gap: var(--at-space-sm); flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }

.at-header-shell {
	position: sticky;
	top: 0;
	z-index: 80;
	background: var(--at-surface);
}

.at-header {
	background: var(--at-surface);
	border-bottom: 1px solid var(--at-border-soft);
}
.at-header__inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--at-space-md);
	padding-block: 13px;
}
.at-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--at-ink); text-decoration: none; }
.at-logo:hover { text-decoration: none; color: var(--at-ink); }
.at-logo img { max-height: 58px; width: auto; }
.at-logo__text { font-weight: 700; font-size: var(--at-size-h4); line-height: 1.1; }
.at-logo__tagline { display: block; font-size: var(--at-size-2xs); font-weight: 400; color: var(--at-ink-soft); }

.at-search { display: flex; gap: var(--at-space-2xs); width: 100%; max-width: 560px; }
.at-search__field { flex: 1; min-width: 0; }
.at-search .at-btn { width: 46px; padding-inline: 0; flex: none; }

.at-header__tools { display: flex; align-items: center; gap: var(--at-space-sm); }
.at-tool {
	display: inline-flex;
	align-items: center;
	gap: var(--at-space-2xs);
	color: var(--at-ink);
	text-decoration: none;
	font-size: var(--at-size-sm);
	font-weight: 600;
}
.at-tool:hover { color: var(--at-accent-dark); text-decoration: none; }
.at-tool .at-ico { width: 22px; height: 22px; }
.at-tool__phone { font-size: 19px; font-weight: 700; }
.at-tool__hours { display: block; font-size: var(--at-size-2xs); font-weight: 400; color: var(--at-ink-soft); }
.at-tool--cart { position: relative; }
.at-tool--cart .at-badge { position: absolute; top: -6px; left: 14px; }

.at-burger { display: none; }

/* ---------- навигация каталога ---------- */
.at-nav { background: var(--at-surface); border-bottom: 1px solid var(--at-border-soft); }
.at-nav__list {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: clamp(20px, 3.1vw, 46px);
	margin: 0;
	padding: 0;
	list-style: none;
}
.at-nav__mobile-search { display: none; }
.at-nav__list > li { position: relative; }
.at-nav__list a {
	display: block;
	padding: var(--at-space-xs) 0;
	color: var(--at-ink);
	font-family: var(--at-font-ui);
	font-size: var(--at-size-sm);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.at-nav__list a:hover,
.at-nav__list .current-menu-item > a { color: var(--at-accent-dark); }

/* подменю — всплывает, поэтому тень уместна */
.at-nav__list ul {
	position: absolute;
	z-index: 30;
	top: 100%;
	left: -12px;
	min-width: 240px;
	margin: 0;
	padding: var(--at-space-2xs) 0;
	list-style: none;
	background: var(--at-surface);
	border: 1px solid var(--at-border-soft);
	border-radius: var(--at-radius);
	box-shadow: var(--at-shadow);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--at-ease), visibility var(--at-ease);
}
.at-nav__list li:hover > ul,
.at-nav__list li:focus-within > ul { opacity: 1; visibility: visible; }
.at-nav__list ul a { padding: var(--at-space-2xs) var(--at-space-sm); white-space: normal; }
.at-nav__list ul a:hover { background: var(--at-accent-soft); }
.at-nav__list .menu-item-has-children > a::after {
	content: '';
	display: inline-block;
	width: 6px; height: 6px;
	margin-left: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}

/* ============================= страницы ================================ */
.at-page__header { margin-bottom: var(--at-space-md); }
.at-page__title { margin-bottom: var(--at-space-2xs); }
.at-page__lead { color: var(--at-ink-soft); font-size: var(--at-size-h4); max-width: 68ch; }

.at-breadcrumbs {
	margin-bottom: var(--at-space-sm);
	font-size: var(--at-size-xs);
	color: var(--at-ink-soft);
}
.at-breadcrumbs a { color: var(--at-ink-soft); }
.at-breadcrumbs a:hover { color: var(--at-accent-dark); }

.at-entry { background: var(--at-surface); border: 1px solid var(--at-border-soft); border-radius: var(--at-radius); padding: var(--at-space-md); }
.at-entry__content > * + * { margin-top: var(--at-space-sm); }

/* Резервная карточная лента для типов без отдельного архива. */
.at-postlist { display: grid; gap: var(--at-space-md); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.at-post {
	display: flex;
	flex-direction: column;
	background: var(--at-surface);
	border: 1px solid var(--at-border-soft);
	border-radius: var(--at-radius);
	overflow: hidden;
}
.at-post__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.at-post__body { padding: var(--at-space-sm); display: flex; flex-direction: column; gap: var(--at-space-2xs); flex: 1; }
.at-post__title { font-size: var(--at-size-h4); margin: 0; }
.at-post__title a { color: var(--at-ink); }
.at-post__title a:hover { color: var(--at-accent-dark); text-decoration: none; }
.at-post__meta { font-size: var(--at-size-2xs); color: var(--at-ink-soft); }
.at-post__excerpt { font-size: var(--at-size-sm); color: var(--at-ink-body); }

.at-article-shell { max-width: 1120px; padding-block: var(--at-space-md) var(--at-space-2xl); }
.at-article-hero { max-width: 900px; margin: 8px auto clamp(30px, 5vw, 58px); text-align: center; }
.at-article-hero h1 { margin-bottom: 18px; font-size: clamp(38px, 5.4vw, 66px); line-height: 1.04; }
.at-article-hero__lead { max-width: 64ch; margin-inline: auto; color: var(--at-ink-soft); font-size: 19px; }
.at-article__media { margin: 0 0 clamp(30px, 5vw, 56px); overflow: hidden; border-radius: var(--at-radius-lg); background: var(--at-surface); }
.at-article__media img { width: 100%; max-height: 680px; object-fit: cover; }
.at-article__content { margin-inline: auto; padding: clamp(24px, 5vw, 58px); background: var(--at-surface); border: 1px solid var(--at-border-soft); border-radius: var(--at-radius-lg); font-size: 17px; }
.at-article__content :where(h2, h3) { margin-top: 1.6em; }
.at-article__content > :first-child { margin-top: 0; }
.at-post-navigation { max-width: 760px; margin: var(--at-space-md) auto 0; }
.at-post-navigation .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--at-space-sm); }
.at-post-navigation a { display: block; height: 100%; padding: 16px; background: var(--at-surface); border: 1px solid var(--at-border-soft); border-radius: var(--at-radius); color: var(--at-ink); }
.at-post-navigation a:hover { border-color: var(--at-accent); color: var(--at-accent-dark); text-decoration: none; }

.at-empty-state { display: grid; min-height: min(680px, 70vh); place-items: center; padding-block: var(--at-space-xl); }
.at-empty-state__card { width: min(100%, 720px); padding: clamp(28px, 6vw, 72px); background: var(--at-surface); border: 1px solid var(--at-border-soft); border-radius: var(--at-radius-lg); text-align: center; }
.at-empty-state__code { margin: 0; color: var(--at-accent); font-size: clamp(70px, 12vw, 140px); font-weight: 800; line-height: .9; }
.at-empty-state__card > p:not(.at-empty-state__code) { max-width: 54ch; margin-inline: auto; color: var(--at-ink-soft); }
.at-empty-state__search { width: min(100%, 520px); margin: 24px auto; }
.at-empty-state .at-action-row { justify-content: center; }

.at-pagination { margin-top: var(--at-space-lg); display: flex; gap: var(--at-space-2xs); flex-wrap: wrap; }
.at-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px; height: 38px;
	padding-inline: 10px;
	border: 1px solid var(--at-border-soft);
	border-radius: var(--at-radius);
	background: var(--at-surface);
	color: var(--at-ink);
	font-weight: 600;
	text-decoration: none;
}
.at-pagination .page-numbers:hover { border-color: var(--at-accent); color: var(--at-accent-dark); }
.at-pagination .page-numbers.current { background: var(--at-accent); border-color: var(--at-accent); color: var(--at-ink-on-accent); }

/* ============================= подвал ================================== */
.at-footer {
	background: var(--at-accent-dark);
	color: var(--at-surface);
	padding-block: var(--at-space-xl) var(--at-space-md);
	margin-top: var(--at-space-2xl);
}
.at-footer__trust {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
	margin-bottom: var(--at-space-xl);
	padding-bottom: var(--at-space-lg);
	border-bottom: 1px solid rgba(255, 255, 255, .18);
}
.at-footer__trust > div { display: flex; gap: 14px; padding: 4px clamp(12px, 2.5vw, 34px); }
.at-footer__trust > div + div { border-left: 1px solid rgba(255, 255, 255, .18); }
.at-footer__trust .at-ico { width: 26px; height: 26px; color: var(--at-accent); }
.at-footer__trust span,
.at-footer__trust strong { display: block; }
.at-footer__trust span { color: rgba(255, 255, 255, .7); font-size: var(--at-size-xs); }
.at-footer__trust strong { margin-bottom: 3px; color: var(--at-surface); font-size: var(--at-size-sm); }
.at-footer a { color: var(--at-surface); }
.at-footer a:hover { color: var(--at-accent); text-decoration: none; }
.at-footer__cols {
	display: grid;
	grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 1fr));
	gap: var(--at-space-lg);
}
.at-footer__coltitle {
	margin: 0 0 var(--at-space-xs);
	color: var(--at-surface);
	font-size: var(--at-size-sm);
	font-family: var(--at-font-ui);
	letter-spacing: .04em;
	text-transform: uppercase;
}
.at-footer__menu { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--at-space-2xs); font-size: var(--at-size-sm); }
.at-footer__contact { display: grid; gap: var(--at-space-2xs); font-size: var(--at-size-sm); }
.at-footer__contact .at-logo { width: fit-content; color: var(--at-surface); }
.at-footer__contact .at-logo__tagline { color: rgba(255, 255, 255, .68); }
.at-footer__contact .at-logo img { max-width: 180px; max-height: 58px; filter: brightness(0) invert(1); }
.at-footer__contact p { max-width: 34ch; color: rgba(255, 255, 255, .78); }
.at-footer__phone { font-size: 21px; font-weight: 700; }
.at-footer__socials { display: flex; gap: 14px; margin-top: 4px; }
.at-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	gap: var(--at-space-sm);
	justify-content: space-between;
	margin-top: var(--at-space-lg);
	padding-top: var(--at-space-sm);
	border-top: 1px solid rgba(255, 255, 255, .18);
	font-size: var(--at-size-2xs);
	color: rgba(255, 255, 255, .75);
}

/* ============================= адаптив ================================= */
@media (max-width: 991px) {
	.at-header-shell { position: relative; }
	.at-header__inner { grid-template-columns: auto 1fr auto; gap: var(--at-space-sm); }
	.at-search { display: none; }
	.at-tool__label, .at-tool__hours { display: none; }
	.at-burger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px; height: 40px;
		padding: 0;
		border: 0;
		border-radius: var(--at-radius);
		background: transparent;
		color: var(--at-ink);
		cursor: pointer;
	}
	.at-nav__list {
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding-block: var(--at-space-2xs);
	}
	.at-nav__mobile-search { display: block; padding-block: var(--at-space-xs); }
	.at-nav__mobile-search .at-search { display: flex; max-width: none; }
	.at-topbar__offer { display: none; }
	.at-nav__list.is-open { display: flex; }
	.at-nav__list > li { border-bottom: 1px solid var(--at-border-soft); }
	.at-nav__list ul {
		position: static;
		opacity: 1;
		visibility: visible;
		border: 0;
		box-shadow: none;
		padding-left: var(--at-space-sm);
	}
	.at-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.at-postlist { grid-template-columns: 1fr; }
	.at-post-navigation .nav-links { grid-template-columns: 1fr; }
	.at-topbar__inner { justify-content: center; }
	.at-topbar__links { display: none; }
	.at-footer__trust { grid-template-columns: 1fr; }
	.at-footer__trust > div { padding-block: 14px; }
	.at-footer__trust > div + div { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .18); }
}

@media (max-width: 450px) {
	.at-footer__cols { grid-template-columns: 1fr; }
	.at-topbar__offer { display: none; }
	.at-tool__phone { display: none; }
}
