/* Category Title and Subtitle Styles */
.anysell-category-subtitle {
	font-size: 1.1rem;
	font-weight: 400;
	color: var(--wp--preset--color--gray-600, #666);
	margin-top: 0.5rem;
	line-height: 1.4;
}

/* Subcategories Grid Styles */
.anysell-subcategories-container {
	margin: 20px 0;
}

.anysell-subcategories-header {
	text-align: center;
	margin-bottom: 2rem;
}

.anysell-category-header-image-container {
	margin-bottom: 1.5rem;
}

.anysell-category-header-image {
	max-width: 200px;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease;
}

.anysell-category-header-image:hover {
	transform: scale(1.05);
}

.anysell-subcategories-main-title {
	font-size: 2rem;
	font-weight: 600;
	margin: 0 0 0.5rem 0;
	color: var(--wp--preset--color--gray-900, #1a1a1a);
	line-height: 1.2;
}

.anysell-subcategories-main-subtitle {
	font-size: 1.2rem;
	font-weight: 400;
	color: var(--wp--preset--color--gray-600, #666);
	margin: 0;
	line-height: 1.4;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

.anysell-subcategories-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 1rem;
	text-align: center;
	color: var(--wp--preset--color--gray-900, #1a1a1a);
}

.anysell-subcategories-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1.5rem;
	margin-top: 1rem;
}

.anysell-subcategory-item {
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border: 1px solid #e5e5e5;
}

.anysell-subcategory-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.anysell-subcategory-link {
	display: block;
	text-decoration: none;
	color: inherit;
	padding: 1rem;
	height: 100%;
}

.anysell-subcategory-link:hover {
	text-decoration: none;
	color: inherit;
}

.anysell-subcategory-image {
	width: 100%;
	height: 150px;
	margin-bottom: 1rem;
	overflow: hidden;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f8f9fa;
}

.anysell-subcategory-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.anysell-subcategory-item:hover .anysell-subcategory-image img {
	transform: scale(1.05);
}

.anysell-subcategory-placeholder {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.anysell-subcategory-icon {
	font-size: 2.5rem;
	opacity: 0.6;
}

.anysell-subcategory-title {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0 0 0.5rem 0;
	color: var(--wp--preset--color--gray-900, #1a1a1a);
	line-height: 1.3;
}

.anysell-subcategory-description {
	font-size: 0.9rem;
	color: #666;
	margin: 0 0 0.75rem 0;
	line-height: 1.4;
}

.anysell-subcategory-count {
	font-size: 0.85rem;
	color: var(--wp--preset--color--primary, #007cba);
	font-weight: 500;
	display: inline-block;
	background: rgba(0, 124, 186, 0.1);
	padding: 0.25rem 0.5rem;
	border-radius: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
	.anysell-subcategories-list {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
		gap: 1rem;
	}

	.anysell-subcategory-image {
		height: 120px;
	}

	.anysell-subcategory-title {
		font-size: 1rem;
	}

	.anysell-subcategories-main-title {
		font-size: 1.6rem;
	}

	.anysell-subcategories-main-subtitle {
		font-size: 1rem;
	}

	.anysell-category-header-image {
		max-width: 150px;
	}
}

@media (max-width: 480px) {
	.anysell-subcategories-list {
		grid-template-columns: 1fr;
	}
}

/* Dark theme support */
.dark-theme .anysell-subcategory-item {
	background: #2a2a2a;
	border-color: #444;
}

.dark-theme .anysell-category-header-image {
	box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.dark-theme .anysell-subcategories-main-title,
.dark-theme .anysell-subcategory-title {
	color: #fff;
}

.dark-theme .anysell-subcategories-main-subtitle,
.dark-theme .anysell-subcategory-description {
	color: #ccc;
}

.dark-theme .anysell-subcategory-placeholder {
	background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
}

/* Custom Categories Filter Styles - Hierarchical Tree Structure */
.anysell-custom-categories {
	font-size: 13px;
	line-height: 1.4;
}

.anysell-category-hierarchy {
	display: flex;
	flex-direction: column;
	gap: 1px;
	background: var(--wp--preset--color--white, #fff);
	border-radius: 6px;
	padding: 0.5rem;
	position: relative;
}

.anysell-category-hierarchy .cat-item {
	position: relative;
	transition: all 0.2s ease;
	margin: 0;
}

/* Level indentation */
.anysell-category-hierarchy .cat-item.level-0 {
	margin-left: 0;
}

.anysell-category-hierarchy .cat-item.level-1 {
	margin-left: 18px;
}

.anysell-category-hierarchy .cat-item.level-2 {
	margin-left: 36px;
}

.anysell-category-hierarchy .cat-item.level-3 {
	margin-left: 54px;
}

.anysell-category-hierarchy .cat-item.level-4 {
	margin-left: 72px;
}

/* Tree lines using CSS borders */
.anysell-category-hierarchy .cat-item:not(.level-0)::before {
	content: '';
	position: absolute;
	top: 50%;
	left: -10px;
	width: 8px;
	height: 0;
	border-top: 1px solid #bbb;
	z-index: auto;
}

.anysell-category-hierarchy .cat-item:not(.level-0)::after {
	content: '';
	position: absolute;
	top: -1px;
	left: -10px;
	width: 0;
	height: 100%;
	border-left: 1px solid #bbb;
	z-index: auto;
}

/* Remove horizontal line for level-1 categories */
.anysell-category-hierarchy .cat-item.level-1::before {
	display: none;
}

/* Remove bottom border for last child to create └ effect */
.anysell-category-hierarchy .cat-item:last-child::after {
	height: 50%;
}

/* Remove vertical line from first level children of parents */
.anysell-category-hierarchy .cat-item.level-1:first-of-type::after {
	display: none;
}

/* Remove connecting line between root (level-0) and level-1 */
.anysell-category-hierarchy .cat-item.level-1::after {
	display: none;
}

.anysell-category-hierarchy .cat-link {
	display: flex;
	align-items: center;
	padding: 4px 6px;
	text-decoration: none;
	color: var(--wp--preset--color--gray-700, #666);
	border-radius: 3px;
	transition: all 0.2s ease;
	font-size: 12px;
	font-weight: 400;
	gap: 6px;
	min-height: 26px;
	position: relative;
	z-index: auto;
}

.anysell-category-hierarchy .cat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 10px;
	height: 10px;
	font-size: 9px;
	flex-shrink: 0;
	line-height: 1;
	font-family: monospace;
}

.anysell-category-hierarchy .cat-icon.current {
	color: var(--wp--preset--color--primary, #007cba);
	font-weight: bold;
	font-size: 11px;
}

.anysell-category-hierarchy .cat-icon.parent {
	color: var(--wp--preset--color--gray-600, #666);
	font-size: 9px;
}

.anysell-category-hierarchy .cat-icon.sibling,
.anysell-category-hierarchy .cat-icon.normal,
.anysell-category-hierarchy .cat-icon.child {
	color: var(--wp--preset--color--gray-400, #9ca3af);
	font-size: 9px;
}

.anysell-category-hierarchy .cat-name {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 11px;
}

.anysell-category-hierarchy .cat-count {
	font-size: 9px;
	opacity: 0.7;
	font-weight: 400;
	color: var(--wp--preset--color--gray-500, #888);
	flex-shrink: 0;
}

/* Different styles for different category types */
.anysell-category-hierarchy .cat-item.current-path .cat-link {
	background: var(--wp--preset--color--primary, #007cba);
	color: white;
	font-weight: 500;
}

.anysell-category-hierarchy .cat-item.current-path .cat-name {
	font-weight: 500;
}

.anysell-category-hierarchy .cat-item.current-path .cat-count {
	color: rgba(255, 255, 255, 0.8);
}

.anysell-category-hierarchy .cat-item.parent-in-path .cat-link {
	background: var(--wp--preset--color--gray-50, #fafafa);
	color: var(--wp--preset--color--gray-900, #1a1a1a);
	font-weight: 500;
	border: 1px solid var(--wp--preset--color--gray-200, #e5e5e5);
}

.anysell-category-hierarchy .cat-item.parent-in-path .cat-name {
	font-weight: 500;
}

.anysell-category-hierarchy .cat-item.sibling-cat .cat-link,
.anysell-category-hierarchy .cat-item.child-cat .cat-link,
.anysell-category-hierarchy .cat-item.normal-cat .cat-link {
	color: var(--wp--preset--color--gray-600, #777);
	background: transparent;
}

/* Hover effects */
.anysell-category-hierarchy .cat-item:not(.current-path) .cat-link:hover {
	background: var(--wp--preset--color--primary, #007cba);
	color: white;
	transform: translateX(2px);
}

.anysell-category-hierarchy .cat-item:not(.current-path) .cat-link:hover .cat-count {
	color: rgba(255, 255, 255, 0.8);
}

.anysell-category-hierarchy .cat-item:not(.current-path) .cat-link:hover .cat-icon {
	color: white;
}

/* Level indentation - based on hierarchy level */
.anysell-category-hierarchy .cat-item.level-1 {
	margin-left: 18px;
}

.anysell-category-hierarchy .cat-item.level-2 {
	margin-left: 36px;
}

.anysell-category-hierarchy .cat-item.level-3 {
	margin-left: 54px;
}

.anysell-category-hierarchy .cat-item.level-4 {
	margin-left: 72px;
}



/* Responsive adjustments */
@media (max-width: 768px) {
	.anysell-custom-categories {
		font-size: 12px;
	}
	
	.anysell-category-hierarchy .cat-link {
		padding: 3px 4px;
		font-size: 11px;
		gap: 4px;
		min-height: 22px;
	}
	
	.anysell-category-hierarchy .cat-name {
		font-size: 10px;
	}
	
	.anysell-category-hierarchy .cat-icon {
		width: 8px;
		height: 8px;
		font-size: 7px;
	}
	
	.anysell-category-hierarchy .cat-count {
		font-size: 8px;
	}
	
	.anysell-category-hierarchy .cat-item.level-1 {
		margin-left: 15px;
	}
	
	.anysell-category-hierarchy .cat-item.level-2 {
		margin-left: 30px;
	}
	
	.anysell-category-hierarchy .cat-item.level-3 {
		margin-left: 45px;
	}
	
	.anysell-category-hierarchy .cat-item.level-4 {
		margin-left: 60px;
	}
	
	/* Adjust tree lines for mobile */
	.anysell-category-hierarchy .cat-item:not(.level-0)::before {
		left: -8px;
		width: 6px;
	}
	
	.anysell-category-hierarchy .cat-item:not(.level-0)::after {
		left: -8px;
	}
}

/* Dark theme support */
.dark-theme .anysell-category-hierarchy .cat-link {
	color: #ccc;
}

.dark-theme .anysell-category-hierarchy .cat-item.parent-in-path .cat-link {
	background: #3a3a3a;
	color: #fff;
	border-color: #555;
}

.dark-theme .anysell-category-hierarchy .cat-item:not(.current-path) .cat-link:hover {
	background: var(--wp--preset--color--primary, #007cba);
}

.dark-theme .anysell-category-hierarchy .cat-item:before {
	background: #555;
}
