/**
 * Flyn fabric-themed preloader overrides.
 * Keeps .loader-wrap, .preloader-close, and handlePreloader() selectors intact.
 */

/* ── Background & textile texture ───────────────────────────────────────── */

.handle-preloader {
	background-color: #0970ff !important;
	overflow: hidden;
}

.handle-preloader::before {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0.14;
	background-image:
		repeating-linear-gradient(
			0deg,
			transparent,
			transparent 3px,
			rgba(255, 255, 255, 0.35) 3px,
			rgba(255, 255, 255, 0.35) 4px
		),
		repeating-linear-gradient(
			90deg,
			transparent,
			transparent 3px,
			rgba(255, 255, 255, 0.35) 3px,
			rgba(255, 255, 255, 0.35) 4px
		);
	background-size: 8px 8px;
	pointer-events: none;
}

.handle-preloader .animation-preloader {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

/* ── Loom / weave loader (replaces spinner circle) ──────────────────────── */

.handle-preloader .animation-preloader .spinner {
	animation: none;
	border: none;
	border-radius: 0;
	width: 148px;
	height: 96px;
	margin: 0 auto 36px;
	position: relative;
	background:
		repeating-linear-gradient(
			90deg,
			rgba(255, 255, 255, 0.22) 0,
			rgba(255, 255, 255, 0.22) 1px,
			transparent 1px,
			transparent 9px
		),
		linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(0, 0, 0, 0.08) 100%);
	box-shadow:
		inset 0 0 0 2px rgba(255, 255, 255, 0.45),
		0 12px 32px rgba(0, 0, 0, 0.12);
	overflow: hidden;
}

/* Shuttle travelling across the loom */
.handle-preloader .animation-preloader .spinner::before {
	content: "";
	position: absolute;
	top: 50%;
	left: -28%;
	width: 34%;
	height: 4px;
	margin-top: -2px;
	border-radius: 2px;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.55) 18%,
		#ffffff 50%,
		rgba(255, 255, 255, 0.55) 82%,
		transparent 100%
	);
	box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
	animation: flyn-shuttle-pass 1.6s ease-in-out infinite;
}

/* Weft threads weaving in */
.handle-preloader .animation-preloader .spinner::after {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(
		0deg,
		transparent 0,
		transparent 7px,
		rgba(255, 255, 255, 0.5) 7px,
		rgba(255, 255, 255, 0.5) 8px
	);
	background-size: 100% 16px;
	animation: flyn-weft-weave 1.6s linear infinite;
	opacity: 0.85;
}

@keyframes flyn-shuttle-pass {
	0% {
		transform: translateX(0);
		opacity: 0;
	}
	12% {
		opacity: 1;
	}
	50% {
		transform: translateX(290%);
		opacity: 1;
	}
	88% {
		opacity: 1;
	}
	100% {
		transform: translateX(290%);
		opacity: 0;
	}
}

@keyframes flyn-weft-weave {
	0% {
		background-position: 0 0;
	}
	100% {
		background-position: 0 16px;
	}
}

/* ── Brand wordmark ─────────────────────────────────────────────────────── */

.handle-preloader .animation-preloader .txt-loading {
	display: block;
	margin-top: 4px;
}

.handle-preloader .animation-preloader .txt-loading .letters-loading {
	font-weight: 600;
	letter-spacing: 18px;
	font-size: 52px;
	line-height: 1;
	-webkit-text-stroke-color: rgba(255, 255, 255, 0.35);
}

.handle-preloader .animation-preloader .txt-loading .letters-loading::before {
	color: #ffffff;
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.12);
}

/* ── Tagline (below FLYN) ───────────────────────────────────────────────── */

.handle-preloader .animation-preloader .txt-loading::after {
	display: block;
	margin-top: 20px;
	padding: 0 24px;
	max-width: 360px;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.55;
	letter-spacing: 0.4px;
	text-transform: none;
	color: rgba(255, 255, 255, 0.88);
	-webkit-text-stroke-width: 0;
	animation: flyn-tagline-glow 2.4s ease-in-out infinite alternate;
}

@keyframes flyn-tagline-glow {
	from {
		opacity: 0.72;
	}
	to {
		opacity: 1;
	}
}

/* ── Close button ───────────────────────────────────────────────────────── */

.preloader-close {
	font-size: 16px;
	font-weight: 400;
	line-height: 28px;
	color: #0970ff;
	background: rgba(255, 255, 255, 0.95);
	width: 32px;
	height: 32px;
	border-radius: 50%;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.preloader-close:hover {
	background: #ffffff;
	color: #0860d9;
	transform: scale(1.05);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media screen and (max-width: 767px) {
	.handle-preloader .animation-preloader .spinner {
		width: 120px;
		height: 78px;
		margin-bottom: 28px;
	}

	.handle-preloader .animation-preloader .txt-loading .letters-loading {
		font-size: 38px;
		letter-spacing: 14px;
	}

	.handle-preloader .animation-preloader .txt-loading::after {
		font-size: 13px;
		margin-top: 16px;
		padding: 0 20px;
		max-width: 300px;
	}
}

@media screen and (max-width: 500px) {
	.handle-preloader .animation-preloader .spinner {
		width: 108px;
		height: 70px;
	}

	.handle-preloader .animation-preloader .txt-loading .letters-loading {
		font-size: 30px;
		letter-spacing: 10px;
	}

	.handle-preloader .animation-preloader .txt-loading::after {
		font-size: 12px;
		letter-spacing: 0.2px;
	}
}
