/**
 * bKash Checkout Styles
 * Modern responsive CSS for block-based themes
 */

/* Lightbox Styles */
.bkash-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--wp--preset--spacing--20, 1rem);
	animation: bkashFadeIn 0.3s ease;
}

.bkash-lightbox-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(4px);
}

.bkash-lightbox-content {
	position: relative;
	z-index: 1;
	background: var(--wp--preset--color--base, #ffffff);
	border-radius: var(--wp--custom--border-radius, 12px);
	padding: var(--wp--preset--spacing--40, 2rem);
	max-width: 90vw;
	max-height: 90vh;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: bkashScaleIn 0.3s ease;
}

.bkash-lightbox-close {
	position: absolute;
	top: var(--wp--preset--spacing--20, 1rem);
	right: var(--wp--preset--spacing--20, 1rem);
	background: transparent;
	border: none;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	color: var(--wp--preset--color--contrast, #000);
	padding: 0.5rem;
	width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.bkash-lightbox-close:hover,
.bkash-lightbox-close:focus {
	background-color: var(--wp--preset--color--contrast-1, #f5f5f5);
	transform: rotate(90deg);
}

.bkash-lightbox-close:focus {
	outline: 2px solid var(--wp--preset--color--primary, #e2136e);
	outline-offset: 2px;
}

.bkash-lightbox-title {
	margin: 0 0 var(--wp--preset--spacing--30, 1rem);
	font-size: var(--wp--preset--font-size--large, 1.5rem);
	color: var(--wp--preset--color--contrast, #000);
	text-align: center;
}

.bkash-lightbox-image {
	display: block;
	max-width: 100%;
	height: auto;
	max-height: calc(90vh - 8rem);
	border-radius: var(--wp--custom--border-radius, 8px);
	margin: 0 auto;
}

/* Validation Errors */
.bkash-validation-error {
	margin-bottom: var(--wp--preset--spacing--30, 1rem);
	padding: var(--wp--preset--spacing--30, 1rem);
	background: var(--wp--preset--color--vivid-red, #cf2e2e);
	color: var(--wp--preset--color--base, #ffffff);
	border-left: 4px solid darkred;
	border-radius: var(--wp--custom--border-radius, 4px);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
}

.bkash-validation-error ul {
	margin: 0;
	padding-left: 1.5rem;
	list-style: disc;
}

.bkash-validation-error li {
	margin: 0.25rem 0;
}

/* Payment Method Fields */
.payment_method_bpg .payment_box {
	background: var(--wp--preset--color--base, #ffffff);
	border: 1px solid var(--wp--preset--color--contrast-3, #ddd);
	border-radius: var(--wp--custom--border-radius, 8px);
	padding: var(--wp--preset--spacing--30, 1rem);
	margin-top: var(--wp--preset--spacing--20, 0.75rem);
}

.payment_method_bpg .payment_box::before {
	display: none;
}

.payment_method_bpg input[type="text"],
.payment_method_bpg input[type="tel"] {
	width: 100%;
	padding: var(--wp--preset--spacing--20, 0.75rem);
	border: 1px solid var(--wp--preset--color--contrast-3, #ddd);
	border-radius: var(--wp--custom--border-radius, 4px);
	font-size: var(--wp--preset--font-size--medium, 1rem);
	line-height: 1.5;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	font-family: var(--wp--preset--font-family--system-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.payment_method_bpg input[type="text"]:focus,
.payment_method_bpg input[type="tel"]:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary, #e2136e);
	box-shadow: 0 0 0 1px var(--wp--preset--color--primary, #e2136e);
}

.payment_method_bpg input::placeholder {
	color: var(--wp--preset--color--contrast-2, #999);
	opacity: 0.7;
}

.payment_method_bpg label {
	display: block;
	margin-bottom: var(--wp--preset--spacing--10, 0.5rem);
	font-weight: 500;
	color: var(--wp--preset--color--contrast, #000);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
}

.payment_method_bpg p {
	margin-bottom: var(--wp--preset--spacing--20, 0.75rem);
}

.payment_method_bpg p:last-child {
	margin-bottom: 0;
}

/* QR Code in Checkout */
.payment_method_bpg .bkash-qr-link {
	display: inline-block;
	position: relative;
	border: 2px solid var(--wp--preset--color--primary, #e2136e);
	border-radius: var(--wp--custom--border-radius, 8px);
	padding: var(--wp--preset--spacing--10, 0.5rem);
	background: var(--wp--preset--color--base, #ffffff);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
	max-width: 240px;
	display: block;
	margin: var(--wp--preset--spacing--20, 1rem) auto;
}

.payment_method_bpg .bkash-qr-link:hover {
	transform: scale(1.05);
	box-shadow: 0 8px 16px rgba(226, 19, 110, 0.2);
}

.payment_method_bpg .bkash-qr-link:focus {
	outline: 2px solid var(--wp--preset--color--primary, #e2136e);
	outline-offset: 2px;
}

.payment_method_bpg .bkash-qr-code-image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--wp--custom--border-radius, 6px);
}

/* Animations */
@keyframes bkashFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes bkashScaleIn {
	from {
		transform: scale(0.9);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

/* Responsive Design */
@media (max-width: 782px) {
	.bkash-lightbox-content {
		padding: var(--wp--preset--spacing--30, 1.5rem);
	}
	
	.payment_method_bpg .bkash-qr-link {
		max-width: 200px;
	}
	
	.payment_method_bpg input[type="text"],
	.payment_method_bpg input[type="tel"] {
		font-size: 16px; /* Prevent zoom on iOS */
	}
}

@media (max-width: 480px) {
	.bkash-lightbox-content {
		padding: var(--wp--preset--spacing--20, 1rem);
	}
	
	.bkash-lightbox-title {
		font-size: var(--wp--preset--font-size--medium, 1.25rem);
	}
	
	.payment_method_bpg .bkash-qr-link {
		max-width: 180px;
	}
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
	.bkash-lightbox-content {
		background: var(--wp--preset--color--contrast, #1a1a1a);
	}
	
	.bkash-lightbox-close {
		color: var(--wp--preset--color--base, #ffffff);
	}
	
	.bkash-lightbox-close:hover,
	.bkash-lightbox-close:focus {
		background-color: var(--wp--preset--color--contrast-2, #2a2a2a);
	}
	
	.payment_method_bpg .payment_box {
		background: var(--wp--preset--color--contrast, #1a1a1a);
		border-color: var(--wp--preset--color--contrast-2, #444);
	}
	
	.payment_method_bpg input[type="text"],
	.payment_method_bpg input[type="tel"] {
		background: var(--wp--preset--color--contrast, #1a1a1a);
		border-color: var(--wp--preset--color--contrast-2, #444);
		color: var(--wp--preset--color--base, #fff);
	}
}

/* RTL Support */
[dir="rtl"] .bkash-validation-error {
	border-left: none;
	border-right: 4px solid darkred;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
	.bkash-lightbox-close:focus {
		outline-width: 3px;
	}
	
	.payment_method_bpg input:focus {
		box-shadow: 0 0 0 2px var(--wp--preset--color--primary, #e2136e);
	}
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	.bkash-lightbox,
	.bkash-lightbox-content,
	.bkash-lightbox-close,
	.payment_method_bpg .bkash-qr-link,
	.payment_method_bpg input {
		transition: none;
		animation: none;
	}
}

/* Print Styles */
@media print {
	.bkash-lightbox,
	.bkash-validation-error {
		display: none;
	}
	
	.payment_method_bpg .bkash-qr-link {
		border: 2px solid #000;
		page-break-inside: avoid;
	}
}

