/* Автоматические попапы Manul (единые стили вместо инлайновых из include/modal) */

.custom_popup_wrapper {
	position: fixed;
	width: 100%;
	height: calc(100 * var(--vh, 1vh));
	z-index: 9999;
	background: rgba(50, 50, 50, 0.7);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	top: 0;
	left: 0;
	overflow: hidden;
	overflow-y: auto;
}

.custom_popup_wrapper.active {
	opacity: 1;
	pointer-events: auto;
}

/* ---------- картинка + кнопки ---------- */

.custom_popup {
	width: 904px;
	height: 522px;
	position: fixed;
	background-color: #000;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) scale(0.7);
	z-index: 555;
	padding: 60px 36px 80px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-start;
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.custom_popup_wrapper.active .custom_popup {
	transform: translate(-50%, -50%) scale(1);
	opacity: 1;
}

.custom_popup .h1 {
	font-size: 40px;
	line-height: 1.1;
	margin-bottom: 20px;
	text-transform: uppercase;
}

.custom_popup p {
	font-size: 20px;
	line-height: 1.3;
	max-width: 450px;
}

.custom_popup .btns {
	display: inline-flex;
	flex-direction: column;
	gap: 24px;
}

.custom_popup .btns a {
	width: 280px;
}

/* Текст нарисован на картинке — прячем HTML-текст */
.custom_popup.mp-text-hidden .h1,
.custom_popup.mp-text-hidden p {
	opacity: 0;
}

/* ---------- кнопки ---------- */

/* Как в старом попапе: у кнопки чёрная рамка, она видна на белом состоянии. */
.mp-popup .btns a.but {
	border: 1px solid #000;
}

/* Вторичная кнопка: обычное состояние — чёрный фон и белый текст,
   при наведении инверсия: белая заливка и чёрный текст. */
.mp-popup .btns a.but.wthout-bg {
	position: relative;
	z-index: 0;
	overflow: hidden;
	background: #000;
	color: #fff;
}

.mp-popup .btns a.but.wthout-bg::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #fff;
	transform: translateY(100%) !important;
	transition: transform 0.35s ease;
	z-index: 0;
}

.mp-popup .btns a.but.wthout-bg:hover::before,
.mp-popup .btns a.but.wthout-bg:focus::before {
	transform: translateY(0) !important;
}

.mp-popup .btns a.but.wthout-bg span {
	position: relative;
	z-index: 2;
	color: #fff;
}

.mp-popup .btns a.but.wthout-bg:hover span,
.mp-popup .btns a.but.wthout-bg:focus span {
	color: #000;
}

/* ---------- кнопка закрытия ---------- */

.custom_popup_close:not(.button) {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
}

.custom_popup_close:not(.button):hover {
	transform: scale(1.08);
}

.custom_popup_close:not(.button) > span {
	position: absolute;
	width: 18px;
	height: 2px;
	background: #000;
	border-radius: 2px;
}

.custom_popup_close:not(.button) span:first-child {
	transform: rotate(45deg);
}

.custom_popup_close:not(.button) span:last-child {
	transform: rotate(-45deg);
}

@media (max-width: 767.98px) {
	.custom_popup {
		width: 326px;
		height: 482px;
		padding: 40px 30px 50px;
		justify-content: flex-start;
	}

	.custom_popup .h1 {
		font-size: 40px;
		display: block;
		margin: 0 0 20px -6px;
		line-height: 1.05;
	}

	.custom_popup .btns {
		margin-top: 36px;
	}

	.custom_popup p {
		text-transform: none !important;
		font-size: 80%;
	}

	.custom_popup .btns a {
		width: 250px;
	}

	.custom_popup_close:not(.button) {
		top: 12px;
		right: 12px;
		width: 36px;
		height: 36px;
	}

	/* как в старых попапах: кнопки прижаты к низу, если текст на картинке */
	.custom_popup.mp-text-hidden .btns {
		position: absolute;
		left: 40px;
		bottom: 24px;
		margin-top: 0;
	}
}

.mp-popup .mp-img-mobile {
	display: none;
}

@media (max-width: 767.98px) {
	.mp-popup .mp-img-desktop {
		display: none;
	}

	.mp-popup .mp-img-mobile {
		display: block;
	}
}

/* ---------- картинка + форма ---------- */

.mp-popup--form .custom_popup {
	width: 904px;
	height: 682px;
	background: #000;
	padding: 0;
	gap: 24px;
	justify-content: flex-start;
}

.mp-popup--form .custom_popup img {
	width: 100%;
	object-fit: cover;
	height: 240px;
}

.mp-popup--form .custom_popup > span {
	display: block;
	padding: 0 60px;
}

.mp-popup--form .custom_popup .h1 {
	font-size: 56px;
	margin-bottom: 24px;
}

.mp-popup--form .custom_popup p {
	max-width: 450px;
}

.mp-popup--form .input span:not(.wpcf7-form-control-wrap, .wpcf7-form-control-wrap *),
.mp-popup--form .textarea span:not(.wpcf7-form-control-wrap, .wpcf7-form-control-wrap *) {
	color: #fff;
}

.mp-popup--form .input span.active {
	color: rgba(255, 255, 255, 0.55);
}

.mp-popup--form .input:not(.fill):hover span:not(.wpcf7-form-control-wrap, .wpcf7-form-control-wrap *) {
	color: #fff;
}

.mp-popup--form .input i {
	background: #fff;
}

.mp-popup--form .input input {
	border-bottom: 1px solid #fff;
}

.mp-popup--form .wpcf7-list-item.first.last {
	margin: 0;
}

.mp-popup--form .wpcf7-list-item.first.last input {
	height: 20px;
	width: 20px;
	border: 1px solid;
	-webkit-appearance: auto;
}

.mp-popup--form .wpcf7-form .button,
.mp-popup--form .success .button {
	background: #fff;
	color: #000;
}

.mp-popup--form .wpcf7-form .button:before,
.mp-popup--form .success .button:before {
	background: #fff;
}

.mp-popup--form input,
.mp-popup--form input:focus,
.mp-popup--form textarea,
.mp-popup--form textarea:focus {
	color: #fff !important;
}

.mp-popup--form .input input:focus ~ i,
.mp-popup--form .input.fill input ~ i {
	background: #fff;
}

.mp-popup--form .success {
	position: absolute;
	min-height: 480px;
	width: 100%;
	opacity: 0;
	height: 100%;
	background: #000;
	z-index: -1;
	pointer-events: none;
	display: flex;
	transition: opacity 0.3s ease-in-out;
	align-items: center;
	justify-content: space-between;
	flex-direction: column;
	text-align: center;
	padding: 64px;
}

.mp-popup--form .success.active {
	opacity: 1;
	z-index: 10;
	pointer-events: all;
}

.mp-popup--form .custom_popup .success .h1 {
	font-size: 64px;
}

.mp-popup--form .custom_popup .success p {
	max-width: 100%;
	margin: 0;
}

@media (max-width: 767.98px) {
	.mp-popup--form .custom_popup {
		width: 326px;
		height: auto;
		min-height: 482px;
		max-height: calc(100 * var(--vh, 1vh) - 30px);
		overflow-y: auto;
	}

	.mp-popup--form .custom_popup img {
		height: 160px;
	}

	.mp-popup--form .custom_popup > span {
		padding: 0 16px;
	}

	.mp-popup--form .custom_popup .h1 {
		font-size: 48px;
		margin-bottom: 24px;
	}

	.mp-popup--form .custom_popup p {
		font-size: 18px;
	}

	.mp-popup--form .custom_popup .btns a {
		width: 250px;
	}

	.mp-popup--form .success {
		padding: 24px;
	}

	.mp-popup--form .custom_popup .success .h1 {
		font-size: 36px;
	}

	.mp-popup--form .custom_popup .success p {
		font-size: 15px;
	}
}

/* ---------- объявление (модалка темы) ---------- */

.mp-popup--announcement {
	background: rgba(0, 0, 0, 0.5);
}

.mp-popup--announcement .modal-item {
	position: relative;
	visibility: visible;
	width: 100%;
	height: 100%;
}

.mp-popup--announcement .new-menu-modal {
	background: transparent;
}

.mp-popup--announcement .modal_title {
	font-weight: 500;
	font-size: 30px;
	line-height: 120%;
	letter-spacing: 0;
	color: #222;
	padding: 30px 39px;
}

.mp-popup--announcement .modal_address {
	padding-bottom: 0.1rem;
}

.mp-popup--announcement .modal_address p {
	font-weight: 400;
	font-size: 16px;
	line-height: 140%;
	letter-spacing: 0;
	padding: 0 39px;
	color: #222;
}

.mp-popup--announcement .modal_address .btns {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 24px;
}

.mp-popup--announcement .content-modal {
	max-height: 86vh;
	overflow-y: auto;
}

@media (max-width: 767.98px) {
	.mp-popup--announcement .content-modal {
		position: absolute !important;
		top: 50% !important;
		left: 50% !important;
		transform: translate(-50%, -50%) !important;
		width: 92vw;
		max-width: 92vw;
		max-height: 86vh;
		margin: 0 !important;
	}

	.mp-popup--announcement .btn.close {
		position: fixed;
		top: 12px;
		right: 12px;
		z-index: 1000;
		background: #fff;
		border-radius: 50%;
		width: 36px;
		height: 36px;
		padding: 0;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.mp-popup--announcement .btn.close svg g {
		fill: #000;
	}

	.mp-popup--announcement .modal_title {
		font-size: 20px;
		padding: 16px;
	}

	.mp-popup--announcement .modal_address p {
		font-size: 14px;
		padding: 0 16px;
	}

	.mp-popup--announcement .modal_address .btns {
		padding: 0 16px 16px;
	}
}
