/*
 * Окно товара и объекта — <dialog class="kt-eq-modal">, его собирает скрипт kt-product-modal
 * из functions.php. Базовые правила повторяют CSS страницы «Домофония»
 * (tools/fix-domofonia-feedback-6.php), чтобы окно работало на любой странице;
 * .kt-eq-modal--object — вариант для каталога «Объекты» (inc/objects.php).
 */
.kt-eq-modal {
	width: min(1080px, calc(100% - 32px));
	max-width: none;
	max-height: min(760px, calc(100% - 32px));
	padding: 0;
	border: 0;
	border-radius: 24px;
	background-color: #ffffff;
	color: #383838;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(12, 18, 70, 0.35);
}
/* Строка minmax(0, 1fr): длинное содержимое прокручивается в своей колонке, а не растягивает фото */
.kt-eq-modal[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); animation: kt-eq-modal-in 0.25s ease; }
.kt-eq-modal::backdrop { background-color: rgba(12, 18, 70, 0.55); }
@keyframes kt-eq-modal-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
html.kt-modal-open { overflow: hidden; }
.kt-eq-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid #e4e9f2;
	border-radius: 50%;
	background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23383838' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m4 4 8 8M12 4l-8 8'/%3E%3C/svg%3E") center / 16px no-repeat;
	cursor: pointer;
	transition: background-color 0.3s ease;
}
.kt-eq-modal__close:hover { background-color: #f2f4ff; }
.kt-eq-modal__gallery {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-height: 0;
	padding: 28px;
	background-color: #f2f4ff;
}
.kt-eq-modal__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 260px;
	border-radius: 16px;
	background-color: #ffffff;
	overflow: hidden;
}
.kt-eq-modal__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 20px;
	object-fit: contain;
}
.kt-eq-modal__arrow {
	position: absolute;
	top: 50%;
	z-index: 1;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid #2a3efa;
	border-radius: 50%;
	background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%232a3efa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 3 5 5-5 5'/%3E%3C/svg%3E") center / 16px no-repeat;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color 0.3s ease;
}
.kt-eq-modal__arrow:hover { background-color: #f2f4ff; }
.kt-eq-modal__arrow--prev { left: 10px; transform: translateY(-50%) rotate(180deg); }
.kt-eq-modal__arrow--next { right: 10px; }
.kt-eq-modal__thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.kt-eq-modal__thumb {
	width: 60px;
	height: 60px;
	padding: 4px;
	border: 2px solid transparent;
	border-radius: 10px;
	background-color: #ffffff;
	cursor: pointer;
	transition: border-color 0.3s ease;
}
.kt-eq-modal__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.kt-eq-modal__thumb:hover { border-color: #acb4ff; }
.kt-eq-modal__thumb.is-active { border-color: #2a3efa; }
.kt-eq-modal button:focus-visible { outline: 2px solid #2a3efa; outline-offset: 2px; }
.kt-eq-modal__info { min-height: 0; padding: 32px 28px 28px; overflow-y: auto; overscroll-behavior: contain; }
.kt-eq-modal__title { margin: 0 50px 4px 0; font-size: 28px; line-height: 1.2; }
.kt-eq-modal__subtitle { margin: 0 0 16px; font-size: 15px; color: #6b7280; }
.kt-eq-modal .kt-spec-group {
	margin: 22px 0 8px;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #2a3efa;
}
.kt-eq-modal .kt-spec-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.kt-eq-modal .kt-spec-table th, .kt-eq-modal .kt-spec-table td {
	padding: 9px 0;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid #e4e9f2;
}
.kt-eq-modal .kt-spec-table tr:last-child th, .kt-eq-modal .kt-spec-table tr:last-child td { border-bottom: 0; }
.kt-eq-modal .kt-spec-table th { width: 46%; padding-right: 16px; font-weight: 500; color: #6b7280; }
.kt-eq-modal .kt-spec-list { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.kt-eq-modal .kt-spec-list li { margin-bottom: 6px; }

/* --- Окно объекта: фото крупнее и заполняет кадр 3:2, как на карточке каталога */
.kt-eq-modal--object { width: min(1200px, calc(100% - 32px)); }
.kt-eq-modal--object[open] { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.kt-eq-modal--object .kt-eq-modal__gallery { justify-content: center; }
.kt-eq-modal--object .kt-eq-modal__stage { flex: none; min-height: 0; aspect-ratio: 3 / 2; background-color: #e4e9f2; }
.kt-eq-modal--object .kt-eq-modal__photo { padding: 0; object-fit: cover; }
.kt-eq-modal--object .kt-eq-modal__thumb { width: 84px; height: 56px; padding: 0; overflow: hidden; }
.kt-eq-modal--object .kt-eq-modal__thumb img { object-fit: cover; }
.kt-eq-modal__caption {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 1;
	padding: 6px 12px;
	border-radius: 999px;
	background-color: rgba(12, 18, 70, 0.6);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	color: #ffffff;
}
.kt-eq-modal .kt-obj-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kt-eq-modal .kt-obj-chips li {
	padding: 7px 14px;
	border-radius: 999px;
	background-color: #f2f4ff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: #383838;
}
.kt-eq-modal--object .kt-spec-group { color: #383838; }
.kt-eq-modal .kt-obj-desc { font-size: 16px; line-height: 1.6; }
.kt-eq-modal .kt-obj-desc p { margin: 0 0 10px; }

@media (max-width: 760px) {
	.kt-eq-modal { max-height: calc(100% - 24px); width: calc(100% - 24px); border-radius: 18px; overflow-y: auto; }
	.kt-eq-modal[open] { display: block; }
	.kt-eq-modal__gallery { padding: 16px; }
	.kt-eq-modal__stage { flex: none; min-height: 0; aspect-ratio: 4 / 3; }
	.kt-eq-modal__thumb { width: 48px; height: 48px; }
	.kt-eq-modal--object .kt-eq-modal__thumb { width: 66px; height: 44px; }
	.kt-eq-modal__info { padding: 20px 16px 22px; overflow: visible; }
	.kt-eq-modal__title { margin-right: 0; font-size: 22px; }
	.kt-eq-modal__close { position: fixed; top: 22px; right: 22px; }
}
@media (prefers-reduced-motion: reduce) {
	.kt-eq-modal[open] { animation: none; }
}
