/**
 * cf-modal — styles for the native <dialog> enquiry popup (replaces Easy Modal, 2026-07-13).
 * Mirrors the old modal's look: centred panel near the top, fade in, dark overlay.
 */

dialog.cf-modal {
	width: min(560px, 92vw);
	max-height: 86vh;
	margin: 6vh auto auto;      /* Easy Modal used "center top" with a 100px offset */
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
	overflow: hidden;
}

dialog.cf-modal::backdrop {
	background: rgba(0, 0, 0, .6);
	animation: cf-modal-fade .35s ease;
}

dialog.cf-modal[open] {
	animation: cf-modal-fade .35s ease;
}

@keyframes cf-modal-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	dialog.cf-modal[open],
	dialog.cf-modal::backdrop { animation: none; }
}

.cf-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #e6e6e6;
}

.cf-modal__title {
	margin: 0;
	font-size: 1.35rem;
	line-height: 1.2;
}

.cf-modal__close {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	font-size: 1.9rem;
	line-height: 1;
	color: #666;
	cursor: pointer;
}

.cf-modal__close:hover,
.cf-modal__close:focus-visible {
	background: #f1f1f1;
	color: #111;
}

.cf-modal__body {
	padding: 1.25rem;
	overflow-y: auto;
	max-height: calc(86vh - 70px);
}

/* The CF7 form inside the modal — keep the theme's Bootstrap form styling working. */
.cf-modal__body .wpcf7-form .form-group {
	margin-bottom: 1rem;
}

/* The theme sets a fixed pixel width on CF7 inputs (they rendered ~375px in a 560px panel).
   Beat it on specificity rather than with !important, and make the fields fill the modal. */
dialog.cf-modal .cf-modal__body .wpcf7-form input.form-control,
dialog.cf-modal .cf-modal__body .wpcf7-form textarea.form-control,
dialog.cf-modal .cf-modal__body .wpcf7-form select.form-control {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

dialog.cf-modal .cf-modal__body .wpcf7-form textarea.form-control {
	min-height: 8rem;
	resize: vertical;
}

dialog.cf-modal .cf-modal__body .wpcf7-form label {
	display: block;
	width: 100%;
	font-weight: 600;
}
