/* =============================================
 * Custom Categories Widget
 * ============================================= */

.cc-categories-widget {
	position: relative;
	overflow: hidden;
}

/* =============================================
 * List Wrap (scrollable)
 * ============================================= */
.cc-list-wrap {
	overflow-y: auto;
	overflow-x: hidden;
	scroll-behavior: smooth;
	scrollbar-width: thin;
	scrollbar-color: rgba(0,0,0,0.12) rgba(0,0,0,0.03);
}

.cc-list-wrap::-webkit-scrollbar {
	width: 5px;
}

.cc-list-wrap::-webkit-scrollbar-track {
	background: rgba(0,0,0,0.03);
	border-radius: 5px;
}

.cc-list-wrap::-webkit-scrollbar-thumb {
	background: rgba(0,0,0,0.12);
	border-radius: 5px;
}

.cc-list-wrap::-webkit-scrollbar-thumb:hover {
	background: rgba(0,0,0,0.25);
}

/* =============================================
 * Category Item
 * ============================================= */
.cc-cat-item {
	display: flex;
	align-items: center;
	text-decoration: none;
	transition: background-color 0.15s ease;
	cursor: pointer;
}

.cc-cat-item + .cc-cat-item {
	border-top: 1px solid #f0f0f0;
}

/* =============================================
 * Thumbnail / Custom Icon
 * ============================================= */
.cc-cat-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
}

.cc-cat-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.cc-cat-thumb i {
	display: block;
	line-height: 1;
}

.cc-cat-thumb svg {
	display: block;
	width: 100%;
	height: 100%;
}

.cc-cat-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: #f0f0f0;
	border-radius: inherit;
}

/* =============================================
 * Featured Item
 * ============================================= */
.cc-cat-item.cc-featured + .cc-cat-item {
	border-top: none;
}

/* =============================================
 * Name & Count
 * ============================================= */
.cc-cat-name {
	flex: 1;
	min-width: 0;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.15s ease, font-weight 0.1s ease;
}

.cc-cat-count {
	margin-left: 4px;
	font-size: 12px;
}

/* =============================================
 * Arrow
 * ============================================= */
.cc-cat-arrow {
	flex-shrink: 0;
	margin-left: auto;
	line-height: 1;
	transition: transform 0.15s ease, color 0.15s ease;
	display: flex;
	align-items: center;
}

.cc-cat-arrow svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.cc-cat-item:hover .cc-cat-name {
	font-weight: 600 !important;
}

.cc-cat-item:hover .cc-cat-arrow {
	transform: translateX(2px);
}

/* =============================================
 * View All (hover to show)
 * ============================================= */
.cc-view-all {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	padding: 6px 14px;
	border-radius: 20px;
	text-decoration: none;
	font-size: 13px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: 5;
}

.cc-view-all-arrow {
	display: inline-flex;
	align-items: center;
}

.cc-view-all-arrow svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.cc-categories-widget:hover .cc-view-all {
	opacity: 1;
	visibility: visible;
}

/* =============================================
 * Modal Overlay
 * ============================================= */
.cc-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.cc-modal-overlay.cc-modal-open {
	opacity: 1;
}

.cc-modal {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 90vw;
	max-width: 1000px;
	height: 80vh;
	max-height: 600px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.cc-modal-close {
	position: absolute;
	top: 12px;
	right: 16px;
	z-index: 2;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #333;
	padding: 4px 8px;
}

.cc-modal-close:hover {
	color: #000;
}

.cc-modal-body {
	display: flex;
	flex: 1;
	min-height: 0;
}

/* =============================================
 * Modal Left Sidebar
 * ============================================= */
.cc-modal-left {
	width: 260px;
	flex-shrink: 0;
	overflow-y: auto;
	border-right: 1px solid #f0f0f0;
	background: #fafafa;
}

.cc-modal-left::-webkit-scrollbar {
	width: 4px;
}

.cc-modal-left::-webkit-scrollbar-thumb {
	background: #d0d0d0;
	border-radius: 2px;
}

.cc-modal-cat-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	text-decoration: none;
	color: #333;
	font-size: 14px;
	cursor: pointer;
	border-left: 3px solid transparent;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cc-modal-cat-item + .cc-modal-cat-item {
	border-top: 1px solid #f0f0f0;
}

.cc-modal-cat-item:hover {
	background: #f5f5f5;
}

.cc-modal-cat-item.cc-active {
	background: #fff;
	border-left-color: #333;
	color: #333;
}

.cc-modal-cat-item.cc-active .cc-modal-cat-name {
	font-weight: 600;
}

.cc-modal-cat-thumb {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cc-modal-cat-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.cc-modal-cat-thumb svg {
	width: 100%;
	height: 100%;
}

.cc-modal-cat-name {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cc-modal-cat-arrow {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	color: #ccc;
}

.cc-modal-cat-arrow svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.cc-modal-cat-item.cc-active .cc-modal-cat-arrow {
	color: #333;
}

/* =============================================
 * Modal Right Panel
 * ============================================= */
.cc-modal-right {
	flex: 1;
	min-width: 0;
	overflow-y: auto;
	padding: 24px 28px;
}

.cc-modal-panel + .cc-modal-panel {
	padding-top: 24px;
}

.cc-modal-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.cc-modal-panel-title {
	font-size: 18px;
	font-weight: 600;
	color: #333;
	margin: 0;
}

.cc-modal-browse {
	font-size: 13px;
	color: #999;
	text-decoration: none;
	white-space: nowrap;
}

.cc-modal-browse:hover {
	color: #666;
}

/* =============================================
 * Modal Grid
 * ============================================= */
.cc-modal-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 20px 16px;
}

.cc-modal-grid-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	color: #333;
	gap: 8px;
}

.cc-modal-grid-thumb {
	width: 90px;
	height: 90px;
	border-radius: 50%;
	overflow: hidden;
	background: #f8f8f8;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cc-modal-grid-item:hover .cc-modal-grid-thumb {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
	transform: scale(1.08);
}

.cc-modal-grid-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cc-modal-grid-thumb svg {
	width: 36px;
	height: 36px;
	color: #999;
}

.cc-grid-view-all .cc-modal-grid-thumb {
	background: #f0f0f0;
}

.cc-modal-grid-name {
	font-size: 12px;
	text-align: center;
	line-height: 1.3;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* =============================================
 * Mobile: Inline Split Layout (≤768px)
 * ============================================= */
@media (max-width: 768px) {
	.cc-modal-overlay {
		display: none !important;
	}
}
