/**
 * CashCom Pay animation — tap-to-pay story (port of the Cryptolink POS loop).
 * Brand: teal #78DED4 / navy #003E52. No third-party chrome.
 *
 * Mounted in the hero image slot (replaces the credit-card handle image).
 */

/* Hero section — tighten vertical padding (Elementor default was 150/100) */
body.ccp-magic-bento .elementor-element-65924c69 {
	padding-top: 64px !important;
	padding-bottom: 64px !important;
}

/* Hero copy column — top/start instead of vertically centered */
body.ccp-magic-bento .elementor-element-5b3a5d3f.elementor-column > .elementor-widget-wrap,
body.ccp-magic-bento .elementor-bc-flex-widget .elementor-element-5b3a5d3f.elementor-column .elementor-widget-wrap {
	align-items: flex-start !important;
	align-content: flex-start !important;
	justify-content: flex-start !important;
}

@media (max-width: 1024px) {
	body.ccp-magic-bento .elementor-element-65924c69 {
		padding-top: 48px !important;
		padding-bottom: 48px !important;
	}
}

@media (max-width: 767px) {
	body.ccp-magic-bento .elementor-element-65924c69 {
		padding-top: 32px !important;
		padding-bottom: 32px !important;
	}
}

/* Hero image widget — hide original <img> once POS mounts */
body.ccp-magic-bento .ccp-pos-replaced > .elementor-widget-container {
	position: relative;
	min-height: 560px;
	margin: 0 !important;
	padding: 0 !important;
	background: none !important;
	background-image: none !important;
	background-color: transparent !important;
	border: none !important;
	box-shadow: none !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
	display: flex;
	align-items: center;
	justify-content: center;
}

body.ccp-magic-bento .ccp-pos-replaced > .elementor-widget-container > img {
	display: none !important;
}

/* Kill Color Bends hero glass panel behind the POS (was for the card-handle image) */
body.ccp-color-bends.ccp-magic-bento:not(.ccp-color-bends-gateway) .elementor-element-34370057 > .elementor-widget-wrap,
body.ccp-color-bends:not(.ccp-color-bends-gateway) .elementor-element-34370057:has(.ccp-pos-replaced) > .elementor-widget-wrap,
body.ccp-color-bends:not(.ccp-color-bends-gateway) .elementor-column:has(.ccp-pos-replaced) > .elementor-widget-wrap,
body.ccp-color-bends:not(.ccp-color-bends-gateway) .ccp-pos-hero-column > .elementor-widget-wrap {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
}

body.ccp-magic-bento .ccp-pos-replaced .ccp-pos-container {
	position: relative;
	z-index: 2;
}

.ccp-pos-container {
	position: relative;
	width: 100%;
	max-width: 340px;
	min-height: 560px;
	margin: 0 auto;
	perspective: 1000px;
	font-family: "DIN Next", Sans-serif;
	text-align: left;
}

/* —— Terminal —— */
.ccp-pos-device {
	width: 100%;
	background: linear-gradient(145deg, #0b4b60, #002a38);
	border: 1px solid rgba(120, 222, 212, 0.25);
	border-radius: 24px;
	padding: 20px;
	box-shadow:
		0 20px 25px -5px rgba(0, 0, 0, 0.35),
		0 10px 10px -5px rgba(0, 0, 0, 0.25),
		0 0 32px rgba(120, 222, 212, 0.08),
		inset 0 1px 1px rgba(255, 255, 255, 0.08);
	position: relative;
	transform-style: preserve-3d;
	/* Face the hero copy on the right */
	transform: rotateY(12deg) rotateX(4deg);
	transition: transform 0.5s ease;
	cursor: pointer;
}

.ccp-pos-device:hover {
	transform: rotateY(7deg) rotateX(2deg);
}

/* Arabic — face hero copy on the opposite side */
body.rtl .ccp-pos-device {
	transform: rotateY(-12deg) rotateX(4deg);
}

body.rtl .ccp-pos-device:hover {
	transform: rotateY(-7deg) rotateX(2deg);
}

.ccp-pos-screen-shell {
	background: #021820;
	border-radius: 16px;
	height: 280px;
	overflow: hidden;
	position: relative;
	box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
	margin-bottom: 16px;
}

.ccp-pos-screen {
	height: 100%;
	padding: 20px;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.ccp-pos-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(120, 222, 212, 0.15);
}

.ccp-pos-logo {
	font-weight: 700;
	font-size: 18px;
	letter-spacing: 0.5px;
	color: #78ded4;
}

.ccp-pos-status {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	letter-spacing: 1px;
	color: #78ded4;
}

.ccp-pos-status-dot {
	width: 8px;
	height: 8px;
	background: #78ded4;
	border-radius: 50%;
	animation: ccp-pos-blink 2s infinite;
}

@keyframes ccp-pos-blink {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

.ccp-pos-amount-block {
	text-align: center;
	padding: 16px 0;
}

.ccp-pos-amount-label {
	font-size: 13px;
	letter-spacing: 1px;
	color: rgba(255, 255, 255, 0.55);
	margin-bottom: 4px;
}

.ccp-pos-amount {
	font-size: 34px;
	font-weight: 700;
	color: #fff;
	margin-bottom: 4px;
}

.ccp-pos-currency {
	font-size: 13px;
	letter-spacing: 2px;
	color: rgba(255, 255, 255, 0.55);
}

/* NFC prompt */
.ccp-pos-nfc {
	margin-top: auto;
	text-align: center;
	transition: opacity 0.4s ease;
}

.ccp-pos-nfc-waves {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-bottom: 10px;
}

.ccp-pos-nfc-waves span {
	width: 40px;
	height: 3px;
	background: linear-gradient(90deg, rgba(120, 222, 212, 0.5), #78ded4);
	border-radius: 2px;
	animation: ccp-pos-wave 1.5s ease-in-out infinite;
}

.ccp-pos-nfc-waves span:nth-child(2) { animation-delay: 0.2s; }
.ccp-pos-nfc-waves span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ccp-pos-wave {
	0%, 100% { opacity: 0.3; transform: scaleY(1); }
	50% { opacity: 1; transform: scaleY(1.5); }
}

.ccp-pos-nfc-text {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.6);
}

/* Success line */
.ccp-pos-success {
	margin-top: auto;
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	color: #78ded4;
}

.ccp-pos-success.is-visible {
	display: flex;
}

.ccp-pos-success.is-visible ~ .ccp-pos-nfc {
	display: none;
}

.ccp-pos-success svg {
	width: 18px;
	height: 18px;
	stroke: #78ded4;
	flex-shrink: 0;
}

/* Processing overlay */
.ccp-pos-processing {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: rgba(2, 24, 32, 0.92);
	border-radius: 16px;
	z-index: 20;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.5s ease;
}

.ccp-pos-processing.is-active {
	opacity: 1;
}

.ccp-pos-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(120, 222, 212, 0.25);
	border-top-color: #78ded4;
	border-radius: 50%;
	margin-bottom: 14px;
	animation: ccp-pos-spin 1s linear infinite;
}

@keyframes ccp-pos-spin {
	to { transform: rotate(360deg); }
}

.ccp-pos-processing-text {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.65);
}

/* Card slot + brand line */
.ccp-pos-slot {
	height: 12px;
	background: #01141b;
	border-radius: 6px;
	margin: 14px 0;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.ccp-pos-brand {
	text-align: center;
	font-size: 11px;
	color: rgba(120, 222, 212, 0.55);
	margin-top: 12px;
	letter-spacing: 3px;
	text-transform: uppercase;
}

/* —— Card —— */
.ccp-pos-card-holder {
	position: absolute;
	left: 50%;
	top: 63%;
	transform: translateX(-50%);
	width: 300px;
	height: 170px;
	z-index: 10;
	transform-style: preserve-3d;
}

.ccp-pos-card {
	width: 100%;
	height: 100%;
	position: relative;
	transform-style: preserve-3d;
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	background:
		radial-gradient(120% 160% at 85% 10%, rgba(120, 222, 212, 0.5) 0%, rgba(120, 222, 212, 0) 45%),
		linear-gradient(135deg, #005a74, #003e52 55%, #002230);
	border: 1px solid rgba(120, 222, 212, 0.35);
	padding: 20px;
	box-sizing: border-box;
}

.ccp-pos-card.is-idle {
	animation: ccp-pos-card-hover 3s ease-in-out infinite;
}

@keyframes ccp-pos-card-hover {
	0%, 100% { transform: translateY(0) rotateX(30deg); }
	50% { transform: translateY(-10px) rotateX(30deg); }
}

.ccp-pos-card.is-swiping {
	animation: ccp-pos-card-swipe 3s forwards;
}

@keyframes ccp-pos-card-swipe {
	0% { transform: translateY(0) translateX(0) rotateX(30deg); opacity: 1; }
	30% { transform: translateY(-40px) translateX(0) rotateX(20deg); opacity: 1; }
	50% { transform: translateY(-60px) translateX(0) rotateX(10deg); opacity: 1; }
	70% { transform: translateY(-80px) translateX(0) rotateX(0deg); opacity: 1; }
	100% { transform: translateY(-80px) translateX(200px) rotateX(0deg); opacity: 0; }
}

.ccp-pos-card.is-returning {
	animation: ccp-pos-card-return 1.5s forwards;
	opacity: 0;
}

@keyframes ccp-pos-card-return {
	0% { transform: translateY(-80px) translateX(200px) rotateX(0deg); opacity: 0; }
	100% { transform: translateY(0) translateX(0) rotateX(30deg); opacity: 1; }
}

.ccp-pos-chip {
	width: 40px;
	height: 30px;
	background: linear-gradient(145deg, #d4af37, #f1c40f);
	border-radius: 5px;
	position: absolute;
	top: 20px;
	left: 20px;
	overflow: hidden;
}

.ccp-pos-chip-glow {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at center, rgba(120, 222, 212, 0.9) 0%, rgba(120, 222, 212, 0) 70%);
	opacity: 0;
	pointer-events: none;
}

.ccp-pos-chip-glow.is-active {
	animation: ccp-pos-chip-pulse 2s forwards;
}

@keyframes ccp-pos-chip-pulse {
	0% { opacity: 0; transform: scale(0.5); }
	50% { opacity: 0.85; transform: scale(1.2); }
	100% { opacity: 0; transform: scale(1.5); }
}

.ccp-pos-card-logo {
	position: absolute;
	top: 20px;
	right: 20px;
	font-size: 18px;
	font-weight: 700;
	color: #78ded4;
}

.ccp-pos-card-number {
	position: absolute;
	bottom: 52px;
	left: 20px;
	color: #fff;
	font-size: 16px;
	letter-spacing: 2px;
	font-family: "Courier New", monospace;
}

.ccp-pos-card-meta {
	position: absolute;
	bottom: 18px;
	left: 20px;
	right: 20px;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	color: #fff;
	font-size: 12px;
}

.ccp-pos-card-name {
	text-transform: uppercase;
	font-weight: 600;
	letter-spacing: 1px;
}

.ccp-pos-card-expiry {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.ccp-pos-card-expiry-label {
	font-size: 8px;
	opacity: 0.7;
}

.ccp-pos-card-mark {
	position: absolute;
	right: 18px;
	bottom: 40px;
	display: flex;
}

.ccp-pos-card-mark span {
	width: 22px;
	height: 22px;
	border-radius: 50%;
}

.ccp-pos-card-mark span:first-child {
	background: rgba(120, 222, 212, 0.85);
}

.ccp-pos-card-mark span:last-child {
	background: rgba(255, 255, 255, 0.35);
	margin-left: -9px;
}

/* —— Receipt —— */
.ccp-pos-receipt {
	position: absolute;
	left: 50%;
	top: 60%;
	transform: translateX(-50%);
	pointer-events: none;
	width: 200px;
	height: 0;
	background: #fff;
	z-index: 15;
	overflow: hidden;
	transition: height 1s ease;
	border-radius: 0 0 4px 4px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

.ccp-pos-receipt.is-active {
	animation: ccp-pos-receipt-print 2s forwards;
}

@keyframes ccp-pos-receipt-print {
	0% { height: 0; }
	70% { height: 175px; }
	80% { height: 145px; }
	90% { height: 175px; }
	100% { height: 175px; }
}

.ccp-pos-receipt-content {
	padding: 14px;
	font-size: 10px;
	color: #1f2933;
	opacity: 0;
	transition: opacity 0.5s ease 1s;
}

.ccp-pos-receipt.is-active .ccp-pos-receipt-content {
	opacity: 1;
}

.ccp-pos-receipt-header {
	text-align: center;
	font-weight: 700;
	margin-bottom: 8px;
	font-size: 12px;
	color: #003e52;
	letter-spacing: 1px;
}

.ccp-pos-receipt-divider {
	border-bottom: 1px dashed #c3cbd3;
	margin: 5px 0;
}

.ccp-pos-receipt-row {
	display: flex;
	justify-content: space-between;
	margin-bottom: 4px;
}

.ccp-pos-receipt-total {
	font-weight: 700;
	margin-top: 4px;
	display: flex;
	justify-content: space-between;
	color: #003e52;
}

.ccp-pos-receipt-footer {
	text-align: center;
	margin-top: 8px;
	font-style: italic;
	color: #5a6672;
}

@media (max-width: 480px) {
	.ccp-pos-container {
		max-width: 300px;
		min-height: 500px;
	}

	.ccp-pos-card-holder {
		width: 260px;
		height: 150px;
	}

	.ccp-pos-card-number {
		font-size: 14px;
	}

	.ccp-pos-screen-shell {
		height: 250px;
	}

	.ccp-pos-amount {
		font-size: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ccp-pos-device {
		transform: none;
		transition: none;
	}

	.ccp-pos-card.is-idle,
	.ccp-pos-card.is-swiping,
	.ccp-pos-card.is-returning,
	.ccp-pos-nfc-waves span,
	.ccp-pos-status-dot,
	.ccp-pos-spinner,
	.ccp-pos-chip-glow.is-active,
	.ccp-pos-receipt.is-active {
		animation: none !important;
	}

	.ccp-pos-card {
		transform: rotateX(0deg);
	}
}
