:root { --wpc-max-width: 980px; }

html.wpc-lock,
html.wpc-lock body { overflow: hidden !important; }

.wpc-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity .2s ease;
}
.wpc-modal[hidden] { display: none; }
.wpc-modal.is-open { opacity: 1; }

.wpc-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .6);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.wpc-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: var(--wpc-max-width);
	height: 92vh;
	height: min(92dvh, 920px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
	overflow: hidden;
	transform: translateY(16px) scale(.98);
	transition: transform .22s ease;
}
.wpc-modal.is-open .wpc-dialog { transform: none; }

.wpc-header {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid #e5e7eb;
	background: #fff;
}
.wpc-title {
	font: 600 16px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: #111827;
}
.wpc-close {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f3f4f6;
	color: #111827;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.wpc-close:hover,
.wpc-close:focus-visible { background: #e5e7eb; outline: 2px solid #2563eb; outline-offset: 2px; }

.wpc-body { position: relative; flex: 1 1 auto; min-height: 0; }
.wpc-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

.wpc-loader {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 22px;
	padding: 24px;
	overflow-y: auto;
	text-align: center;
	background: #fff;
}
.wpc-loader-msg { max-width: 640px; }
.wpc-loader-text {
	margin: 0 0 14px;
	font-family: "Noto Sans Bengali", "Hind Siliguri", "Kalpurush", "Siyam Rupali", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: clamp(19px, 2.6vw, 26px);
	font-weight: 600;
	line-height: 1.75;
	color: #111827;
}
.wpc-loader-phone {
	display: inline-block;
	padding: 10px 26px;
	border-radius: 999px;
	background: #16a34a;
	color: #fff !important;
	font-family: "Noto Sans Bengali", "Hind Siliguri", "Kalpurush", "Siyam Rupali", system-ui, sans-serif;
	font-size: clamp(22px, 3vw, 30px);
	font-weight: 700;
	letter-spacing: .5px;
	text-decoration: none !important;
}
.wpc-loader-phone:hover,
.wpc-loader-phone:focus-visible { background: #15803d; outline: 2px solid #166534; outline-offset: 2px; }
.wpc-loader.is-active { display: flex; }
.wpc-spinner {
	width: 38px;
	height: 38px;
	border: 4px solid #e5e7eb;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: wpc-spin .8s linear infinite;
}
@keyframes wpc-spin { to { transform: rotate(360deg); } }

/* Buttons while adding to cart */
.wpc-loading { opacity: .65; pointer-events: none; cursor: progress; }
.wpc-buy-now { margin-left: 8px; }

/* Tablet / phone: bottom sheet that fills most of the screen */
@media (max-width: 640px) {
	.wpc-modal { padding: 0; align-items: flex-end; }
	.wpc-dialog {
		max-width: none;
		height: 94vh;
		height: 94dvh;
		border-radius: 16px 16px 0 0;
		transform: translateY(100%);
		padding-bottom: env(safe-area-inset-bottom, 0);
	}
	.wpc-buy-now { margin: 8px 0 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.wpc-modal, .wpc-dialog { transition: none; }
	.wpc-spinner { animation-duration: 1.6s; }
}
