/* Category Filter Widget Styles */
.robot-category-filter-widget .robot-product-categories {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar styling for category list */
.robot-category-filter-widget .robot-product-categories::-webkit-scrollbar {
    width: 6px;
}

.robot-category-filter-widget .robot-product-categories::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.robot-category-filter-widget .robot-product-categories::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.robot-category-filter-widget .robot-product-categories::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.robot-category-filter-widget .robot-product-categories .robot-cat-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eee;
    display: block;
    width: 100%;
}

.robot-category-filter-widget .robot-product-categories .robot-cat-item:last-child {
    border-bottom: none;
}

/* Make the entire list item clickable */
.robot-cat-item {
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.robot-cat-item:hover {
    background-color: #f5f5f5;
}

/* Hide any duplicate checkboxes from WooCommerce/WoodMart */
.robot-category-filter-widget input[type="checkbox"]:not(.robot-cat-checkbox) {
    display: none !important;
}

/* Only show our custom checkbox */
.robot-category-filter-widget li::before {
    display: none !important;
}

/* Checkbox label container - now an anchor - full width clickable */
.robot-category-filter-widget .robot-cat-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
    padding: 8px 0;
    text-decoration: none;
    color: inherit;
}

.robot-category-filter-widget .robot-cat-checkbox-label:hover {
    text-decoration: none;
}

/* Category name span */
.robot-category-filter-widget .robot-cat-name {
    flex: 1;
    color: #333;
    transition: color 0.3s ease;
}

.robot-category-filter-widget .robot-cat-checkbox-label:hover .robot-cat-name {
    color: #0073aa;
}

/* Prevent label from generating pseudo elements */
.robot-category-filter-widget .robot-cat-checkbox-label::before,
.robot-category-filter-widget .robot-cat-checkbox-label::after {
    display: none !important;
    content: none !important;
}

/* Checkbox styling */
.robot-category-filter-widget .robot-cat-checkbox {
    margin: 0 !important;
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    pointer-events: auto;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    appearance: checkbox;
}

.robot-category-filter-widget .robot-product-categories .robot-cat-item a {
    text-decoration: none;
    color: inherit;
}

.robot-category-filter-widget .robot-product-categories .robot-cat-item a:hover {
    text-decoration: none;
}

/* All categories button - styled like regular items */
.robot-category-filter-widget .robot-all-categories {
    border-bottom: 1px solid #eee !important;
    margin-bottom: 0;
}

.robot-category-filter-widget .robot-all-categories .robot-cat-checkbox-label {
    font-weight: normal;
    color: inherit;
}

.robot-category-filter-widget .robot-all-categories a {
    color: inherit;
    font-weight: normal;
}

/* Selected parent category (bold) */
.robot-category-filter-widget .robot-product-categories .robot-cat-item.robot-cat-parent-selected .robot-cat-name {
    font-weight: bold !important;
    font-size: 1.1em;
    color: #0073aa;
}

/* Current active category */
.robot-category-filter-widget .robot-product-categories .robot-cat-item.robot-current-cat .robot-cat-name {
    color: #0073aa;
    font-weight: 600;
}

.robot-category-filter-widget .robot-product-categories .robot-count {
    color: #999;
    font-size: 0.9em;
    margin-left: 5px;
}

/* Nested categories */
.robot-category-filter-widget .robot-product-categories ul.robot-children {
    list-style: none;
    margin: 8px 0 0 0;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
}

.robot-category-filter-widget .robot-product-categories ul.robot-children .robot-cat-item {
    padding: 6px 0;
    font-size: 0.95em;
    display: block;
    width: 100%;
}

.robot-category-filter-widget .robot-product-categories ul.robot-children .robot-cat-item a {
    color: inherit;
}

.robot-category-filter-widget .robot-product-categories ul.robot-children .robot-cat-item .robot-cat-name {
    color: #666;
}

.robot-category-filter-widget .robot-product-categories ul.robot-children .robot-cat-item.robot-current-cat .robot-cat-name {
    color: #0073aa;
    font-weight: 600;
}

/* Deeply nested categories (level 3+) */
.robot-category-filter-widget .robot-product-categories ul.robot-children ul.robot-children {
    padding-left: 20px;
    border-left: 1px dashed #ddd;
    margin-left: 10px;
}

.robot-category-filter-widget .robot-product-categories ul.robot-children ul.robot-children .robot-cat-item {
    padding: 4px 0;
    font-size: 0.9em;
}

.robot-category-filter-widget .robot-product-categories ul.robot-children ul.robot-children .robot-cat-item .robot-cat-name {
    color: #888;
}

/* Price Filter Custom Inputs */
.robot-price-custom-inputs {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* Unified Search Input for All Filter Widgets */
.robot-filter-search-wrapper {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.robot-filter-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
    text-align: right;
    direction: rtl;
}

.robot-filter-search:focus {
    outline: none;
    border-color: #0073aa;
}

.robot-filter-search::placeholder {
    color: #999;
}

/* Legacy support - keep old classes for backwards compatibility */
.robot-attribute-search-wrapper,
.robot-category-search-wrapper {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.robot-attribute-search,
.robot-category-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
    text-align: right;
    direction: rtl;
}

.robot-attribute-search:focus,
.robot-category-search:focus {
    outline: none;
    border-color: #0073aa;
}

.robot-attribute-search::placeholder,
.robot-category-search::placeholder {
    color: #999;
}

/* No results message */
.robot-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
    list-style: none;
    border: none !important;
}

/* Attribute color/image swatches */
.robot-attribute-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ddd;
    margin-right: auto;
    margin-left: 10px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.robot-current-cat .robot-attribute-swatch {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Attribute item layout with swatch - full width clickable */
.robot-attribute-filter-widget .robot-cat-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.robot-attribute-filter-widget .robot-cat-item:hover .robot-cat-checkbox-label {
    background-color: #f5f5f5;
}

.robot-attribute-filter-widget .robot-cat-name {
    flex: 1;
}

/* Attribute and Price list items - full width clickable */
.robot-price-list .robot-cat-item,
.robot-attribute-list .robot-cat-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eee;
    display: block;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.robot-price-list .robot-cat-item:hover,
.robot-attribute-list .robot-cat-item:hover {
    background-color: #f5f5f5;
}

.robot-price-list .robot-cat-item:last-child,
.robot-attribute-list .robot-cat-item:last-child {
    border-bottom: none;
}

/* Price filter items - specific padding */
.robot-price-list .robot-cat-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

/* Attribute filter items - specific padding */
.robot-attribute-list .robot-cat-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

/* Price and Attribute Filter Lists */
.robot-price-list,
.robot-attribute-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar styling for price and attribute lists */
.robot-price-list::-webkit-scrollbar,
.robot-attribute-list::-webkit-scrollbar {
    width: 6px;
}

.robot-price-list::-webkit-scrollbar-track,
.robot-attribute-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.robot-price-list::-webkit-scrollbar-thumb,
.robot-attribute-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.robot-price-list::-webkit-scrollbar-thumb:hover,
.robot-attribute-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.robot-price-inputs-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.robot-price-input-group {
    flex: 1;
    min-width: 120px;
}

.robot-price-input-group input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
    text-align: center;
}

.robot-price-input-group input[type="number"]:focus {
    outline: none;
    border-color: #0073aa;
}

.robot-price-input-group input[type="number"]::placeholder {
    color: #999;
    font-weight: 500;
}

.robot-price-filter-button {
    width: 100%;
    padding: 10px 15px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.robot-price-filter-button:hover {
    background-color: #005a87;
}

.robot-price-custom-inputs form {
    margin: 0;
    padding: 0;
}

/* Attribute Loading Indicator */
.robot-attribute-loading {
    text-align: center;
    padding: 15px;
    color: #999;
    font-size: 0.9em;
}

.robot-loading-spinner {
    display: inline-block;
    position: relative;
}

.robot-loading-spinner::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: robot-spin 1s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes robot-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth transitions for attribute list */
.robot-attribute-list {
    transition: opacity 0.3s ease;
}

/* Search input enhanced styling */
.robot-attribute-search-ajax {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="%23999"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: 10px center;
    padding-right: 35px;
}

/* Load More Button */
.robot-attribute-load-more-wrapper {
    text-align: center;
    padding: 10px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.robot-attribute-load-more-btn {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-weight: 500;
}

.robot-attribute-load-more-btn:hover {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.robot-attribute-load-more-btn:active {
    transform: translateY(1px);
}

.robot-attribute-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
