/**
 * Magaz — общие стили поверх Storefront (для всех дизайнов).
 * Дизайн-специфичные стили — в assets/css/designs/{slug}.css.
 */

:root {
	--magaz-radius: 4px;
	--magaz-gap: 1.5rem;
	--magaz-muted: rgba(0, 0, 0, 0.55);
	--magaz-line: rgba(0, 0, 0, 0.1);
	--magaz-surface: #fff;
}

/* ---------- Шапка: телефон ---------- */
.magaz-header-contacts {
	display: none;
}

@media (min-width: 768px) {
	/* Сетка шапки: логотип слева, справа сверху — доп. меню, снизу — телефон и поиск. */
	#masthead > .col-full {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto minmax(240px, 400px);
		grid-template-areas:
			"brand secondary secondary"
			"brand contacts search";
		align-items: center;
		column-gap: 2rem;
		row-gap: 0.5rem;
		padding-bottom: 1.2rem;
	}

	#masthead > .col-full::before,
	#masthead > .col-full::after {
		display: none;
	}

	#masthead > .col-full > .site-branding,
	#masthead > .col-full > .secondary-navigation,
	#masthead > .col-full > .site-search {
		float: none;
		width: auto;
		margin: 0;
		clear: none;
	}

	#masthead > .col-full > .site-branding {
		grid-area: brand;
	}

	#masthead > .col-full > .secondary-navigation {
		grid-area: secondary;
		justify-self: end;
	}

	#masthead > .col-full > .secondary-navigation .menu > li > a {
		padding-top: 0.5em;
		padding-bottom: 0.5em;
	}

	#masthead > .col-full > .site-search {
		grid-area: search;
	}

	#masthead > .col-full > .site-search .widget_product_search form {
		margin-bottom: 0;
	}

	.magaz-header-contacts {
		grid-area: contacts;
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		line-height: 1.3;
	}

	.magaz-header-contacts__phone {
		font-weight: 700;
		font-size: 1.15em;
		white-space: nowrap;
	}

	.magaz-header-contacts__hours {
		font-size: 0.8em;
		opacity: 0.75;
		white-space: nowrap;
	}
}

/* ---------- Главная: обложка и преимущества ---------- */
.page-template-template-homepage .site-main > .page:first-child .col-full,
.page-template-template-homepage .type-page .entry-content {
	max-width: none;
}

.page-template-template-homepage .site-main > .page:first-child {
	padding-top: 0;
	margin-bottom: 2.5em;
}


.magaz-hero.wp-block-cover {
	border-radius: var(--magaz-radius);
	overflow: hidden;
	padding: clamp(1.5rem, 5vw, 4rem);
	margin-bottom: var(--magaz-gap);
}

/* Перебиваем .hentry .entry-content .wp-block-cover … из Storefront (белый текст, крупный кегль). */
.hentry .entry-content .magaz-hero.wp-block-cover .wp-block-cover__inner-container,
.hentry .entry-content .magaz-hero.wp-block-cover .wp-block-cover__inner-container h1,
.hentry .entry-content .magaz-hero.wp-block-cover .wp-block-cover__inner-container p:not(.has-text-color) {
	color: var(--magaz-hero-text, #1f1f1f);
	text-align: left;
}

.magaz-hero .wp-block-cover__inner-container {
	max-width: 34rem;
	width: 100%;
	margin-left: 0;
}

.hentry .entry-content .magaz-hero.wp-block-cover .wp-block-cover__inner-container p.magaz-hero__eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 0.75rem;
	opacity: 0.8;
}

.hentry .entry-content .magaz-hero.wp-block-cover .wp-block-cover__inner-container h1.magaz-hero__title {
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	line-height: 1.1;
	margin-bottom: 1rem;
}

.hentry .entry-content .magaz-hero.wp-block-cover .wp-block-cover__inner-container p.magaz-hero__lead {
	font-size: 1.1rem;
	margin-bottom: 1.75rem;
}

.magaz-hero .wp-block-buttons {
	gap: 0.75rem;
	align-items: center;
}

.hentry .entry-content .magaz-hero .wp-block-buttons > .wp-block-button {
	margin: 0;
}

.magaz-benefits.wp-block-columns {
	gap: 1rem;
	margin-bottom: 1rem;
}

.magaz-benefits .wp-block-column {
	background: var(--magaz-surface);
	border: 1px solid var(--magaz-line);
	border-radius: var(--magaz-radius);
	padding: 1rem 1.25rem;
}

.magaz-benefits p {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.45;
}

.magaz-benefits strong {
	display: block;
	font-size: 1rem;
	margin-bottom: 0.15rem;
}

/* ---------- Единицы измерения ---------- */
.magaz-unit-suffix {
	font-size: 0.85em;
	font-weight: 400;
	opacity: 0.7;
	white-space: nowrap;
}

.quantity {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.magaz-qty-unit {
	font-size: 0.95em;
	opacity: 0.75;
}

/* ---------- Подвал ---------- */
.magaz-footer {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 2rem;
	padding: 3rem 0 1rem;
}

.magaz-footer__brand {
	font-size: 1.4em;
	font-weight: 700;
	margin-bottom: 0.25em;
}

.magaz-footer__title {
	font-weight: 700;
	margin-bottom: 0.75em;
}

.magaz-footer__menu,
.magaz-footer__contacts,
.magaz-pay-badges {
	list-style: none;
	margin: 0;
	padding: 0;
}

.magaz-footer__menu li,
.magaz-footer__contacts li {
	margin-bottom: 0.45em;
}

.magaz-pay-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 0.75rem;
}

.magaz-pay-badges li {
	border: 1px solid currentColor;
	border-radius: 999px;
	padding: 0.15em 0.7em;
	font-size: 0.8em;
	opacity: 0.85;
}

.magaz-footer__note {
	font-size: 0.85em;
	opacity: 0.8;
}

/* ---------- Каталог ---------- */
ul.products li.product .woocommerce-loop-product__title {
	min-height: 2.6em;
}

.woocommerce-products-header__title.page-title,
.storefront-product-section .section-title {
	text-wrap: balance;
}

/* ---------- Переключатель дизайнов (для согласования) ---------- */
.magaz-switcher {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 9999;
	max-width: min(22rem, calc(100vw - 2rem));
	background: #111;
	color: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	font: 500 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.magaz-switcher summary {
	cursor: pointer;
	padding: 0.7rem 1rem;
	list-style: none;
	user-select: none;
}

.magaz-switcher summary::-webkit-details-marker {
	display: none;
}

.magaz-switcher summary::after {
	content: " ▴";
	opacity: 0.6;
}

.magaz-switcher[open] summary::after {
	content: " ▾";
}

.magaz-switcher__label {
	opacity: 0.6;
}

.magaz-switcher__list {
	list-style: none;
	margin: 0;
	padding: 0 0.5rem 0.5rem;
	max-height: 60vh;
	overflow: auto;
}

.magaz-switcher__list a {
	display: block;
	padding: 0.55rem 0.6rem;
	border-radius: 10px;
	color: #fff;
	text-decoration: none;
}

.magaz-switcher__list a:hover,
.magaz-switcher__list a:focus-visible {
	background: rgba(255, 255, 255, 0.1);
}

.magaz-switcher__list a.is-current {
	background: rgba(255, 255, 255, 0.16);
}

.magaz-switcher__list strong {
	display: block;
}

.magaz-switcher__list span {
	display: block;
	font-size: 12px;
	opacity: 0.65;
	font-weight: 400;
}

/* ---------- Мобильная версия ---------- */
@media (max-width: 767px) {
	.magaz-switcher {
		bottom: 5rem; /* над нижней панелью Storefront */
		left: 0.75rem;
	}

	.magaz-hero.wp-block-cover {
		min-height: 420px !important;
		border-radius: 0;
	}

	.magaz-benefits.wp-block-columns {
		display: grid;
		grid-template-columns: 1fr 1fr;
		padding: 0 1rem;
	}

	.magaz-footer {
		grid-template-columns: 1fr 1fr;
		gap: 1.5rem;
		padding-top: 2rem;
	}

	.magaz-footer__about {
		grid-column: 1 / -1;
	}

	/* 2 товара в ряд на телефоне вместо одного. */
	.site-main ul.products.columns-4 li.product,
	.site-main ul.products.columns-3 li.product {
		width: 48%;
		margin-right: 4%;
		float: left;
		clear: none;
	}

	.site-main ul.products.columns-4 li.product:nth-child(2n),
	.site-main ul.products.columns-3 li.product:nth-child(2n) {
		margin-right: 0;
	}

	.site-main ul.products.columns-4 li.product:nth-child(2n + 1),
	.site-main ul.products.columns-3 li.product:nth-child(2n + 1) {
		clear: both;
	}

	ul.products li.product .button {
		padding: 0.6em 0.8em;
		font-size: 0.85em;
	}
}

/*
 * Storefront на ≥768px обнуляет боковые отступы колонок блока «Колонки»
 * (.hentry .entry-content .wp-block-columns .wp-block-column:not(:first-child) и т.п.),
 * из-за чего текст плашек преимуществ прилипал к рамке. Возвращаем отступы с бо́льшим весом.
 */
@media (min-width: 768px) {
	body.magaz-design-standard .hentry .entry-content .magaz-benefits.wp-block-columns > .wp-block-column:nth-child(n) {
		padding: 1rem 1.25rem;
	}
}
