/*
 * Dopee – extras (only loaded when at least one is switched on).
 * 1. Top bar   2. Mobile bar   3. Preloader   4. Progress & ring   5. Cursor
 */

/* 1. Announcement top bar ------------------------------------------- */
.dp-topbar {
	position: relative;
	z-index: 101;
	color: #0c0d0d;
	background: var(--dp-topbar-bg, var(--dp-primary));
	font-size: 0.85rem;
	font-weight: 500;
}

.dp-topbar-closed .dp-topbar {
	display: none;
}

.dp-topbar__inner {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px 16px;
	min-height: 40px;
	padding-block: 8px;
	padding-right: calc(var(--dp-gutter) + 32px);
	text-align: center;
}

.dp-topbar__text {
	margin: 0;
}

.dp-topbar a.dp-topbar__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.dp-topbar a.dp-topbar__link:hover {
	color: inherit;
	text-decoration-thickness: 2px;
}

.dp-topbar a.dp-topbar__link .dp-icon {
	transition: transform 0.35s var(--dp-ease);
}

.dp-topbar a.dp-topbar__link:hover .dp-icon {
	transform: translateX(3px);
}

.dp-topbar__close {
	position: absolute;
	top: 50%;
	right: var(--dp-gutter);
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	padding: 0;
	color: inherit;
	background: rgba(0, 0, 0, 0.08);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transform: translateY(-50%);
}

.dp-topbar__close:hover {
	background: rgba(0, 0, 0, 0.16);
}

/* 2. Mobile call-to-action bar --------------------------------------- */
.dp-mbar {
	display: none;
}

@media (max-width: 767px) {
	.dp-mbar {
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		z-index: 95;
		display: flex;
		gap: 8px;
		padding: 6px;
		background: rgba(var(--dp-bg-rgb), 0.78);
		border: 1px solid var(--dp-border-strong);
		border-radius: 999px;
		-webkit-backdrop-filter: blur(18px) saturate(160%);
		backdrop-filter: blur(18px) saturate(160%);
		box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.6);
	}

	.dp-mbar a {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		min-height: 48px;
		padding: 0 20px;
		font-family: var(--dp-font-button);
		font-weight: 600;
		font-size: 0.9rem;
		border-radius: 999px;
	}

	.dp-mbar a.dp-mbar__main {
		flex: 1;
		color: #0c0d0d;
		background: var(--dp-primary);
	}

	.dp-mbar a.dp-mbar__call {
		color: var(--dp-text);
		background: rgba(var(--dp-text-rgb), 0.08);
	}

	/* Keep page content and the back-to-top button clear of the bar */
	.dopee-has-mobilebar {
		padding-bottom: 84px;
	}

	.dopee-has-mobilebar .dp-to-top {
		bottom: 92px;
	}
}

/* 3. Preloader -------------------------------------------------------- */
.dp-preloader {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 18px;
	color: var(--dp-text);
	background: var(--dp-bg);
	transition: opacity 0.6s var(--dp-ease), visibility 0.6s;
	/* Safety net: disappears on its own even if JavaScript never runs */
	animation: dp-preloader-out 0.6s ease 5s forwards;
}

.dp-preloader.is-done {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.dp-skip-preload .dp-preloader {
	display: none;
}

@keyframes dp-preloader-out {
	to { opacity: 0; visibility: hidden; }
}

.dp-preloader .dp-preloader__mark {
	width: 72px;
	height: 72px;
	animation: dp-preloader-pulse 1.2s ease-in-out infinite;
}

[data-theme="light"] .dp-preloader .dp-mark--mono img {
	filter: invert(1) brightness(0.1);
}

@keyframes dp-preloader-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.55; transform: scale(0.9); }
}

/* Scrambling messages + a round badge that follows the mouse. */
.dp-preloader--scramble {
	color: #fff;
	background: #050505;
	/* Longer safety net: the messages need a few seconds. */
	animation-delay: 12s;
}

.dp-preloader__msg {
	font-family: var(--dp-font-heading);
	font-size: clamp(1rem, 1.6vw, 1.5rem);
	font-weight: 500;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.dp-preloader__msg .is-r {
	opacity: 0.45;
}

.dp-preloader__ball {
	position: fixed;
	left: 0;
	top: 0;
	display: grid;
	place-items: center;
	width: 88px;
	height: 88px;
	margin: -44px 0 0 -44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
	transform: translate3d(50vw, calc(50vh - 90px), 0);
	will-change: transform;
}

.dp-preloader__count {
	font-family: var(--dp-font-heading);
	font-size: clamp(4rem, 14vw, 10rem);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.05em;
	font-variant-numeric: tabular-nums;
}

.dp-preloader__name {
	font-family: var(--dp-font-heading);
	font-size: clamp(1.6rem, 4vw, 2.6rem);
	font-weight: 700;
	letter-spacing: -0.03em;
}

.dp-preloader__line {
	display: block;
	width: min(240px, 60vw);
	height: 2px;
	overflow: hidden;
	background: var(--dp-border);
	border-radius: 2px;
}

.dp-preloader__line i {
	display: block;
	height: 100%;
	background: var(--dp-primary);
	transform: scaleX(var(--dp-load, 0));
	transform-origin: left;
	transition: transform 0.2s linear;
}

/* 4. Reading progress & back-to-top ring ------------------------------ */
.dp-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1001;
	height: 3px;
	pointer-events: none;
}

.admin-bar .dp-progress {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.dp-progress i {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--dp-primary), var(--dp-accent));
	transform: scaleX(var(--dp-scroll, 0));
	transform-origin: left;
}

.dp-to-top__ring {
	position: absolute;
	inset: -4px;
	width: calc(100% + 8px);
	height: calc(100% + 8px);
	transform: rotate(-90deg);
	pointer-events: none;
}

.dp-to-top__ring circle {
	fill: none;
	stroke: var(--dp-primary);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-dasharray: 157.08;
	stroke-dashoffset: calc(157.08 * (1 - var(--dp-scroll, 0)));
}

/* 5. Custom cursor (desktop with a mouse only) ------------------------ */
.dp-cursor {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 3000;
	pointer-events: none;
	border-radius: 50%;
	opacity: 0;
	transition: opacity 0.3s, width 0.3s var(--dp-ease), height 0.3s var(--dp-ease), margin 0.3s var(--dp-ease), background 0.3s, border-color 0.3s;
	will-change: transform;
}

.dp-cursor-on .dp-cursor {
	opacity: 1;
}

.dp-cursor--dot {
	width: 8px;
	height: 8px;
	margin: -4px 0 0 -4px;
	background: var(--dp-primary);
}

.dp-cursor--ring {
	width: 36px;
	height: 36px;
	margin: -18px 0 0 -18px;
	border: 1.5px solid rgba(var(--dp-text-rgb), 0.5);
}

.dp-cursor--ring.is-hover {
	width: 64px;
	height: 64px;
	margin: -32px 0 0 -32px;
	background: rgba(var(--dp-primary-rgb), 0.12);
	border-color: var(--dp-primary);
}

.dp-cursor--blob {
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	background: #fff;
	mix-blend-mode: difference;
}

.dp-cursor--blob.is-hover {
	width: 72px;
	height: 72px;
	margin: -36px 0 0 -36px;
}

/* Word inside the cursor over linked images */
.dp-cursor {
	display: grid;
	place-items: center;
	overflow: hidden;
	font-size: 0;
	color: var(--dp-bg);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	white-space: nowrap;
}

.dp-cursor--ring.is-label,
.dp-cursor--blob.is-label {
	width: 84px;
	height: 84px;
	margin: -42px 0 0 -42px;
	font-size: 11px;
	font-weight: 600;
}

.dp-cursor--ring.is-label {
	background: var(--dp-primary);
	border-color: var(--dp-primary);
}

.dp-cursor--blob.is-label {
	color: #000;
}

/* Hide the normal cursor only once the custom one is running */
.dp-cursor-on.dp-cursor-hide,
.dp-cursor-on.dp-cursor-hide a,
.dp-cursor-on.dp-cursor-hide button {
	cursor: none;
}

.dp-cursor-on.dp-cursor-hide input,
.dp-cursor-on.dp-cursor-hide textarea,
.dp-cursor-on.dp-cursor-hide select {
	cursor: auto;
}

@media (prefers-reduced-motion: reduce) {
	.dp-preloader .dp-preloader__mark {
		animation: none;
	}
}

/* Top bar + transparent (absolute/fixed) header: push the header below the bar.
 * JS keeps --dp-topbar-offset in sync (bar height, shrinking to 0 as you scroll). */
.dopee-has-topbar.dopee-transparent-header .dp-header {
	top: var(--dp-topbar-offset, 0px);
}

.admin-bar.dopee-has-topbar.dopee-transparent-header .dp-header {
	top: calc(var(--wp-admin--admin-bar--height, 32px) + var(--dp-topbar-offset, 0px));
}

/* WhatsApp chat button ------------------------------------------------ */
.dp-wa {
	--dp-wa-gap: 24px;
	position: fixed;
	bottom: var(--dp-wa-gap);
	z-index: 95;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: #fff;
	text-decoration: none;
	animation: dp-wa-in 0.6s var(--dp-ease, ease) 0.8s both;
}

.dp-wa--right { right: var(--dp-wa-gap); flex-direction: row-reverse; }
.dp-wa--left { left: var(--dp-wa-gap); }

.dp-wa__icon {
	position: relative;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	flex: none;
	background: #25d366;
	border-radius: 50%;
	box-shadow: 0 10px 30px -8px rgba(37, 211, 102, 0.6);
	transition: transform 0.35s var(--dp-ease, ease);
}

.dp-wa__icon::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: 2px solid #25d366;
	animation: dp-wa-pulse 2.4s ease-out infinite;
}

.dp-wa__label {
	padding: 10px 16px;
	font-family: var(--dp-font-button, inherit);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--dp-text);
	background: var(--dp-glass-bg);
	border: 1px solid var(--dp-glass-border);
	border-radius: 999px;
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	white-space: nowrap;
}

.dp-wa:hover .dp-wa__icon,
.dp-wa:focus-visible .dp-wa__icon { transform: scale(1.08); }

.dopee-no-glow .dp-wa__icon { box-shadow: none; }

/* Keep the back-to-top button clear of it on the same side */
.dopee-wa-right .dp-to-top { bottom: 96px; }

@keyframes dp-wa-in {
	from { opacity: 0; transform: translateY(20px) scale(0.9); }
}

@keyframes dp-wa-pulse {
	0% { opacity: 0.7; transform: scale(1); }
	70%, 100% { opacity: 0; transform: scale(1.5); }
}

@media (max-width: 767px) {
	.dp-wa { --dp-wa-gap: 16px; }
	.dp-wa__label { display: none; }
	.dp-wa__icon { width: 52px; height: 52px; }
	.dopee-wa-right .dp-to-top { bottom: 84px; }
	.dopee-has-mobilebar .dp-wa { bottom: 92px; }
	.dopee-has-mobilebar.dopee-wa-right .dp-to-top { bottom: 156px; }
}

@media (prefers-reduced-motion: reduce) {
	.dp-wa,
	.dp-wa__icon::after { animation: none; }
}
