/**
 * Product Categories Widget - Garden & Plants Theme
 * Beautiful, nature-inspired category sidebar widget
 * 100% RTL Optimized for Hebrew
 */

/* === Base Widget Container === */
.product-cats-widget {
	width: 100%;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Heebo', sans-serif;
	direction: rtl;
	text-align: right;
}

/* === Statistics === */
.widget-stats {
	display: flex;
	justify-content: space-around;
	align-items: center;
	padding: 16px 20px;
	margin-bottom: 20px;
	background: linear-gradient(135deg, #2d7a3e 0%, #1e5631 100%);
	border-radius: 12px;
	color: white;
	font-size: 0.95rem;
	box-shadow: 0 4px 12px rgba(45, 122, 62, 0.3);
	direction: rtl;
	gap: 12px;
}

.widget-stats span {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	flex-direction: row-reverse;
	padding: 0 8px;
}

.widget-stats i {
	font-size: 1.2rem;
	flex-shrink: 0;
}

/* === Search Box === */
.cat-search-box {
	position: relative;
	margin-bottom: 20px;
	direction: rtl;
}

.cat-search-input {
	width: 100%;
	padding: 12px 40px 12px 16px;
	border: 2px solid #c8e6c9;
	border-radius: 10px;
	font-size: 0.95rem;
	transition: all 0.3s ease;
	background: #f1f8f4;
	direction: rtl;
	text-align: right;
}

.cat-search-input:focus {
	outline: none;
	border-color: #4caf50;
	background: white;
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.cat-search-input::placeholder {
	text-align: right;
	opacity: 0.6;
}

.cat-search-box::after {
	content: "🔍";
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.1rem;
	opacity: 0.5;
	pointer-events: none;
}

/* === Category List === */
.cats-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cat-item {
	position: relative;
	margin: 0 0 4px 0;
	padding: 0;
}

.cat-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
	flex-direction: row-reverse;
	gap: 8px;
}

/* === Category Links === */
.cat-link {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-direction: row;
	padding: 12px 16px;
	text-decoration: none;
	color: #2c3e2f;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 10px;
	font-weight: 500;
	position: relative;
	overflow: hidden;
	direction: rtl;
}

.cat-link::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 0;
	height: 100%;
	background: linear-gradient(270deg, transparent, rgba(76, 175, 80, 0.1));
	transition: width 0.4s ease;
	z-index: -1;
}

.cat-link:hover {
	background-color: #f1f8f4;
	color: #2d7a3e;
	transform: translateX(-4px);
}

.cat-link:hover::before {
	width: 100%;
}

/* Current Category */
.current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
	color: #000000;
    font-weight: 700;
    /* box-shadow: 0px 0px 0px 2px rgba(45, 122, 62, 0.35); */
}

.current-cat > .cat-row > .cat-link:hover {
	transform: translateX(-4px) scale(1.02);
}

.cat-name {
	font-weight: 500;
}

.current-cat .cat-name {
	font-weight: 700;
}

/* === Count Badge === */
.cat-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 24px;
	padding: 0 8px;
	/* background: #c8e6c9; */
	color: #2d7a3e;
	font-size: 0.8rem;
	font-weight: 600;
	border-radius: 12px;
	margin-right: 8px;
	transition: all 0.3s ease;
}

.cat-link:hover .cat-count {
	background: #2d7a3e;
	color: white;
	transform: scale(1.1);
}

.current-cat .cat-count {
background: rgba(255, 255, 255, 0.25);
    color: #000000;
}

/* === Toggle Button === */
.cat-toggle {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	margin: 0;
	border-radius: 8px;
	transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
	flex-shrink: 0;
	font-size: 14px;
	opacity: 0.35;
	transform: scale(1);
}

/* מופיע יותר בבירור במעבר מעל השורה */
.cat-row:hover .cat-toggle {
	opacity: 1;
	transform: scale(1.05);
}

.cat-toggle:hover {
	background: rgba(45, 122, 62, 0.08);
	opacity: 1;
}

.cat-toggle::before {
	content: "◀";
	display: block;
	transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
	font-size: 11px;
	color: #2d7a3e;
}

.cat-toggle:hover::before {
	color: #2d7a3e;
	font-weight: 600;
}

/* כשהקטגוריה פתוחה - תמיד מוצג בבירור */
.cat-item.is-expanded > .cat-row > .cat-toggle {
	opacity: 1;
	background: rgba(45, 122, 62, 0.08);
}

.cat-item.is-expanded > .cat-row > .cat-toggle::before {
	transform: rotate(90deg);
}

/* סטייל מיוחד לקטגוריה נוכחית - תמיד בולט */
.current-cat > .cat-row > .cat-toggle {
	opacity: 1;
	background: rgba(255, 255, 255, 0.15);
}

.current-cat > .cat-row:hover > .cat-toggle {
	opacity: 1;
	background: rgba(255, 255, 255, 0.3);
	transform: scale(1.05);
}

.current-cat > .cat-row > .cat-toggle::before {
	color: white;
}

.current-cat.is-expanded > .cat-row > .cat-toggle {
	opacity: 1;
	background: rgba(255, 255, 255, 0.25);
}

/* Hide toggle button for current category */
.current-cat > .cat-row > .cat-toggle {
	display: none;
}

/* === Children/Subcategories === */
.cat-children {
	list-style: none;
	margin: 4px 0 0 20px;
	padding: 8px 0;
	background: #f9fdf9;
	border-radius: 0 12px 12px 0;
	overflow: hidden;
	direction: rtl;
}

.cat-children .cat-item {
	position: relative;
}

.cat-children .cat-item::before {
	content: ">";
	position: absolute;
	right: 8px;
	top: 14px;
	color: #a5d6a7;
	font-size: 14px;
	font-weight: 300;
}

.cat-children .cat-link {
	padding: 10px 40px 10px 16px;
	font-size: 0.9rem;
	font-weight: 400;
}

.cat-children .cat-children {
	margin-left: 20px;
	border-right-color: #81c784;
}

.cat-children .cat-children .cat-link {
	padding: 10px 20px 10px 26px;
	font-size: 0.85rem;
}

.cat-children .cat-children .cat-children {
	margin-left: 24px;
	border-right-color: #66bb6a;
}

.cat-children .cat-children .cat-children .cat-link {
	padding: 10px 40px 10px 16px;
	font-size: 0.8rem;
}

/* === STYLE PRESETS === */

/* ===============================================
   STYLE 1: Minimal - Clean & Simple
   =============================================== */
.style-minimal .cat-link {
	border-radius: 0;
	border-bottom: 1px solid #e8f5e9;
	padding: 10px 12px;
}

.style-minimal .cat-link::before {
	display: none;
}

.style-minimal .cat-link:hover {
	background: transparent;
	border-bottom-color: #2d7a3e;
	transform: translateX(-2px);
}

.style-minimal .current-cat > .cat-row > .cat-link {
	background: transparent;
	border-bottom: 2px solid #2d7a3e;
	color: #2d7a3e;
	box-shadow: none;
}

.style-minimal .cat-count {
	background: transparent;
	color: #66bb6a;
	font-size: 0.85rem;
}

.style-minimal .cat-toggle {
	border-radius: 0;
	opacity: 0.3;
}

.style-minimal .cat-row:hover .cat-toggle {
	opacity: 0.8;
}

.style-minimal .cat-toggle:hover {
	background: rgba(45, 122, 62, 0.05);
	opacity: 1;
}

.style-minimal .cat-item.is-expanded > .cat-row > .cat-toggle {
	background: rgba(45, 122, 62, 0.05);
	opacity: 1;
}

.style-minimal .cat-children {
	background: transparent;
	border-right: 2px solid #a5d6a7;
}

/* ===============================================
   STYLE 2: Modern - Bold & Colorful (Default)
   =============================================== */
.style-modern .cat-link {
	border-radius: 12px;
	margin-bottom: 2px;
}

.style-modern .cat-link:hover {
	box-shadow: 0 4px 12px rgba(45, 122, 62, 0.15);
	transform: translateX(-6px);
}

.style-modern .current-cat > .cat-row > .cat-link {
	/* box-shadow: 0 6px 20px rgba(45, 122, 62, 0.35); */
}

.style-modern .cat-toggle {
	border-radius: 10px;
}

.style-modern .cat-children {
	border-radius: 0 10px 10px 0;
	margin-top: 2px;
}

/* ===============================================
   STYLE 3: Bold - Strong Borders
   =============================================== */
.style-bold .cat-link {
	font-weight: 600;
	border-right: 4px solid transparent;
	border-radius: 8px;
	padding: 14px 16px;
}

.style-bold .cat-link:hover {
	border-right-color: #2d7a3e;
	background: #f1f8f4;
	transform: translateX(-2px);
}

.style-bold .current-cat > .cat-row > .cat-link {
	border-right-width: 6px;
	border-right-color: white;
}

.style-bold .cat-name {
	font-weight: 700;
}

.style-bold .cat-children {
	border-right-width: 4px;
	border-right-color: #81c784;
}

/* ===============================================
   STYLE 4: Classic - Traditional
   =============================================== */
.style-classic .cat-link {
	border-radius: 0;
	border-bottom: 1px solid #c8e6c9;
	padding: 12px 14px;
}

.style-classic .cat-link::before {
	background: linear-gradient(270deg, transparent, rgba(45, 122, 62, 0.05));
}

.style-classic .cat-link:hover {
	border-bottom-color: #2d7a3e;
	background: #f9fdf9;
}

.style-classic .current-cat > .cat-row > .cat-link {
	border-bottom: 3px solid #2d7a3e;
	background: #f1f8f4;
	color: #2d7a3e;
	box-shadow: none;
}

.style-classic .cat-toggle {
	border-radius: 4px;
}

.style-classic .cat-children {
	border-radius: 0;
	background: #f9fdf9;
}

/* ===============================================
   STYLE 5: Card - Boxed Style
   =============================================== */
.style-card .cat-item {
	margin-bottom: 8px;
}

.style-card .cat-link {
	background: white;
	border: 2px solid #c8e6c9;
	border-radius: 12px;
	padding: 14px 16px;
	box-shadow: 0 2px 4px rgba(45, 122, 62, 0.06);
}

.style-card .cat-link:hover {
	border-color: #2d7a3e;
	box-shadow: 0 8px 16px rgba(45, 122, 62, 0.15);
	transform: translateY(-2px) translateX(-4px);
}

.style-card .current-cat > .cat-row > .cat-link {
	border-color: #2d7a3e;
	box-shadow: 0 8px 20px rgba(45, 122, 62, 0.25);
}

.style-card .cat-children {
	margin-top: 8px;
	margin-left: 12px;
	border-radius: 8px;
	border: 2px solid #e8f5e9;
}

/* ===============================================
   STYLE 6: Elegant - Sophisticated
   =============================================== */
.style-elegant .cat-link {
	font-family: Georgia, 'Times New Roman', serif;
	padding: 14px 18px;
	border-radius: 0;
	border-bottom: 1px solid #c8e6c9;
	position: relative;
}

.style-elegant .cat-link::after {
	content: '';
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 0;
	height: 2px;
	background: linear-gradient(270deg, #2d7a3e, #1e5631);
	transition: width 0.4s ease;
}

.style-elegant .cat-link:hover::after {
	width: 100%;
}

.style-elegant .cat-link:hover {
	background: transparent;
	color: #2d7a3e;
	transform: none;
}

.style-elegant .current-cat > .cat-row > .cat-link {
	background: transparent;
	color: #2d7a3e;
	font-weight: 700;
	box-shadow: none;
}

.style-elegant .current-cat > .cat-row > .cat-link::after {
	width: 100%;
}

.style-elegant .cat-name {
	font-size: 1.05rem;
	letter-spacing: 0.3px;
}

/* === COLOR SCHEMES === */

/* Default - Nature Green (Garden Theme) */
.color-default .cat-link:hover {
	color: #2d7a3e;
}

.color-default .current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #2d7a3e 0%, #1e5631 100%);
}

.color-default .cat-link:hover .cat-count,
.color-default .cat-toggle:hover {
	background: #2d7a3e;
}

.color-default .widget-stats {
	background: linear-gradient(135deg, #2d7a3e 0%, #1e5631 100%);
}

/* Blue */
.color-blue .cat-link:hover {
	color: #3b82f6;
}

.color-blue .current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

.color-blue .cat-link:hover .cat-count,
.color-blue .cat-toggle:hover {
	background: #3b82f6;
}

.color-blue .widget-stats {
	background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

/* Green */
.color-green .cat-link:hover {
	color: #10b981;
}

.color-green .current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.color-green .cat-link:hover .cat-count,
.color-green .cat-toggle:hover {
	background: #10b981;
}

.color-green .widget-stats {
	background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

/* Purple */
.color-purple .cat-link:hover {
	color: #a855f7;
}

.color-purple .current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
}

.color-purple .cat-link:hover .cat-count,
.color-purple .cat-toggle:hover {
	background: #a855f7;
}

.color-purple .widget-stats {
	background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
}

/* Orange */
.color-orange .cat-link:hover {
	color: #f97316;
}

.color-orange .current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.color-orange .cat-link:hover .cat-count,
.color-orange .cat-toggle:hover {
	background: #f97316;
}

.color-orange .widget-stats {
	background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

/* Red */
.color-red .cat-link:hover {
	color: #ef4444;
}

.color-red .current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.color-red .cat-link:hover .cat-count,
.color-red .cat-toggle:hover {
	background: #ef4444;
}

.color-red .widget-stats {
	background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Pink */
.color-pink .cat-link:hover {
	color: #ec4899;
}

.color-pink .current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.color-pink .cat-link:hover .cat-count,
.color-pink .cat-toggle:hover {
	background: #ec4899;
}

.color-pink .widget-stats {
	background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

/* Teal */
.color-teal .cat-link:hover {
	color: #14b8a6;
}

.color-teal .current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
}

.color-teal .cat-link:hover .cat-count,
.color-teal .cat-toggle:hover {
	background: #14b8a6;
}

.color-teal .widget-stats {
	background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
}

/* Custom - Brown/Beige Theme */
.color-custom .cat-link {
	color: #5a4a3a;
	background: #fafafa;
}

.color-custom .cat-link:hover {
	background-color: #ffffff;
	color: #77675c;
	transform: translateX(-4px);
	box-shadow: 0 4px 12px rgba(119, 103, 92, 0.15);
}

.color-custom .current-cat > .cat-row > .cat-link {
	background: linear-gradient(135deg, #77675c 0%, #fdfcfc 100%);
	color: #2c2419;
	font-weight: 700;
}

.color-custom .style-modern .current-cat > .cat-row > .cat-link {
	box-shadow: 0 6px 20px #c1c1c159;
}

.color-custom .cat-link:hover .cat-count,
.color-custom .cat-toggle:hover {
	background: #77675c;
	color: white;
}

.color-custom .cat-toggle::before {
	color: #77675c;
}

.color-custom .cat-count {
	color: #77675c;
}

.color-custom .current-cat .cat-count {
	background: rgba(255, 255, 255, 0.25);
	color: #2c2419;
}

.color-custom .widget-stats {
	background: linear-gradient(135deg, #77675c 0%, #5a4a3a 100%);
	box-shadow: 0 4px 12px rgba(119, 103, 92, 0.3);
}

.color-custom .cat-search-input {
	border-color: #d4c4b4;
	background: #f9f6f2;
}

.color-custom .cat-search-input:focus {
	border-color: #77675c;
	box-shadow: 0 0 0 3px rgba(119, 103, 92, 0.1);
}

.color-custom .cat-children {
	background: #faf8f6;
}

.color-custom .cat-children .cat-item::before {
	color: #d4c4b4;
}

/* === RTL is now built-in! === */
/* All styles above are 100% RTL-optimized for Hebrew */
/* No additional RTL overrides needed */

/* === MOBILE RESPONSIVE === */
@media (max-width: 992px) {
	.cat-link {
		padding: 14px;
		font-size: 0.95rem;
	}

	.cat-toggle {
		width: 40px;
		height: 40px;
		/* במובייל תמיד מוצג בשקיפות קלה - קל ללחיצה */
		opacity: 0.5;
	}

	/* במובייל touch - אין hover אז פתוח תמיד בולט */
	.cat-item.is-expanded > .cat-row > .cat-toggle,
	.current-cat > .cat-row > .cat-toggle {
		opacity: 1;
	}

	.cat-count {
		font-size: 0.75rem;
		min-width: 24px;
		height: 20px;
	}

	.widget-stats {
		flex-direction: column;
		gap: 8px;
		align-items: stretch;
	}

	.widget-stats span {
		justify-content: center;
	}

	.cat-children {
		margin-left: 16px;
	}

	.cat-children .cat-link {
		padding: 10px 36px 10px 12px;
		font-size: 0.9rem;
	}

	.cat-children .cat-children {
		margin-left: 16px;
	}

	.cat-children .cat-children .cat-link {
		padding: 10px 36px 10px 12px;
	}
}

/* === ANIMATIONS === */
@keyframes slideDown {
	from {
		opacity: 0;
		max-height: 0;
	}
	to {
		opacity: 1;
		max-height: 1000px;
	}
}

@keyframes slideUp {
	from {
		opacity: 1;
		max-height: 1000px;
	}
	to {
		opacity: 0;
		max-height: 0;
	}
}

/* Smooth transitions */
.cat-item,
.cat-link,
.cat-toggle,
.cat-count,
.cat-children {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
