/* Модальное окно */
.custom-modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10000;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.custom-modal-overlay.active {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 20px;
}

.custom-modal {
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	width: 100%;
	max-width: 600px;
	margin: auto;
	display: flex;
	flex-direction: column;
	max-height: 90vh;
	position: relative;
}

.custom-modal-header {
	padding: 20px 24px;
	border-bottom: 2px solid #9B0023;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.custom-modal-header h2,
.custom-modal-header .custom-modal-title {
	font-size: 16px;
	font-weight: 600;
	color: #383838;
	margin: 0;
	padding: 0;
	line-height: 1.4;
}

.custom-modal-close {
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.3s ease;
	border-radius: 4px;
	margin-left: 16px;
	position: relative;
}

.custom-modal-close:hover {
	background: #f5f5f5;
}

.custom-modal-close:before,
.custom-modal-close:after {
	content: '';
	position: absolute;
	width: 18px;
	height: 2px;
	background: #383838;
	border-radius: 1px;
	transition: all 0.3s ease;
}

.custom-modal-close:before {
	transform: rotate(45deg);
}

.custom-modal-close:after {
	transform: rotate(-45deg);
}

.custom-modal-close:hover:before,
.custom-modal-close:hover:after {
	background: #9B0023;
}

.custom-modal-content {
	padding: 24px;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
}

.custom-modal-content::-webkit-scrollbar {
	width: 8px;
}

.custom-modal-content::-webkit-scrollbar-track {
	background: #f5f5f5;
	border-radius: 4px;
}

.custom-modal-content::-webkit-scrollbar-thumb {
	background: #9B0023;
	border-radius: 4px;
}

.custom-modal-content::-webkit-scrollbar-thumb:hover {
	background: #7a001b;
}

/* Мобильные устройства */
@media (max-width: 768px) {
	.custom-modal-overlay.active {
		padding: 0;
		align-items: stretch;
	}
	
	.custom-modal {
		max-width: 100%;
		width: 100%;
		height: 100%;
		max-height: 100vh;
		border-radius: 0;
		margin: 0;
	}
	
	.custom-modal-header {
		padding: 16px 20px;
	}
	
	.custom-modal-content {
		padding: 20px;
	}
}

@media (max-width: 480px) {
	.custom-modal-header {
		padding: 14px 16px;
	}
	
	.custom-modal-header h2,
	.custom-modal-header .custom-modal-title {
		font-size: 15px;
	}
	
	.custom-modal-content {
		padding: 16px;
	}
}
