/* CEAF Archive Filter — base styles + layout variables (mô phỏng cơ chế --e-filter-* của Elementor Pro). */

/* Defaults đặt ở WRAPPER với :where() (specificity 0) để các control alignment ghi đè được. */
:where(.elementor-widget-ceaf-archive-filter) {
	--ceaf-direction: row;
	--ceaf-white-space: nowrap;
	--ceaf-wrap: wrap;
	--ceaf-overflow-x: initial;
	--ceaf-justify-content: flex-start;
	--ceaf-align-items: center;
	--ceaf-space-between: 8px;

	--ceaf-item-width: initial;
	--ceaf-item-max-width: none;
	--ceaf-item-flex-grow: 0;
	--ceaf-item-justify-content: center;
	--ceaf-item-align-items: center;
	--ceaf-item-align-text: center;
	--ceaf-item-box-sizing: border-box;
	--ceaf-item-padding: 8px;
}

.ceaf-filter {
	display: flex;
	flex-direction: var(--ceaf-direction);
	flex-wrap: var(--ceaf-wrap);
	align-items: var(--ceaf-align-items);
	justify-content: var(--ceaf-justify-content);
	gap: var(--ceaf-space-between);
	overflow-x: var(--ceaf-overflow-x);
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.ceaf-filter::-webkit-scrollbar {
	display: none;
}

.ceaf-filter-item {
	display: flex;
	align-items: var(--ceaf-item-align-items);
	justify-content: var(--ceaf-item-justify-content);
	text-align: var(--ceaf-item-align-text);
	width: var(--ceaf-item-width);
	max-width: var(--ceaf-item-max-width);
	flex-grow: var(--ceaf-item-flex-grow);
	flex-shrink: 0;
	box-sizing: var(--ceaf-item-box-sizing);
	white-space: var(--ceaf-white-space);
	padding: var(--ceaf-item-padding);
	line-height: normal;
	overflow-wrap: break-word;
	cursor: pointer;
	border: 1px solid #69727d;
	background-color: transparent;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.ceaf-filter-item[aria-pressed="true"] {
	font-weight: 600;
}

.ceaf-filter-item .ceaf-count {
	opacity: .6;
	font-size: .85em;
	margin-inline-start: 4px;
}

.ceaf-filter-select {
	padding: 8px 12px;
}

/* Loading state cho Loop Grid đang refresh */
.ceaf-loading {
	position: relative;
	pointer-events: none;
}

.ceaf-loading > .elementor-widget-container,
.ceaf-loading > .elementor-loop-container {
	opacity: .45;
	transition: opacity .2s ease;
}

.ceaf-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 36px;
	height: 36px;
	border: 3px solid rgba(0, 0, 0, .15);
	border-top-color: rgba(0, 0, 0, .6);
	border-radius: 50%;
	animation: ceaf-spin .7s linear infinite;
	z-index: 5;
}

@keyframes ceaf-spin {
	to {
		transform: rotate(360deg);
	}
}

.ceaf-notice {
	padding: 12px;
	border: 1px dashed #c3c4c7;
	color: #646970;
	font-size: 13px;
}
