/* Button pager for webshop product listings.

   Scoped to .frappe-webshop-paging so a failed patch still leaves webshop's
   own .product-paging-area alone. Paint properties use !important because
   website themes often reset button/link chrome (transparent background, no
   border), which is why Prev/Next were reading as plain text.

   Colors follow the website theme: --primary / --primary-color, with
   --text-color, --border-color, and --fg-color when the theme defines them.
*/

.frappe-webshop-paging {
	display: flex;
	width: 100%;
	margin-top: 1.5rem;
	margin-bottom: 1.5rem;
}

.frappe-webshop-paging .product-paging-area__spacer {
	display: none;
}

.frappe-webshop-paging .product-paging {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
}

.frappe-webshop-paging .product-paging__status {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.4;
	text-align: center;
	color: var(--text-muted, var(--text-light, #6c7680));
}

.frappe-webshop-paging .product-paging__controls {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.375rem;
	max-width: 100%;
}

.frappe-webshop-paging .product-paging__btn {
	box-sizing: border-box;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 44px !important;
	min-height: 44px !important;
	padding: 0.375rem 0.75rem;
	border: 1px solid var(--border-color, var(--gray-300, #d1d8dd)) !important;
	border-radius: var(--border-radius, var(--radius, 6px));
	background: var(--fg-color, var(--card-bg, #fff)) !important;
	color: var(--text-color, inherit) !important;
	box-shadow: var(--btn-shadow, none);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1;
	text-align: center;
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.frappe-webshop-paging a.product-paging__btn:hover,
.frappe-webshop-paging .product-paging__btn:focus-visible {
	border-color: var(--primary, var(--primary-color, #2490ef)) !important;
	color: var(--primary, var(--primary-color, #2490ef)) !important;
	text-decoration: none !important;
}

.frappe-webshop-paging .product-paging__btn:focus-visible {
	outline: 2px solid var(--primary, var(--primary-color, #2490ef));
	outline-offset: 2px;
}

.frappe-webshop-paging .product-paging__btn.is-current {
	background: var(--primary, var(--primary-color, #2490ef)) !important;
	border-color: var(--primary, var(--primary-color, #2490ef)) !important;
	color: var(--white, #fff) !important;
	font-weight: 600;
	cursor: default;
}

.frappe-webshop-paging .product-paging__btn:disabled,
.frappe-webshop-paging .product-paging__btn[aria-disabled="true"] {
	opacity: 0.45 !important;
	cursor: not-allowed !important;
	background: var(--disabled-control-bg, var(--gray-100, #f4f5f6)) !important;
	color: var(--text-muted, #8d99a6) !important;
	border-color: var(--border-color, var(--gray-300, #d1d8dd)) !important;
	box-shadow: none;
	pointer-events: none;
}

.frappe-webshop-paging .product-paging__ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	min-height: 44px;
	color: var(--text-muted, #8d99a6);
	user-select: none;
}

@media (min-width: 768px) {
	.frappe-webshop-paging .product-paging-area__spacer {
		display: block;
		flex: 0 0 25%;
		max-width: 25%;
	}

	.frappe-webshop-paging .product-paging {
		flex: 0 0 75%;
		max-width: 75%;
	}
}
