/* Whop embedded checkout for WooCommerce */

.wc-whop-overlay,
.wc-whop-paypage {
	--wc-whop-bg: #ffffff;
	--wc-whop-fg: #111827;
	--wc-whop-muted: #6b7280;
	--wc-whop-border: #e5e7eb;
	--wc-whop-notice-bg: #fef2f2;
	--wc-whop-notice-fg: #991b1b;
	--wc-whop-page-bg: #f6f7f9;
}

.wc-whop-theme-dark {
	--wc-whop-bg: #111113;
	--wc-whop-fg: #f4f4f5;
	--wc-whop-muted: #a1a1aa;
	--wc-whop-border: #27272a;
	--wc-whop-notice-bg: #3b1212;
	--wc-whop-notice-fg: #fecaca;
	--wc-whop-page-bg: #09090b;
}

@media (prefers-color-scheme: dark) {
	.wc-whop-theme-system {
		--wc-whop-bg: #111113;
		--wc-whop-fg: #f4f4f5;
		--wc-whop-muted: #a1a1aa;
		--wc-whop-border: #27272a;
		--wc-whop-notice-bg: #3b1212;
		--wc-whop-notice-fg: #fecaca;
		--wc-whop-page-bg: #09090b;
	}
}

html.wc-whop-open,
html.wc-whop-open body {
	overflow: hidden;
}

.wc-whop-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	background: rgba(17, 24, 39, 0.55);
	animation: wc-whop-fade 0.15s ease-out;
}

.wc-whop-modal {
	box-sizing: border-box;
	width: 100%;
	max-width: 520px;
	max-height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 20px 20px 16px;
	border-radius: 14px;
	background: var(--wc-whop-bg);
	color: var(--wc-whop-fg);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
	font-family: inherit;
	animation: wc-whop-rise 0.2s ease-out;
}

.wc-whop-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.wc-whop-modal__title {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
}

.wc-whop-modal__meta,
.wc-whop-modal__email {
	margin-top: 2px;
	font-size: 14px;
	color: var(--wc-whop-muted);
}

.wc-whop-modal__email {
	margin: 0 0 10px;
}

.wc-whop-modal__close {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--wc-whop-border);
	border-radius: 50%;
	background: transparent;
	color: var(--wc-whop-fg);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.wc-whop-modal__close:disabled {
	opacity: 0.4;
	cursor: default;
}

.wc-whop-modal__body {
	min-height: 120px;
}

.wc-whop-modal__body--done .wc-whop-embed {
	opacity: 0.35;
	pointer-events: none;
}

.wc-whop-embed,
.wc-whop-embed iframe {
	width: 100% !important;
	max-width: 100% !important;
	border: 0;
}

.wc-whop-loading,
.wc-whop-confirming {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 28px 0;
	font-size: 14px;
	color: var(--wc-whop-muted);
}

.wc-whop-loading[hidden],
.wc-whop-confirming[hidden],
.wc-whop-notice[hidden],
.wc-whop-fallback[hidden] {
	display: none;
}

.wc-whop-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid var(--wc-whop-border);
	border-top-color: var(--wc-whop-fg);
	border-radius: 50%;
	animation: wc-whop-spin 0.8s linear infinite;
}

.wc-whop-notice {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-radius: 8px;
	background: var(--wc-whop-notice-bg);
	color: var(--wc-whop-notice-fg);
	font-size: 14px;
}

.wc-whop-fallback {
	padding: 12px 0 4px;
	font-size: 14px;
	text-align: center;
	color: var(--wc-whop-muted);
}

.wc-whop-fallback a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
}

.wc-whop-modal__secured {
	margin-top: 12px;
	font-size: 12px;
	text-align: center;
	color: var(--wc-whop-muted);
}

.wc-whop-testmode {
	margin: 0 0 8px;
	padding: 6px 10px;
	border-radius: 6px;
	background: #fff7ed;
	color: #9a3412;
	font-size: 13px;
	font-weight: 600;
}

/* Mobile: bottom sheet */
@media (max-width: 600px) {
	.wc-whop-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.wc-whop-modal {
		max-width: none;
		max-height: 94vh;
		border-radius: 16px 16px 0 0;
		padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}
}

/* Store-hosted pay page */
body.wc-whop-paypage {
	margin: 0;
	min-height: 100vh;
	background: var(--wc-whop-page-bg);
	color: var(--wc-whop-fg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wc-whop-paypage__wrap {
	box-sizing: border-box;
	max-width: 560px;
	margin: 0 auto;
	padding: 32px 20px 48px;
}

.wc-whop-paypage__header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 24px;
}

.wc-whop-paypage__header img {
	border-radius: 6px;
}

.wc-whop-paypage__store {
	font-weight: 600;
}

.wc-whop-paypage__title {
	margin: 0;
	font-size: 22px;
}

.wc-whop-paypage__meta {
	margin: 4px 0 20px;
	color: var(--wc-whop-muted);
}

.wc-whop-paypage__embed {
	padding: 16px;
	border-radius: 12px;
	background: var(--wc-whop-bg);
	border: 1px solid var(--wc-whop-border);
}

.wc-whop-paypage__back {
	margin-top: 20px;
	font-size: 14px;
}

.wc-whop-paypage__back a {
	color: var(--wc-whop-muted);
}

@keyframes wc-whop-spin {
	to { transform: rotate(360deg); }
}

@keyframes wc-whop-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes wc-whop-rise {
	from { transform: translateY(12px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.wc-whop-overlay,
	.wc-whop-modal {
		animation: none;
	}
}

/* Inline card form inside the payment box */
.wc-whop-inline {
	position: relative;
	margin-top: 12px;
	min-height: 64px;
}

.wc-whop-inline .wc-whop-loading {
	justify-content: flex-start;
	padding: 16px 0;
}

.wc-whop-inline__error {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fef2f2;
	color: #991b1b;
	font-size: 14px;
}

.wc-whop-inline--busy .wc-whop-embed {
	opacity: 0.35;
	pointer-events: none;
}

.wc-whop-inline__overlay {
	position: absolute;
	inset: 0;
	justify-content: center !important;
	background: rgba(255, 255, 255, 0.6);
	color: #111827;
	font-weight: 600;
}

#place_order.wc-whop-busy {
	opacity: 0.6;
	cursor: progress;
}
