/**
 * Felix modal + treatments picker
 *
 * assets/css/parts/modal.css — generic shell + treatments-specific rules.
 */

/* =============================================================================
   1. Felix modal shell (generic)
   ============================================================================= */
felix-modal.felix-modal {
	display: none;
	position: fixed;
	inset: 0;
	width: 100vw;
	max-width: 100vw;
	height: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	z-index: 100000;
}

felix-modal.felix-modal.is-open {
	display: block;
}

.felix-modal__panel {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	max-height: 85dvh;
	transform: translateY(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

felix-modal.felix-modal.is-open .felix-modal__panel {
	transform: translateY(0);
}

/* md: tablet (768px) — centered dialog, scale + fade */
@media (min-width: 48rem) {
	.felix-modal__panel {
		left: 50%;
		right: auto;
		top: 50%;
		bottom: auto;
		width: 100%;
		max-width: 34.3125rem;
		/* 549px */
		max-height: 80dvh;
		transform: translate(-50%, -50%) scale(0.96);
		opacity: 0;
		transition:
			transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
			opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	}

	felix-modal.felix-modal.is-open .felix-modal__panel {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.felix-modal__panel {
		transition: none;
	}
}

html.felix-modal-open,
html.felix-modal-open body {
	overflow: hidden;
}

/* =============================================================================
   2. Treatments picker (specific)
   ============================================================================= */

.treatments-modal__list {
	overflow-y: auto;
	overscroll-behavior: contain;
}
.treatments-modal__list::-webkit-scrollbar {
	display: none;
}

.treatments-modal__list-item > .custom-button {
	flex-shrink: 0;
	align-self: center;
}

/* Close — Figma 38×38 touch target */
.treatments-modal__close {
	width: 38px;
	height: 38px;
}

/* Row thumb — 60×60 mobile, 80×80 md+ */
.treatments-modal__item-thumb {
	width: 3.75rem;
	height: 3.75rem;
}

.treatments-modal__item-body {
	min-width: 0;
}

.treatments-modal__footer {
	box-shadow: 0 -2px 12px color-mix(in srgb, var(--wp--preset--color--slate-20, #31302f) 4%, transparent);
}

.treatments-modal__footer-btn {
	white-space: nowrap;
}

.treatments-modal__item,
.treatments-modal__footer-btn {
	color: inherit;
	text-decoration: none;
}

@media (min-width: 48rem) {
	.treatments-modal__item-thumb {
		width: 5rem;
		height: 5rem;
	}
}
