/**
 * WooCommerce Categories for Elementor - Frontend Styles
 *
 * @package WooCategoriesElementor
 */

/* ==========================================================================
   Category List Container
   ========================================================================== */

.wce-categories-wrapper {
	width: 100%;
	box-sizing: border-box;
}

.wce-categories-list {
	list-style: disc;
	margin: 0;
	padding: 0;
	padding-left: 0;
}

/* List Style Variations */
.wce-list-style-none {
	list-style: none;
}

.wce-list-style-disc {
	list-style: disc;
	padding-left: 20px;
}

.wce-list-style-circle {
	list-style: circle;
	padding-left: 20px;
}

.wce-list-style-square {
	list-style: square;
	padding-left: 20px;
}

/* When list style is none, remove all padding for child lists too */
.wce-list-style-none .wce-child-list {
	list-style: none;
	padding-left: 20px;
}

/* ==========================================================================
   Category Items
   ========================================================================== */

.wce-category-item {
	margin: 0;
	padding: 0;
	line-height: 1.6;
	position: relative;
}

/* Default spacing between items */
.wce-category-item + .wce-category-item {
	margin-top: 10px;
}

/* Depth indicators for better visual hierarchy */
.wce-category-item.wce-depth-1 {
	font-size: 1em;
}

.wce-category-item.wce-depth-2 {
	font-size: 0.95em;
}

.wce-category-item.wce-depth-3 {
	font-size: 0.9em;
}

/* ==========================================================================
   Category Links
   ========================================================================== */

.wce-category-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: #333;
	transition: all 0.3s ease;
	padding: 5px 10px;
	border-radius: 3px;
	line-height: 1.5;
}

.wce-category-link:hover {
	color: #0066cc;
	background-color: rgba(0, 102, 204, 0.05);
}

.wce-category-link:focus {
	outline: 2px solid #0066cc;
	outline-offset: 2px;
}

/* Category Name */
.wce-category-name {
	font-weight: 500;
	flex: 0 1 auto;
}

/* ==========================================================================
   Product Count
   ========================================================================== */

.wce-category-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.875em;
	color: #666;
	background-color: #f5f5f5;
	padding: 2px 8px;
	border-radius: 10px;
	line-height: 1.4;
	min-width: 24px;
	text-align: center;
	font-weight: 400;
	flex-shrink: 0;
}

/* ==========================================================================
   Child Categories (Nested Lists)
   ========================================================================== */

.wce-child-list {
	margin-top: 10px;
	margin-bottom: 0;
	padding-left: 20px;
}

/* Add subtle indentation lines for visual hierarchy */
.wce-child-list::before {
	content: '';
	position: absolute;
	left: 10px;
	top: 0;
	bottom: 0;
	width: 1px;
	background-color: #e0e0e0;
	opacity: 0.5;
}

/* Adjust spacing for nested items */
.wce-child-list .wce-category-item {
	position: relative;
}

.wce-child-list .wce-category-item:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Typography Enhancements
   ========================================================================== */

/* Responsive typography scaling */
@media screen and (max-width: 768px) {
	.wce-category-link {
		font-size: 14px;
		padding: 4px 8px;
	}

	.wce-category-count {
		font-size: 0.8em;
		padding: 1px 6px;
	}

	.wce-child-list {
		padding-left: 15px;
	}
}

@media screen and (max-width: 480px) {
	.wce-category-link {
		font-size: 13px;
		padding: 3px 6px;
	}

	.wce-child-list {
		padding-left: 12px;
	}
}

/* ==========================================================================
   Spacing Utilities
   ========================================================================== */

/* Compact spacing variant */
.wce-categories-wrapper.wce-compact .wce-category-item {
	margin-bottom: 5px;
}

.wce-categories-wrapper.wce-compact .wce-child-list {
	margin-top: 5px;
}

/* Spacious variant */
.wce-categories-wrapper.wce-spacious .wce-category-item {
	margin-bottom: 15px;
}

.wce-categories-wrapper.wce-spacious .wce-child-list {
	margin-top: 15px;
}

.wce-categories-wrapper.wce-spacious .wce-category-link {
	padding: 8px 12px;
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
	.wce-category-link {
		border: 1px solid currentColor;
	}

	.wce-category-count {
		border: 1px solid #666;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.wce-category-link {
		transition: none;
	}
}

/* Focus visible for keyboard navigation */
.wce-category-link:focus-visible {
	outline: 2px solid #0066cc;
	outline-offset: 2px;
	background-color: rgba(0, 102, 204, 0.1);
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

[dir="rtl"] .wce-categories-list {
	padding-left: 0;
	padding-right: 20px;
}

[dir="rtl"] .wce-child-list {
	padding-left: 0;
	padding-right: 20px;
}

[dir="rtl"] .wce-child-list::before {
	left: auto;
	right: 10px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.wce-category-link {
		color: #000;
		background-color: transparent;
		padding: 2px 0;
	}

	.wce-category-count {
		background-color: transparent;
		border: 1px solid #000;
	}
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.wce-categories-wrapper:empty::after {
	content: 'No categories to display';
	display: block;
	padding: 20px;
	text-align: center;
	color: #999;
	font-style: italic;
}
