/**
 * File: assets/css/components/cookie-consent.css
 * Description: Cookie consent component styling.
 *
 * MAGIDA COOKIE CONSENT PASS 23.6.0:
 * - Adds a compact glass notice that matches the locked Magida dark UI.
 * - Positions bottom-left so it does not clash with WhatsApp/go-to-top controls.
 *
 * MAGIDA FINAL POLISH QA HOTFIX PASS 23.7.0.1:
 * - Tightens the mobile banner so it takes less vertical space.
 * - Temporarily hides mobile floating controls while the banner is visible.
 */

.magida-cookie-consent {
	position: fixed;
	left: clamp(16px, 2vw, 30px);
	bottom: clamp(16px, 2vw, 30px);
	z-index: 9997;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 18px;
	width: min(640px, calc(100vw - 32px));
	padding: 18px;
	border: 1px solid rgba(0, 214, 255, 0.24);
	border-radius: 24px;
	background:
		radial-gradient(
			circle at 8% 15%,
			rgba(0, 214, 255, 0.14),
			transparent 36%
		),
		linear-gradient(135deg, rgba(8, 13, 28, 0.94), rgba(14, 18, 38, 0.9));
	box-shadow:
		0 24px 80px rgba(0, 0, 0, 0.42),
		inset 0 1px 0 rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	color: var(--magida-text, #ffffff);
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translate3d(0, 18px, 0) scale(0.98);
	pointer-events: none;
	transition:
		opacity 0.28s ease,
		transform 0.28s ease,
		visibility 0.28s ease;
}

.magida-cookie-consent.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translate3d(0, 0, 0) scale(1);
	pointer-events: auto;
}

.magida-cookie-consent.is-hiding {
	opacity: 0;
	transform: translate3d(0, 12px, 0) scale(0.985);
	pointer-events: none;
}

.magida-cookie-consent__glow {
	position: absolute;
	inset: auto auto -90px -80px;
	width: 220px;
	height: 220px;
	border-radius: 999px;
	background: rgba(0, 214, 255, 0.16);
	filter: blur(20px);
	pointer-events: none;
}

.magida-cookie-consent__content,
.magida-cookie-consent__actions {
	position: relative;
	z-index: 1;
}

.magida-cookie-consent__eyebrow {
	margin: 0 0 6px;
	font-size: 0.72rem;
	font-weight: 900;
	letter-spacing: 0.18em;
	line-height: 1;
	text-transform: uppercase;
	color: var(--magida-accent, #00d6ff);
}

.magida-cookie-consent__title {
	margin: 0;
	font-size: clamp(1rem, 1.5vw, 1.22rem);
	font-weight: 900;
	letter-spacing: -0.03em;
	line-height: 1.05;
	color: #ffffff;
}

.magida-cookie-consent__message {
	max-width: 46rem;
	margin: 8px 0 0;
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.55;
	color: var(--magida-text-soft, rgba(221, 226, 255, 0.78));
}

.magida-cookie-consent__actions {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	white-space: nowrap;
}

.magida-cookie-consent__link,
.magida-cookie-consent__button {
	min-height: 44px;
	border-radius: 12px;
	font-size: 0.84rem;
	font-weight: 900;
	letter-spacing: 0.02em;
	text-decoration: none;
	transition:
		transform 0.25s ease,
		border-color 0.25s ease,
		background 0.25s ease,
		color 0.25s ease;
}

.magida-cookie-consent__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: var(--magida-text-soft, rgba(221, 226, 255, 0.78));
	background: rgba(255, 255, 255, 0.035);
}

.magida-cookie-consent__button {
	padding: 0 18px;
	border: 1px solid rgba(0, 214, 255, 0.48);
	background: linear-gradient(
		135deg,
		rgba(0, 214, 255, 0.22),
		rgba(111, 66, 255, 0.18)
	);
	color: #ffffff;
	cursor: pointer;
}

.magida-cookie-consent__link:hover,
.magida-cookie-consent__button:hover {
	transform: translateY(-2px);
}

.magida-cookie-consent__link:hover {
	border-color: rgba(0, 214, 255, 0.34);
	color: #ffffff;
}

.magida-cookie-consent__button:hover {
	border-color: rgba(0, 214, 255, 0.72);
	background: linear-gradient(
		135deg,
		rgba(0, 214, 255, 0.3),
		rgba(111, 66, 255, 0.24)
	);
}

@media (max-width: 780px) {
	.magida-cookie-consent {
		/* MAGIDA FINAL POLISH QA HOTFIX PASS 23.7.0.1:
		 * Use left/right instead of fixed width so the banner fits inside narrow
		 * mobile safe areas and does not feel clipped by browser chrome.
		 */
		left: max(12px, env(safe-area-inset-left));
		right: max(12px, env(safe-area-inset-right));
		bottom: calc(12px + env(safe-area-inset-bottom));
		grid-template-columns: 1fr;
		gap: 12px;
		width: auto;
		max-height: min(54vh, 420px);
		padding: 14px;
		border-radius: 20px;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: none;
		-ms-overflow-style: none;
		-webkit-overflow-scrolling: touch;
	}

	/* MAGIDA MOBILE COOKIE SCROLLBAR FIX PASS 24.1.17:
	 * Keep the compact cookie notice scrollable on very small phones, but stop
	 * the global themed scrollbar from appearing outside the rounded notice.
	 */
	.magida-cookie-consent::-webkit-scrollbar {
		width: 0;
		height: 0;
	}

	.magida-cookie-consent__eyebrow {
		margin-bottom: 5px;
		font-size: 0.68rem;
		letter-spacing: 0.16em;
	}

	.magida-cookie-consent__title {
		font-size: 1rem;
	}

	.magida-cookie-consent__message {
		margin-top: 7px;
		font-size: 0.84rem;
		line-height: 1.48;
	}

	.magida-cookie-consent__actions {
		width: 100%;
		justify-content: space-between;
		white-space: normal;
	}

	.magida-cookie-consent__link,
	.magida-cookie-consent__button {
		flex: 1 1 auto;
		min-height: 42px;
	}

	/* MAGIDA FINAL POLISH QA HOTFIX PASS 23.7.0.1:
	 * Hiding is cleaner than lifting here because lifting the buttons pushes them
	 * into the hero/card content on small screens. They return immediately after
	 * the visitor accepts cookies.
	 */
	html.magida-cookie-consent-visible .magida-floating-whatsapp,
	html.magida-cookie-consent-visible .magida-go-to-top {
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
		transform: translate3d(0, 8px, 0) !important;
	}
}

@media (max-width: 480px) {
	.magida-cookie-consent {
		left: max(10px, env(safe-area-inset-left));
		right: max(10px, env(safe-area-inset-right));
		bottom: calc(10px + env(safe-area-inset-bottom));
		padding: 12px;
		border-radius: 18px;
	}

	.magida-cookie-consent__actions {
		align-items: stretch;
		flex-direction: column;
		gap: 8px;
	}

	.magida-cookie-consent__link,
	.magida-cookie-consent__button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.magida-cookie-consent,
	.magida-cookie-consent__link,
	.magida-cookie-consent__button {
		transition: none;
	}
}
