/* ==========================================================================
   Mobile 2026 — компактная шапка, нижняя навигация, первый экран главной
   Все правила только для телефона, десктоп и планшет не меняются.
   ========================================================================== */

.tsm-mobile-phone,
.tsm-bottom-nav,
.tsm-profile,
.tsm-profile__overlay { display: none; }

@media (max-width: 767px) {
	html { overflow-x: hidden; }
	/* clip, а не hidden: hidden делает body скролл-контейнером,
	   из-за чего jquery.lazy не видит прокрутку и не грузит фото ниже первого экрана. */
	body { overflow-x: clip; }

	body::after {
		content: "";
		display: block;
		flex: 0 0 auto;
		height: calc(80px + env(safe-area-inset-bottom, 0px));
	}

	.awz_cookies_sett__message {
		bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
	}
	body.tsm-cat-lock .awz_cookies_sett__message,
	body.tsm-contacts-lock .awz_cookies_sett__message,
	body.tsm-profile-lock .awz_cookies_sett__message {
		display: none !important;
	}

	/* ---------- Компактная шапка ------------------------------------------ */

	.tsm-header__top {
		height: 0;
		min-height: 0;
		overflow: visible;
	}
	.tsm-header__top-inner {
		min-height: 0;
		padding: 0;
	}
	.tsm-header__top .tsm-phone { display: none; }

	.tsm-header__main-inner {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"logo phone"
			"search search";
		gap: 8px 10px;
	}
	.tsm-header .tsm-header__main-inner {
		padding: 10px 16px 14px;
	}
	.tsm-header__logo {
		grid-area: logo;
		min-width: 0;
		gap: 8px;
	}
	.tsm-header__logo img {
		max-width: 42px;
		max-height: 40px;
	}
	.tsm-header__logo-text {
		min-width: 0;
		font-size: 16px;
		line-height: 1.1;
	}
	.tsm-header__logo-text small { font-size: 10px; }

	.tsm-header__search { grid-area: search; }
	.tsm-header__search .search form {
		height: 48px;
		border: 1.5px solid #dfe4e8;
		border-radius: 12px;
		background: #f8fafb;
	}
	.tsm-header__search .search input {
		padding: 0 12px 0 14px;
		font-size: 16px;
	}
	.tsm-header__search .search button {
		width: 48px;
		min-width: 48px;
	}

	.tsm-catalog { display: contents; }
	.tsm-catalog__btn { display: none; }
	.tsm-header__personal,
	.tsm-burger { display: none; }
	.tsm-header__tools { display: contents; }
	.tsm-header__top {
		display: block;
		height: 0;
		min-height: 0;
		padding: 0;
		overflow: visible;
	}
	.tsm-header__top .tsm-header__contacts {
		position: static;
		margin: 0;
		padding: 0;
		border: 0;
	}
	.tsm-header__top .tsm-phone,
	.tsm-header__top .tsm-header__callback { display: none; }

	.tsm-mobile-phone {
		grid-area: phone;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin-right: 2px;
		padding: 0;
		background: #eef8fb;
		border: 1px solid #d7edf3;
		border-radius: 50%;
		color: #147f9b;
		cursor: pointer;
	}
	.tsm-mobile-phone:active { background: #dff2f7; }
	.tsm-mobile-phone .tsm-icon { width: 22px; height: 22px; }

	/* ---------- Нижняя панель --------------------------------------------- */

	.tsm-bottom-nav {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 95;
		display: flex;
		align-items: stretch;
		padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
		background: #fff;
		border-top: 1px solid #e4e7ea;
		box-shadow: 0 -8px 24px rgba(20, 26, 33, .08);
		transition: transform .18s ease, visibility .18s ease;
	}
	.tsm-bottom-nav__item {
		position: relative;
		flex: 1 1 0;
		min-width: 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: 52px;
		padding: 4px 2px;
		background: none;
		border: 0;
		font: inherit;
		font-size: 10px;
		line-height: 1.1;
		color: #565d66;
		text-decoration: none;
		white-space: nowrap;
		cursor: pointer;
	}
	.tsm-bottom-nav__item.is-active { color: #1b9fc6; }
	.tsm-bottom-nav__icon {
		position: relative;
		display: inline-flex;
		color: currentColor;
	}
	.tsm-bottom-nav__icon .tsm-icon { width: 22px; height: 22px; }
	.tsm-bottom-nav__badge {
		position: absolute;
		top: -6px;
		right: -13px;
		display: block;
		min-width: 17px;
		height: 17px;
		padding: 0 4px;
		background: #1b9fc6;
		border-radius: 9px;
		box-shadow: 0 0 0 2px #fff;
		font-size: 10px;
		font-weight: 700;
		line-height: 17px;
		color: #fff;
		text-align: center;
	}
	.tsm-bottom-nav__badge[hidden] { display: none; }

	body.tsm-contacts-lock .tsm-bottom-nav,
	body.tsm-cat-lock .tsm-bottom-nav,
	body.tsm-profile-lock .tsm-bottom-nav {
		transform: translateY(110%);
		visibility: hidden;
	}

	body.tsm-profile-lock {
		position: fixed;
		left: 0;
		right: 0;
		width: 100%;
		overflow: hidden;
	}

	/* ---------- Профиль: нижняя панель ----------------------------------- */

	.tsm-profile {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 260;
		display: none;
		max-height: min(86vh, 720px);
		padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
		background: #fff;
		border-radius: 18px 18px 0 0;
		box-shadow: 0 -16px 44px rgba(20, 26, 33, .28);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}
	.tsm-profile.is-open { display: block; }
	.tsm-profile__overlay {
		position: fixed;
		inset: 0;
		z-index: 250;
		background: rgba(20, 26, 33, .5);
	}
	.tsm-profile__overlay.is-open { display: block; }
	.tsm-profile__head {
		position: sticky;
		top: 0;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin: 0 -16px 4px;
		padding: 6px 10px 6px 16px;
		background: #fff;
		border-bottom: 1px solid #eef0f2;
	}
	.tsm-profile__head-title {
		font-size: 17px;
		font-weight: 700;
		color: #2b2f34;
	}
	.tsm-profile__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		background: none;
		border: 0;
		border-radius: 8px;
		font-size: 28px;
		line-height: 1;
		color: #565d66;
		cursor: pointer;
	}
	.tsm-profile__close:hover { background: #f2f4f6; color: #2b2f34; }
	.tsm-profile__hello {
		padding: 8px 0 2px;
		font-size: 13px;
		color: #838a93;
	}
	.tsm-profile__primary {
		display: flex;
		align-items: center;
		gap: 12px;
		margin: 10px 0 8px;
		padding: 13px 14px;
		background: #eef8fb;
		border: 1px solid #d7edf3;
		border-radius: 14px;
		color: #147f9b;
		text-decoration: none;
	}
	.tsm-profile__primary-icon {
		display: inline-flex;
		flex: 0 0 auto;
		color: #147f9b;
	}
	.tsm-profile__primary-icon .tsm-icon { width: 24px; height: 24px; }
	.tsm-profile__primary-text {
		display: flex;
		flex-direction: column;
		gap: 2px;
		min-width: 0;
	}
	.tsm-profile__primary-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
	.tsm-profile__primary-note { font-size: 12px; line-height: 1.25; color: #565d66; }
	.tsm-profile__primary-chev { margin-left: auto; font-size: 24px; line-height: 1; color: #147f9b; }
	.tsm-profile__login {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 44px;
		margin: 8px 0;
		padding: 8px 14px;
		background: #1b9fc6;
		border-radius: 10px;
		font-size: 14px;
		font-weight: 600;
		color: #fff;
		text-decoration: none;
	}
	.tsm-profile__link {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 13px 2px;
		border-bottom: 1px solid #f0f1f3;
		font-size: 15px;
		line-height: 1.3;
		color: #2b2f34;
		text-decoration: none;
	}
	.tsm-profile__link::after {
		content: "›";
		font-size: 20px;
		line-height: 1;
		color: #9aa3ab;
	}
	.tsm-profile__section {
		margin: 16px 0 2px;
		font-size: 11px;
		font-weight: 600;
		letter-spacing: .06em;
		text-transform: uppercase;
		color: #838a93;
	}

	/* ---------- Главная: первый экран и подборки -------------------------- */

	.banners {
		display: block;
		margin: 0;
	}
	.banners .carousel {
		border-radius: 18px;
		overflow: hidden;
		box-shadow: 0 10px 26px rgba(20, 26, 33, .14);
	}
	.banners .carousel .item {
		position: relative;
		height: clamp(230px, 62vw, 320px);
		background-position: center;
		background-size: cover;
	}
	.banners .carousel .item::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 1;
		background: linear-gradient(90deg, rgba(12, 40, 50, .72) 0%, rgba(12, 40, 50, .35) 55%, rgba(12, 40, 50, .02) 100%);
	}
	.banners .carousel .item .text {
		position: relative;
		z-index: 2;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		align-items: flex-start;
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 20px 18px;
		text-align: left;
	}
	.banners .carousel .item .name {
		font-size: 22px;
		font-weight: 800;
		line-height: 1.08;
		color: #fff;
		text-shadow: 0 1px 10px rgba(0, 0, 0, .28);
	}
	.banners .carousel .item .name small {
		display: block;
		margin-top: 8px;
		font-size: 13px;
		font-weight: 500;
		line-height: 1.25;
	}
	.banners .carousel .item .button {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 38px;
		margin-top: 14px;
		padding: 8px 14px;
		background: #fff;
		border-radius: 10px;
		font-size: 13px;
		font-weight: 700;
		color: #147f9b;
		text-decoration: none;
	}
	.banners .carousel .owl-nav,
	.banners .carousel .owl-dots { z-index: 3; }

	.banners .static {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
		margin-top: 10px;
	}
	.banners .static .item {
		width: auto !important;
		min-height: 92px;
		margin: 0 !important;
		border-radius: 14px;
		background-position: center;
		background-size: cover;
		box-shadow: 0 4px 14px rgba(20, 26, 33, .10);
	}
	.banners .static .item.medium {
		grid-column: 1 / -1;
		min-height: 76px;
	}
	.banners .static .item.small { min-height: 92px; }
	.banners .static .item .text { display: none; }

	section.catalog { margin-top: 18px; }
	section.catalog .title {
		margin: 0;
		font-size: 20px;
		font-weight: 800;
		line-height: 1.2;
	}
	section.catalog > .link {
		display: inline-flex;
		align-items: center;
		margin: 8px 0 0;
		padding: 6px 10px;
		background: #eef8fb;
		border: 1px solid #d7edf3;
		border-radius: 999px;
		font-size: 12px;
		font-weight: 600;
		color: #147f9b;
		text-decoration: none;
	}
	section.catalog .categories {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
		margin: 16px 0 0;
	}
	section.catalog .category-wrap {
		width: auto;
		margin: 0;
	}
	section.catalog .category {
		height: 100%;
		padding: 10px;
		border-radius: 14px;
		background: #fff;
		box-shadow: 0 1px 3px rgba(20, 26, 33, .07);
	}
	section.catalog .category .static {
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}
	section.catalog .category .img {
		width: 100%;
		height: 96px;
		margin: 0 0 8px;
		background: #f6f8f9;
		border-radius: 10px;
		overflow: hidden;
	}
	section.catalog .category .img img {
		width: auto;
		max-width: 92%;
		max-height: 92%;
		object-fit: contain;
	}
	section.catalog .category .text {
		width: 100%;
		margin: 0;
	}
	section.catalog .category .name {
		display: -webkit-box;
		overflow: hidden;
		font-size: 13px;
		font-weight: 700;
		line-height: 1.25;
		color: #2b2f34;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}
	section.catalog .category .text .sub { display: none; }
}

@media (min-width: 768px) and (max-width: 1024px) {
	.tsm-header__tools {
		display: flex;
		grid-area: menu;
		align-items: center;
		justify-self: end;
		gap: 10px;
	}
	.tsm-mobile-phone {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		background: #eef8fb;
		border: 1px solid #d7edf3;
		border-radius: 50%;
		color: #147f9b;
		cursor: pointer;
	}
	.tsm-mobile-phone:active { background: #dff2f7; }
	.tsm-mobile-phone .tsm-icon { width: 22px; height: 22px; }
}
