/*
 * Главная страница: категории, вкладки предложений, промо-блок, новости.
 * Баннеры — в banner.css, карточки — в product-card.css.
 */

/* ---------- Категории ---------- */

.cm-hcats {
	display: grid;
	grid-template-columns: 1.35fr 1fr 1fr;
	grid-template-rows: repeat(2, minmax(150px, auto));
	gap: 16px;
}

.cm-hcats a {
	color: var(--cm-black);
	text-decoration: none;
}

.cm-hcats__tariffs {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 28px;
	grid-row: span 2;
	overflow: hidden;
	padding: 32px;
	border-radius: 20px;
	background: linear-gradient(145deg, #fff4ec 0%, #ffe2cf 100%);
}

/* Мягкое оранжевое «пятно» в углу. */
.cm-hcats__tariffs::before {
	content: "";
	position: absolute;
	top: -90px;
	right: -90px;
	width: 260px;
	height: 260px;
	border-radius: 50%;
	background: radial-gradient(circle, rgb(255 101 1 / 22%) 0%, rgb(255 101 1 / 0%) 70%);
	pointer-events: none;
}

.cm-hcats__head {
	position: relative;
}

.cm-hcats__title {
	display: inline-block;
	font-size: 28px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
	transition: color 0.2s;
}

.cm-hcats__title:hover {
	color: var(--cm-orange);
}

.cm-hcats__lead {
	margin: 8px 0 0;
	color: var(--cm-dark-grey);
	font-size: 15px;
	line-height: 1.45;
}

.cm-hcats__ops {
	position: relative;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cm-hcats__ops li {
	margin: 0;
}

.cm-hcats__op {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	height: 100%;
	padding: 8px 10px;
	border-radius: 16px;
	transition: transform 0.2s ease;
}

.cm-hcats__op:hover,
.cm-hcats__op:focus-visible {
	transform: translateY(-3px);
}

.cm-hcats__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
}

.cm-hcats__logo img {
	display: block;
	width: auto;
	max-width: 100%;
	height: 100%;
	object-fit: contain;
}

.cm-hcats__op-name {
	color: var(--cm-dark-grey);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	transition: color 0.2s;
}

.cm-hcats__op:hover .cm-hcats__op-name {
	color: var(--cm-orange);
}

/* Малые карточки категорий. */
.cm-hcats__card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 22px 24px;
	border: 1px solid var(--cm-line);
	border-radius: 20px;
	background: #fff;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.cm-hcats__card:hover,
.cm-hcats__card:focus-visible {
	border-color: transparent;
	box-shadow: var(--cm-shadow);
	transform: translateY(-3px);
}

.cm-hcats__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 18px;
	background: var(--cm-orange-soft);
	color: var(--cm-orange);
	font-size: 30px;
	transition: background 0.2s, color 0.2s;
}

.cm-hcats__icon .cm-icon {
	stroke-width: 1.6;
}

.cm-hcats__card:hover .cm-hcats__icon,
.cm-hcats__card:focus-visible .cm-hcats__icon {
	background: var(--cm-orange);
	color: #fff;
}

.cm-hcats__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.cm-hcats__card-title {
	font-size: 19px;
	font-weight: 800;
	line-height: 1.2;
	transition: color 0.2s;
}

.cm-hcats__card:hover .cm-hcats__card-title {
	color: var(--cm-orange);
}

.cm-hcats__card-lead {
	color: var(--cm-text);
	font-size: 13px;
	line-height: 1.35;
}

.cm-hcats__go {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--cm-bg-soft);
	color: var(--cm-dark-grey);
	font-size: 16px;
	transition: background 0.2s, color 0.2s, transform 0.2s;
}

.cm-hcats__card:hover .cm-hcats__go {
	background: var(--cm-orange);
	color: #fff;
	transform: translateX(3px);
}

.cm-hcats a:focus-visible {
	outline: 2px solid var(--cm-orange);
	outline-offset: 3px;
}

@media (max-width: 1024px) {
	.cm-hcats {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: none;
		grid-auto-rows: minmax(110px, auto);
	}

	.cm-hcats__tariffs {
		grid-column: 1 / -1;
		grid-row: auto;
	}

	.cm-hcats__ops {
		max-width: 560px;
	}
}

@media (max-width: 600px) {
	.cm-hcats {
		gap: 12px;
	}

	.cm-hcats__tariffs {
		gap: 20px;
		padding: 22px 18px;
		border-radius: 18px;
	}

	.cm-hcats__title {
		font-size: 22px;
	}

	.cm-hcats__lead {
		font-size: 14px;
	}

	.cm-hcats__ops {
		gap: 8px;
	}

	.cm-hcats__op {
		padding: 6px 4px;
	}

	.cm-hcats__logo {
		height: 34px;
	}

	.cm-hcats__op-name {
		font-size: 12px;
	}

	/* Две колонки: значок сверху, стрелка скрыта. */
	.cm-hcats__card {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		padding: 16px;
		border-radius: 18px;
	}

	.cm-hcats__icon {
		width: 48px;
		height: 48px;
		border-radius: 14px;
		font-size: 24px;
	}

	.cm-hcats__card-title {
		font-size: 16px;
	}

	.cm-hcats__card-lead,
	.cm-hcats__go {
		display: none;
	}
}

/* ---------- Вкладки «Топ предложений» ---------- */

.cm-tabs {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

/* Радиокнопки спрятаны, но остаются доступными с клавиатуры. */
.cm-tabs__radio {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.cm-tabs__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-bottom: clamp(20px, 3vw, 32px);
}

.cm-tabs__label {
	padding: 10px 22px;
	border: 1px solid var(--cm-line);
	border-radius: 999px;
	background: #fff;
	color: var(--cm-title);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cm-tabs__label:hover {
	border-color: var(--cm-orange);
	color: var(--cm-orange);
}

.cm-tabs__panel {
	display: none;
}

.cm-tabs__all {
	margin-top: clamp(20px, 3vw, 32px);
	text-align: center;
}

/* Переключение: n-я радиокнопка показывает n-ю панель. */
.cm-tabs__radio:nth-of-type(1):checked ~ .cm-tabs__panels > .cm-tabs__panel:nth-child(1),
.cm-tabs__radio:nth-of-type(2):checked ~ .cm-tabs__panels > .cm-tabs__panel:nth-child(2),
.cm-tabs__radio:nth-of-type(3):checked ~ .cm-tabs__panels > .cm-tabs__panel:nth-child(3),
.cm-tabs__radio:nth-of-type(4):checked ~ .cm-tabs__panels > .cm-tabs__panel:nth-child(4),
.cm-tabs__radio:nth-of-type(5):checked ~ .cm-tabs__panels > .cm-tabs__panel:nth-child(5),
.cm-tabs__radio:nth-of-type(6):checked ~ .cm-tabs__panels > .cm-tabs__panel:nth-child(6) {
	display: block;
}

.cm-tabs__radio:nth-of-type(1):checked ~ .cm-tabs__nav > .cm-tabs__label:nth-child(1),
.cm-tabs__radio:nth-of-type(2):checked ~ .cm-tabs__nav > .cm-tabs__label:nth-child(2),
.cm-tabs__radio:nth-of-type(3):checked ~ .cm-tabs__nav > .cm-tabs__label:nth-child(3),
.cm-tabs__radio:nth-of-type(4):checked ~ .cm-tabs__nav > .cm-tabs__label:nth-child(4),
.cm-tabs__radio:nth-of-type(5):checked ~ .cm-tabs__nav > .cm-tabs__label:nth-child(5),
.cm-tabs__radio:nth-of-type(6):checked ~ .cm-tabs__nav > .cm-tabs__label:nth-child(6) {
	border-color: var(--cm-orange);
	background: var(--cm-orange);
	color: #fff;
}

.cm-tabs__radio:nth-of-type(1):focus-visible ~ .cm-tabs__nav > .cm-tabs__label:nth-child(1),
.cm-tabs__radio:nth-of-type(2):focus-visible ~ .cm-tabs__nav > .cm-tabs__label:nth-child(2),
.cm-tabs__radio:nth-of-type(3):focus-visible ~ .cm-tabs__nav > .cm-tabs__label:nth-child(3),
.cm-tabs__radio:nth-of-type(4):focus-visible ~ .cm-tabs__nav > .cm-tabs__label:nth-child(4),
.cm-tabs__radio:nth-of-type(5):focus-visible ~ .cm-tabs__nav > .cm-tabs__label:nth-child(5),
.cm-tabs__radio:nth-of-type(6):focus-visible ~ .cm-tabs__nav > .cm-tabs__label:nth-child(6) {
	outline: 2px solid var(--cm-dark-grey);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	/* Вкладки в одну строку со свайпом по горизонтали. */
	.cm-tabs__nav {
		flex-wrap: nowrap;
		justify-content: flex-start;
		margin-inline: -15px;
		padding: 2px 15px 6px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}

	.cm-tabs__nav::-webkit-scrollbar {
		display: none;
	}

	.cm-tabs__label {
		padding: 9px 18px;
		font-size: 13px;
		scroll-snap-align: start;
	}

	/* Две колонки: оператор, название, характеристики и цена на одной линии. */
	.cm-home .cm-card__operator {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		line-height: 1.3;
		min-height: 2.6em;
	}

	.cm-home .cm-card__title {
		min-height: calc(1.3em * 3);
	}

	.cm-home .cm-card__title a {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
	}

	.cm-home .cm-specs {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: flex-start;
		gap: 4px;
		min-height: calc(3 * 15.6px + 8px);
	}

	.cm-home .cm-specs__item {
		white-space: nowrap;
	}

	.cm-home .cm-price {
		min-height: calc(13px * 1.2 + 18px);
		justify-content: flex-end;
	}
}

/* ---------- Промо-блок ---------- */

.cm-promo-band {
	position: relative;
	overflow: hidden;
	background: #fff;
	isolation: isolate;
}

.cm-promo-band__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.cm-promo-band__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: right center;
}

.cm-promo-band__inner {
	padding-block: clamp(56px, 8vw, 110px);
}

.cm-promo-band__content {
	max-width: 540px;
}

.cm-promo-band__eyebrow {
	display: block;
	margin-bottom: 10px;
	color: #8e8e8e;
	font-size: 15px;
}

.cm-promo-band__title {
	margin: 0 0 18px;
	color: var(--cm-black);
	font-size: clamp(28px, 3.6vw, 40px);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -0.01em;
	text-transform: uppercase;
}

.cm-promo-band__content p {
	margin: 0 0 14px;
	color: var(--cm-dark-grey);
	font-size: 15px;
	line-height: 1.65;
}

.cm-promo-band__content .cm-promo-band__note {
	margin-bottom: 24px;
	font-style: italic;
}

.cm-promo-band__content .cm-btn {
	padding: 12px 26px;
}

@media (max-width: 900px) {
	/* Картинка над текстом, а не под ним. */
	.cm-promo-band {
		display: flex;
		flex-direction: column;
	}

	.cm-promo-band__media {
		position: static;
		z-index: auto;
		height: clamp(190px, 52vw, 340px);
	}

	.cm-promo-band__media img {
		object-position: 74% 40%;
	}

	.cm-promo-band__inner {
		padding-block: 28px 44px;
	}

	.cm-promo-band__content {
		max-width: none;
	}
}

/* ---------- Лента смартфонов ---------- */

.cm-shelf {
	position: relative;
	min-width: 0;
}

.cm-shelf__radio {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.cm-shelf__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px 32px;
	margin-bottom: clamp(20px, 3vw, 28px);
}

.cm-shelf__intro {
	max-width: 640px;
}

.cm-shelf__eyebrow {
	display: block;
	margin-bottom: 8px;
	color: var(--cm-orange);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.cm-shelf__title {
	margin: 0;
	color: var(--cm-black);
	font-size: clamp(26px, 3.2vw, 36px);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
	text-transform: uppercase;
}

.cm-shelf__nav {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.cm-shelf__label {
	padding: 10px 18px;
	border: 1px solid var(--cm-line);
	border-radius: 999px;
	background: #fff;
	color: var(--cm-title);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cm-shelf__label:hover {
	border-color: var(--cm-orange);
	color: var(--cm-orange);
}

.cm-shelf__panel {
	display: none;
}

.cm-shelf__radio:nth-of-type(1):checked ~ .cm-shelf__panels > .cm-shelf__panel:nth-child(1),
.cm-shelf__radio:nth-of-type(2):checked ~ .cm-shelf__panels > .cm-shelf__panel:nth-child(2),
.cm-shelf__radio:nth-of-type(3):checked ~ .cm-shelf__panels > .cm-shelf__panel:nth-child(3) {
	display: block;
}

.cm-shelf__radio:nth-of-type(1):checked ~ .cm-shelf__head .cm-shelf__label:nth-child(1),
.cm-shelf__radio:nth-of-type(2):checked ~ .cm-shelf__head .cm-shelf__label:nth-child(2),
.cm-shelf__radio:nth-of-type(3):checked ~ .cm-shelf__head .cm-shelf__label:nth-child(3) {
	border-color: var(--cm-orange);
	background: var(--cm-orange);
	color: #fff;
}

.cm-shelf__radio:nth-of-type(1):focus-visible ~ .cm-shelf__head .cm-shelf__label:nth-child(1),
.cm-shelf__radio:nth-of-type(2):focus-visible ~ .cm-shelf__head .cm-shelf__label:nth-child(2),
.cm-shelf__radio:nth-of-type(3):focus-visible ~ .cm-shelf__head .cm-shelf__label:nth-child(3) {
	outline: 2px solid var(--cm-dark-grey);
	outline-offset: 2px;
}

.cm-shelf__track {
	display: flex;
	align-items: stretch;
	gap: 16px;
	margin-inline: -15px;
	padding: 4px 15px 8px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 15px;
	scrollbar-width: none;
	cursor: grab;
	-webkit-overflow-scrolling: touch;
}

.cm-shelf__track::-webkit-scrollbar {
	display: none;
}

.cm-shelf__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
}

.cm-phone {
	position: relative;
	display: flex;
	flex: 0 0 calc((100% - 48px) / 4.25);
	flex-direction: column;
	min-width: 200px;
	overflow: hidden;
	border: 1px solid var(--cm-line);
	border-radius: 16px;
	background: #fff;
	scroll-snap-align: start;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.cm-phone:hover,
.cm-phone:focus-within {
	border-color: transparent;
	box-shadow: var(--cm-shadow);
	transform: translateY(-4px);
}

.cm-phone__media {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f7f8fa;
}

.cm-phone__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Кадры Kimovil default_big — телефон по центру широкого белого поля. */
.cm-phone__media img[src*="default_big"] {
	transform: scale(2.15);
}

.cm-phone__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: 14px 16px 16px;
}

.cm-phone__brand {
	color: var(--cm-orange);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.cm-phone__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.cm-phone__title a {
	display: -webkit-box;
	overflow: hidden;
	color: var(--cm-black);
	text-decoration: none;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	transition: color 0.2s;
}

.cm-phone__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.cm-phone:hover .cm-phone__title a,
.cm-phone__title a:focus-visible {
	color: var(--cm-orange);
}

.cm-phone__title a:focus-visible {
	outline: none;
}

.cm-phone:focus-within {
	outline: 2px solid var(--cm-orange);
	outline-offset: 2px;
}

.cm-phone__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	padding-top: 4px;
	color: var(--cm-orange);
	font-size: 13px;
	font-weight: 700;
}

@media (max-width: 900px) {
	.cm-shelf__head {
		flex-direction: column;
		align-items: flex-start;
	}

	.cm-shelf__nav {
		justify-content: flex-start;
	}

	.cm-phone {
		flex-basis: calc((100% - 16px) / 2.25);
	}
}

@media (max-width: 600px) {
	.cm-phone {
		flex-basis: 78%;
		min-width: 0;
	}
}

/* ---------- Новости ---------- */
/* Классы только внутри главной: в футере тот же cm-news, но другая вёрстка. */

.cm-home .cm-news {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.cm-home .cm-news__item {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--cm-line);
	border-radius: 16px;
	background: #fff;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.cm-home .cm-news__item:hover,
.cm-home .cm-news__item:focus-within {
	border-color: transparent;
	box-shadow: var(--cm-shadow);
	transform: translateY(-4px);
}

.cm-home .cm-news__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background: var(--cm-bg-soft);
}

.cm-home .cm-news__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cm-home .cm-news__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: 16px 18px 18px;
}

.cm-home .cm-news__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.cm-home .cm-news__cat {
	color: var(--cm-orange);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.cm-home .cm-news__date {
	margin-left: auto;
	color: var(--cm-text);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
}

.cm-home .cm-news__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.cm-home .cm-news__title a {
	color: var(--cm-black);
	text-decoration: none;
	transition: color 0.2s;
}

.cm-home .cm-news__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.cm-home .cm-news__item:hover .cm-news__title a,
.cm-home .cm-news__title a:focus-visible {
	color: var(--cm-orange);
}

.cm-home .cm-news__title a:focus-visible {
	outline: none;
}

.cm-home .cm-news__item:focus-within {
	outline: 2px solid var(--cm-orange);
	outline-offset: 2px;
}

.cm-home .cm-news__excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--cm-text);
	font-size: 14px;
	line-height: 1.55;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
}

.cm-home .cm-news__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
	margin-top: auto;
	padding-top: 6px;
}

.cm-home .cm-news__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--cm-orange);
	font-size: 13px;
	font-weight: 700;
}

.cm-home .cm-news__partner {
	margin-left: auto;
	color: #8a919a;
	font-size: 12px;
	line-height: 1.3;
	text-align: right;
}

@media (max-width: 760px) {
	/* Лента новостей со свайпом. */
	.cm-home .cm-news {
		display: flex;
		margin-inline: -15px;
		padding: 2px 15px 8px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		gap: 14px;
	}

	.cm-home .cm-news::-webkit-scrollbar {
		display: none;
	}

	.cm-home .cm-news__item {
		flex: 0 0 80%;
		scroll-snap-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cm-hcats__op,
	.cm-hcats__card,
	.cm-hcats__go,
	.cm-home .cm-news__item,
	.cm-phone {
		transition: none;
	}

	.cm-hcats__op:hover,
	.cm-hcats__card:hover,
	.cm-hcats__card:hover .cm-hcats__go,
	.cm-home .cm-news__item:hover,
	.cm-phone:hover {
		transform: none;
	}
}
