/**
 * Bootstrap Modal JS потребує класів .modal / .modal-dialog тощо.
 * Повний bootstrap.css не підключаємо — він ламає `.row` теми (FlexboxGrid).
 */

/* --- backdrop (Bootstrap створює окремий елемент) --- */
.modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 10000090;
	width: 100vw;
	height: 100vh;
	background-color: #000;
}
.modal-backdrop.fade {
	opacity: 0;
	transition: opacity 0.15s linear;
}
.modal-backdrop.show {
	opacity: 0.5;
}

/* --- modal root --- */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 10000100;
	display: none;
	width: 100%;
	height: 100%;
	overflow-x: hidden;
	overflow-y: auto;
	outline: 0;
}

.modal.fade .modal-dialog {
	transition: transform 0.3s ease-out;
	transform: translate(0, -40px);
}

.modal.show .modal-dialog {
	transform: none;
}

.modal.show {
	display: block;
}

body.modal-open {
	overflow: hidden;
	padding-right: 0 !important;
}

/* --- dialog --- */
.modal-dialog {
	position: relative;
	width: auto;
	max-width: min(800px, calc(100% - 1rem));
	margin: 0.5rem auto;
	pointer-events: none;
}

.modal-dialog-centered {
	display: flex;
	align-items: center;
	min-height: calc(100% - 1rem);
}

.modal-dialog-scrollable {
	height: calc(100% - 1rem);
}

.modal-dialog-scrollable .modal-content {
	max-height: 100%;
	overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
	overflow-y: auto;
}

@media (max-width: 575.98px) {
	.modal-fullscreen-sm-down {
		width: 100vw;
		max-width: none;
		height: 100%;
		margin: 0;
	}

	.modal-fullscreen-sm-down.modal-dialog-scrollable {
		height: 100%;
		min-height: 100%;
	}

	.modal-fullscreen-sm-down.modal-dialog-centered {
		min-height: 100%;
		align-items: stretch;
	}

	.modal-fullscreen-sm-down .modal-content {
		height: 100%;
		border: 0;
		border-radius: 0;
	}

	.modal-fullscreen-sm-down .modal-header {
		border-radius: 0;
	}
}

.modal-content {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	pointer-events: auto;
	background-color: #fff;
	background-clip: padding-box;
	border: 1px solid rgba(0, 0, 0, 0.175);
	border-radius: 0.5rem;
	box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
	outline: 0;
}

/* --- header / body (без Bootstrap utilities) --- */
#artel-request-modal .modal-header {
	position: relative;
	flex-shrink: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: flex-start;
	padding: 1rem 1rem 0.5rem;
	border-bottom: none;
}

#artel-request-modal .modal-title {
	margin: 0;
	padding-right: 2.75rem;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.35;
}

#artel-request-modal .modal-body {
	flex: 1 1 auto;
	padding: 0.5rem 1rem 1rem;
}

#artel-request-modal .artel-modal-close {
	position: absolute;
	top: 0.35rem;
	right: 0.35rem;
	z-index: 2;
	color: inherit;
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 50%;
}

#artel-request-modal .artel-modal-fallback {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--theme-base-color, #666);
	opacity: 0.85;
}

/* CF7 усередині модалки */
#artel-request-modal .wpcf7-form label {
	display: block;
}

#artel-request-modal .wpcf7-form input[type="text"],
#artel-request-modal .wpcf7-form input[type="email"],
#artel-request-modal .wpcf7-form input[type="tel"],
#artel-request-modal .wpcf7-form textarea,
#artel-request-modal .wpcf7-form select {
	max-width: 100%;
	box-sizing: border-box;
}
