/* Category Display Widget CSS - v1.7.0 (Toggle Tag Links & Icon Styling) */

/* ======================================== */
/* Container & Basic Structure            */
/* ======================================== */
.elementor-widget-category_display .category-widget-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    transition-property: background, border-color, border-width, border-style, box-shadow;
    transition-timing-function: ease;
    transition-duration: 0.3s; /* Default, overridden by control */
}

.elementor-widget-category_display .category-title {
    display: block;
    line-height: 1.2;
    box-sizing: border-box;
    transition-property: color;
    transition-timing-function: ease;
    transition-duration: 0.3s; /* Default, overridden by control */
}

.elementor-widget-category_display .category-list-ajax-wrapper {
    transition: opacity 0.3s ease;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.elementor-widget-category_display .category-list-ajax-wrapper.loading {
    opacity: 0.5;
    pointer-events: none;
}

.elementor-widget-category_display .category-list {
	list-style: none;
	margin: 0;
	padding: 0;
    display: block;
    box-sizing: border-box;
}

.elementor-widget-category_display .category-list li {
    position: relative;
    box-sizing: border-box;
    display: flex;
    transition-property: background, color, border-color, border-width, border-style, box-shadow, transform;
    transition-timing-function: ease;
    transition-duration: 0.3s; /* Default, overridden by control */
    overflow: visible;
}

/* ======================================== */
/* Layout Specific Styles                 */
/* ======================================== */

/* --- List Layout --- */
.elementor-widget-category_display.category-layout-list .category-list li {
    flex-direction: column;
    width: 100%;
}

/* --- Grid Layout --- */
.elementor-widget-category_display.category-layout-grid .category-list {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
    gap: var(--grid-gap, 20px);
    width: 100%;
    box-sizing: border-box;
}

.elementor-widget-category_display.category-layout-grid .category-list li {
    flex-direction: column;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    min-width: 0;
}

.elementor-widget-category_display.grid-item-shape-square .category-list li { aspect-ratio: 1 / 1; }
.elementor-widget-category_display.grid-item-shape-rect_portrait .category-list li { aspect-ratio: 2 / 3; }
.elementor-widget-category_display.grid-item-shape-rect_landscape .category-list li { aspect-ratio: 3 / 2; }
.elementor-widget-category_display.grid-item-shape-rect_wide .category-list li { aspect-ratio: 16 / 9; }
.elementor-widget-category_display.category-layout-grid.grid-item-shape-circle .category-list > li {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
}


/* ======================================== */
/* Item Content & Components              */
/* ======================================== */

/* Item Link (Common) & Non-Linked Term Text */
.elementor-widget-category_display .category-list li a,
.elementor-widget-category_display .category-list li .term-text-plain { /* Apply to both links and plain text spans */
     text-decoration: none; /* Default for links, good to have for spans too if themes interfere */
     color: inherit; /* Inherit color from LI or specific text color controls */
     word-break: break-word;
     display: inline-flex;
     align-items: center;
     position: relative;
     z-index: 2;
}

/* Specifically for non-linked plain text tags */
.elementor-widget-category_display .category-list li .term-text-plain {
    cursor: default; /* Ensure no pointer cursor for non-linked items */
}


.elementor-widget-category_display .category-list li .term-name {
    display: inline-block;
}


.elementor-widget-category_display.category-layout-list .category-list li .term-text-badge-wrapper a,
.elementor-widget-category_display.category-layout-list .category-list li .term-text-badge-wrapper .term-text-plain { /* Apply to non-linked text in list wrapper too */
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
}

.elementor-widget-category_display.category-layout-grid .category-list li a,
.elementor-widget-category_display.category-layout-grid .category-list li .term-text-plain { /* Apply to non-linked text in grid too */
    flex-grow: 0;
    white-space: normal;
    overflow: visible;
}

.elementor-widget-category_display.category-layout-list .term-text-badge-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
    order: 1;
}


.elementor-widget-category_display.category-layout-grid .category-list li .term-content-wrapper {
    display: block;
    text-align: inherit;
    width: auto;
    max-width: 100%;
    margin-bottom: 0;
    z-index: 2;
    position: relative;
    order: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.elementor-widget-category_display.category-layout-grid .category-list li.has-background-image {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    isolation: isolate;
}
.elementor-widget-category_display.category-layout-grid .category-list li.has-background-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 1);
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}

.elementor-widget-category_display .category-list li .badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	white-space: nowrap;
    box-sizing: border-box;
    position: relative;
    vertical-align: middle;
    z-index: 2;
    flex-shrink: 0;
    border-radius: 50%;
    clip-path: none;
}

.elementor-widget-category_display.badge-shape-square li .badge { border-radius: 0; }
.elementor-widget-category_display.badge-shape-rounded li .badge { border-radius: 5px; }
.elementor-widget-category_display.badge-shape-star li .badge { border-radius: 0 !important; }
.elementor-widget-category_display.badge-shape-hexagon li .badge { border-radius: 0 !important; }


.elementor-widget-category_display.category-layout-list .badge {
    position: static;
    transform: none;
}

.elementor-widget-category_display.category-layout-grid .badge {
     order: 2;
     margin-top: 8px;
}

/* ======================================== */
/* Tag Icon Styling                       */
/* ======================================== */
.elementor-widget-category_display .category-list li .term-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: contain;
    flex-shrink: 0;
}

.elementor-widget-category_display.category-layout-list .term-text-badge-wrapper .term-name {
    flex-grow: 1;
}


/* Post Count Bar */
.elementor-widget-category_display .post-count-bar-container {
    position: relative;
    overflow: visible !important;
}

.elementor-widget-category_display.category-layout-list .post-count-bar-container {
    width: 100%;
    margin-left: 0;
    order: 2;
}

.elementor-widget-category_display .post-count-bar {
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.5s ease, box-shadow 0.3s ease;
    z-index: 1;
}

.elementor-widget-category_display.bar-style-dotted .post-count-bar {
	background-image: linear-gradient(to right, currentColor 50%, transparent 50%);
	background-size: 8px 100%;
	background-repeat: repeat-x;
    background-color: transparent !important;
    box-shadow: none !important;
}
.elementor-widget-category_display.bar-style-double .post-count-bar {
	height: calc(50% - 1px);
	top: 0;
    box-shadow: none !important;
}
.elementor-widget-category_display.bar-style-double .post-count-bar::after {
	content: '';
	position: absolute;
	bottom: calc(-100% - 1px);
	left: 0;
	width: 100%;
	height: 100%;
	background: inherit;
	border-radius: inherit;
}

.elementor-widget-category_display.category-layout-grid .post-count-bar-container {
    order: 3;
    align-self: center;
    max-width: 90%;
    width: 90%;
    margin-left: 0;
}

/* ======================================== */
/* Hover Effects                          */
/* ======================================== */

.elementor-widget-category_display.item-hover-effect-translate-y li:hover { transform: translateY(-5px); }
.elementor-widget-category_display.item-hover-effect-scale li:hover { transform: scale(1.05); z-index: 10; }
.elementor-widget-category_display.item-hover-effect-translate-x li:hover { transform: translateX(5px); }

/* ======================================== */
/* Pagination                             */
/* ======================================== */
.elementor-widget-category_display .category-pagination {
    margin-top: 20px;
    text-align: center;
}
.elementor-widget-category_display .category-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
}
.elementor-widget-category_display .category-pagination li {
    display: inline-block;
}
.elementor-widget-category_display .category-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
    min-width: 2.5em;
    min-height: 2.5em;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}
.elementor-widget-category_display .category-pagination .page-numbers.current {
    cursor: default;
}

/* ======================================== */
/* Scrollbar Styling (Webkit/Firefox)     */
/* ======================================== */
.elementor-widget-category_display .category-widget-container.scroll-enabled {
    overflow-y: auto;
    --scrollbar-track-color: rgba(255, 255, 255, 0.05);
    --scrollbar-thumb-color: #0073aa;
    --scrollbar-thumb-hover-color: #228be6;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
}
.elementor-widget-category_display .category-widget-container.scroll-enabled::-webkit-scrollbar {
    width: 8px;
}
.elementor-widget-category_display .category-widget-container.scroll-enabled::-webkit-scrollbar-track {
    background: var(--scrollbar-track-color);
    border-radius: 4px;
}
.elementor-widget-category_display .category-widget-container.scroll-enabled::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-color);
    border-radius: 4px;
    border: 2px solid var(--scrollbar-track-color);
}
.elementor-widget-category_display .category-widget-container.scroll-enabled::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-color);
}

/* ======================================== */
/* Alignment Fixes (using prefix class)   */
/* ======================================== */
.elementor-widget-category_display .category-list li.elementor-align-left { align-items: flex-start; text-align: left; }
.elementor-widget-category_display .category-list li.elementor-align-center { align-items: center; text-align: center; }
.elementor-widget-category_display .category-list li.elementor-align-right { align-items: flex-end; text-align: right; }

.elementor-widget-category_display.category-layout-list li.elementor-align-left .term-text-badge-wrapper { justify-content: flex-start; }
.elementor-widget-category_display.category-layout-list li.elementor-align-center .term-text-badge-wrapper { justify-content: center; }
.elementor-widget-category_display.category-layout-list li.elementor-align-right .term-text-badge-wrapper { justify-content: flex-end; }


/* ======================================== */
/* Responsiveness (Placeholders)          */
/* ======================================== */
@media (max-width: 1024px) { /* Tablet */ }
@media (max-width: 767px) { /* Mobile */ }
