/**
 * WhatsApp Checkout Pro - Premium Checkout Popup styles.
 *
 * Presentation only. No selector here affects validation rules, AJAX
 * calls, or order/invoice creation - those all live in email-capture.js
 * and the PHP AJAX handlers, none of which this file touches.
 */

:root {
	--wacp-ec-green: #25d366;
	--wacp-ec-green-dark: #1faa59;
	--wacp-ec-green-tint: #f0fbf5;
	--wacp-ec-green-border: #cdeed9;
	--wacp-ec-blue: #3b5fe2;
	--wacp-ec-blue-dark: #2b48c4;
	--wacp-ec-blue-tint: #f0f3ff;
	--wacp-ec-blue-border: #d2dbfb;
	--wacp-ec-ink: #1a2129;
	--wacp-ec-muted: #6b7280;
}

.wacp-ec-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 19, 0.6);
	backdrop-filter: blur(2px);
}

body.wacp-ec-open {
	overflow: hidden;
}

.wacp-ec-modal {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: 92vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: 20px;
	padding: 32px 28px 26px;
	box-shadow: 0 24px 60px rgba(16, 24, 39, 0.25), 0 4px 12px rgba(16, 24, 39, 0.08);
	animation: wacp-ec-pop-in 0.22s ease;
}

@keyframes wacp-ec-pop-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.wacp-ec-close {
	position: absolute;
	top: 14px;
	right: 16px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: #f3f4f6;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.wacp-ec-close:hover {
	background: #e9ebee;
	color: #1a2129;
	transform: rotate(90deg);
}

/* ---------- Header ---------- */
.wacp-ec-header {
	text-align: center;
	margin: 0 0 22px;
}

.wacp-ec-title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 800;
	color: var(--wacp-ec-ink);
	letter-spacing: -0.01em;
}

.wacp-ec-subtitle {
	margin: 0;
	font-size: 14px;
	color: var(--wacp-ec-muted);
}

/* ---------- Customer Information ---------- */
.wacp-ec-customer-info {
	margin: 0 0 22px;
	padding: 18px 18px 6px;
	background: #fafbfb;
	border: 1px solid #eef0f2;
	border-radius: 14px;
}

.wacp-ec-section-label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12.5px;
	font-weight: 700;
	color: #50575e;
	margin-bottom: 14px;
}

.wacp-ec-section-label svg {
	color: var(--wacp-ec-green-dark);
	flex-shrink: 0;
}

.wacp-ec-field {
	margin: 0 0 14px;
}

.wacp-ec-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--wacp-ec-ink);
	margin-bottom: 6px;
}

.wacp-ec-field input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1.5px solid #e2e6ea;
	border-radius: 10px;
	font-size: 14px;
	background: #ffffff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wacp-ec-field input:focus {
	outline: none;
	border-color: var(--wacp-ec-green);
	box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.13);
}

.wacp-ec-field input.wacp-ec-input-error {
	border-color: #e25555;
	box-shadow: 0 0 0 3px rgba(226, 85, 85, 0.12);
}

.wacp-ec-error {
	margin: 6px 0 0;
	font-size: 12px;
	font-weight: 600;
	color: #d23c3c;
}

.wacp-ec-error[hidden] {
	display: none !important;
}

/* ---------- Option cards ---------- */
.wacp-ec-options {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.wacp-ec-options[hidden] {
	display: none !important;
}

.wacp-ec-option-card {
	border-radius: 16px;
	padding: 18px;
	border: 1.5px solid transparent;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.wacp-ec-option-card:hover {
	transform: translateY(-2px);
}

.wacp-ec-option-card[hidden] {
	display: none !important;
}

.wacp-ec-option-whatsapp {
	background: var(--wacp-ec-green-tint);
	border-color: var(--wacp-ec-green-border);
}

.wacp-ec-option-whatsapp:hover {
	box-shadow: 0 10px 24px rgba(37, 211, 102, 0.16);
}

.wacp-ec-option-invoice {
	background: var(--wacp-ec-blue-tint);
	border-color: var(--wacp-ec-blue-border);
}

.wacp-ec-option-invoice:hover {
	box-shadow: 0 10px 24px rgba(59, 95, 226, 0.14);
}

.wacp-ec-option-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.wacp-ec-option-icon {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}

.wacp-ec-option-whatsapp .wacp-ec-option-icon {
	background: #d9f7e4;
	color: var(--wacp-ec-green-dark);
}

.wacp-ec-option-invoice .wacp-ec-option-icon {
	background: #dde4fb;
	color: var(--wacp-ec-blue);
}

.wacp-ec-option-title-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.wacp-ec-option-title {
	font-size: 16px;
	font-weight: 800;
	letter-spacing: -0.005em;
}

.wacp-ec-option-whatsapp .wacp-ec-option-title {
	color: var(--wacp-ec-green-dark);
}

.wacp-ec-option-invoice .wacp-ec-option-title {
	color: var(--wacp-ec-blue-dark);
}

.wacp-ec-option-badge {
	display: inline-block;
	padding: 3px 9px;
	background: var(--wacp-ec-green-dark);
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.04em;
	border-radius: 999px;
	text-transform: uppercase;
}

.wacp-ec-option-desc {
	margin: 0 0 16px;
	font-size: 13.5px;
	line-height: 1.5;
	color: #45524c;
}

.wacp-ec-option-invoice .wacp-ec-option-desc {
	color: #3c4566;
}

/* ---------- Option buttons ---------- */
.wacp-ec-option-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 14px 18px;
	border: none;
	border-radius: 11px;
	font-size: 14.5px;
	font-weight: 700;
	color: #ffffff;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.wacp-ec-option-button:disabled {
	cursor: not-allowed;
	filter: saturate(0.85);
}

.wacp-ec-continue:not(.wacp-ec-continue-invoice) {
	background: linear-gradient(135deg, var(--wacp-ec-green-dark) 0%, var(--wacp-ec-green) 100%);
	box-shadow: 0 6px 16px rgba(31, 170, 89, 0.3);
}

.wacp-ec-continue:not(.wacp-ec-continue-invoice):hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(31, 170, 89, 0.38);
}

.wacp-ec-continue-invoice {
	background: linear-gradient(135deg, var(--wacp-ec-blue-dark) 0%, var(--wacp-ec-blue) 100%);
	box-shadow: 0 6px 16px rgba(59, 95, 226, 0.28);
}

.wacp-ec-continue-invoice:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(59, 95, 226, 0.36);
}

.wacp-ec-chevron {
	flex-shrink: 0;
	transition: transform 0.15s ease;
}

.wacp-ec-option-button:hover .wacp-ec-chevron {
	transform: translateX(2px);
}

.wacp-ec-trust-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 0 0 16px;
}

.wacp-ec-trust-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 600;
}

.wacp-ec-option-whatsapp .wacp-ec-trust-item {
	color: #2c8a55;
}

.wacp-ec-option-whatsapp .wacp-ec-trust-item svg {
	color: var(--wacp-ec-green-dark);
}

.wacp-ec-option-invoice .wacp-ec-trust-item {
	color: #4458c2;
}

.wacp-ec-option-invoice .wacp-ec-trust-item svg {
	color: var(--wacp-ec-blue);
}

.wacp-ec-trust-item svg {
	flex-shrink: 0;
}

/* ---------- Divider ---------- */
.wacp-ec-divider {
	position: relative;
	text-align: center;
	height: 1px;
	background: #ebedf0;
	margin: 2px 0;
}

.wacp-ec-divider[hidden] {
	display: none !important;
}

.wacp-ec-divider span {
	position: relative;
	top: -11px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 22px;
	background: #ffffff;
	border: 1px solid #ebedf0;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 800;
	color: #9aa1ab;
}

/* ---------- Invoice status message ---------- */
.wacp-ec-invoice-status {
	margin: 16px 0 0;
	padding: 14px 16px;
	border-radius: 12px;
	font-size: 13.5px;
	font-weight: 600;
	text-align: center;
}

.wacp-ec-invoice-status[hidden] {
	display: none !important;
}

.wacp-ec-invoice-status.is-success {
	background: #e7f7ed;
	color: #1a7a3c;
}

.wacp-ec-invoice-status.is-error {
	background: #fdecec;
	color: #9b1c1c;
}

/* ---------- Footer trust line ---------- */
.wacp-ec-footer-trust {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 16px;
	margin: 22px 0 0;
	padding-top: 16px;
	border-top: 1px solid #f0f1f3;
}

.wacp-ec-footer-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11.5px;
	font-weight: 600;
	color: #9aa1ab;
}

.wacp-ec-footer-item svg {
	flex-shrink: 0;
	color: #b7bcc4;
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	.wacp-ec-modal {
		padding: 26px 18px 20px;
		border-radius: 16px;
	}

	.wacp-ec-title {
		font-size: 19px;
	}

	.wacp-ec-option-card {
		padding: 15px;
	}

	.wacp-ec-option-icon {
		width: 38px;
		height: 38px;
	}

	.wacp-ec-option-title {
		font-size: 14.5px;
	}

	.wacp-ec-option-button {
		padding: 13px 14px;
		font-size: 14px;
	}

	.wacp-ec-trust-row {
		gap: 5px 10px;
	}

	.wacp-ec-trust-item {
		font-size: 11px;
	}

	.wacp-ec-footer-trust {
		gap: 6px 12px;
	}

	.wacp-ec-footer-item {
		font-size: 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wacp-ec-modal,
	.wacp-ec-option-card,
	.wacp-ec-option-button,
	.wacp-ec-close,
	.wacp-ec-chevron {
		animation: none !important;
		transition: none !important;
	}
}
