/* Collections Hub Page */
.collections-hub {
	display: flex;
	flex-direction: column;
	gap: 30px;
}

.collection-hub-group-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 16px 0;
	padding-bottom: 8px;
	border-bottom: 2px solid #222222;
}

.collection-hub-grid {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 12px !important;
}

.collection-hub-card {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;

	padding: 8px 22px !important; /* Tỷ lệ lề trong vừa vặn */
	border: 1px solid #e2e8f0 !important;
	border-radius: 999px !important; /* Bo tròn vo 2 đầu tuyệt đối */

	background: #ffffff !important;
	color: #2d3748 !important;
	text-decoration: none !important;
	font-size: 14px;
	font-weight: 500;

	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.collection-hub-card:hover {
	border-color: #111111 !important;
	background-color: #111111 !important;
	color: #ffffff !important;

	transform: translateY(-2px) !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Ẩn hoàn toàn khung ảnh để thẻ Pill gọn gàng chỉ còn chữ */
.collection-hub-card-image {
    display: none !important;
}
.collection-hub-card-title {
	font-size: 14px;
	font-weight: 500;
	color: inherit;
}

@media (max-width: 767px) {
	.collection-hub-grid {
		gap: 8px !important;
	}
	.collection-hub-card {
		padding: 7px 16px !important;
		font-size: 13.5px;
	}
}

/* Collection Hero Banner */
.collection-hero {
	margin-bottom: 25px;
}

.collection-hero img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

/* Layout Structure */
.collection-layout {
	display: flex;
	gap: 30px;
	width: 100%;
	box-sizing: border-box;
	align-items: flex-start;
}

.collection-sidebar {
	flex: 0 0 25%;
	max-width: 25%;
	box-sizing: border-box;
	position: sticky;
	top: 20px;
}

.collection-main {
	flex: 0 0 75%;
	max-width: 75%;
	box-sizing: border-box;
	position: relative;
}

/* Sidebar Box Styling */
.collection-filter-sidebar-wrapper {
	background: #ffffff;
	padding: 20px;
	border-radius: 8px;
	border: 1px solid #e5e5e5;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.collection-sidebar-heading {
	font-size: 16px;
	font-weight: 700;
	text-transform: uppercase;
	margin: 0 0 15px 0;
	padding-bottom: 10px;
	border-bottom: 2px solid #222222;
	letter-spacing: 0.5px;
	color: #111111;
}

.collection-filter-group {
	margin-bottom: 20px;
}

.collection-filter-group:last-child {
	margin-bottom: 0;
}

.collection-filter-title {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 10px 0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #444444;
}

/* Base Filter List */
.collection-layout ul.collection-filter-list {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.collection-layout li.collection-filter-item {
	list-style: none !important;
	margin-bottom: 8px;
}

.collection-layout li.collection-filter-item:last-child {
	margin-bottom: 0;
}

.collection-filter-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 13px;
	color: #333333;
	user-select: none;
	width: 100%;
}

.collection-filter-checkbox {
	cursor: pointer;
	width: 15px;
	height: 15px;
	margin: 0;
	flex-shrink: 0;
}

.collection-filter-term-name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	text-transform: capitalize;
}

.collection-filter-term-count {
	color: #777777;
	font-size: 12px;
	white-space: nowrap;
	flex-shrink: 0;
}

.collection-filter-list-wrapper {
	position: relative;
	transition: max-height 0.35s ease-in-out;
}

/* Hide Show More toggle on Desktop */
.collection-filter-more-toggle {
	display: none;
}

/* Pagination */
.collection-pagination {
	margin: 30px 0;
	text-align: center;
	clear: both;
}

.collection-pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	margin: 0 3px;
	border: 1px solid #ddd;
	text-decoration: none;
	color: #333;
	border-radius: 4px;
	background: #fff;
}

.collection-pagination .page-numbers.current {
	background-color: #222;
	color: #fff;
	border-color: #222;
}

.collection-pagination .page-numbers:hover {
	background-color: #f5f5f5;
	color: #111;
}

/* AJAX Loading State */
.collection-main.is-loading {
	opacity: 0.4;
	pointer-events: none;
	transition: opacity 0.2s ease-in-out;
}

/* Mobile Responsive Layout (< 768px) */
@media (max-width: 767px) {
	.collection-layout {
		flex-direction: column;
		gap: 20px;
	}

	.collection-sidebar,
	.collection-main {
		flex: 0 0 100%;
		max-width: 100%;
		width: 100%;
		position: static;
	}

	.collection-filter-sidebar-wrapper {
		padding: 15px;
	}

	/* Disable theme pseudo-elements in Grid */
	.collection-layout ul.collection-filter-list::before,
	.collection-layout ul.collection-filter-list::after {
		display: none !important;
		content: none !important;
	}

	/* Grid layout: 2 columns on small screens */
	.collection-layout ul.collection-filter-list {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px 12px;
	}

	.collection-layout li.collection-filter-item {
		margin: 0 !important;
	}

	/* Mobile Collapsed State (~1 row height) */
	.collection-filter-group.is-collapsible.is-collapsed .collection-filter-list-wrapper {
		max-height: 38px;
		overflow: hidden;
	}

	/* Gradient fade out effect at bottom */
	.collection-filter-group.is-collapsible.is-collapsed .collection-filter-list-wrapper::after {
		content: "";
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		height: 45px;
		background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
		pointer-events: none;
	}

	/* Expanded State */
	.collection-filter-group.is-collapsible.is-expanded .collection-filter-list-wrapper {
		max-height: 2000px;
	}

	/* Show More / Show Less Button - Centered */
	.collection-filter-more-toggle {
		display: block;
		width: 100%;
		text-align: center;
		background: none;
		border: none;
		padding: 10px 0 0 0;
		margin-top: 4px;
		color: #111111;
		font-size: 13px;
		font-weight: 700;
		text-decoration: underline;
		cursor: pointer;
	}
}

/* Grid layout: 3 columns on larger mobile / landscape screens (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
	.collection-layout ul.collection-filter-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
/* --- TỐI ƯU BỘ LỌC TAG TRÊN DESKTOP (>= 768px) --- */
@media (min-width: 768px) {
	.collection-filter-list-wrapper {
		max-height: 360px; /* Chiều cao vừa đủ hiển thị khoảng 12 dòng tag */
		overflow-y: auto;  /* Tự động xuất hiện thanh trượt khi vượt quá 12 tag */
		padding-right: 6px; /* Tạo khoảng trống để thanh trượt không đè lên chữ */
	}

	/* Tùy chỉnh thanh trượt (Scrollbar) mỏng, đẹp, hiện đại */
	.collection-filter-list-wrapper::-webkit-scrollbar {
		width: 5px;
	}

	.collection-filter-list-wrapper::-webkit-scrollbar-track {
		background: #f1f1f1;
		border-radius: 4px;
	}

	.collection-filter-list-wrapper::-webkit-scrollbar-thumb {
		background: #ccc;
		border-radius: 4px;
	}

	.collection-filter-list-wrapper::-webkit-scrollbar-thumb:hover {
		background: #888;
	}
}
/* --- TỰ ĐỘNG CẮT CHỈ HIỆN 8 PILL ĐẦU TIÊN --- */
.collection-hub-grid:not(.is-expanded) .collection-hub-card:nth-child(n+9) {
	display: none !important;
}

/* Nút Show More / Show Less bên dưới hàng Pill */
.collection-hub-toggle-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 14px;
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #111111;
	text-decoration: underline;
	transition: opacity 0.2s ease;
}

.collection-hub-toggle-btn:hover {
	opacity: 0.7;
}
/* ==========================================================================
   Collection Breadcrumb
   Minimal, unopinionated base styles only — the active theme's own
   ".woocommerce-breadcrumb" rules (if any) apply on top of this automatically.
   ========================================================================== */
.collection-breadcrumb {
	margin-bottom: 16px;
	font-size: 13px;
}

.collection-breadcrumb a {
	text-decoration: none;
}

.collection-breadcrumb a:hover {
	text-decoration: underline;
}

.collection-breadcrumb-sep {
	margin: 0 6px;
	opacity: 0.5;
}

.collection-breadcrumb-current {
	opacity: 0.75;
}
