/* OnePG instrument picker — classic and block checkout. */

.onepg-wrapper {
	padding: 4px 0 8px;
}

.onepg-wrapper .onepg-description {
	margin: 0 0 12px;
}

/*
 * Tabs. One group is on screen at a time, so the picker stays a fixed height
 * no matter how many banks the gateway returns and the place-order button
 * stays within reach.
 */

.onepg-tablist {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 14px;
	padding: 0;
}

/*
 * Tabs are styled as the instrument tiles are, so the strip reads as part of
 * the same control. They wrap rather than scroll: a scrolling strip hides
 * groups off the edge and puts a scrollbar where the selected state belongs.
 */
.onepg-tab {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 9px 13px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
	color: #6b7280;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;

	/* A tap that drags a pixel should switch tabs, not select the label. */
	-webkit-user-select: none;
	user-select: none;
}

.onepg-tab:hover {
	border-color: #9ca3af;
	background: #fafafa;
	color: #374151;
}

.onepg-tab:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.onepg-tab.is-active {
	border-color: #2271b1;
	background: #f0f6fc;
	color: #111827;
}

.onepg-tab-count {
	padding: 1px 7px;
	border-radius: 10px;
	background: #f3f4f6;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0;
	color: #6b7280;
}

.onepg-tab.is-active .onepg-tab-count {
	background: #dce9f5;
	color: #2271b1;
}

/* A tab holding the current selection is marked, so the choice stays findable
   from any other tab. */
.onepg-tab-mark {
	font-size: 11px;
	line-height: 1;
	color: #2271b1;
}

.onepg-panel {
	padding: 0;
}

.onepg-panel[hidden] {
	display: none;
}

/*
 * The grid scrolls inside the panel instead of growing the page. The padding
 * keeps focus rings off the clipping edge.
 */
.onepg-scroll {
	max-height: 300px;
	overflow-y: auto;
	padding: 3px;
	margin: 0 -3px;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.onepg-filter {
	display: block;
	width: 100%;
	margin: 0 0 10px;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.3;
	box-sizing: border-box;
}

.onepg-filter:focus {
	border-color: #2271b1;
	outline: 2px solid rgba(34, 113, 177, 0.25);
	outline-offset: 0;
}

.onepg-no-match {
	margin: 0;
	padding: 6px 2px;
	font-size: 13px;
	color: #6b7280;
}

.onepg-no-match[hidden] {
	display: none;
}

.onepg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.onepg-item {
	margin: 0;
}

.onepg-item[hidden] {
	display: none;
}

.onepg-item label {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 100%;
	padding: 11px 12px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	box-sizing: border-box;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.onepg-item label:hover {
	border-color: #9ca3af;
	background: #fafafa;
}

.onepg-item input[type="radio"] {
	margin: 0;
	flex: 0 0 auto;
}

.onepg-item input[type="radio"]:checked + img,
.onepg-item input[type="radio"]:checked ~ span {
	color: #111827;
}

.onepg-item label:has(input:checked) {
	border-color: #2271b1;
	background: #f0f6fc;
}

.onepg-item label:focus-within {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.onepg-item img {
	flex: 0 0 auto;
	width: auto;
	height: auto;
	max-width: 38px;
	max-height: 22px;
	object-fit: contain;
}

.onepg-item span {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	color: #374151;
}

.onepg-error {
	margin-top: 10px;
	padding: 10px 12px;
	border: 1px solid #f3c2c2;
	border-radius: 6px;
	background: #fcf0f0;
	color: #a11a1a;
	font-size: 13px;
}

@media (max-width: 480px) {
	.onepg-grid {
		grid-template-columns: 1fr;
	}

	/* Tighter pills fit more groups per row on a phone. */
	.onepg-tablist {
		gap: 5px;
		margin-bottom: 12px;
	}

	.onepg-tab {
		gap: 5px;
		padding: 8px 10px;
		font-size: 11px;
		letter-spacing: 0.02em;
	}

	.onepg-scroll {
		max-height: 260px;
	}
}
