/* WooCommerce Attribute Filter Widget Styles */

.wc-attr-filter-widget {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 100%;
}

.wc-attr-title {
	margin: 0;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.wc-attr-subtitle {
	margin: 0;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.wc-attr-terms {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	align-items: center;
}

/* Horizontal scroll (swipe) mode */
.wc-attr-filter-widget .wc-attr-terms--scroll {
	flex-wrap: nowrap;
	/* A centered overflowing flex row clips its first item outside the scroll origin. */
	justify-content: flex-start !important;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scroll-padding-inline: 10px;
}

/*
 * Flexible edge spacers center the buttons while they fit. When they overflow,
 * the spacers collapse and leave one gap of reachable space at each edge.
 */
.wc-attr-filter-widget .wc-attr-terms--scroll::before,
.wc-attr-filter-widget .wc-attr-terms--scroll::after {
	content: "";
	flex: 1 0 0;
	min-width: 0;
}

.wc-attr-filter-widget .wc-attr-terms--scroll .wc-attr-term-link {
	flex-shrink: 0;
}

/* Optional: hide the scrollbar while keeping scroll functionality */
.wc-attr-filter-widget .wc-attr-terms--no-scrollbar {
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.wc-attr-filter-widget .wc-attr-terms--no-scrollbar::-webkit-scrollbar {
	display: none;
}

.wc-attr-term-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	text-decoration: none;
	cursor: pointer;
	outline: none;
	flex-shrink: 0;
	box-sizing: border-box;
	white-space: nowrap;
}

.wc-attr-term-link:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.wc-attr-term-name {
	display: inline;
}

.wc-attr-term-count {
	display: inline;
	opacity: 0.7;
	font-size: 0.9em;
}

.wc-attr-empty {
	padding: 20px;
	text-align: center;
	opacity: 0.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.wc-attr-filter-widget {
		gap: 15px;
	}

	.wc-attr-terms {
		flex-wrap: wrap;
	}
}

@media (max-width: 480px) {
	.wc-attr-filter-widget {
		gap: 10px;
	}

	.wc-attr-title {
		font-size: 1.2em;
	}

	.wc-attr-subtitle {
		font-size: 0.9em;
	}
}
