/*
 * Golden Snitch Add-to-Cart Button & Flight Animation
 */

.shoco-btn.hp-snitch-btn {
	position: relative;
	column-gap: 5px;
	overflow: visible;
}

.shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: 16px;
	height: 13px;
	line-height: 0;
	flex-shrink: 0;
	overflow: visible;
	pointer-events: none;
	animation: hpSnitchFloat 2.2s ease-in-out infinite;
	transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
	will-change: transform, opacity;
}

.shoco-btn.hp-snitch-btn svg.hp-snitch-svg {
	width: 26px !important;
	height: 15px !important;
	flex-shrink: 0;
	overflow: visible;
	pointer-events: none;
	filter: drop-shadow(0 1px 3px rgba(122, 75, 4, 0.32));
	transition: filter 0.25s ease, transform 0.25s ease;
}

/* На сторінці товару на десктопі шрифт кнопки більший (23px, іконка 20x20) */
.woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap,
.woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap {
	width: 24px;
	height: 20px;
}

.woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn svg.hp-snitch-svg,
.woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn svg.hp-snitch-svg {
	width: 34px !important;
	height: 20px !important;
}

/* В upsells використовується стандартний розмір каталогу */
.upsells .woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap,
.upsells .woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap {
	width: 16px;
	height: 13px;
}

.upsells .woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn svg.hp-snitch-svg,
.upsells .woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn svg.hp-snitch-svg {
	width: 26px !important;
	height: 15px !important;
}

/* Вимикаємо стандартне обертання іконки на 360deg при .loading */
.shoco-btn.hp-snitch-btn.loading svg.hp-snitch-svg {
	animation: none !important;
}

/* Зберігаємо кольори Снітча при наведенні на кнопку (.btn-style-1:hover svg path) */
.shoco-btn.hp-snitch-btn:hover svg.hp-snitch-svg {
	filter: drop-shadow(0 0 6px rgba(242, 193, 58, 0.85)) drop-shadow(0 1px 3px rgba(140, 86, 6, 0.45));
	transform: scale(1.08);
}

.shoco-btn.hp-snitch-btn:hover svg.hp-snitch-svg path.hp-snitch-wing-main {
	fill: #FFF8DC !important;
	stroke: #C8921E !important;
}

.shoco-btn.hp-snitch-btn:hover svg.hp-snitch-svg path.hp-snitch-wing-vein {
	fill: none !important;
	stroke: #D8A22E !important;
}

.shoco-btn.hp-snitch-btn:hover svg.hp-snitch-svg path.hp-snitch-seam {
	fill: none !important;
	stroke: #8C5606 !important;
}

.shoco-btn.hp-snitch-btn:hover svg.hp-snitch-svg path.hp-snitch-sparkle {
	fill: #F3B626 !important;
	stroke: none !important;
}

/* Анімація крил */
.hp-snitch-svg .hp-snitch-wing-left {
	transform-origin: 17px 12.5px;
	animation: hpSnitchWingLeft 0.34s ease-in-out infinite alternate;
}

.hp-snitch-svg .hp-snitch-wing-right {
	transform-origin: 27px 12.5px;
	animation: hpSnitchWingRight 0.34s ease-in-out infinite alternate;
}

.shoco-btn.hp-snitch-btn:hover .hp-snitch-svg .hp-snitch-wing-left {
	animation: hpSnitchWingLeftFast 0.085s ease-in-out infinite alternate;
}

.shoco-btn.hp-snitch-btn:hover .hp-snitch-svg .hp-snitch-wing-right {
	animation: hpSnitchWingRightFast 0.085s ease-in-out infinite alternate;
}

/* Мерехтіння зірочок біля Снітча */
.hp-snitch-svg .hp-snitch-sparkle-1 {
	transform-origin: 11.5px 4.3px;
	animation: hpSnitchSparkle 1.8s ease-in-out infinite;
}

.hp-snitch-svg .hp-snitch-sparkle-2 {
	transform-origin: 33.2px 18.5px;
	animation: hpSnitchSparkle 1.8s ease-in-out 0.9s infinite;
}

/* Точний розмір .added-mark під контейнер Снітча, щоб кнопка не змінювала розмір */
.shoco-btn.hp-snitch-btn .added-mark {
	width: 16px !important;
	height: 13px !important;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 1;
}

.woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn .added-mark,
.woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn .added-mark {
	width: 24px !important;
	height: 20px !important;
}

.upsells .woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn .added-mark,
.upsells .woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn .added-mark {
	width: 16px !important;
	height: 13px !important;
}

/* Стани кнопки під час польоту та після приземлення */
.shoco-btn.hp-snitch-btn.hp-snitch-inflight .hp-snitch-icon-wrap {
	opacity: 0 !important;
	transform: scale(0.15) translateY(-10px) !important;
}

.shoco-btn.hp-snitch-btn.hp-snitch-inflight svg.hp-snitch-svg {
	display: block !important;
}

.shoco-btn.hp-snitch-btn.hp-snitch-inflight .added-mark {
	display: none !important;
}

.shoco-btn.hp-snitch-btn.hp-snitch-show-check .hp-snitch-icon-wrap {
	display: none !important;
}

.shoco-btn.hp-snitch-btn.hp-snitch-show-check .added-mark {
	display: inline-flex !important;
	animation: hpSnitchReturnPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shoco-btn.hp-snitch-btn.added:not(.hp-snitch-show-check):not(.hp-snitch-inflight) svg.hp-snitch-svg {
	display: block !important;
}

.shoco-btn.hp-snitch-btn.added:not(.hp-snitch-show-check) .added-mark {
	display: none !important;
}

.shoco-btn.hp-snitch-btn.hp-snitch-returning .hp-snitch-icon-wrap {
	animation: hpSnitchReturnPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), hpSnitchFloat 2.2s ease-in-out 0.45s infinite;
}

/* Повноекранний шар для польоту та сліду (не блокує кліки) */
#hp-snitch-flight-layer {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	pointer-events: none !important;
	z-index: 2147483640;
	overflow: hidden;
}

#hp-snitch-flight-layer * {
	pointer-events: none !important;
}

.hp-snitch-trail-canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none !important;
}

.hp-flying-snitch {
	position: fixed;
	top: 0;
	left: 0;
	width: 52px;
	height: 30px;
	margin-left: -26px;
	margin-top: -15px;
	pointer-events: none !important;
	will-change: transform, opacity;
	filter: drop-shadow(0 0 8px rgba(255, 222, 89, 0.95)) drop-shadow(0 2px 12px rgba(216, 152, 28, 0.7));
}

.hp-flying-snitch svg.hp-snitch-svg {
	width: 100% !important;
	height: 100% !important;
	display: block !important;
	overflow: visible;
}

.hp-flying-snitch .hp-snitch-wing-left {
	transform-origin: 17px 12.5px;
	animation: hpSnitchWingLeftFast 0.055s ease-in-out infinite alternate !important;
}

.hp-flying-snitch .hp-snitch-wing-right {
	transform-origin: 27px 12.5px;
	animation: hpSnitchWingRightFast 0.055s ease-in-out infinite alternate !important;
}

/* Ефект кошика при влучанні Снітча */
.xoo-wsc-basket.hp-snitch-basket-caught {
	animation: hpBasketCatch 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hpSnitchFloat {
	0%, 100% { transform: translateY(0px) rotate(0deg); }
	50% { transform: translateY(-2px) rotate(-2deg); }
}

@keyframes hpSnitchWingLeft {
	0% { transform: rotate(10deg) scaleY(0.92); }
	100% { transform: rotate(-16deg) scaleY(1.05); }
}

@keyframes hpSnitchWingRight {
	0% { transform: rotate(-10deg) scaleY(0.92); }
	100% { transform: rotate(16deg) scaleY(1.05); }
}

@keyframes hpSnitchWingLeftFast {
	0% { transform: rotate(22deg) scaleY(0.78); }
	100% { transform: rotate(-28deg) scaleY(1.1); }
}

@keyframes hpSnitchWingRightFast {
	0% { transform: rotate(-22deg) scaleY(0.78); }
	100% { transform: rotate(28deg) scaleY(1.1); }
}

@keyframes hpSnitchSparkle {
	0%, 100% { opacity: 0.25; transform: scale(0.7) rotate(0deg); }
	50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}

@keyframes hpSnitchReturnPop {
	0% { opacity: 0; transform: scale(0.2); }
	70% { opacity: 1; transform: scale(1.18); }
	100% { opacity: 1; transform: scale(1); }
}

@keyframes hpBasketCatch {
	0% {
		transform: scale(1);
		box-shadow: 0 1px 3px 1px #9ECFCA;
	}
	35% {
		transform: scale(1.22) rotate(-6deg);
		box-shadow: 0 0 24px 6px rgba(246, 200, 68, 0.85), 0 0 8px 2px #FFF6B7;
	}
	65% {
		transform: scale(0.94) rotate(3deg);
		box-shadow: 0 0 14px 3px rgba(246, 200, 68, 0.55);
	}
	100% {
		transform: scale(1) rotate(0deg);
		box-shadow: 0 1px 3px 1px #9ECFCA;
	}
}

@media (max-width: 767px) {
	.shoco-btn.hp-snitch-btn {
		column-gap: 5px;
	}

	.shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap,
	.upsells .woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap,
	.upsells .woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap,
	.shoco-btn.hp-snitch-btn .added-mark,
	.upsells .woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn .added-mark,
	.upsells .woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn .added-mark {
		width: 15px !important;
		height: 13px !important;
	}

	.woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap,
	.woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn .hp-snitch-icon-wrap,
	.woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn .added-mark,
	.woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn .added-mark {
		width: 14px !important;
		height: 9px !important;
	}

	.shoco-btn.hp-snitch-btn svg.hp-snitch-svg,
	.woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn svg.hp-snitch-svg,
	.woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn svg.hp-snitch-svg,
	.upsells .woocommerce-variation-add-to-cart.variations_button .shoco-btn.hp-snitch-btn svg.hp-snitch-svg,
	.upsells .woocommerce-variation-add-to-cart .shoco-btn.hp-snitch-btn svg.hp-snitch-svg {
		width: 22px !important;
		height: 13px !important;
	}

	.hp-flying-snitch {
		width: 44px;
		height: 25px;
		margin-left: -22px;
		margin-top: -12.5px;
	}
}
