/* ============================================
   МОБИЛЬНАЯ ВЕРСИЯ v5 — ИСПРАВЛЕННАЯ
   ============================================ */

/* Мобильные элементы скрыты по умолчанию */
.mobile-header, .mobile-menu, .mobile-menu-overlay, .mobile-bottom-bar { display: none; }

@media (max-width: 960px) {
/* Убираем горизонтальный скролл */
html { 
	overflow-x: hidden !important; 
}
body { 
	overflow-x: hidden !important; 
	max-width: 100% !important;
	width: 100% !important;
	position: relative !important;
}

/* Таблицы */
table {
	width: 100% !important;
	table-layout: fixed !important;
}

/* Контейнер страницы */
#pageWrapper {
	overflow-x: hidden !important;
	max-width: 100% !important;
	width: 100% !important;
}

/* Скрываем кнопку Telegram внизу */
.whatsapp-button {
	display: none !important;
}

/* === ОТЗЫВЫ НА МОБИЛЬНЫХ === */
/* Контейнер отзывов */
div[style*="display:flex;flex-direction:column;gap:20px"] {
	gap: 15px !important;
}

/* Карточка отзыва - вертикальная раскладка */
div[style*="display:flex;gap:20px;background:#fff;border-radius:12px"] {
	flex-direction: column !important;
}
div[style*="flex-direction:row-reverse"] {
	flex-direction: column !important;
}

/* Картинка отзыва */
div[style*="display:flex;gap:20px;background:#fff"] > a[style*="width:200px"] {
	width: 100% !important;
	flex-shrink: 1 !important;
}
div[style*="display:flex;gap:20px;background:#fff"] > a img {
	height: 180px !important;
	width: 100% !important;
}

/* Нижняя строка отзыва - перенос */
div[style*="display:flex;justify-content:space-between;align-items:center"] {
	flex-wrap: wrap !important;
	gap: 8px !important;
}
div[style*="display:flex;justify-content:space-between;align-items:center"] > span,
div[style*="display:flex;justify-content:space-between;align-items:center"] > a {
	margin: 0 !important;
}

/* Отступ внизу страницы под нижнее меню */
body {
	padding-top: 60px !important;
	padding-bottom: 60px !important;
}

/* === ФУТЕР НА МОБИЛЬНЫХ === */
.footer-dark,
td.footer-dark,
td.b-footer.footer-dark,
.b-footer.footer-dark {
	background: #1e1e1e !important;
	background-image: none !important;
	color: #fff !important;
	padding: 25px 15px 15px !important;
	height: auto !important;
}
.footer-columns {
	display: block !important;
}
.footer-col {
	margin-bottom: 25px !important;
}
.footer-col h4 {
	font-size: 15px !important;
	margin-bottom: 12px !important;
	color: #fff !important;
	background: transparent !important;
}
.footer-col p {
	color: #aaa !important;
}
.footer-col ul {
	display: grid !important;
	grid-template-columns: 1fr 1fr !important;
	gap: 5px 10px !important;
}
.footer-col ul li {
	margin-bottom: 5px !important;
}
.footer-col ul a {
	font-size: 13px !important;
	color: #aaa !important;
}
.footer-col .phone {
	font-size: 18px !important;
	color: #fff !important;
}
.footer-bottom {
	font-size: 11px !important;
	line-height: 1.5 !important;
	padding-bottom: 70px !important;
	color: #666 !important;
	background: transparent !important;
}

/* СКРЫВАЕМ ДЕСКТОПНУЮ ШАПКУ И ЛЕВОЕ МЕНЮ */
.b-header,
td.b-header,
tr:has(.b-header),
.b-content__aside,
td.b-content__aside { 
	display: none !important; 
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	max-height: 0 !important;
	min-height: 0 !important;
	overflow: hidden !important;
	background: none !important;
	background-image: none !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
}

/* Убираем тень под шапкой */
.i-content {
	background-image: none !important;
	background: #fefaeb !important;
	border-top: none !important;
	padding-top: 0 !important;
}

/* Адаптация таблиц */
.i-wrapper,
table.i-wrapper, 
table.i-wrapper tbody, 
table.i-wrapper tr, 
table.i-wrapper td { 
	display: block !important; 
	width: 100% !important; 
	max-width: 100% !important;
	padding: 0 !important;
}
table.b-content, 
table.b-content tbody, 
table.b-content tr, 
table.b-content td { 
	display: block !important; 
	width: 100% !important; 
	max-width: 100% !important;
}
.b-content__main { 
	padding: 10px !important; 
	width: 100% !important;
}

/* === МОБИЛЬНАЯ ШАПКА (ФИКСИРОВАННАЯ - всегда вверху) === */
.mobile-header {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	height: 56px !important;
	min-height: 56px !important;
	max-height: 56px !important;
	background: #730f20 !important;
	padding: 0 15px !important;
	z-index: 9999 !important;
	box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
	flex-shrink: 0 !important;
	transform: none !important;
	-webkit-transform: none !important;
	transition: none !important;
	-webkit-transition: none !important;
	animation: none !important;
	-webkit-animation: none !important;
	contain: layout style !important;
	overflow: visible !important;
}
.mobile-header * {
	transform: none !important;
	-webkit-transform: none !important;
	transition: none !important;
	-webkit-transition: none !important;
	animation: none !important;
}
.mobile-menu-btn {
	background: none; 
	border: none;
	color: #fff; 
	font-size: 14px;
	cursor: pointer; 
	padding: 8px 12px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.mobile-logo {
	font-size: 14px;
	color: #fff;
	font-weight: bold;
	text-align: center;
	flex: 1;
}
.mobile-phone-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	background: rgba(255,255,255,0.15);
	border-radius: 50%;
	text-decoration: none;
}

/* === НИЖНЕЕ ПРИЛИПАЮЩЕЕ МЕНЮ === */
.mobile-bottom-bar {
	display: flex;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 56px;
	background: #730f20;
	align-items: center;
	justify-content: space-between;
	padding: 0 10px;
	z-index: 9998;
	box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
.bottom-online {
	color: #7fff7f;
	font-size: 12px;
	font-weight: bold;
	white-space: nowrap;
	padding-left: 5px;
}
.bottom-messengers {
	display: flex;
	gap: 6px;
}
.bottom-msg {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 10px;
	border-radius: 8px;
	color: #fff;
	text-decoration: none;
	font-size: 11px;
	font-weight: bold;
}
.bottom-msg.tg { background: #0088cc; }
.bottom-msg.max { background: #7B68EE; }
.bottom-msg.wa { background: #25D366; }

/* Отступ внизу страницы под нижнее меню */
.footer-bottom {
	padding-bottom: 70px !important;
}

/* Отступ для контента под фиксированной шапкой */
#pageWrapper {
	padding-top: 56px !important;
}
	/* === ОВЕРЛЕЙ === */
.mobile-menu-overlay {
	display: none;
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.5);
	z-index: 1001;
}
.mobile-menu-overlay.open { display: block; }

/* === МОБИЛЬНОЕ МЕНЮ === */
.mobile-menu {
	display: block;
	position: fixed;
	top: 0; left: -320px;
	width: 300px; 
	max-width: 85vw;
	height: 100%;
	background: #f5f5f5;
	z-index: 1002;
	overflow-y: auto;
	overflow-x: hidden;
	transition: left 0.3s ease;
	box-shadow: 2px 0 20px rgba(0,0,0,0.3);
}
.mobile-menu.open { left: 0; }

/* Заголовок меню (прилипает к верху) */
.mobile-menu-header {
	position: sticky;
	top: 0;
	background: #730f20;
	padding: 15px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	z-index: 10;
}
.mobile-menu-title {
	color: #fff;
	font-size: 16px;
	font-weight: bold;
}
.mobile-menu-close {
	background: rgba(255,255,255,0.2);
	border: none;
	width: 36px; height: 36px;
	border-radius: 50%;
	font-size: 20px; color: #fff;
	cursor: pointer;
}

/* === КАРТОЧКА КОНТАКТОВ === */
.contact-card {
	background: linear-gradient(135deg, #730f20 0%, #9a1a2e 100%);
	margin: 15px;
	border-radius: 16px;
	padding: 20px;
	color: #fff;
	box-shadow: 0 8px 25px rgba(115,15,32,0.3);
}
.contact-card-title {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 1px;
	opacity: 0.8;
	margin-bottom: 15px;
}
.contact-card-phone {
	display: block;
	color: #fff;
	font-size: 20px;
	font-weight: bold;
	text-decoration: none;
	margin: 8px 0;
}
.contact-card-hours {
	font-size: 13px;
	opacity: 0.9;
	margin: 15px 0;
	padding-top: 15px;
	border-top: 1px solid rgba(255,255,255,0.2);
	line-height: 1.4;
}
.contact-card-messengers {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 15px;
}
.msg-btn {
	flex: 1;
	min-width: 70px;
	padding: 10px 8px;
	border-radius: 8px;
	color: #fff;
	text-decoration: none;
	font-size: 11px;
	font-weight: bold;
	text-align: center;
}
.msg-tg { background: #0088cc; }
.msg-max { background: #7B68EE; }
.msg-wa { background: #25D366; }

/* === БЛОКИ МЕНЮ === */
.mobile-menu-list {
	background: #fff;
	margin: 15px;
	border-radius: 12px;
	overflow: hidden;
}
.mobile-menu-list-title {
	padding: 12px 15px;
	background: #eee;
	color: #730f20;
	font-size: 12px;
	font-weight: bold;
	text-transform: uppercase;
}
.mobile-menu-list a {
	display: flex;
	align-items: center;
	padding: 14px 15px;
	color: #333;
	text-decoration: none;
	font-size: 15px;
	border-bottom: 1px solid #f0f0f0;
}
.mobile-menu-list a:last-child { border-bottom: none; }
.mobile-menu-list a:hover { background: #f9f9f9; color: #730f20; }
.mobile-menu-list a::before {
	content: '•';
	color: #730f20;
	margin-right: 10px;
	font-weight: bold;
}
.mobile-menu-list a.highlight {
	background: #fff8f8;
	color: #730f20;
	font-weight: bold;
}
}

/* === СТРАНИЦА ОТЗЫВОВ НА МОБИЛЬНЫХ === */
@media (max-width: 960px) {
	.review-item {
		flex-direction: column !important;
	}
	.review-item:nth-child(even) {
		flex-direction: column !important;
	}
	.review-image {
		width: 100% !important;
	}
	.review-image img {
		height: 180px !important;
	}
	.review-content {
		padding: 15px !important;
	}
	.review-header {
		flex-wrap: wrap !important;
		gap: 8px !important;
	}
	.review-footer {
		flex-wrap: wrap !important;
		gap: 10px !important;
	}
	.review-badge {
		font-size: 11px !important;
	}
}

/* === ДОПОЛНИТЕЛЬНЫЕ ОТСТУПЫ === */
@media (max-width: 960px) {
	/* Небольшие отступы по бокам для карточек */
	.services-main,
	.project-preview-grid,
	.stats-grid,
	.steps-grid,
	.faq-grid,
	.cta-block,
	.about-section,
	.reviews-section,
	.review-item {
		margin-left: 8px !important;
		margin-right: 8px !important;
	}
	
	/* Заголовки с отступами */
	.section-title,
	h2.title {
		padding-left: 10px !important;
		padding-right: 10px !important;
	}
	
	/* Контент с отступами */
	.b-content__main { 
		padding: 10px 15px !important; 
	}
}

/* === БЛОК "КАК МЫ РАБОТАЕМ" НА МОБИЛЬНЫХ === */
@media (max-width: 960px) {
	/* Шаги - flex версия (на страницах проектов) */
	.steps {
		flex-wrap: wrap !important;
		gap: 10px !important;
	}
	.step {
		flex: 1 1 45% !important;
		min-width: 140px !important;
	}
	.how-we-work {
		margin: 20px 8px !important;
		padding: 20px 15px !important;
	}
}

@media (max-width: 480px) {
	.step {
		flex: 1 1 100% !important;
	}
	.steps {
		grid-template-columns: 1fr !important;
	}
}

/* === СТРАНИЦЫ ПРОЕКТОВ НА МОБИЛЬНЫХ === */
@media (max-width: 960px) {
	/* Хлебные крошки */
	.breadcrumbs,
	.b-content__main__breadcrumbs {
		padding: 10px 15px !important;
		font-size: 13px !important;
	}
	
	/* Заголовок проекта */
	.b-content__main .title,
	.b-content__main h1,
	.b-content__main h2.title {
		padding: 0 15px !important;
		font-size: 20px !important;
		line-height: 1.3 !important;
	}
	
	/* Теги категорий */
	.tags {
		padding: 0 15px !important;
		flex-wrap: wrap !important;
	}
	
	/* Галерея фото */
	.gallery-grid {
		padding: 0 8px !important;
		gap: 8px !important;
	}
	
	/* Описание проекта */
	.project-description,
	.b-content__main__item .info,
	.b-content__main p {
		padding: 0 15px !important;
	}
	
	/* Блок CTA */
	.cta-block,
	.price-block {
		margin: 20px 8px !important;
		border-radius: 12px !important;
	}
}

/* === СКРЫВАЕМ СТАРЫЕ ФИКСИРОВАННЫЕ КНОПКИ ВНИЗУ === */
@media (max-width: 960px) {
	/* Telegram кнопка */
	a[href*="t.me"] > div[style*="position:fixed"],
	div[style*="position:fixed"][style*="bottom:0"],
	noindex > a[href*="t.me"] > div {
		display: none !important;
	}
}

/* Скрываем фиксированную кнопку Telegram (inline стили) */
@media (max-width: 960px) {
	noindex a[href*="t.me"][target="_blank"] {
		display: none !important;
	}
}

/* === СКРЫВАЕМ ВНЕШНИЕ ВИДЖЕТЫ TELEGRAM/ЧАТЫ === */
@media (max-width: 960px) {
	/* Типичные селекторы для Telegram виджетов */
	[class*="telegram-widget"],
	[class*="tg-widget"],
	[id*="telegram"],
	[class*="chat-widget"],
	[class*="messenger-widget"],
	div[style*="position: fixed"][style*="bottom"],
	div[style*="position:fixed"][style*="bottom"],
	iframe[src*="telegram"],
	/* Конкретный виджет "Написать в Telegram" */
	div[style*="linear-gradient"][style*="0077b5"],
	a[href*="t.me"] > div[style*="border-radius"][style*="fixed"] {
		display: none !important;
		visibility: hidden !important;
	}
}

/* === УБИРАЕМ ТЕНЬ ПОД ШАПКОЙ === */
@media (max-width: 960px) {
	.i-content {
		background-image: none !important;
		border-top: none !important;
	}
	.b-header {
		max-height: 0 !important;
		min-height: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		border: none !important;
	}
}
