/* Детальная страница объекта недвижимости (single-apps.php) */

/* переменные на :root — ими пользуется и нижняя панель, которая лежит вне .apt */
:root {
	--apt-dark: #202020;
	--apt-text: #4a4a4a;
	--apt-muted: #8a8a8a;
	--apt-line: #e6e6e6;
	--apt-gold: rgba(193, 154, 107, 1);
	--apt-gold-soft: #f6efe6;
	--apt-bg-soft: #f7f7f7;
	--apt-radius: 16px;
}
.apt {
	text-align: left;
	padding-top: 0;
}
.apt *, .apt-mobilebar * { box-sizing: border-box; }

.apt__grid {
	display: flex;
	align-items: flex-start;
	gap: 48px;
}
.apt__col--main { flex: 1 1 auto; min-width: 0; }
.apt__col--side { flex: 0 0 520px; width: 520px; }

/* хлебные крошки над карточкой (их выводит шапка сайта) */
body.is-apt .news-main { padding-bottom: 10px; }
body.is-apt .news-main .breadcumbs { gap: 4px; }
body.is-apt .news-main .breadcumbs a,
body.is-apt .news-main .breadcumbs span { font-size: 14px; line-height: 18px; color: var(--apt-muted); }
body.is-apt .news-main .breadcumbs a:hover { color: var(--apt-dark); }

/* ---------- галерея ---------- */
.apt-gallery__main {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: var(--apt-radius);
	background: var(--apt-bg-soft);
	aspect-ratio: 4 / 3;
	max-height: 560px;
}
.apt-gallery__main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}
.apt-gallery__main:hover img { transform: scale(1.02); }
.apt-gallery__label {
	position: absolute;
	left: 16px;
	top: 16px;
	padding: 6px 12px;
	border-radius: 8px;
	background: rgba(32, 32, 32, .8);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.apt-gallery__thumbs {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 10px;
	margin-top: 12px;
}
.apt-gallery__thumb {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 10px;
	aspect-ratio: 1 / 1;
	border: 2px solid transparent;
	background: var(--apt-bg-soft);
	transition: border-color .2s;
}
.apt-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	opacity: .85;
	transition: opacity .2s;
}
.apt-gallery__thumb:hover img,
.apt-gallery__thumb.is-active img { opacity: 1; }
.apt-gallery__thumb.is-active { border-color: var(--apt-gold); }
.apt-gallery__thumb--more span {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(32, 32, 32, .55);
	color: #fff;
	font-size: 18px;
	font-weight: 600;
}

/* лента для мобильных: на десктопе скрыта */
.apt-gallery__strip { display: none; }

/* ---------- описание ---------- */
.apt-desc { margin-top: 40px; }
.apt-desc__title,
.apt-desc h2.apt-desc__title {
	margin: 0 0 16px;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--apt-dark);
	text-transform: none;
}
.apt-desc__text {
	font-size: 16px;
	line-height: 1.65;
	color: var(--apt-text);
}
.apt-desc__text p { margin: 0 0 14px; }
.apt-desc__text p:last-child { margin-bottom: 0; }
.apt-desc__text ul, .apt-desc__text ol { margin: 0 0 14px 20px; }
.apt-desc__text img { max-width: 100%; height: auto; border-radius: 12px; }

/* ---------- риэлтор ---------- */
.apt-agent {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-top: 32px;
	padding: 20px 24px;
	border-radius: var(--apt-radius);
	background: var(--apt-bg-soft);
}
.apt-agent__person {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}
.apt-agent__photo {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	background: #ddd;
}
.apt-agent__info { display: flex; flex-direction: column; min-width: 0; }
.apt-agent__photo-link { flex: 0 0 64px; display: block; }
.apt-agent__name {
	font-size: 18px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--apt-dark);
	text-decoration: none;
}
.apt-agent__name:hover { color: var(--apt-gold); }
.apt-agent__sub {
	font-size: 14px;
	line-height: 1.4;
	color: var(--apt-muted);
}
.apt-agent__sub a { color: var(--apt-dark); font-weight: 500; white-space: nowrap; }
.apt-agent__actions { display: flex; gap: 10px; flex: 0 0 auto; }

/* ---------- кнопки ---------- */
.apt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding: 0 22px;
	border-radius: 12px;
	border: 1px solid var(--apt-dark);
	background: var(--apt-dark);
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	text-decoration: none;
	transition: background .2s, color .2s, border-color .2s, transform .1s;
}
.apt-btn:hover { background: #000; color: #fff; }
.apt-btn:active { transform: translateY(1px); }
.apt-btn--outline { background: #fff; color: var(--apt-dark); border-color: var(--apt-line); }
.apt-btn--outline:hover { background: #fff; color: var(--apt-dark); border-color: var(--apt-dark); }
.apt-btn--wa { background: #25d366; border-color: #25d366; gap: 8px; }
.apt-btn--wa img { width: 18px; height: 18px; display: block; }
.apt-btn--wa:hover { background: #1fb959; border-color: #1fb959; }
.apt-btn--primary { width: 100%; height: 56px; font-size: 16px; background: var(--apt-gold); border-color: var(--apt-gold); }
.apt-btn--primary:hover { background: #ad8757; border-color: #ad8757; color: #fff; }
.apt-actions .apt-btn--outline { width: 100%; height: 56px; font-size: 16px; }

/* ---------- правая колонка ---------- */
.apt-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.apt-badge {
	display: inline-block;
	padding: 6px 10px;
	border-radius: 6px;
	background: var(--apt-gold-soft);
	color: #9a7346;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.apt-badge--accent { background: #fdecec; color: #c0392b; }

.apt-head__title,
h1.apt-head__title {
	margin: 0 0 8px;
	font-size: 30px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--apt-dark);
	text-transform: none;
	text-align: left;
}
.apt-head__address {
	margin: 0;
	font-size: 15px;
	line-height: 1.4;
	color: var(--apt-muted);
}

.apt-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin-top: 22px;
	padding: 22px 0;
	border-top: 1px solid var(--apt-line);
	border-bottom: 1px solid var(--apt-line);
}
.apt-price__value {
	font-size: 38px;
	line-height: 1;
	font-weight: 700;
	color: var(--apt-dark);
	white-space: nowrap;
}
.apt-price__value--ask { font-size: 24px; }
.apt-price__old { font-size: 16px; color: var(--apt-muted); }
.apt-price__m2 { font-size: 14px; color: var(--apt-muted); white-space: nowrap; }

/* ---------- характеристики ---------- */
.apt-specs { margin: 8px 0 0; }
.apt-specs__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 13px 0;
	border-bottom: 1px solid var(--apt-line);
}
.apt-specs__row dt {
	flex: 0 0 auto;
	white-space: nowrap;
	font-size: 15px;
	color: var(--apt-muted);
	font-weight: 400;
}
.apt-specs__row dd {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--apt-dark);
	text-align: right;
}

.apt-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

.apt-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 0;
	margin: 20px 0 0;
	font-size: 13px;
	color: var(--apt-muted);
}
.apt-meta span + span::before { content: '·'; margin: 0 10px; }

/* ---------- мобильная панель: на десктопе скрыта ---------- */
.apt-mobilebar { display: none; }

/* ---------- адаптив ---------- */
@media (max-width: 1200px) {
	.apt__grid { gap: 32px; }
	.apt__col--side { flex-basis: 440px; width: 440px; }
	.apt-price__value { font-size: 32px; }
}
@media (max-width: 991px) {
	.apt__grid { display: flex; flex-direction: column; gap: 0; }
	.apt__col { display: block; width: 100%; max-width: none; flex: none; }
	.apt__col--side { order: -1; }
	.apt-gallery { margin-top: 20px; }
	.apt-params  { margin-top: 8px; }
	.apt-desc    { margin-top: 28px; }
	.apt-specs { width: 100%; }
	.apt-specs__row { padding: 11px 0; }
	.apt-specs__row dt, .apt-specs__row dd { font-size: 14px; }

	/* хлебные крошки вплотную к заголовку */
	body.is-apt .news-main { margin-top: 90px; padding-top: 16px; padding-bottom: 0; }
	body.is-apt .news-main .breadcumbs a,
	body.is-apt .news-main .breadcumbs span { font-size: 12px; line-height: 16px; }
	.apt.content { padding-top: 12px; }
	.apt-badges { margin-bottom: 10px; }

	/* фото: лента с прокруткой вместо большого фото и миниатюр */
	.apt-gallery__main, .apt-gallery__thumbs { display: none; }
	.apt-gallery__strip {
		display: flex;
		gap: 10px;
		margin: 0 -15px;
		padding: 0 15px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.apt-gallery__strip::-webkit-scrollbar { display: none; }
	.apt-gallery__slide {
		flex: 0 0 86%;
		scroll-snap-align: start;
		aspect-ratio: 4 / 3;
		border-radius: 14px;
		overflow: hidden;
		background: var(--apt-bg-soft);
	}
	.apt-gallery__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

	/* цена и кнопки: цена без рамок, кнопки уезжают в нижнюю панель */
	.apt-price { margin-top: 14px; padding: 0 0 6px; border: 0; }
	.apt-actions { display: none; }
	.apt-meta { margin-top: 14px; }
	.apt-agent__actions { display: none; }

	/* нижняя панель */
	.apt-mobilebar {
		display: flex;
		align-items: center;
		gap: 10px;
		position: fixed;
		left: 0; right: 0; bottom: 0;
		z-index: 90;
		padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
		background: #fff;
		box-shadow: 0 -6px 24px rgba(0, 0, 0, .08);
		transition: transform .25s ease;
	}
	.apt-mobilebar.is-hidden { transform: translateY(110%); }
	.apt-mobilebar__photo { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; display: block; }
	.apt-mobilebar__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
	.apt-mobilebar__book { flex: 1 1 auto; height: 52px; }
	.apt-mobilebar__wa { flex: 0 0 56px; width: 56px; height: 52px; padding: 0; }
	.apt-mobilebar__wa img { width: 22px; height: 22px; }
	body.has-apt-bar { padding-bottom: 84px; }
	body.has-apt-bar .site-whatsapp__link { bottom: 90px; }
	body.has-apt-bar .scroll__top { bottom: 190px; }
}
@media (max-width: 600px) {
	.apt-head__title, h1.apt-head__title { font-size: 24px; }
	.apt-price__value { font-size: 28px; }
	.apt-agent { padding: 14px 16px; }
}
