/* =========================================================
   СТРАНИЦА 3D-МОДЕЛИ — по макету Figma «HP», фрейм 3d/vintagechair01
   Подключается вместе с project.css (общие шрифты, подвал).
   ========================================================= */

/* Белая шапка с тёмным логотипом */
.model-header {
	display: flex;
	justify-content: center;
	padding: var(--gutter);
}

.model-header a {
	display: block;
	line-height: 0;
}

.model-header img {
	width: 257px;
	height: 50px;
}

/* Две колонки: просмотрщик + описание. На узком экране — друг под другом. */
.model {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: center;
	gap: 40px;
	padding: 0 var(--gutter) 140px;
}

/* ---------- Просмотрщик ---------- */
.viewer {
	position: relative;
	flex: 1 0 0;
	min-width: 400px;
	max-width: 800px;
	aspect-ratio: 636 / 800;
	overflow: hidden;
	background: #e8e8e8;
	/* цвет фона рендеров, пока грузится кадр */
	cursor: grab;
	touch-action: pan-y;
	/* вертикальная прокрутка на телефоне работает */
	user-select: none;
	-webkit-user-select: none;
}

.viewer.is-dragging {
	cursor: grabbing;
}

.viewer:focus-visible {
	outline: 2px solid #141414;
	outline-offset: 4px;
}

/* Кадр — квадрат на всю высоту, по центру, края по бокам обрезаются */
.viewer__frame {
	position: absolute;
	top: 0;
	left: 50%;
	height: 100%;
	width: auto;
	aspect-ratio: 1;
	max-width: none;
	translate: -50% 0;
	pointer-events: none;
	-webkit-user-drag: none;
}

/* Переключатель режимов в левом верхнем углу */
.viewer__modes {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	z-index: 1;
}

.viewer__mode {
	display: grid;
	place-items: center;
	width: 48px;
	height: 50px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #141414;
	cursor: pointer;
}

.viewer__mode svg {
	width: 32px;
	height: 32px;
}

.viewer__mode[aria-pressed="true"] {
	background: #141414;
	color: #fff;
}

/* Полоска загрузки внизу просмотрщика */
.viewer__progress {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 2px;
	width: 0;
	background: #141414;
	transition: width 0.2s, opacity 0.6s;
}

.viewer__progress.is-done {
	opacity: 0;
}

/* Подсказка «потяните, чтобы повернуть» — исчезает после первого движения */
.viewer__hint {
	position: absolute;
	left: 50%;
	bottom: 20px;
	translate: -50% 0;
	margin: 0;
	padding: 8px 14px;
	border-radius: 0px;
	background: #141414;
	color: #fff;
	font-size: 14px;
	white-space: nowrap;
	pointer-events: none;
	transition: opacity 0.6s;
}

.viewer.was-dragged .viewer__hint {
	opacity: 0;
}

/* ---------- Описание ---------- */
.model-info {
	flex: 1 0 0;
	min-width: 320px;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	gap: 40px;
	color: #141414;
	font-size: 16px;
	line-height: 21px;
}

.model-info__head {
	display: flex;
	flex-direction: column;
	gap: 40px;
	padding-top: 40px;
}

.model-info__meta {
	display: flex;
	justify-content: space-between;
	gap: 20px;
}

.model-info h1 {
	margin: 0;
	font-size: 24px;
	line-height: 30px;
	font-weight: 600;
}

.model-info p {
	margin: 0;
}

/* Характеристики: подпись слева, значение справа */
.specs {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 20px 40px;
	margin: 0;
}

.specs dt,
.specs dd {
	margin: 0;
}

/* Цена и кнопка */
.buy {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.buy__row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 25px;
}

.buy__price {
	font-size: 36px;
	font-weight: 500;
	line-height: 1;
}

.buy__button {
	display: inline-block;
	padding: 15px 30px 20px;
	border-radius: 15px;
	background: #141414;
	color: #fff;
	font-size: 36px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	transition: background 0.3s;
}

.buy__button:hover {
	background: #3a3a3a;
}

.buy__note a {
	color: inherit;
	text-underline-position: from-font;
}

/* --- Телефоны --- */
@media (max-width: 760px) {
	.model {
		padding-bottom: 80px;
	}

	.viewer {
		min-width: 100%;
	}

	.model-info {
		min-width: 100%;
	}

	.model-info__head {
		padding-top: 0;
	}

	.model-header img {
		width: 180px;
		height: auto;
	}
}
