/**
 * GC Return Popup
 * Floating "back to grandcar.ua" popup, bottom-left corner.
 * Entrance/exit animations mirror grandcar.com.ua/pop
 * (seed -> ring -> pill reveal via clip-path -> label slide-in -> arrow -> close -> shine;
 *  close plays the collapse in reverse).
 */

.gc-pop-wrap {
	--gc-mint: #72F7B0;
	--gc-card: #14161c;
	--gc-card-line: rgba(255, 255, 255, .1);
	--gc-ink: #000;
	--gc-muted: rgba(255, 255, 255, .62);
	position: fixed;
	left: clamp(12px, 2.4vw, 28px);
	bottom: calc(clamp(12px, 2.4vw, 28px) + env(safe-area-inset-bottom, 0px));
	z-index: 1000000;
	pointer-events: none;
	font-family: inherit;
	/* Pointer on the wrapper too, so the pill's rounded-corner fringe (which falls
	   through to this element) stays pointer and never flickers. */
	cursor: pointer;
}

.gc-pop-wrap.is-live { pointer-events: auto; }

.gc-pop-wrap .gc-seed,
.gc-pop-wrap .gc-ring {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	/* Decorative only. After the entrance the scaled ring stays in the DOM and
	   hugs the pill edges; without this it caught hovers with the default cursor
	   and flickered pointer<->arrow along the button edge. */
	pointer-events: none;
}

.gc-pop-wrap .gc-seed { background: var(--gc-mint); transform: scale(0); }
.gc-pop-wrap .gc-ring { border: 2px solid var(--gc-mint); opacity: 0; }

.gc-pop-wrap .gc-pop {
	position: relative;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px;
	background: var(--gc-card);
	border: 1px solid var(--gc-card-line);
	border-radius: 999px;
	box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .75), 0 0 40px -10px rgba(114, 247, 176, .25);
	overflow: hidden;
	clip-path: circle(0px at 30px 50%);
	/* Pointer across the whole pill (not just the CTA/close) so moving over the
	   inner padding and the gap between the two buttons never flickers the cursor. */
	cursor: pointer;
}

/* Mint overlay that fades out while the pill reveals; never catches the cursor. */
.gc-pop-wrap .gc-pop::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--gc-mint);
	z-index: 3;
	pointer-events: none;
}

.gc-pop-wrap .gc-cta {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 14px;
	padding: 6px 6px 6px 20px;
	background: var(--gc-mint);
	color: var(--gc-ink);
	text-decoration: none;
	border-radius: 999px;
	font-weight: 600;
	font-size: 15px;
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	cursor: pointer;
}

/* Shine sweep overlay; must not intercept pointer events. */
.gc-pop-wrap .gc-cta::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 40%;
	left: -60%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
	transform: skewX(-20deg);
	pointer-events: none;
}

/* Keep the cursor steady: inner nodes never grab pointer events. */
.gc-pop-wrap .gc-cta *,
.gc-pop-wrap .gc-close * { pointer-events: none; }

.gc-pop-wrap .gc-cta:hover { box-shadow: 0 8px 24px -8px rgba(114, 247, 176, .7); }
.gc-pop-wrap .gc-cta:hover .gc-arrow svg { animation: gcArrow .55s cubic-bezier(.6, 0, .2, 1) 1; }

.gc-pop-wrap .gc-label { display: block; overflow: hidden; }
.gc-pop-wrap .gc-label > span { display: block; transform: translateY(110%); }

.gc-pop-wrap .gc-arrow {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex: 0 0 auto;
	background: var(--gc-ink);
	color: var(--gc-mint);
	border-radius: 50%;
	overflow: hidden;
	transform: scale(0);
}

.gc-pop-wrap .gc-arrow svg { width: 15px; height: 15px; display: block; transform: translate(-160%, -160%); }

.gc-pop-wrap .gc-close {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gc-muted);
	cursor: pointer;
	border-radius: 50%;
	opacity: 0;
	transform: rotate(-90deg) scale(.5);
}

.gc-pop-wrap .gc-close:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.gc-pop-wrap .gc-close:focus-visible { outline: 2px solid var(--gc-mint); outline-offset: 2px; }
.gc-pop-wrap .gc-close svg { width: 11px; height: 11px; display: block; }

/* ===== Entrance ===== */
.gc-pop-wrap.is-in .gc-seed { animation: gcSeed .9s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.gc-pop-wrap.is-in .gc-ring { animation: gcRing 1.1s ease-out .3s forwards; }
.gc-pop-wrap.is-in .gc-pop { clip-path: circle(150% at 30px 50%); transition: clip-path .95s cubic-bezier(.76, 0, .18, 1) .4s; }
.gc-pop-wrap.is-in .gc-pop::before { opacity: 0; transition: opacity .6s .85s; }
.gc-pop-wrap.is-in .gc-label > span { transform: translateY(0); transition: transform .8s cubic-bezier(.16, 1, .3, 1) 1.05s; }
.gc-pop-wrap.is-in .gc-arrow { transform: scale(1); transition: transform .6s cubic-bezier(.34, 1.56, .64, 1) 1.2s; }
.gc-pop-wrap.is-in .gc-arrow svg { transform: translate(0, 0); transition: transform .6s cubic-bezier(.16, 1, .3, 1) 1.45s; }
.gc-pop-wrap.is-in .gc-cta::after { animation: gcShine 1s ease 1.8s 1; }
.gc-pop-wrap.is-in .gc-close { opacity: 1; transform: none; transition: opacity .4s 1.4s, transform .6s cubic-bezier(.34, 1.56, .64, 1) 1.4s, color .2s, background .2s; }

/* ===== Exit ===== */
.gc-pop-wrap.is-out .gc-close { opacity: 0; transform: rotate(90deg) scale(.4); transition: opacity .25s ease-in, transform .3s cubic-bezier(.5, 0, .75, 0); }
.gc-pop-wrap.is-out .gc-arrow svg { transform: translate(160%, 160%); transition: transform .32s cubic-bezier(.5, 0, .75, 0); }
.gc-pop-wrap.is-out .gc-label > span { transform: translateY(-110%); transition: transform .38s cubic-bezier(.5, 0, .75, 0) .08s; }
.gc-pop-wrap.is-out .gc-arrow { transform: scale(0); transition: transform .34s cubic-bezier(.36, 0, .66, -.56) .18s; }
.gc-pop-wrap.is-out .gc-pop { animation: gcCollapse .85s cubic-bezier(.76, 0, .24, 1) .3s both; }
.gc-pop-wrap.is-out .gc-pop::before { opacity: 1; transition: opacity .3s .62s; }
.gc-pop-wrap.is-out .gc-ring { animation: gcRingOut .7s ease-out .95s forwards; }

@keyframes gcSeed { 0% { transform: scale(0); } 45% { transform: scale(1); } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@keyframes gcRing { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(3); } }
@keyframes gcRingOut { 0% { opacity: .8; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.4); } }
@keyframes gcCollapse { 0% { clip-path: circle(150% at 30px 50%); transform: scale(1); } 62% { clip-path: circle(30px at 30px 50%); transform: scale(1); } 76% { clip-path: circle(30px at 30px 50%); transform: scale(1.08); } 100% { clip-path: circle(0px at 30px 50%); transform: scale(1); } }
@keyframes gcShine { 100% { left: 130%; } }
@keyframes gcArrow { 0% { transform: translate(0, 0); } 45% { transform: translate(160%, 160%); } 46% { transform: translate(-160%, -160%); } 100% { transform: translate(0, 0); } }

@media (prefers-reduced-motion: reduce) {
	.gc-pop-wrap .gc-seed,
	.gc-pop-wrap .gc-ring { display: none; }
	.gc-pop-wrap.is-in .gc-pop { clip-path: none; transition: none; }
	.gc-pop-wrap.is-in .gc-pop::before { display: none; }
	.gc-pop-wrap.is-in .gc-label > span { transform: none; transition: none; }
	.gc-pop-wrap.is-in .gc-arrow { transform: scale(1); transition: none; }
	.gc-pop-wrap.is-in .gc-arrow svg { transform: none; }
	.gc-pop-wrap.is-in .gc-cta::after { animation: none; }
	.gc-pop-wrap.is-in .gc-close { opacity: 1; transform: none; transition: none; }
}
