/* =========================================================================
   Demo Selection Modal
   Triggered by clicks on a[href="#try-demo"]. Scoped to .demo-modal.
   ========================================================================= */

.demo-modal[hidden] {
	display: none !important;
}

.demo-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.demo-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 33, 98, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	animation: demo-fade-in 0.15s ease-out;
}

.demo-modal-panel {
	position: relative;
	background: #fff;
	border-radius: 16px;
	max-width: 580px;
	width: 100%;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 50px rgba(2, 33, 98, 0.25);
	animation: demo-slide-in 0.2s ease-out;
	overflow: hidden;
	outline: none;
}

@keyframes demo-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes demo-slide-in {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Header --- */
.demo-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 16px;
	border-bottom: 1px solid #e9eef5;
}
.demo-modal-title {
	font-size: 22px;
	font-weight: 700;
	color: #022162;
	margin: 0 0 4px;
	line-height: 1.2;
	letter-spacing: -0.01em;
}
.demo-modal-sub {
	font-size: 13px;
	color: #6e7b91;
	margin: 0;
	line-height: 1.4;
}
.demo-modal-close {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border: 0;
	background: #f0f2f5;
	border-radius: 50%;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	color: #43506a;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.15s ease, color 0.15s ease;
}
.demo-modal-close:hover {
	background: #022162;
	color: #fff;
}
.demo-modal-close:focus-visible {
	outline: 2px solid #007cff;
	outline-offset: 2px;
}

/* --- Body --- */
.demo-modal-body {
	padding: 16px 24px;
	overflow-y: auto;
	flex: 1;
}

/* --- Module card --- */
.demo-module {
	padding: 18px 0;
	border-bottom: 1px solid #e9eef5;
}
.demo-module:first-child {
	padding-top: 6px;
}
.demo-module:last-child {
	border-bottom: 0;
	padding-bottom: 6px;
}

.demo-module-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 6px;
}
.demo-module-title {
	font-size: 17px;
	font-weight: 700;
	color: #022162;
	margin: 0;
	line-height: 1.3;
}
.demo-module-price {
	font-size: 18px;
	font-weight: 700;
	color: #022162;
	white-space: nowrap;
}

.demo-module-desc {
	font-size: 14px;
	line-height: 1.55;
	color: #43506a;
	margin: 0 0 10px;
}

.demo-module-rating {
	font-size: 13px;
	color: #6e7b91;
	margin: 0 0 12px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.demo-module-rating .stars {
	color: #f5a623;
	letter-spacing: 2px;
	font-size: 14px;
}

.demo-module-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 12px;
}

.demo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1;
	min-height: 38px;
	border: 1.5px solid transparent;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}
.demo-btn-primary {
	background: #022162;
	color: #fff !important;
	border-color: #022162;
}
.demo-btn-primary:hover {
	background: #003080;
	border-color: #003080;
	color: #fff !important;
}
.demo-btn-secondary {
	background: transparent;
	color: #022162 !important;
	border-color: #022162;
}
.demo-btn-secondary:hover {
	background: rgba(2, 33, 98, 0.06);
	color: #022162 !important;
}

/* --- Footer --- */
.demo-modal-footer {
	padding: 14px 24px 18px;
	border-top: 1px solid #e9eef5;
	background: #f8fafd;
}
.demo-modal-footer p {
	font-size: 13px;
	color: #6e7b91;
	margin: 0;
	text-align: center;
}
.demo-modal-footer a {
	color: #007cff;
	text-decoration: none;
}
.demo-modal-footer a:hover {
	text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 600px) {
	.demo-modal {
		padding: 0;
		align-items: flex-end;
	}
	.demo-modal-panel {
		border-radius: 16px 16px 0 0;
		max-height: 92vh;
		animation: demo-slide-up 0.22s ease-out;
	}
	@keyframes demo-slide-up {
		from { opacity: 0; transform: translateY(30px); }
		to   { opacity: 1; transform: translateY(0); }
	}
	.demo-modal-header {
		padding: 18px 20px 14px;
	}
	.demo-modal-body {
		padding: 14px 20px;
	}
	.demo-modal-footer {
		padding: 12px 20px 14px;
	}
	.demo-module-head {
		flex-wrap: wrap;
	}
	.demo-module-actions {
		gap: 8px;
	}
	.demo-btn {
		flex: 1;
		min-width: 0;
	}
}

/* --- Prevent body scroll when open --- */
body.demo-modal-open {
	overflow: hidden;
}
