/* =========================================================================
   Floating Coupon Popup - Frontend Styles
   All classes prefixed "wcfp-" to avoid theme/plugin conflicts.
   ========================================================================= */

.wcfp-widget-root {
	position: fixed;
	bottom: var( --wcfp-spacing-bottom, 20px );
	z-index: 999999;
	line-height: 0;
}

.wcfp-pos-bottom-right {
	right: var( --wcfp-spacing-right, 20px );
}

.wcfp-pos-bottom-left {
	left: var( --wcfp-spacing-left, 20px );
}

/* ---- Floating trigger ---- */
.wcfp-floating-btn {
	background: none !important;
	border: none !important;
	padding: 0 !important;
	cursor: pointer !important;
	display: inline-block !important;
	line-height: 0 !important;
	border-radius: 50% !important;
}

.wcfp-floating-btn:focus-visible {
	outline: 2px solid #2271b1 !important;
	outline-offset: 4px !important;
}

.wcfp-floating-img {
	display: block;
	width: 100px !important;
	max-width: 100px;
	height: auto;
	filter: drop-shadow( 0 6px 14px rgba( 0, 0, 0, 0.3 ) );
	animation: wcfp-zoom-pulse 1.8s ease-in-out infinite;
	transition: filter 0.2s ease;
	will-change: transform;
}

.wcfp-floating-btn:hover .wcfp-floating-img {
	filter: drop-shadow( 0 8px 18px rgba( 0, 0, 0, 0.38 ) );
}

@keyframes wcfp-zoom-pulse {
	0% { transform: scale( 1 ); }
	50% { transform: scale( 1.12 ); }
	100% { transform: scale( 1 ); }
}

@media ( prefers-reduced-motion: reduce ) {
	.wcfp-floating-img {
		animation: none;
	}
}

/* ---- Shared overlay ---- */
.wcfp-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba( 20, 20, 20, 0.65 );
	z-index: 1000000;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity 0.25s ease;
	overscroll-behavior: contain;
}

.wcfp-overlay.wcfp-active {
	display: flex;
	opacity: 1;
}

/* ---- Close Button ---- */
.wcfp-close-btn {
	position: absolute !important;
	top: 12px !important;
	right: 12px !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	min-height: 32px !important;
	max-width: 32px !important;
	max-height: 32px !important;
	border-radius: 50% !important;
	border: none !important;
	background: #f1f1f1 !important;
	color: #333333 !important;
	font-size: 20px !important;
	line-height: 32px !important;
	text-align: center !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	transition: background 0.15s ease !important;
	z-index: 2 !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.wcfp-close-btn:hover {
	background: #e2e2e2 !important;
	color: #333333 !important;
}

/* ---- Cool close animation (overlay fades, modal shrinks + slides down) ---- */
.wcfp-overlay.wcfp-closing {
	display: flex;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease 0.05s;
}

.wcfp-overlay.wcfp-closing .wcfp-main-modal,
.wcfp-overlay.wcfp-closing .wcfp-detail-modal {
	transform: scale( 0.86 ) translateY( 28px );
	opacity: 0;
	transition: transform 0.3s cubic-bezier( 0.4, 0, 0.2, 1 ), opacity 0.22s ease;
}

@media ( prefers-reduced-motion: reduce ) {
	.wcfp-overlay.wcfp-closing,
	.wcfp-overlay.wcfp-closing .wcfp-main-modal,
	.wcfp-overlay.wcfp-closing .wcfp-detail-modal {
		transition: none;
	}
}

/* ---- Back button (detail popup, top-left) ---- */
.wcfp-close-btn.wcfp-back-btn {
	left: 12px !important;
	right: auto !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

.wcfp-back-btn svg {
	display: block;
	width: 18px;
	height: 18px;
	pointer-events: none;
}

/* ---- Main Coupon Popup ---- */
.wcfp-main-modal {
	position: relative;
	background: #ffffff;
	border-radius: 16px;
	max-width: 640px;
	width: 100%;
	max-height: 88vh;
	overflow-y: auto;
	box-sizing: border-box;
	padding: 26px 22px 24px;
	box-shadow: 0 20px 50px rgba( 0, 0, 0, 0.35 );
	transform: scale( 0.9 );
	opacity: 0;
	transition: transform 0.28s cubic-bezier( 0.34, 1.56, 0.64, 1 ), opacity 0.22s ease;
}

.wcfp-overlay.wcfp-active .wcfp-main-modal,
.wcfp-overlay.wcfp-active .wcfp-detail-modal {
	transform: scale( 1 );
	opacity: 1;
}

.wcfp-main-title {
	margin: 0 0 16px !important;
	padding: 0 !important;
	font-family: inherit;
	font-size: 19px !important;
	line-height: 1.3 !important;
	font-weight: 700;
	text-align: center !important;
	color: #1d2327;
}

/* ---- Coupon Slider (2 cards per view, paged by exact viewport width + gap) ---- */
.wcfp-coupon-slider {
	--wcfp-gap: 12px;
	position: relative;
	padding: 0 38px;
}

.wcfp-coupon-viewport {
	overflow: hidden;
	padding: 8px 0;
}

.wcfp-coupon-track {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: stretch;
	gap: var( --wcfp-gap );
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
	transition: transform 0.4s cubic-bezier( 0.4, 0, 0.2, 1 );
	backface-visibility: hidden;
}

.wcfp-coupon-card {
	flex: 0 0 calc( ( 100% - var( --wcfp-gap ) ) / 2 ) !important;
	width: calc( ( 100% - var( --wcfp-gap ) ) / 2 );
	min-width: 0;
	box-sizing: border-box;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 22px;
	background: #fff8ee !important;
	border: 1px solid #f3ddb8 !important;
	border-radius: 12px !important;
	padding: 14px 12px !important;
	margin: 0 !important;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wcfp-coupon-card:hover {
	transform: translateY( -3px );
	box-shadow: 0 8px 18px rgba( 217, 119, 6, 0.18 );
}

.wcfp-card-image-wrap {
	display: block;
	width: 100%;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 4px;
}

.wcfp-card-image {
	display: block;
	width: 100% !important;
	height: 100px !important;
	object-fit: cover;
	border-radius: 10px;
	margin: 0 !important;
}

.wcfp-card-discount {
	font-size: 20px;
	font-weight: 800;
	color: #d97706;
}

.wcfp-card-title {
	font-size: 13px;
	font-weight: 700;
	color: #1d2327;
	line-height: normal;
}

.wcfp-card-short {
	font-size: 12px;
	color: #757c82;
}

.wcfp-card-cta {
	margin-top: auto;
	padding-top: 6px;
	font-size: 11px;
	font-weight: 600;
	color: #2271b1;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ---- Slider nav buttons ---- */
.wcfp-slider-nav {
	position: absolute !important;
	top: 50% !important;
	transform: translateY( -50% ) !important;
	width: 30px !important;
	height: 30px !important;
	min-width: 30px !important;
	min-height: 30px !important;
	border-radius: 50% !important;
	border: 1px solid #f3ddb8 !important;
	background: #ffffff !important;
	color: #d97706 !important;
	font-size: 18px !important;
	line-height: 1 !important;
	font-weight: 700 !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: 0 4px 10px rgba( 0, 0, 0, 0.15 ) !important;
	z-index: 3 !important;
	display: flex;
	align-items: center !important;
	justify-content: center !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	transition: background 0.15s ease, color 0.15s ease !important;
}

.wcfp-slider-nav:hover {
	background: #d97706 !important;
	color: #ffffff !important;
}

.wcfp-slider-prev {
	left: 0 !important;
}

.wcfp-slider-next {
	right: 0 !important;
}

/* ---- Coupon Details / Scratch Popup ---- */
.wcfp-detail-modal {
	position: relative;
	background: #ffffff;
	border-radius: 16px;
	max-width: 380px;
	width: 100%;
	max-height: 92vh;
	overflow-y: auto;
	box-sizing: border-box;
	padding: 48px 18px 18px;
	box-shadow: 0 20px 50px rgba( 0, 0, 0, 0.35 );
	transform: scale( 0.9 );
	opacity: 0;
	transition: transform 0.28s cubic-bezier( 0.34, 1.56, 0.64, 1 ), opacity 0.22s ease;
}

/* The reveal content is now in normal flow, so the box grows with its
 * content (email form etc.) instead of being cramped in a fixed height. */
.wcfp-scratch-wrap {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	background: #fffaf0;
	touch-action: none;
}

.wcfp-reveal-content {
	position: relative;
	z-index: 1;
	min-height: 220px;
	padding: 24px 18px;
	box-sizing: border-box;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.wcfp-reveal-discount {
	font-size: 26px;
	line-height: 1.15;
	font-weight: 800;
	color: #d97706;
}

.wcfp-reveal-title {
	margin: 0;
	font-size: 16px;
	line-height: 1.3;
	font-weight: 700;
	color: #1d2327;
}

.wcfp-reveal-detail {
	margin: 0;
	font-size: 13px;
	color: #646970;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

/* ---- Email collection form (replaces the old copy-code section) ---- */
.wcfp-email-form {
	margin-top: 8px;
	padding-top: 14px;
	border-top: 1px dashed #f0d9b0;
	width: 100%;
	max-width: 300px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wcfp-email-label {
	font-size: 13px;
	font-weight: 700;
	color: #1d2327;
	text-align: center;
}

.wcfp-email-row {
	display: flex;
	flex-direction: column;
	gap: 10px;
	transition: opacity 0.15s ease;
}

.wcfp-email-form.wcfp-email-done .wcfp-email-row,
.wcfp-email-form.wcfp-email-done .wcfp-phone-wrap,
.wcfp-email-form.wcfp-email-done .wcfp-email-submit {
	display: none !important;
}

.wcfp-email-input {
	width: 100% !important;
	box-sizing: border-box !important;
	padding: 10px 14px !important;
	border: 1px solid #d0d5da !important;
	border-radius: 8px !important;
	font-size: 14px !important;
	color: #1d2327 !important;
	background: #ffffff !important;
	transition: border-color 0.15s ease !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.wcfp-email-input:focus {
	outline: none !important;
	border-color: #2271b1 !important;
}

.wcfp-email-input.wcfp-email-invalid {
	border-color: #dc3545 !important;
}

.wcfp-email-submit {
	padding: 10px 22px !important;
	border: none !important;
	border-radius: 8px !important;
	background: #2271b1 !important;
	color: #ffffff !important;
	font-weight: 600 !important;
	font-size: 14px !important;
	cursor: pointer !important;
	transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease !important;
	height: auto !important;
	line-height: normal !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	width: 100%;
}

.wcfp-email-submit:hover:not( :disabled ) {
	background: #135e96 !important;
}

.wcfp-email-submit:active:not( :disabled ) {
	transform: scale( 0.98 ) !important;
}

.wcfp-email-submit:disabled {
	cursor: not-allowed !important;
	opacity: 0.55 !important;
}

.wcfp-email-message {
	margin: 0;
	min-height: 0;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}

.wcfp-email-message:empty {
	display: none;
}

.wcfp-email-message-success {
	color: #1a7d1a;
}

.wcfp-email-message-error {
	color: #dc3545;
}

/* ---- Optional phone number (collapsed line -> input, fades in/out) ---- */
/* Wrapper = ONE flex child, so the form's 10px gap applies once and never
   leaves a stray gap behind while the toggle/row swap. */
.wcfp-phone-wrap {
	display: block;
}

/* Smooth height + fade using the grid 0fr <-> 1fr trick (no fixed heights). */
.wcfp-phone-collapse {
	display: grid;
	grid-template-rows: 1fr;
	opacity: 1;
	visibility: visible;
	transition: grid-template-rows 0.3s ease, opacity 0.22s ease, visibility 0s linear 0s;
}

.wcfp-phone-collapse-inner {
	min-height: 0;
	overflow: hidden;
}

/* Default (closed): toggle shown, input row collapsed. */
.wcfp-phone-collapse-row {
	grid-template-rows: 0fr;
	opacity: 0;
	visibility: hidden;
	transition: grid-template-rows 0.3s ease, opacity 0.18s ease, visibility 0s linear 0.3s;
}

/* Open: toggle collapses, input row expands. */
.wcfp-phone-wrap.wcfp-phone-open .wcfp-phone-collapse-toggle {
	grid-template-rows: 0fr;
	opacity: 0;
	visibility: hidden;
	transition: grid-template-rows 0.3s ease, opacity 0.18s ease, visibility 0s linear 0.3s;
}

.wcfp-phone-wrap.wcfp-phone-open .wcfp-phone-collapse-row {
	grid-template-rows: 1fr;
	opacity: 1;
	visibility: visible;
	transition: grid-template-rows 0.3s ease, opacity 0.22s ease 0.06s, visibility 0s linear 0s;
}

@media ( prefers-reduced-motion: reduce ) {
	.wcfp-phone-collapse,
	.wcfp-phone-collapse-row,
	.wcfp-phone-wrap.wcfp-phone-open .wcfp-phone-collapse-toggle,
	.wcfp-phone-wrap.wcfp-phone-open .wcfp-phone-collapse-row {
		transition: none;
	}
}

.wcfp-phone-toggle {
	display: block;
	background: none !important;
	border: none !important;
	padding: 0 !important;
	margin: 10px 0 !important; /* 10px spacing top & bottom */
	color: #2271b1 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	text-decoration: underline !important;
	cursor: pointer !important;
	box-shadow: none !important;
	text-align: center;
	width: 100%;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.wcfp-phone-toggle:hover {
	color: #135e96 !important;
}

.wcfp-phone-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wcfp-phone-input {
	flex: 1 1 auto;
	width: 100% !important;
	box-sizing: border-box !important;
	padding: 10px 14px !important;
	border: 1px solid #d0d5da !important;
	border-radius: 8px !important;
	font-size: 14px !important;
	color: #1d2327 !important;
	background: #ffffff !important;
	transition: border-color 0.15s ease !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.wcfp-phone-input:focus {
	outline: none !important;
	border-color: #2271b1 !important;
}

.wcfp-phone-input.wcfp-phone-invalid {
	border-color: #dc3545 !important;
}

.wcfp-phone-remove {
	flex: 0 0 auto !important;
	width: 30px !important;
	height: 30px !important;
	min-width: 30px !important;
	border-radius: 50% !important;
	border: 1px solid #d0d5da !important;
	background: #ffffff !important;
	color: #646970 !important;
	font-size: 16px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	padding: 0 !important;
	box-shadow: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	transition: background 0.15s ease, color 0.15s ease !important;
}

.wcfp-phone-remove:hover {
	background: #f1f1f1 !important;
	color: #dc3545 !important;
}

/* ---- Success state (form done — row hidden, this replaces it) ---- */
.wcfp-email-status {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.wcfp-email-success-icon {
	display: none;
	width: 40px;
	height: 40px;
	align-items: center;
	justify-content: center;
	line-height: 0;
	opacity: 0;
	transform: scale( 0.6 );
}

.wcfp-email-form.wcfp-email-done .wcfp-email-success-icon {
	display: flex;
}

.wcfp-email-success-icon.wcfp-email-success-pop {
	animation: wcfp-success-pop 0.4s cubic-bezier( 0.34, 1.56, 0.64, 1 ) forwards;
}

@keyframes wcfp-success-pop {
	0% {
		opacity: 0;
		transform: scale( 0.6 );
	}
	100% {
		opacity: 1;
		transform: scale( 1 );
	}
}

.wcfp-email-form.wcfp-email-done .wcfp-email-message-success {
	font-size: 14px;
	font-weight: 700;
	background: #eaf7ea;
	border: 1px solid #c3e6c3;
	border-radius: 10px;
	padding: 12px 14px;
	line-height: 1.45;
	margin: 0;
}

.wcfp-email-change {
	display: none;
	background: none !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	color: #2271b1 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	text-decoration: underline !important;
	cursor: pointer !important;
	box-shadow: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.wcfp-email-change:hover {
	color: #135e96 !important;
}

.wcfp-email-form.wcfp-email-done .wcfp-email-change {
	display: inline-block;
}

@media ( prefers-reduced-motion: reduce ) {
	.wcfp-email-success-icon.wcfp-email-success-pop {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

/* ---- Scratch Canvas ---- */
.wcfp-scratch-canvas {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	cursor: pointer;
	transition: opacity 0.35s ease;
}

.wcfp-scratch-canvas.wcfp-scratch-hidden {
	opacity: 0;
	pointer-events: none;
}

.wcfp-scratch-label {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	z-index: 3;
	font-size: 14px;
	font-weight: 700;
	color: #ffffff;
	text-shadow: 0 1px 3px rgba( 0, 0, 0, 0.4 );
	letter-spacing: 0.5px;
	pointer-events: none;
}

.wcfp-scratch-label.wcfp-scratch-hidden {
	display: none;
}

/* ---- Responsive ---- */
@media ( max-width: 480px ) {
	.wcfp-floating-img {
		max-width: 72px;
	}

	.wcfp-main-modal {
		padding: 22px 14px 18px;
	}

	.wcfp-detail-modal {
		padding: 46px 14px 14px;
	}

	.wcfp-coupon-slider {
		padding: 0 30px;
	}

	.wcfp-coupon-card {
		flex-basis: 100%;
	}

	.wcfp-card-image {
		height: 120px;
	}

	.wcfp-slider-nav {
		width: 26px !important;
		height: 26px !important;
		min-width: 26px !important;
		min-height: 26px !important;
		font-size: 16px !important;
	}

	.wcfp-slider-prev {
		left: -2px !important;
	}

	.wcfp-slider-next {
		right: -2px !important;
	}

	.wcfp-main-title {
		font-size: 17px;
	}

	.wcfp-reveal-content {
		padding: 20px 14px;
	}
	
	.wcfp-card-short {
	   height: 35px; 
	   line-height: normal;
	}
}

/* ---- Open: zoom small -> big ---- */
.wcfp-main-modal,
.wcfp-detail-modal {
	transform: scale( 0.35 );
	transition: transform 0.45s cubic-bezier( 0.34, 1.56, 0.64, 1 ), opacity 0.25s ease;
}

/* ---- Close: "snap" dust (pieces are built by JS) ---- */
.wcfp-overlay.wcfp-snapping {
	display: flex;
	opacity: 1;
	pointer-events: none;
	background: rgba( 20, 20, 20, 0 );
	transition: background 1.2s ease 0.15s;
}

.wcfp-overlay.wcfp-snapping .wcfp-main-modal,
.wcfp-overlay.wcfp-snapping .wcfp-detail-modal {
	visibility: hidden;
}

/* ---- Close animation 2: modal flies into the floating button (animated by JS) ---- */
.wcfp-overlay.wcfp-sucking {
	display: flex;
	opacity: 1;
	pointer-events: none;
	background: rgba( 20, 20, 20, 0 );
	transition: background 0.7s ease 0.05s;
}

.wcfp-overlay.wcfp-sucking .wcfp-main-modal,
.wcfp-overlay.wcfp-sucking .wcfp-detail-modal {
	transform: none;
	opacity: 1;
	transition: none;
	will-change: transform, opacity;
}

@media ( prefers-reduced-motion: reduce ) {
	.wcfp-main-modal,
	.wcfp-detail-modal {
		transition: none;
	}
}
