/**
 * Модальные окна — WoodMart Medical (primary, --wd-brd-radius).
 */

.peptide-modal-root {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	box-sizing: border-box;
}

.peptide-modal-root[hidden] {
	display: none !important;
}

.peptide-modal-root.is-open {
	display: flex;
}

.peptide-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.28s ease;
}

.peptide-modal-root.is-open .peptide-modal-overlay {
	opacity: 1;
}

.peptide-modal-root.is-closing .peptide-modal-overlay {
	opacity: 0;
}

.peptide-modal {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 520px;
	max-height: min(90vh, 720px);
	overflow: auto;
	padding: 28px 28px 32px;
	background: #fff;
	border-radius: var(--wd-brd-radius, 12px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	transition:
		opacity 0.28s ease,
		transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.peptide-modal-root.is-open .peptide-modal.is-active {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.peptide-modal-root.is-closing .peptide-modal.is-leaving {
	opacity: 0;
	transform: translateY(12px) scale(0.98);
}

.peptide-modal[hidden] {
	display: none !important;
}

.peptide-modal-root.is-open .peptide-modal[data-peptide-modal-panel].is-active {
	display: block;
}

.peptide-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: calc(var(--wd-brd-radius, 12px) / 1.5);
	background: transparent;
	color: var(--color-gray-800, #333);
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.peptide-modal__close:hover {
	color: var(--wd-primary-color, #2080c9);
	background: rgba(32, 128, 201, 0.08);
}

.peptide-modal__close span {
	display: block;
	width: 16px;
	height: 16px;
	position: relative;
}

.peptide-modal__close span::before,
.peptide-modal__close span::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
}

.peptide-modal__close span::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.peptide-modal__close span::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.peptide-modal__header {
	margin-bottom: 20px;
	padding-right: 36px;
}

.peptide-modal__title {
	margin: 0 0 8px;
	color: var(--wd-title-color, inherit);
	font-weight: var(--wd-title-font-weight, 600);
}

.peptide-modal__subtitle {
	margin: 0;
	color: var(--color-gray-500, #767676);
	font-size: 14px;
	line-height: 1.5;
}

.peptide-modal--surface .peptide-modal__title {
	color: #242424;
}

.peptide-modal--surface .peptide-modal__subtitle {
	color: #777;
}

.peptide-modal--surface .peptide-modal__close {
	color: #333;
}

.peptide-modal__body {
	font-size: 15px;
	line-height: 1.6;
}

.peptide-modal--surface .peptide-modal__body {
	color: #777;
}

/* Формы внутри модалки */
.peptide-modal__body .wpcf7-form,
.peptide-modal__body .wpforms-container {
	margin: 0;
}

.peptide-modal__body input[type="text"],
.peptide-modal__body input[type="email"],
.peptide-modal__body input[type="tel"],
.peptide-modal__body input[type="number"],
.peptide-modal__body textarea,
.peptide-modal__body select {
	width: 100%;
	max-width: 100%;
}

.peptide-modal__body .wpcf7-submit,
.peptide-modal__body .wpforms-submit {
	cursor: pointer;
}

body.peptide-modal-is-open {
	overflow: hidden;
}

.peptide-modal.peptide-modal--split {
	max-width: min(920px, calc(100vw - 24px));
	max-height: calc(100vh - 32px);
	padding: 0;
	border-radius: var(--wd-brd-radius, 12px);
	overflow: hidden;
}

.peptide-modal-root.is-open .peptide-modal.peptide-modal--split.is-active {
	overflow: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.peptide-modal-root.is-open .peptide-modal.peptide-modal--split.is-active::-webkit-scrollbar {
	display: none;
}

.peptide-modal.peptide-modal--split .peptide-modal__body {
	color: inherit;
}

.peptide-modal.peptide-modal--split .peptide-modal__close {
	top: 14px;
	right: 14px;
	z-index: 3;
}

@media (max-width: 576px) {
	.peptide-modal {
		padding: 22px 18px 26px;
		max-height: 92vh;
	}

	.peptide-modal.peptide-modal--split {
		padding: 0;
	}
}
