/**
 * Checkout styles for manual mobile banking payments.
 *
 * Scoped to .wc-mfs so nothing leaks into the theme. Type, text colour and font
 * family are inherited. Each provider sets --mfs-accent inline, so bKash, Nagad
 * and Rocket share one stylesheet while keeping their own colour.
 */

.wc-mfs {
	--mfs-accent: #e2136e;
	--mfs-tint: color-mix(in srgb, var(--mfs-accent) 4%, transparent);
	--mfs-glow: color-mix(in srgb, var(--mfs-accent) 16%, transparent);
	--mfs-line: rgba(0, 0, 0, 0.14);
	--mfs-line-soft: rgba(0, 0, 0, 0.08);
	--mfs-muted: rgba(0, 0, 0, 0.6);
	--mfs-valid: #1e7a3c;
	--mfs-error: #b32d2e;
	--mfs-radius: 10px;

	font-size: inherit;
	line-height: 1.5;
}

/* color-mix is widely supported, but fall back to a flat tint where it is not. */
@supports not (background: color-mix(in srgb, red 4%, transparent)) {
	.wc-mfs {
		--mfs-tint: transparent;
		--mfs-glow: rgba(0, 0, 0, 0.12);
	}
}

/* ---------------------------------------------------------------- Label */

.wc-mfs-label {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
}

.wc-mfs-label__icon {
	display: block;
	width: auto;
	height: 1.5em;
	max-height: 24px;
}

.wc-mfs-icon {
	display: block;
	flex: 0 0 auto;
}

/* ----------------------------------------------------------------- Intro */

.wc-mfs__intro {
	margin: 0 0 1em;
	max-width: 60ch;
	color: var(--mfs-muted);
}

/* ------------------------------------------------------------ Payee strip */

.wc-mfs-strip {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em 0.85em;
	margin: 0 0 0.85em;
	padding: 0.6em 0.85em;
	border: 1px solid var(--mfs-line-soft);
	border-left: 3px solid var(--mfs-accent);
	border-radius: 8px;
	background: var(--mfs-tint);
	font-size: 0.95em;
}

.wc-mfs-strip__text {
	min-width: 0;
}

.wc-mfs-strip__number,
.wc-mfs-strip__amount {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

/* WooCommerce wraps prices in its own markup; keep it inline. */
.wc-mfs-strip__amount .woocommerce-Price-amount,
.wc-mfs-strip__amount bdi {
	font-weight: inherit;
}

/* --------------------------------------------------------- Collapsed guide */

.wc-mfs-guide {
	margin: 0 0 1em;
	font-size: 0.88em;
}

.wc-mfs-guide__summary {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	list-style: none;
	cursor: pointer;
	color: var(--mfs-accent);
}

/* Hide the native disclosure triangle so the caret below is the only marker. */
.wc-mfs-guide__summary::-webkit-details-marker {
	display: none;
}

.wc-mfs-guide__summary::marker {
	content: '';
}

.wc-mfs-guide__summary::before {
	content: '\203A';
	display: inline-block;
	transform: rotate(90deg);
	transition: transform 0.15s ease;
	line-height: 1;
}

.wc-mfs-guide[open] .wc-mfs-guide__summary::before {
	transform: rotate(270deg);
}

.wc-mfs-guide__summary:focus-visible {
	outline: 2px solid var(--mfs-accent);
	outline-offset: 3px;
	border-radius: 3px;
}

/* ----------------------------------------------------------------- Fields */

.wc-mfs-fields {
	display: grid;
	gap: 0.75em;
	grid-template-columns: 1fr 1fr;
}

/* A lone field should not sit in a half-width column. */
.wc-mfs-fields > .wc-mfs-field:only-child {
	grid-column: 1 / -1;
}

.wc-mfs-field {
	margin: 0;
	min-width: 0;
}

.wc-mfs-field__label {
	display: block;
	margin: 0 0 0.35em;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.4;
}

.wc-mfs-field__required {
	margin-left: 0.2em;
	color: var(--mfs-accent);
}

.wc-mfs-field__control {
	position: relative;
	display: block;
}

.wc-mfs .wc-mfs-field__input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0.7em 2.4em 0.7em 0.85em;
	border: 1px solid var(--mfs-line);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wc-mfs .wc-mfs-field__input::placeholder {
	color: var(--mfs-muted);
	opacity: 0.55;
	letter-spacing: normal;
}

.wc-mfs .wc-mfs-field__input:focus {
	border-color: var(--mfs-accent);
	box-shadow: 0 0 0 3px var(--mfs-glow);
	outline: none;
}

.wc-mfs-field.has-error .wc-mfs-field__input {
	border-color: var(--mfs-error);
}

.wc-mfs-field.has-error .wc-mfs-field__input:focus {
	box-shadow: 0 0 0 3px rgba(179, 45, 46, 0.14);
}

.wc-mfs-field__check {
	position: absolute;
	top: 50%;
	right: 0.8em;
	transform: translateY(-50%);
	color: var(--mfs-valid);
	pointer-events: none;
}

.wc-mfs-field__hint {
	margin: 0.4em 0 0;
	font-size: 0.82em;
	line-height: 1.45;
	color: var(--mfs-muted);
}

.wc-mfs-field__error {
	margin: 0.4em 0 0;
	font-size: 0.85em;
	line-height: 1.45;
	color: var(--mfs-error);
}

/* ------------------------------------------------- Order received / emails */

.wc-mfs-receipt__summary {
	margin: 0 0 1em;
	padding: 0;
	list-style: none;
}

.wc-mfs-receipt__summary li {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 1em;
	justify-content: space-between;
	padding: 0.5em 0;
	border-bottom: 1px solid var(--mfs-line-soft);
}

.wc-mfs-receipt__summary span {
	color: var(--mfs-muted);
}

.wc-mfs-receipt__summary strong {
	font-variant-numeric: tabular-nums;
}

.wc-mfs-copy{
	display: inline-flex;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid #7f7f7f;
    border-radius: 4px;
}

/* ------------------------------------------------------------------ A11y */

.wc-mfs .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.wc-mfs * {
		transition: none !important;
	}
}

/* ------------------------------------------------------------ Small screens */

@media (max-width: 560px) {
	.wc-mfs-fields {
		grid-template-columns: 1fr;
	}

	.wc-mfs-strip {
		align-items: flex-start;
	}

	.wc-mfs-copy {
		align-self: flex-start;
	}
}

/* Narrow checkout columns on wide screens stack too, where supported. */
@supports (container-type: inline-size) {
	.wc-mfs {
		container-type: inline-size;
	}

	@container (max-width: 420px) {
		.wc-mfs-fields {
			grid-template-columns: 1fr;
		}
	}
}

/* ------------------------------------------------------------------- Dark */

@media (prefers-color-scheme: dark) {
	.wc-mfs {
		--mfs-line: rgba(255, 255, 255, 0.22);
		--mfs-line-soft: rgba(255, 255, 255, 0.14);
		--mfs-muted: rgba(255, 255, 255, 0.66);
		--mfs-tint: color-mix(in srgb, var(--mfs-accent) 10%, transparent);
		--mfs-valid: #4cc27a;
		--mfs-error: #f0837f;
	}
}
