/**
 * Enrollment Bar
 *
 * Sticky bottom bar for non-enrolled visitors on course pages.
 * Full-width frosted glass with SAR currency icon.
 *
 * @since 1.10.0
 */

/* ==========================================================================
   Container — fixed bottom, full-width
   ========================================================================== */
.qimah-enrollment-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99990;
	transform: translateY(100%);
	opacity: 0;
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
	            opacity 0.4s ease;
	direction: rtl;

	/* Glass surface */
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(20px) saturate(1.6);
	-webkit-backdrop-filter: blur(20px) saturate(1.6);
	border-top: 1px solid rgba(30, 102, 73, 0.12);
	box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08),
	            0 -1px 3px rgba(0, 0, 0, 0.04);
}

.qimah-enrollment-bar.is-visible {
	transform: translateY(0);
	opacity: 1;
}

/* ==========================================================================
   Inner — full-width layout
   ========================================================================== */
.qimah-enrollment-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 14px 32px;
}

/* ==========================================================================
   Info block — title + price
   ========================================================================== */
.qimah-enrollment-bar__info {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	flex: 1;
}

.qimah-enrollment-bar__title {
	font-size: 15px;
	font-weight: 600;
	color: var(--qimah-text, #055E55);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.qimah-enrollment-bar__price {
	font-size: 17px;
	font-weight: 700;
	color: var(--qimah-primary, #1E6649);
	white-space: nowrap;
	flex-shrink: 0;
	letter-spacing: -0.01em;
}

/* WooCommerce price overrides */
.qimah-enrollment-bar__price del {
	opacity: 0.45;
	font-weight: 400;
	font-size: 14px;
}

.qimah-enrollment-bar__price ins {
	text-decoration: none;
}

/* SAR currency icon — uses theme's --qm-sar-svg CSS variable */
.qimah-enrollment-bar__price .woocommerce-Price-amount.amount::before {
	content: "";
	display: inline-block;
	width: 0.85em;
	height: 0.85em;
	-webkit-mask: var(--qm-sar-svg) no-repeat center / contain;
	mask: var(--qm-sar-svg) no-repeat center / contain;
	background: currentColor;
	margin-inline-end: 0.25em;
	vertical-align: -0.08em;
}

/* Hide the empty currency symbol span */
.qimah-enrollment-bar__price .woocommerce-Price-currencySymbol {
	display: none;
}

/* ==========================================================================
   CTA button
   ========================================================================== */
.qimah-enrollment-bar__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 36px;
	background: var(--qimah-primary, #1E6649);
	color: #fff !important;
	font-size: 15px;
	font-weight: 700;
	border-radius: 10px;
	text-decoration: none !important;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	box-shadow: 0 2px 8px rgba(30, 102, 73, 0.25);
}

.qimah-enrollment-bar__cta:hover {
	background: var(--qimah-primary-dark, #155039);
	color: #fff !important;
	transform: scale(1.03);
	box-shadow: 0 4px 14px rgba(30, 102, 73, 0.35);
}

.qimah-enrollment-bar__cta:active {
	transform: scale(0.98);
}

/* ==========================================================================
   Dark mode
   ========================================================================== */
html[data-theme="dark"] .qimah-enrollment-bar,
html.dark .qimah-enrollment-bar,
body.dark .qimah-enrollment-bar,
body.dark-mode .qimah-enrollment-bar {
	background: rgba(15, 15, 15, 0.75);
	border-top-color: rgba(255, 255, 255, 0.08);
	box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .qimah-enrollment-bar__title,
html.dark .qimah-enrollment-bar__title,
body.dark .qimah-enrollment-bar__title,
body.dark-mode .qimah-enrollment-bar__title {
	color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .qimah-enrollment-bar__price,
html.dark .qimah-enrollment-bar__price,
body.dark .qimah-enrollment-bar__price,
body.dark-mode .qimah-enrollment-bar__price {
	color: #5eda9e;
}

html[data-theme="dark"] .qimah-enrollment-bar__price del,
html.dark .qimah-enrollment-bar__price del,
body.dark .qimah-enrollment-bar__price del,
body.dark-mode .qimah-enrollment-bar__price del {
	opacity: 0.4;
}

/* ==========================================================================
   LTR override
   ========================================================================== */
[dir="ltr"] .qimah-enrollment-bar {
	direction: ltr;
}

/* ==========================================================================
   Body spacing when bar is visible
   ========================================================================== */
body.has-enrollment-bar {
	padding-bottom: 64px;
}

/* ==========================================================================
   Mobile responsive
   ========================================================================== */
@media (max-width: 768px) {
	.qimah-enrollment-bar__inner {
		flex-direction: column;
		padding: 12px 16px;
		gap: 10px;
		text-align: center;
	}

	.qimah-enrollment-bar__info {
		flex-direction: column;
		gap: 4px;
	}

	.qimah-enrollment-bar__title {
		font-size: 13px;
		max-width: 100%;
	}

	.qimah-enrollment-bar__cta {
		width: 100%;
		padding: 12px 24px;
	}

	body.has-enrollment-bar {
		padding-bottom: 110px;
	}
}
