/**
 * Perfect WP checkout modal styles.
 *
 * @package Perfect_WP
 */

[hidden] {
	display: none !important;
}

.pwp-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.pwp-modal-overlay {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 50% 20%, rgba(17, 24, 39, 0.55), rgba(17, 24, 39, 0.75));
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	animation: pwp-fade-in 0.25s ease;
}

.pwp-modal-content {
	position: relative;
	background: #ffffff;
	border: 1px solid rgba(17, 24, 39, 0.06);
	border-radius: 20px;
	max-width: 480px;
	width: 100%;
	padding: 30px 28px 26px;
	box-shadow: 0 30px 60px rgba(17, 24, 39, 0.35);
	animation: pwp-pop-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
	text-align: center;
	box-sizing: border-box;
}

.pwp-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: #f3f4f6;
	border: none;
	font-size: 20px;
	line-height: 1;
	width: 32px;
	height: 32px;
	color: #4b5563;
	cursor: pointer;
	padding: 0;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.pwp-modal-close:hover {
	color: #111827;
	background: #e5e7eb;
	transform: rotate(90deg);
}

.pwp-modal-close:focus-visible,
.pwp-btn:focus-visible {
	outline: 3px solid rgba(34, 113, 177, 0.4);
	outline-offset: 2px;
}

.pwp-modal-header {
	margin-bottom: 14px;
}

.pwp-modal-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 74px;
	height: 74px;
	margin-bottom: 14px;
	font-size: 38px;
	line-height: 1;
	border-radius: 50%;
	color: #b91c1c;
	background: linear-gradient(145deg, #fee2e2, #fecaca);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.pwp-modal-title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: #111827;
}

.pwp-modal-subtitle {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #6b7280;
}

.pwp-modal-message {
	margin: 0 0 18px;
	color: #374151;
	font-size: 14px;
	line-height: 1.7;
	text-align: left;
}

.pwp-prev-order {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 14px 16px;
	margin-bottom: 16px;
	text-align: left;
}

.pwp-prev-order-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.pwp-prev-order-label {
	color: #6b7280;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.pwp-status-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	color: #0369a1;
	background: #e0f2fe;
	border: 1px solid #bae6fd;
	white-space: nowrap;
}

.pwp-status-badge::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex: 0 0 auto;
}

.pwp-prev-order-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
	line-height: 1.8;
	color: #374151;
}

.pwp-prev-order-row strong {
	font-weight: 600;
	text-align: right;
	word-break: break-word;
}

.pwp-countdown {
	margin-bottom: 16px;
	padding: 14px 16px;
	border-radius: 14px;
	background: linear-gradient(145deg, #eff6ff, #dbeafe);
	border: 1px solid #bfdbfe;
}

.pwp-countdown-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #1d4ed8;
	margin-bottom: 4px;
}

.pwp-countdown-value {
	display: block;
	font-size: 30px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	color: #1e40af;
	line-height: 1.2;
}

.pwp-help {
	margin: 0 0 18px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.6;
	color: #4b5563;
}

.pwp-modal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.pwp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.pwp-btn:hover {
	transform: translateY(-1px);
	opacity: 0.95;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.pwp-btn-phone {
	background: #2271b1;
	color: #ffffff;
}

.pwp-btn-phone:hover {
	background: #135e96;
}

.pwp-btn-whatsapp {
	background: #25d366;
	color: #ffffff;
}

.pwp-btn-whatsapp:hover {
	background: #1eb858;
}

.pwp-btn-ghost {
	background: #ffffff;
	color: #374151;
	border-color: #d1d5db;
}

.pwp-btn-ghost:hover {
	background: #f9fafb;
}

@keyframes pwp-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes pwp-pop-in {
	from {
		opacity: 0;
		transform: translateY(18px) scale(0.92);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pwp-modal-content,
	.pwp-modal-overlay,
	.pwp-modal-close {
		animation: none;
		transition: none;
	}
}

@media only screen and (max-width: 480px) {
	.pwp-modal {
		padding: 14px;
	}

	.pwp-modal-content {
		padding: 24px 18px 20px;
		border-radius: 16px;
		max-height: 92vh;
		overflow-y: auto;
	}

	.pwp-btn {
		flex: 1 1 100%;
	}

	.pwp-countdown-value {
		font-size: 26px;
	}
}
