/* ==========================================================================
   MOBILE-SITE.CSS — параллельная мобильная вёрстка для art-kievskaya.ru
   Стратегия (из промта, вариант C):
   - На экранах > 768px: десктопная вёрстка (#ancestor-homepage и т.п.) видна,
     блок .mobile-site скрыт.
   - На экранах <= 768px: десктоп прячется CSS-ом, .mobile-site показывается.
   - Без JavaScript: бургер-меню работает через checkbox-hack.
   - Бургер рисуется через linear-gradient (надёжнее в старых браузерах).
   - Шапка через float (поддерживается везде).
   Палитра взята из существующей темы adventure-journal.
   ========================================================================== */

/* ---------- 1. По умолчанию (десктоп > 768px): скрыть мобильную часть ----- */
.mobile-site { display: none; }

/* ---------- 2. Mobile breakpoint ---------------------------------------- */
@media (max-width: 768px) {

	/* === 2.1. Прячем оригинальную десктопную вёрстку =================== */
	/* Главная обёртка темы adventure-journal: id меняется (ancestor-homepage,
	   ancestor-32, ancestor-18 и т.п.), но class="siteframe" есть у всех. */
	.siteframe,
	[id^="ancestor-"],
	#browser-helper,
	div.style1,                /* информер Я.Метрики */
	a.btn-messenger {          /* старые плавающие кнопки только на десктоп */
		display: none !important;
	}

	/* убираем фоновую картинку body на мобильном (тяжёлая, не нужна) */
	body.custom-background,
	body {
		background-image: none !important;
		background: #f5f5f5 !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	/* === 2.2. Показываем .mobile-site ================================== */
	.mobile-site {
		display: block;
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
		font-size: 16px;
		line-height: 1.5;
		color: #2a2a2a;
		background: #f5f5f5;
		min-height: 100vh;
	}
	.mobile-site * { box-sizing: border-box; }
	.mobile-site img { max-width: 100%; height: auto; display: block; }
	.mobile-site a { color: #7D3913; text-decoration: underline; }
	.mobile-site a:hover { color: #8e2e06; }
}

/* ==========================================================================
   3. ВНУТРЕННИЕ КОМПОНЕНТЫ .mobile-site
   Описаны вне @media для читаемости, но видны только при <=768px,
   потому что родитель скрыт. Никакого конфликта с десктопом нет.
   ========================================================================== */

/* ---- 3.1. Чекбокс для бургера (скрыт визуально, переключает :checked) --- */
.mobile-site .m-toggle {
	position: absolute;
	left: -9999px;
	opacity: 0;
}

/* ---- 3.2. Шапка через float ------------------------------------------- */
.mobile-site .m-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: #fff;
	border-bottom: 2px solid #603913;
	padding: 4px 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	min-height: 60px;
}
.mobile-site .m-header::after {
	content: "";
	display: block;
	clear: both;
}

/* лого — занимает всё доступное место, кроме бургера справа */
.mobile-site .m-logo {
	float: left;
	display: block;
	max-width: calc(100% - 56px);
	text-decoration: none;
	line-height: 0;        /* убрать инлайн-просвет под img */
}
.mobile-site .m-logo img {
	max-height: 72px;
	max-width: 100%;
	width: auto;
	height: auto;
	display: block;
}

/* бургер — иконка через 3 linear-gradient, без span'ов.
   Позиционирован абсолютно по правому краю и центру шапки, чтобы оставаться
   по центру при любой высоте (зависящей от размера лого). */
.mobile-site .m-header { position: sticky; }  /* нужен для absolute дочернего */
.mobile-site .m-burger {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	cursor: pointer;
	display: block;
	background-color: transparent;
	background-image:
		linear-gradient(#603913, #603913),
		linear-gradient(#603913, #603913),
		linear-gradient(#603913, #603913);
	background-size: 26px 3px;
	background-position: 9px 14px, 9px 21px, 9px 28px;
	background-repeat: no-repeat;
	border-radius: 4px;
}
.mobile-site .m-burger:active { background-color: #efe3d8; }

/* состояние «открыто» — превращаем 3 полоски в крестик */
.mobile-site .m-toggle:checked ~ .m-header .m-burger {
	background-position: 9px 21px, 9px 21px, 9px 21px;
	background-image:
		linear-gradient(#603913, #603913),
		linear-gradient(#603913, #603913),
		linear-gradient(transparent, transparent);
	transform: rotate(0);
}
/* Поворот полосок под крестик через псевдо-эффект:
   делаем 2 полоски накрест, 3-ю прозрачной. */
.mobile-site .m-toggle:checked ~ .m-header .m-burger {
	background-image:
		linear-gradient(45deg, transparent 47%, #603913 47%, #603913 53%, transparent 53%),
		linear-gradient(-45deg, transparent 47%, #603913 47%, #603913 53%, transparent 53%),
		linear-gradient(transparent, transparent);
	background-size: 26px 26px, 26px 26px, 26px 3px;
	background-position: 9px 9px, 9px 9px, 9px 21px;
}

/* ---- 3.3. Полупрозрачная подложка под открытым меню -------------------- */
.mobile-site .m-overlay {
	display: none;
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 90;
	cursor: pointer;
}
.mobile-site .m-toggle:checked ~ .m-overlay {
	display: block;
}

/* ---- 3.4. Выезжающее меню --------------------------------------------- */
.mobile-site .m-menu {
	position: fixed;
	top: 0;
	right: -100vw;       /* за пределы экрана целиком */
	width: 280px;
	max-width: 80vw;
	height: 100vh;
	background: #fff;
	z-index: 95;
	overflow-y: auto;
	transition: right 0.25s ease;
	padding: 70px 0 20px 0;
	box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
	visibility: hidden;
}
.mobile-site .m-toggle:checked ~ .m-menu {
	right: 0;
	visibility: visible;
}
.mobile-site .m-menu a {
	display: block;
	padding: 14px 20px;
	color: #603913;
	text-decoration: none;
	font-weight: bold;
	border-bottom: 1px solid #efe3d8;
	font-size: 16px;
}
.mobile-site .m-menu a:active,
.mobile-site .m-menu a:hover {
	background: #efe3d8;
	color: #8e2e06;
}
.mobile-site .m-menu a.m-active {
	background: #603913;
	color: #fff;
}

/* ---- 3.5. Основной контент -------------------------------------------- */
.mobile-site .m-main {
	padding: 16px 14px 24px 14px;
	max-width: 100%;
	background: #fff;
	margin: 0;
}
.mobile-site .m-h1 {
	font-size: 22px;
	line-height: 1.25;
	color: #603913;
	margin: 4px 0 16px 0;
	font-weight: bold;
	letter-spacing: -0.5px;
}
.mobile-site .m-main h2 {
	font-size: 19px;
	line-height: 1.3;
	color: #603913;
	margin: 22px 0 10px 0;
	font-weight: bold;
}
.mobile-site .m-main h3 {
	font-size: 17px;
	line-height: 1.3;
	color: #7D3913;
	margin: 18px 0 8px 0;
	font-weight: bold;
}
.mobile-site .m-main p {
	margin: 0 0 12px 0;
	font-size: 15px;
	line-height: 1.55;
}
.mobile-site .m-main strong,
.mobile-site .m-main b { font-weight: 600; color: #2a2a2a; }
.mobile-site .m-main em { font-style: italic; }
.mobile-site .m-main ul,
.mobile-site .m-main ol {
	padding-left: 22px;
	margin: 0 0 14px 0;
}
.mobile-site .m-main li {
	margin-bottom: 6px;
	font-size: 15px;
	line-height: 1.5;
}

/* ---- 3.6. Картинки в контенте ----------------------------------------- */
.mobile-site .m-figure {
	margin: 14px 0;
	text-align: center;
}
.mobile-site .m-figure img {
	max-width: 100%;
	height: auto;
	display: inline-block;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---- 3.7. CTA-кнопки -------------------------------------------------- */
.mobile-site .m-cta {
	margin: 24px 0 8px 0;
	display: block;
}
.mobile-site .m-cta__btn {
	display: block;
	width: 100%;
	padding: 14px 20px;
	margin-bottom: 10px;
	background: #603913;
	color: #fff !important;
	text-align: center;
	text-decoration: none !important;
	font-weight: bold;
	font-size: 16px;
	border-radius: 4px;
	box-sizing: border-box;
}
.mobile-site .m-cta__btn:active { background: #7D3913; }
.mobile-site .m-cta__btn--secondary {
	background: #fff;
	color: #603913 !important;
	border: 2px solid #603913;
	padding: 12px 20px;
}
.mobile-site .m-cta__btn--secondary:active { background: #efe3d8; }

/* ---- 3.8. Подвал ------------------------------------------------------- */
.mobile-site .m-footer {
	background: #efe3d8;
	border-top: 2px solid #603913;
	padding: 18px 14px 24px 14px;
	text-align: center;
	font-size: 14px;
	color: #603913;
	margin-top: 24px;
}
.mobile-site .m-footer a {
	color: #603913;
	display: inline-block;
	padding: 6px 0;
}
.mobile-site .m-footer .m-copy {
	margin-top: 10px;
	font-size: 13px;
	color: #7D3913;
}

/* ---- 3.9. Плавающие кнопки связи (свои, для мобильного) ---------------- */
.mobile-site .m-float {
	position: fixed;
	right: 8px;
	bottom: 80px;
	z-index: 80;
	display: block;
}
.mobile-site .m-float a {
	display: block;
	width: 44px;
	height: 44px;
	margin-top: 6px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	border: 1px solid #d3d3d3;
	overflow: hidden;
	padding: 6px;
	text-decoration: none;
	box-sizing: border-box;
}
.mobile-site .m-float a img {
	width: 100%;
	height: 100%;
	display: block;
}

/* ---- 3.10. Таблица цен на мобильном ----------------------------------- */
.mobile-site .m-price-table {
	width: 100%;
	border-collapse: collapse;
	margin: 12px 0 18px 0;
	background: #fff;
	font-size: 14px;
	table-layout: fixed;
}
.mobile-site .m-price-table th,
.mobile-site .m-price-table td {
	padding: 10px 8px;
	border: 1px solid #d3d3d3;
	text-align: left;
	vertical-align: top;
	word-wrap: break-word;
	overflow-wrap: break-word;
}
.mobile-site .m-price-table th {
	background: #efe3d8;
	color: #603913;
	font-weight: bold;
}
/* первая колонка — название, тянется; вторая — цена, фиксированной ширины */
.mobile-site .m-price-table td:first-child { width: auto; }
.mobile-site .m-price-table td:last-child {
	width: 80px;
	text-align: right;
	font-weight: bold;
	color: #8e2e06;
}
/* строка с примечанием на всю ширину */
.mobile-site .m-price-table td[colspan] {
	width: auto;
}
.mobile-site .m-price-section {
	background: #603913;
	color: #fff;
	padding: 8px 10px;
	font-weight: bold;
	font-size: 14px;
	line-height: 1.3;
	margin: 14px 0 0 0;
	border-radius: 3px 3px 0 0;
	word-wrap: break-word;
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: auto;
}

/* ---- 3.12. Каталог макетов печатей/штампов (.m-catalog) --------------- */
.mobile-site .m-catalog {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 14px 0 18px 0;
}
.mobile-site .m-card {
	background: #fff;
	border: 1px solid #e0d8c8;
	border-radius: 4px;
	padding: 10px 8px;
	text-align: center;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
}
.mobile-site .m-card__title {
	font-weight: bold;
	font-size: 13px;
	color: #603913;
	min-height: 36px;
	margin-bottom: 6px;
	line-height: 1.25;
}
.mobile-site .m-card__img {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100px;
	margin: 6px 0;
}
.mobile-site .m-card__img img {
	max-width: 100%;
	max-height: 120px;
	height: auto;
	width: auto;
	display: block;
}
.mobile-site .m-card__label {
	font-size: 12px;
	color: #7D3913;
	margin-top: 4px;
}

/* ---- 3.11. Любые прочие таблицы внутри m-main — защита от переполнения.
   Конкретные таблицы (цены, каталоги) обрабатываются собственными классами. */
.mobile-site .m-main table:not(.m-price-table) {
	width: 100% !important;
	max-width: 100%;
	display: block;
	overflow-x: auto;
	border-collapse: collapse;
}
.mobile-site .m-main table:not(.m-price-table) img {
	max-width: 100%;
	height: auto;
}

/* ==========================================================================
   4. Применяем правила компонентов только в media-query (<=768px),
   чтобы они не «протекали» на десктоп.
   ========================================================================== */
@media (min-width: 769px) {
	.mobile-site { display: none !important; }
}
