/* =========================================================
   project-detail.css — стили страницы «Карточка проекта»
   Зависит от глобального /assets/css/styles.css
   ========================================================= */

/* ===================== 0) ЛОКАЛЬНЫЕ ОТСТУПЫ/ТЕКСТЫ/КНОПКИ ===================== */
.header + main.section {
	padding-top: 4px;
}

.section-sub--left {
	text-align: left;
}

.btn-wrapper {
	padding: 30px 0;
}

.btn--ghost {
	background: #fff;
	color: var(--ink);
	border: 1px solid var(--line);
	padding: 10px 14px;
	border-radius: 10px;
	font-weight: 700;
	box-shadow: 0 2px 8px rgba(17, 25, 40, 0.04);
}

.project-detail {
	padding-top: 1px;
}

/* Make gap between header and back button smaller */
.project-detail > p:first-child {
	margin-top: 4px;
}

.btn--ghost:hover {
	background: var(--blue);
	color: #fff;
}

/* ===== MEDIA 0) ЛОКАЛЬНЫЕ ===== */
@media (max-width: 920px) {
	.main--title {
		text-align: center;
	}
	.project-detail .btn-wrapper {
		text-align: left !important;
	}
	.section-sub--left {
		text-align: center;
	}
}
@media (max-width: 540px) {
	.header + main.section {
		padding-top: 1px;
	}
}

/* ===================== 1) ДВУХКОЛОНОЧНАЯ СЕТКА СТРАНИЦЫ ===================== */
.pd-grid {
	display: grid;
	gap: clamp(24px, 4vw, 48px);
	grid-template-columns: 1.1fr 1fr;
	align-items: start;
}

/* Блок-описание на всю ширину */
.pd-grid > .pd-disclaimer {
	grid-column: 1 / -1;
	margin-top: 12px;
}

/* ===== MEDIA 1) Сетка ===== */
@media (max-width: 920px) {
	.pd-grid {
		grid-template-columns: 1fr;
	}
}

/* ===================== 2) ГАЛЕРЕЯ ПРОЕКТА ===================== */
.pd-gallery {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

/* Главное изображение */
.pd-main {
	width: 100%;
	max-width: 900px;
	border-radius: 12px;
	border: 1px solid var(--line);
	overflow: hidden;
	background: #fff;
	cursor: zoom-in;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: auto; /* снимаем фиксированное соотношение */
}

/* Чтобы контейнер не схлопывался до нуля до загрузки изображения */
.pd-main::before {
	content: '';
	display: block;
	padding-top: 56.25%; /* резерв под 16:9 до появления картинки */
}

.pd-main img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	display: block;
	transition: transform 0.4s ease, opacity 0.3s ease;
	transform: scale(1.02);
}

.pd-main img:hover {
	transform: scale(1.06);
}

/* Превью */
.pd-thumbs {
	display: flex;
	gap: 12px;
	margin-top: 14px;
	padding-bottom: 6px;
	max-width: 1000px;
	width: 100%;
	justify-content: flex-start;
	overflow-x: auto;
	scroll-behavior: smooth;
}

.pd-thumbs::-webkit-scrollbar {
	height: 6px;
}
.pd-thumbs::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 3px;
}

.pd-thumbs img {
	width: 120px;
	height: 68px;
	object-fit: cover;
	border-radius: 8px;
	border: 2px solid var(--line);
	background: #fff;
	cursor: pointer;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.pd-thumbs img:hover {
	box-shadow: 0 4px 3px rgba(0, 0, 0, 0.15);
}
.pd-thumbs img.active {
	border-color: var(--blue, #2563eb);
}

/* ===================== 3) ПРАВАЯ КОЛОНКА: ИНФО/ЦЕНЫ/ДЕЙСТВИЯ ===================== */
.pd-info {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.pd-specs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: space-between;
}

.spec {
	width: 48%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: #fff;
	min-width: 0;
}

.spec img {
	width: 18px;
	height: 18px;
	opacity: 0.9;
}

.spec span {
	color: var(--muted);
	flex: 1 1 auto;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.spec strong {
	margin-left: auto;
	flex: 0 0 auto;
	white-space: nowrap;
}

.pd-pricebox {
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--bg);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pd-pricebox__title {
	font-weight: 800;
	color: var(--heading);
}

.pd-pricebox__value {
	font-size: 1.375rem;
	font-weight: 800;
}

.pd-variant-groups {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pd-variant-group {
	margin: 0;
	padding: 0;
	border: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pd-variant-group legend {
	width: 100%;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 4px;
}

.pd-region-select {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.875rem;
}

.pd-region-select span {
	font-weight: 600;
	color: var(--muted);
}

.pd-region-select select {
	width: 100%;
	min-height: 38px;
	border-radius: 999px;
	border: 1px solid var(--line);
	padding: 6px 14px;
	font-weight: 600;
	font-family: inherit;
	background: #fff;
}

.pd-pricebox__selection {
	font-size: 0.875rem;
	color: var(--muted);
	margin: 0;
}

.pd-pricebox__selection--empty {
	display: none;
}

.pd-pricebox__note {
	font-size: 0.875rem;
	color: var(--muted);
	margin: 0;
}

.pd-hidden-variants,
.pd-variant-hidden {
	display: none;
}

.pd-variants {
	margin: 6px 0 4px;
	border: 0;
	padding: 0;
}

.chip2 {
	position: relative;
	display: inline-flex;
	margin: 6px 8px 0 0;
	cursor: pointer;
}

.chip2 input {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
}

.chip2__body {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: #fff;
	font-weight: 600;
	font-size: 0.875rem;
	transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
		color 0.2s ease;
}

.chip2 input:checked + .chip2__body {
	border-color: var(--blue-strong);
	background: rgba(31, 110, 214, 0.12);
	box-shadow: 0 6px 16px rgba(31, 110, 214, 0.16);
}

.chip2 input:focus-visible + .chip2__body {
	outline: 2px solid var(--blue-strong);
	outline-offset: 2px;
}

.chip2 input:disabled + .chip2__body {
	border-color: var(--line);
	background: var(--bg-soft);
	color: var(--muted);
	box-shadow: none;
	cursor: not-allowed;
}

.pd-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #fff;
	font-weight: 800;
	font-size: 1.25rem;
	line-height: 1;
	box-shadow: 0 4px 12px rgba(17, 25, 40, 0.08);
}

.proj-nav {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

/* ===== MEDIA 3) Инфо ===== */
@media (max-width: 1100px) {
	.pd-specs {
		justify-content: center;
		gap: 12px;
	}

	.spec {
		width: 46%;
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 6px;
		padding: 12px 10px;
	}

	.spec img {
		width: 20px;
		height: 20px;
		opacity: 0.9;
	}

	.spec span {
		flex: 0 0 auto;
		white-space: nowrap;
		overflow: visible;
		text-overflow: initial;
	}

	.spec strong {
		margin-left: 0;
		flex: 0 0 auto;
		white-space: nowrap;
	}
}
@media (max-width: 770px) {
	.pd-pricebox {
		padding: 14px;
		align-items: stretch !important;
		text-align: left;
	}

	.pd-pricebox__header {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.pd-pricebox__selection {
		text-align: left;
	}

	.pd-variant-group {
		justify-content: flex-start;
	}
}

@media (max-width: 540px) {
	.pd-actions {
		gap: 10px;
	}
	.icon-btn {
		width: 36px;
		height: 36px;
	}
}

/* ===================== Блок «Важно о стоимости» ===================== */
.pd-disclaimer {
	padding: 20px 24px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: #fff;
	margin-top: 24px;
	box-shadow: 0 4px 12px rgba(17, 25, 40, 0.05);
	transition: box-shadow 0.25s;
}

.pd-disclaimer__title {
	display: inline-block;
	font-weight: 700;
	padding-bottom: 20px;
	font-size: 1.25rem;
	color: var(--heading);
	transition: color 0.2s, text-decoration 0.2s;
	text-decoration: none;
}

.pd-disclaimer > p,
.pd-disclaimer > ul > li {
	text-align: left;
}

.pd-disclaimer .js-open-order {
	position: relative;
	cursor: pointer;
	color: var(--blue);
}

.pd-disclaimer .js-open-order::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 0%;
	height: 2px;
	background-color: currentColor;
	transition: width 0.3s ease;
}

.pd-disclaimer .js-open-order:hover::after {
	width: 100%;
}

.pd-disclaimer .js-open-order:hover {
	text-decoration: none;
}

.pd-disclaimer__list {
	margin-top: 12px;
	margin-bottom: 12px;
	padding-left: 20px;
	list-style-type: disc;
}

.pd-disclaimer__cta {
	margin-top: 16px;
	font-weight: 600;
}
