/* ================================================================
   Aura Press — Swipe Match v2.0  |  swipe-match.css
   ================================================================ */

/* ── Swipe phase layout ───────────────────────────────────────── */
.apf-phase--swipe {
	background: var(--apf-bg);
	display: flex;
	flex-direction: column;
}

.apf-swipe-header {
	display: flex;
	align-items: center;
	padding: calc(14px + var(--apf-safe-t)) 18px 0;
	flex-shrink: 0;
	gap: 12px;
}

.apf-swipe-back {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px; height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(0,0,0,0.06);
	color: var(--apf-ink);
	cursor: pointer;
	flex-shrink: 0;
}

.apf-swipe-header-text {
	flex: 1;
	text-align: center;
}

.apf-swipe-kicker {
	margin: 0;
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--apf-pink);
}

.apf-swipe-meta {
	display: flex;
	justify-content: center;
	gap: 12px;
	font-size: 0.72rem;
	color: var(--apf-muted);
	margin-top: 2px;
}

.apf-swipe-progress-track {
	height: 2px;
	background: var(--apf-line);
	margin: 10px 0 0;
	flex-shrink: 0;
}
.apf-swipe-progress-fill {
	height: 100%;
	background: var(--apf-pink);
	width: 0%;
	transition: width 0.3s ease;
}

/* ── Card deck ────────────────────────────────────────────────── */
.apf-deck-wrap {
	flex: 1;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 14px 20px 0;
}

.apf-deck {
	position: relative;
	width: min(320px, calc(100vw - 40px));
	height: min(460px, calc(100vh - 240px));
}

/* Each card */
.apf-card {
	position: absolute;
	inset: 0;
	border-radius: 20px;
	overflow: hidden;
	background: var(--apf-white);
	box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
	will-change: transform;
	touch-action: none;
	cursor: grab;
	transform-origin: center 90%;
	transition: box-shadow 0.2s ease;
}
.apf-card:active { cursor: grabbing; }

/* Stack depth visual */
.apf-card:nth-child(2) {
	transform: scale(0.96) translateY(10px);
	z-index: 1;
}
.apf-card:nth-child(3) {
	transform: scale(0.92) translateY(20px);
	z-index: 0;
}
.apf-card:nth-child(n+4) { opacity: 0; }

.apf-card.is-top { z-index: 10; }

/* Card image */
.apf-card__img {
	width: 100%;
	height: 65%;
	object-fit: cover;
	display: block;
	background: var(--apf-pink-soft);
	flex-shrink: 0;
	pointer-events: none;
	user-select: none;
}

/* Card info */
.apf-card__info {
	padding: 14px 16px 12px;
}

.apf-card__name {
	margin: 0 0 4px;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--apf-ink);
}

.apf-card__price {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--apf-pink);
}

/* Swipe direction overlays */
.apf-card__stamp {
	position: absolute;
	top: 24px;
	padding: 8px 18px;
	border-radius: 6px;
	border: 3px solid;
	font-size: 0.9rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	opacity: 0;
	transition: opacity 0.1s ease;
	pointer-events: none;
}

.apf-card__stamp--pass {
	right: 20px;
	color: #e53935;
	border-color: #e53935;
	transform: rotate(12deg);
}
.apf-card__stamp--love {
	left: 20px;
	color: #43a047;
	border-color: #43a047;
	transform: rotate(-12deg);
}

/* Swipe gesture exit animations */
.apf-card.is-exiting-left {
	transition: transform 0.38s cubic-bezier(0.36,0.07,0.19,0.97), opacity 0.38s ease;
	transform: translateX(-130%) rotate(-22deg) !important;
	opacity: 0;
}
.apf-card.is-exiting-right {
	transition: transform 0.38s cubic-bezier(0.36,0.07,0.19,0.97), opacity 0.38s ease;
	transform: translateX(130%) rotate(22deg) !important;
	opacity: 0;
}

/* ── Swipe hint ───────────────────────────────────────────────── */
.apf-swipe-hint {
	text-align: center;
	padding: 6px 0 0;
	font-size: 0.7rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	color: var(--apf-muted);
	text-transform: uppercase;
	flex-shrink: 0;
}
.apf-swipe-hint p { margin: 0; }

/* ── Controls ─────────────────────────────────────────────────── */
.apf-swipe-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	padding: 12px 0 calc(20px + var(--apf-safe-b));
	flex-shrink: 0;
}

.apf-ctrl {
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}
.apf-ctrl:active { transform: scale(0.88); }

.apf-ctrl svg { width: 22px; height: 22px; }

.apf-ctrl--undo {
	width: 48px; height: 48px;
	background: var(--apf-white);
	box-shadow: 0 4px 14px rgba(0,0,0,0.1);
	color: var(--apf-muted);
}
.apf-ctrl--undo svg { width: 18px; height: 18px; }

.apf-ctrl--pass {
	width: 62px; height: 62px;
	background: var(--apf-white);
	box-shadow: 0 6px 20px rgba(229,57,53,0.2);
	color: #e53935;
}

.apf-ctrl--love {
	width: 62px; height: 62px;
	background: var(--apf-pink);
	box-shadow: 0 6px 20px rgba(209,107,123,0.4);
	color: #fff;
}

/* ── Empty / done state ───────────────────────────────────────── */
.apf-deck-empty {
	position: absolute;
	inset: 0;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 24px;
	text-align: center;
	animation: apf-fade-up 0.4s ease both;
}

/* Only show as flex when NOT hidden — fixes override of [hidden] attribute */
.apf-deck-empty:not([hidden]) {
	display: flex;
}

/* Belt and suspenders — ensure [hidden] always wins */
.apf-deck-empty[hidden] {
	display: none !important;
}

.apf-deck-empty__title {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--apf-ink);
}

.apf-deck-empty__sub {
	margin: 0;
	font-size: 0.9rem;
	color: var(--apf-muted);
	max-width: 28ch;
}

@keyframes apf-fade-up {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Short screens ────────────────────────────────────────────── */
@media (max-height: 680px) {
	.apf-deck { height: min(380px, calc(100vh - 220px)); }
	.apf-swipe-controls { padding-bottom: calc(12px + var(--apf-safe-b)); }
}

/* ================================================================
   NEW: Tutorial overlay, Cart icon, Discount banner
   ================================================================ */

/* ── Tutorial overlay — redesigned premium ────────────────────── */
.apf-tutorial {
	position: absolute;
	inset: 0;
	z-index: 100;
	background: linear-gradient(160deg, rgba(17,17,17,0.96) 0%, rgba(40,10,20,0.97) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: apf-fade-up 0.4s ease both;
}
.apf-tutorial[hidden] { display: none !important; }

.apf-tutorial__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
	padding: 36px 28px 32px;
	text-align: center;
	width: 100%;
	max-width: 340px;
}

/* Header */
.apf-tutorial__inner::before {
	content: '✦ How It Works';
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--apf-pink);
	margin-bottom: 20px;
}

.apf-tutorial__cards {
	display: flex;
	gap: 20px;
	margin-bottom: 28px;
	align-items: flex-end;
}

/* Card mock — looks like a real product card */
.apf-tutorial__card {
	width: 110px;
	height: 148px;
	border-radius: 16px;
	background: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	padding-bottom: 14px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.5);
	position: relative;
	overflow: hidden;
}

/* Simulated product image area */
.apf-tutorial__card::before {
	content: '';
	position: absolute;
	inset: 0 0 44px 0;
	background: linear-gradient(135deg, #f7e6ea 0%, #e8d0d5 100%);
}

.apf-tutorial__card--pass {
	transform: rotate(-14deg) translateX(-4px);
	animation: apf-tut-left 2s ease-in-out infinite;
}
.apf-tutorial__card--love {
	transform: rotate(14deg) translateX(4px);
	animation: apf-tut-right 2s ease-in-out infinite;
	animation-delay: 0.2s;
}

.apf-tutorial__stamp {
	position: relative;
	z-index: 2;
	font-size: 11px;
	font-weight: 900;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	border: 2.5px solid;
	border-radius: 5px;
	padding: 4px 10px;
}
.apf-tutorial__card--pass .apf-tutorial__stamp {
	color: #e53935;
	border-color: #e53935;
	background: rgba(229,57,53,0.08);
	transform: rotate(14deg);
}
.apf-tutorial__card--love .apf-tutorial__stamp {
	color: #43a047;
	border-color: #43a047;
	background: rgba(67,160,71,0.08);
	transform: rotate(-14deg);
}

/* Instruction rows */
.apf-tutorial__row {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 16px;
	border-radius: 12px;
	margin-bottom: 10px;
	text-align: left;
}
.apf-tutorial__row--pass {
	background: rgba(229,57,53,0.1);
	border: 1px solid rgba(229,57,53,0.2);
}
.apf-tutorial__row--love {
	background: rgba(67,160,71,0.1);
	border: 1px solid rgba(67,160,71,0.2);
}

.apf-tutorial__row-icon {
	width: 36px; height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 16px;
}
.apf-tutorial__card--pass .apf-tutorial__stamp {
    color: #e53935;
    border-color: #e53935;
    background: rgba(229, 57, 53, 0.08);
    transform: rotate(-2deg) translateX(1px)!important;
}
.apf-tutorial__card--love .apf-tutorial__stamp {
	color: #43a047;
	border-color: #43a047;
	background: rgba(67,160,71,0.08);
	transform: rotate(4deg) translateX(3px)!important;
}


.apf-tutorial__row--pass .apf-tutorial__row-icon { background: rgba(229,57,53,0.15); color: white;}
.apf-tutorial__row--love .apf-tutorial__row-icon { background: rgba(67,160,71,0.15); color: white; }
.apf-tutorial__row-text { flex: 1; }
.apf-tutorial__row-title {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #fff;
	margin-bottom: 1px;
}
.apf-tutorial__row-sub {
	display: block;
	font-size: 11px;
	color: rgba(255,255,255,0.5);
}

/* Discount note */
.apf-tutorial__hint {
	width: 100%;
	margin: 4px 0 22px;
	padding: 12px 16px;
	background: rgba(209,107,123,0.12);
	border: 1px solid rgba(209,107,123,0.25);
	border-radius: 12px;
	font-size: 12px;
	font-weight: 700;
	color: var(--apf-pink);
	letter-spacing: 0.02em;
	line-height: 1.5;
}

.apf-tutorial__skip {
	width: 100%;
	padding: 15px 32px;
	background: var(--apf-pink);
	color: #fff;
	border: none;
	border-radius: 10px;
	font-family: var(--apf-font);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(209,107,123,0.45);
	transition: transform 0.15s ease;
}
.apf-tutorial__skip:active { transform: scale(0.97); }

@keyframes apf-tut-left {
	0%, 100% { transform: rotate(-14deg) translateX(-4px); }
	50%       { transform: rotate(-18deg) translateX(-12px); }
}
@keyframes apf-tut-right {
	0%, 100% { transform: rotate(14deg) translateX(4px); }
	50%       { transform: rotate(18deg) translateX(12px); }
}

/* ── Cart icon in header ──────────────────────────────────────── */
.apf-swipe-home,
.apf-swipe-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px; height: 36px;
	border-radius: 50%;
	background: rgba(0,0,0,0.06);
	color: var(--apf-ink);
	text-decoration: none;
	position: relative;
	flex-shrink: 0;
}

.apf-cart-badge {
	position: absolute;
	top: -4px; right: -4px;
	min-width: 18px; height: 18px;
	background: var(--apf-pink);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
	border: 1.5px solid #fff;
}
.apf-cart-badge[hidden] { display: none !important; }

/* ── Discount countdown banner ────────────────────────────────── */
.apf-discount-banner {
	background: linear-gradient(90deg, #fff5f7 0%, #fce8ec 100%);
	border-bottom: 1px solid rgba(209,107,123,0.15);
	padding: 8px 18px;
	flex-shrink: 0;
}

.apf-discount-banner__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.apf-discount-banner__text {
	font-size: 12px;
	font-weight: 700;
	color: var(--apf-pink);
	letter-spacing: 0.02em;
	flex: 1;
}

.apf-discount-dots {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.apf-discount-dot {
	width: 14px; height: 14px;
	border-radius: 50%;
	border: 2px solid var(--apf-pink);
	background: transparent;
	transition: background 0.25s ease, transform 0.25s ease;
}
.apf-discount-dot.is-filled {
	background: var(--apf-pink);
	transform: scale(1.15);
}

/* ── Discount unlocked celebration ───────────────────────────── */
.apf-discount-unlocked {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 50;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 16px 48px rgba(209,107,123,0.35);
	padding: 24px 32px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
	animation: apf-celebration 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
.apf-discount-unlocked[hidden] { display: none !important; }

.apf-discount-unlocked__emoji {
	font-size: 36px;
}
.apf-discount-unlocked__text {
	font-size: 22px;
	font-weight: 800;
	color: var(--apf-pink);
	letter-spacing: -0.02em;
}
.apf-discount-unlocked__sub {
	font-size: 13px;
	color: var(--apf-muted);
}

@keyframes apf-celebration {
	from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
	to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}
