/*
 * Карточка товара: галерея, цена тарифа, характеристики, похожие.
 */

.cm-product,
.cm-product * {
	box-sizing: border-box;
}

.cm-product {
	container-type: inline-size;
	container-name: cmproduct;
}

.cm-product .cm-section {
	padding-top: 20px;
}

.cm-product__hero {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
	gap: 32px;
	align-items: start;
}

.cm-gallery__stage {
	display: grid;
	touch-action: pan-y;
}

.cm-gallery__stage img {
	display: none;
	grid-area: 1 / 1;
	width: 100%;
	height: auto;
}

/* Фото смартфонов приходят в разных пропорциях. Рамка одна, картинка целиком внутри. */
.cm-product--device .cm-gallery__stage {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 16px;
	background: #f7f8fa;
}

.cm-product--device .cm-gallery__stage img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 12px;
}

.cm-gallery--single .cm-gallery__stage img,
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(1) .cm-gallery__pick:checked) .cm-gallery__stage img:nth-child(1),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(2) .cm-gallery__pick:checked) .cm-gallery__stage img:nth-child(2),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(3) .cm-gallery__pick:checked) .cm-gallery__stage img:nth-child(3),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(4) .cm-gallery__pick:checked) .cm-gallery__stage img:nth-child(4),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(5) .cm-gallery__pick:checked) .cm-gallery__stage img:nth-child(5),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(6) .cm-gallery__pick:checked) .cm-gallery__stage img:nth-child(6),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(7) .cm-gallery__pick:checked) .cm-gallery__stage img:nth-child(7),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(8) .cm-gallery__pick:checked) .cm-gallery__stage img:nth-child(8) {
	display: block;
}

.cm-gallery__thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	overflow-x: auto;
	overflow-y: hidden;
	touch-action: pan-x;
	-webkit-overflow-scrolling: touch;
}

.cm-gallery__thumbs label {
	position: relative;
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	border: 1.5px solid var(--cm-line);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	overflow: hidden;
}

/* Переключатель лежит в миниатюре: фокус не уезжает к началу страницы. */
.cm-gallery__pick {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.cm-gallery__thumbs img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 6px;
}

.cm-gallery:has(.cm-gallery__thumbs label:nth-child(1) .cm-gallery__pick:checked) .cm-gallery__thumbs label:nth-child(1),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(2) .cm-gallery__pick:checked) .cm-gallery__thumbs label:nth-child(2),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(3) .cm-gallery__pick:checked) .cm-gallery__thumbs label:nth-child(3),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(4) .cm-gallery__pick:checked) .cm-gallery__thumbs label:nth-child(4),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(5) .cm-gallery__pick:checked) .cm-gallery__thumbs label:nth-child(5),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(6) .cm-gallery__pick:checked) .cm-gallery__thumbs label:nth-child(6),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(7) .cm-gallery__pick:checked) .cm-gallery__thumbs label:nth-child(7),
.cm-gallery:has(.cm-gallery__thumbs label:nth-child(8) .cm-gallery__pick:checked) .cm-gallery__thumbs label:nth-child(8) {
	border-color: var(--cm-orange);
}

.cm-product__title {
	margin: 0;
	color: var(--cm-black);
	font-size: clamp(26px, 4vw, 40px);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.cm-product .cm-product__summary > * + * {
	margin-top: 16px;
}

.cm-product__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px 6px;
}

.cm-product__amount {
	color: var(--cm-black);
	font-size: 32px;
	font-weight: 800;
	line-height: 1;
}

.cm-product__price small,
.cm-product__price del {
	color: var(--cm-title);
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
}

.cm-product__price > .cm-byn {
	width: 20px;
	height: 22px;
	margin-left: 4px;
	color: var(--cm-black);
	flex: none;
}

.cm-product__price del .cm-byn {
	width: 0.72em;
	height: 0.78em;
	margin-left: 0.12em;
	color: inherit;
}

.cm-product__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

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

.cm-product .cm-product__summary > .cm-product__highlights {
	margin-top: 20px;
}

.cm-product__highlights li {
	min-width: 0;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--cm-bg-soft);
}

.cm-product__highlights span {
	display: block;
	margin-bottom: 6px;
	color: var(--cm-text);
	font-size: 13px;
	line-height: 1.3;
}

.cm-product__highlights strong {
	display: block;
	color: var(--cm-black);
	font-size: 18px;
	font-weight: 800;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.cm-product__highlights strong a {
	color: inherit;
	text-decoration: none;
}

.cm-product__highlights strong a:hover {
	color: var(--cm-orange);
}

.cm-product__tool {
	text-transform: none;
	letter-spacing: 0;
}

.cm-product__tool.is-on {
	border-color: var(--cm-orange);
	background: var(--cm-orange);
	color: #fff;
}

.cm-product__tool--wish.is-on .cm-icon {
	fill: currentColor;
}

.cm-product__store {
	margin-top: 0;
}

.cm-product__detail-row {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

.cm-product__detail {
	flex: 0 0 auto;
	padding: 12px 28px;
	border-color: #111;
	border-radius: 4px;
	background: #111;
	color: #fff;
}

.cm-product__detail:hover,
.cm-product__detail:focus-visible {
	border-color: #333;
	background: #333;
	color: #fff;
}

.cm-product__note {
	margin: 0;
	max-width: 420px;
	padding: 10px 12px;
	border-radius: 4px;
	background: #fdf6f0;
	color: #888;
	font-size: 12px;
	line-height: 1.5;
}

.cm-product__note strong {
	color: #555;
	font-weight: 700;
}

.cm-product__note span {
	color: #d35400;
}

.cm-product__store p {
	margin: 0 0 12px;
	color: var(--cm-text);
	font-size: 14px;
	line-height: 1.5;
}

.cm-product__specs,
.cm-product__about,
.cm-product__related,
.cm-product__facts {
	margin-top: clamp(28px, 4vw, 48px);
}

.cm-product__facts:has(.cm-product__specs):has(.cm-tariff-offer) {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
	gap: 28px 32px;
	align-items: start;
}

.cm-product__facts .cm-product__specs {
	margin-top: 0;
}

.cm-tariff-offer__body {
	padding: 18px 20px 8px;
	border-radius: 16px;
	background: var(--cm-bg-soft);
}

.cm-tariff-offer__media {
	display: none;
	margin: 0 0 14px;
}

.cm-tariff-offer__media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

.cm-tariff-offer__text {
	color: var(--cm-title);
	font-size: 15px;
	line-height: 1.55;
}

.cm-tariff-offer__text p,
.cm-tariff-offer__text ul {
	margin: 0 0 12px;
}

.cm-tariff-offer__text ul {
	padding-left: 1.15em;
}

.cm-tariff-offer__text li + li {
	margin-top: 4px;
}

.cm-tariff-offer__text a {
	color: var(--cm-orange);
	font-weight: 700;
}

.cm-product__updated {
	margin: 16px 0 0;
	color: #444;
	font-size: 14px;
	line-height: 1.6;
}

.cm-product__also {
	margin: 14px 0 0;
	color: var(--cm-text);
	font-size: 15px;
	line-height: 1.55;
}

@media (min-width: 860px) {
	.cm-product__also {
		white-space: nowrap;
	}
}

.cm-product__also a {
	color: var(--cm-black);
	font-weight: 700;
}

.cm-product__specs h2,
.cm-product__about h2,
.cm-product__related h2,
.cm-tariff-offer__title {
	margin: 0 0 14px;
	color: var(--cm-black);
	font-size: 22px;
	font-weight: 800;
}

.cm-product__table-wrap {
	overflow-x: auto;
	border: 1px solid var(--cm-line);
	border-radius: var(--cm-radius);
	background: #fff;
}

.cm-product__table {
	width: 100%;
	border-collapse: collapse;
}

.cm-product__table th,
.cm-product__table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--cm-line);
	text-align: left;
	vertical-align: top;
}

.cm-product__table tr:last-child th,
.cm-product__table tr:last-child td {
	border-bottom: 0;
}

.cm-product__table th {
	width: 42%;
	color: var(--cm-text);
	font-weight: 600;
}

.cm-product__table td {
	color: var(--cm-black);
}

.cm-product__table a {
	color: var(--cm-orange);
	font-weight: 700;
	text-decoration: none;
}

.cm-product__table a:hover,
.cm-product__table a:focus-visible {
	text-decoration: underline;
}

.cm-product__related .cm-shop__grid {
	grid-column: auto;
	grid-row: auto;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cm-product__price .cm-card__badge {
	position: static;
}

@container cmproduct (max-width: 860px) {
	.cm-product__hero {
		grid-template-columns: minmax(0, 1fr);
	}

	.cm-product__facts:has(.cm-product__specs):has(.cm-tariff-offer) {
		grid-template-columns: minmax(0, 1fr);
	}

	.cm-tariff-offer__media {
		display: block;
	}

	.cm-product__related .cm-shop__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container cmproduct (max-width: 720px) {
	.cm-product__detail-row {
		flex-direction: column;
		align-items: stretch;
	}

	.cm-product__detail {
		align-self: flex-start;
	}
}

@container cmproduct (max-width: 460px) {
	.cm-product__highlights {
		gap: 8px;
	}

	.cm-product__highlights li {
		padding: 12px 8px;
	}

	.cm-product__highlights strong {
		font-size: 15px;
	}

	.cm-product__related .cm-shop__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.cm-product__table th {
		width: 46%;
	}
}

@container cmproduct (max-width: 340px) {
	.cm-product__highlights strong {
		font-size: 14px;
	}
}

/* Лист характеристик смартфона, как на боевом сайте. */

.cmby-spec-sheet {
    max-width: 980px;
    margin: 28px auto 0;
}

.cmby-spec-sheet__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin: 0 0 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.cmby-spec-sheet__nav a {
    color: #242424;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f4f4f4;
}

.cmby-spec-sheet__nav a:hover {
    background: #ff6500;
    color: #fff;
}

.cmby-spec-block {
    margin: 0 0 28px;
}

.cmby-spec-block__title {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cmby-spec-block--related .cmby-spec-block__title {
    display: inline-block;
    margin-bottom: 8px;
}

.cmby-spec-kin {
    margin-top: 6px;
}

.cmby-spec-kin__row {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    gap: 12px 20px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #ececec;
}

.cmby-spec-kin__row:last-child {
    border-bottom: none;
}

.cmby-spec-kin__label {
    color: #9a9a9a;
    font-size: 14px;
    font-weight: 500;
}

.cmby-spec-kin__value,
.cmby-spec-kin__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #242424;
    text-decoration: none;
}

.cmby-spec-kin__link:hover .cmby-spec-kin__name {
    color: #ff6500;
}

.cmby-spec-kin__thumb,
.cmby-spec-kin__ph {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 4px;
    background: #ececec;
}

.cmby-spec-kin__ph {
    box-shadow: inset 0 0 0 1px #ddd;
    background:
        linear-gradient(#d0d0d0, #d0d0d0) 50% 18% / 10px 2px no-repeat,
        linear-gradient(#f7f7f7, #e8e8e8);
}

.cmby-spec-kin__name {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

.cmby-spec-block__lead {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.5;
}

.cmby-spec-copy {
    max-width: 720px;
    margin: 4px 0 8px;
    color: #444;
    font-size: 15px;
    line-height: 1.7;
}

.cmby-spec-copy p {
    margin: 0 0 14px;
}

.cmby-spec-copy p:last-child {
    margin-bottom: 0;
}

.cmby-spec-copy a {
    color: #ff6500;
    text-decoration: none;
    font-weight: 600;
}

.cmby-spec-copy a:hover {
    color: #e55a00;
}

.cmby-spec-rows {
    margin: 0;
}

.cmby-spec-row {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 10px 20px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cmby-spec-row dt {
    margin: 0;
    color: #888;
    font-size: 13px;
    font-weight: 500;
}

.cmby-spec-row dd {
    margin: 0;
    color: #1d1d1d;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.cmby-spec-row dd a {
    color: #ff6500;
    text-decoration: none;
}

.cmby-spec-row dd a:hover {
    color: #e55a00;
}

.cmby-spec-row__note {
    color: #999;
    font-size: 12px;
    font-weight: 500;
}

.cmby-spec-block--camera {
    position: relative;
    overflow: hidden;
    margin: 8px -12px 32px;
    padding: 28px 24px 24px 28px;
    border-radius: 18px;
    background-color: #000;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cmby-spec-block--camera:before {
    content: "";
    position: absolute;
    pointer-events: none;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #ff6500;
}

.cmby-spec-block--camera .cmby-spec-block__inner {
    position: relative;
    z-index: 1;
}

.cmby-spec-camera-deco {
    position: absolute;
    top: 0;
    right: 0;
    width: min(52%, 520px);
    height: 300px;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.cmby-spec-camera-deco__img,
.cmby-spec-camera-deco__blur {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: url("../img/cmby-spec-camera-bg.jpg") no-repeat top right;
    background-size: cover;
}

.cmby-spec-camera-deco__blur {
    top: -36px;
    right: 0;
    bottom: -48px;
    left: -48px;
    width: auto;
    height: auto;
    filter: blur(22px);
    transform: scale(1.06);
    -webkit-mask-image:
        linear-gradient(90deg, #000 0%, #000 46%, transparent 78%),
        linear-gradient(180deg, transparent 18%, #000 78%);
    -webkit-mask-composite: destination-in;
    mask-image:
        linear-gradient(90deg, #000 0%, #000 46%, transparent 78%),
        linear-gradient(180deg, transparent 18%, #000 78%);
    mask-composite: intersect;
}

.cmby-spec-camera-deco__img {
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.2) 26%, #000 62%),
        linear-gradient(180deg, #000 38%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
    -webkit-mask-composite: destination-in;
    mask-image:
        linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.2) 26%, #000 62%),
        linear-gradient(180deg, #000 38%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
    mask-composite: intersect;
}

.cmby-spec-camera-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
}

.cmby-spec-camera-head__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    color: #ff6500;
    background: none;
    border: 0;
    box-shadow: none;
}

.cmby-spec-camera-head__icon svg {
    display: block;
    width: 44px;
    height: 44px;
}

.cmby-spec-camera-head__text {
    position: relative;
    padding-bottom: 12px;
}

.cmby-spec-camera-head__text:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 88px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, #ff6500 0%, rgba(255, 101, 0, 0) 100%);
}

.cmby-spec-camera-head__eyebrow {
    margin: 0 0 4px;
    color: #ff6500;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.cmby-spec-block--camera .cmby-spec-block__title {
    margin: 0;
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.cmby-spec-cameras {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 12px;
    margin: 4px 0 20px;
}

.cmby-spec-camera {
    padding: 16px 14px;
    border: 1px solid rgba(255, 101, 0, 0.28);
    border-radius: 14px;
    background: #0d0d0d;
}

.cmby-spec-camera__role {
    color: #ff6500;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cmby-spec-camera__mp {
    margin: 6px 0 4px;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.cmby-spec-camera__meta,
.cmby-spec-camera__detail {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.4;
}

.cmby-spec-camera__detail {
    margin-top: 8px;
}

.cmby-spec-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.cmby-spec-score {
    display: flex;
    flex-direction: column;
    padding: 14px 14px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 101, 0, 0.18), rgba(255, 101, 0, 0.05));
    border: 1px solid rgba(255, 101, 0, 0.35);
    color: #fff !important;
    text-decoration: none !important;
}

.cmby-spec-score:hover {
    border-color: #ff6500;
    background: linear-gradient(180deg, rgba(255, 101, 0, 0.28), rgba(255, 101, 0, 0.08));
}

.cmby-spec-score--empty {
    cursor: default;
    background: #0d0d0d;
    border-color: rgba(255, 255, 255, 0.08);
}

.cmby-spec-score--empty:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: #0d0d0d;
}

.cmby-spec-score--empty .cmby-spec-score__value {
    color: rgba(255, 255, 255, 0.32);
}

.cmby-spec-score__value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #ff6500;
    line-height: 1;
}

.cmby-spec-score__label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
}

.cmby-spec-score__sub {
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.62);
}

.cmby-spec-block--camera .cmby-spec-row {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.cmby-spec-block--camera .cmby-spec-row dt {
    color: rgba(255, 255, 255, 0.55);
}

.cmby-spec-block--camera .cmby-spec-row dd {
    color: #fff;
}

.cmby-spec-block--camera .cmby-spec-row dd a {
    color: #ffb27a;
}

@media (max-width: 767px) {
    .cmby-spec-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .cmby-spec-kin__row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px 0;
    }

    .cmby-spec-block--camera {
        margin-left: -8px;
        margin-right: -8px;
        padding: 22px 16px 18px;
        border-radius: 14px;
    }

    .cmby-spec-camera-deco {
        width: 68%;
        height: 170px;
    }

    .cmby-spec-score__value {
        font-size: 26px;
    }
}
