/**
 * "Вижте цени" price popup (template-parts/doctor/prices-popup.php).
 *
 * Plain CSS (no build step), enqueued by that template part only on doctor
 * pages that show the link. The table inside is a copy of the #prices section,
 * so it keeps its own .doctor-prices styles from site.css; this file only adds
 * the dialog shell and trims the section's page spacing. Values follow the
 * theme tokens (assets/sass/variables/_colors-design.scss): primary #292521.
 */

html.zd-prices-popup-open {
	overflow: hidden;
}

.zd-prices-popup {
	box-sizing: border-box;
	width: min(56rem, calc(100vw - 2rem));
	max-width: none;
	max-height: calc(100dvh - 4rem);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 1.5rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--overlay);
	overflow: hidden;
}

.zd-prices-popup[open] {
	display: flex;
	animation: zd-prices-popup-in 0.2s ease-out;
}

.zd-prices-popup::backdrop {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 60%, transparent);
}

.zd-prices-popup__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: 0;
}

.zd-prices-popup__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 2.5rem 2.5rem 2rem;
}

.zd-prices-popup__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--bg-color-light);
	color: var(--wp--preset--color--primary);
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.zd-prices-popup__close:hover {
	opacity: 0.8;
}

.zd-prices-popup__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.zd-prices-popup__close svg {
	width: 1rem;
	height: 1rem;
}

.zd-prices-popup__close svg path {
	stroke: currentColor;
}

/* The copied section: no page padding, room for the close button. */
.zd-prices-popup .doctor-prices {
	margin: 0;
	padding: 0;
	max-width: none;
	background: transparent;
}

.zd-prices-popup .doctor-prices__header {
	margin-bottom: 1.5rem;
	padding-right: 3rem;
}

@keyframes zd-prices-popup-in {
	from {
		opacity: 0;
		transform: translateY(1rem);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Phones: a bottom sheet across the full width. */
@media (max-width: 767px) {
	.zd-prices-popup {
		width: 100vw;
		max-height: 90dvh;
		margin: auto 0 0;
		border-radius: 1.5rem 1.5rem 0 0;
	}

	.zd-prices-popup[open] {
		animation-name: zd-prices-popup-up;
	}

	.zd-prices-popup__body {
		padding: 2rem 1rem 1.5rem;
	}

	@keyframes zd-prices-popup-up {
		from {
			transform: translateY(100%);
		}
		to {
			transform: none;
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.zd-prices-popup[open] {
		animation: none;
	}
}
