.sub-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;


}

.sub-categories a {
    border: 1px solid #d1d1d1;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-categories a.active,
.sub-categories a:hover {
    border-color: var(--primary-color);
}

/* Product Filter Wrap */
.product-filter-wrap {
    margin-bottom: 1rem;
}

/* Filter Trigger Button - Flat Style */
.filter-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

.filter-trigger-btn:hover {
    border-color: var(--theme-color, #3b82f6);
    background-color: #f9fafb;
}

.filter-trigger-btn svg {
    width: 16px;
    height: 16px;
}

/* Flat Sorting Buttons */
.product-sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    color: #000;
    margin: 0;
}

.sort-btn:hover {
    border-color: var(--theme-color, #3b82f6);
    background-color: #f9fafb;
}

.sort-btn.active {
    border-color: var(--theme-color, #3b82f6);
    background-color: var(--theme-color, #3b82f6);
    color: white;
}

.sort-btn svg {
    width: 16px;
    height: 16px;
}

/* Selected Filters Display - Chips with Remove Button */
#selected-filters-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background-color: #FFF;
    color: #374151;
    font-size: 13px;
    font-weight: 500;

}

.selected-filter-chip .remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    margin: 0;
}

.selected-filter-chip .remove-filter:hover {
    color: #ef4444;
}

.clear-all-filters {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    background-color: transparent;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: underline;
}

.clear-all-filters:hover {
    color: #2563eb;
}

.filter-section {
    margin-top: 5px;
}

/* Filter Section Content */
.filter-section-content {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

/* Modal Overlay */
.product-filter-modal {
    width: 800px;
    position: absolute;
    top: 100%;
    left: 0;
    height: 100%;
    z-index: 9999;
    display: none;
}

.product-filter-modal.active {
    display: block;
}

.product-filter-btn-wrap {
    position: relative;

}

/* Modal Container */
.product-filter-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(0%, -10%);
    }

    to {
        opacity: 1;
        transform: translate(0%, 0%);
    }
}

/* Modal Header */
.product-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.product-filter-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.product-filter-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    margin: 0;
}

.product-filter-close:hover {
    color: #111827;
}

/* Modal Body */
.product-filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    max-height: calc(100vh - 200px);
}

/* Filter Section */

.filter-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}



/* Scrollable Content (max-height: 300px) */
.filter-scrollable {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.filter-scrollable::-webkit-scrollbar {
    width: 6px;
}

.filter-scrollable::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.filter-scrollable::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.filter-scrollable::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Brand/Category Checkbox Items */
.filter-checkbox-item {
    display: flex;
    align-items: stretch;
    margin-bottom: 5px;
    font-size: 14px;
}

.filter-brand-logo-wrap {
    padding: 5px;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FFF;
}

.filter-checkbox-item:hover {
    border-color: var(--theme-color, #3b82f6);
}

.filter-checkbox-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    opacity: 0;
    width: 1px;
    height: 1px;
}



.filter-checkbox-item:hover .filter-brand-logo-wrap {
    border-color: var(--theme-color, #3b82f6);
}

.filter-checkbox-item input[type="checkbox"]:checked~.filter-brand-logo-wrap {
    border-color: var(--theme-color, #3b82f6);

}

.filter-brand-logo {
    width: auto;
    max-height: 30px;
    object-fit: contain;
    object-position: center;
}

/* Price Range Grid */
.filter-price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.filter-price-btn {
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    margin: 0;
}

.filter-price-btn:hover {
    border-color: var(--theme-color, #3b82f6);
    background-color: #f9fafb;
}

.filter-price-btn.active {
    border-color: var(--theme-color, #3b82f6);
    background-color: var(--theme-color, #3b82f6);
    color: white;
    font-weight: 600;
}

/* Attributes Grid (3 columns) */
.filter-attributes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 15px;
}

/* Attribute Buttons */
.filter-attr-btn {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background-color: white;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-attr-btn:hover {
    border-color: var(--theme-color, #3b82f6);
    background-color: #f9fafb;
}

.filter-attr-btn.active {
    border-color: var(--theme-color, #3b82f6);
    background-color: var(--theme-color, #3b82f6);
    color: white;
    font-weight: 600;
}

/* Modal Footer */
.product-filter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    gap: 12px;
}

.product-filter-footer .button {
    flex: 1;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

#product-filter-reset {
    background-color: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

#product-filter-reset:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

#product-filter-apply {
    background-color: var(--theme-color, #3b82f6);
    color: white;
    border: none;
}

#product-filter-apply:hover {
    opacity: 0.9;
}

/* Loading Overlay */
.product-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: var(--theme-color, #3b82f6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.load-more-products {
    background: #ffd022;
    border: 0;
    border-radius: 5px;
    padding: 7px 13px;

}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Attribute Dropdown Styles */
.attribute-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.attribute-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

.attribute-dropdown-trigger:hover {
    border-color: var(--theme-color, #3b82f6);
    background-color: #f9fafb;
}

.attribute-dropdown-trigger.active {
    border-color: var(--theme-color, #3b82f6);
    background-color: var(--theme-color, #3b82f6);
    color: white;
}

.attribute-dropdown-trigger svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.attribute-dropdown-trigger.active svg {
    transform: rotate(180deg);
}

/* Attribute Dropdown Popover */
.attribute-dropdown-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
}

.attribute-dropdown-popover.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.attribute-dropdown-content {
    display: flex;
    flex-direction: column;
}

.attribute-dropdown-options {
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.attribute-dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.attribute-dropdown-options::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.attribute-dropdown-options::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.attribute-dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Filter Attribute Buttons in Popover */
.filter-attr-btn-popover {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background-color: white;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin: 0;
}

.filter-attr-btn-popover:hover {
    border-color: var(--theme-color, #3b82f6);
    background-color: #f9fafb;
}

.filter-attr-btn-popover.active {
    border-color: var(--theme-color, #3b82f6);
    background-color: var(--theme-color, #3b82f6);
    color: white;
    font-weight: 600;
}

/* Attribute Dropdown Footer */
.attribute-dropdown-footer {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
}

.attribute-dropdown-close,
.attribute-dropdown-apply {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    margin: 0;
}

.attribute-dropdown-close {
    background-color: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.attribute-dropdown-close:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.attribute-dropdown-apply {
    background-color: var(--theme-color, #3b82f6);
    color: white;
}

.attribute-dropdown-apply:hover {
    opacity: 0.9;
}

/* Price Dropdown Specific Styles */
.price-dropdown-popover {
    min-width: 400px;
}

.price-dropdown-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    max-height: 400px;
}

.filter-price-btn-popover {
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    margin: 0;
    white-space: nowrap;
}

.filter-price-btn-popover:hover {
    border-color: var(--theme-color, #3b82f6);
    background-color: #f9fafb;
}

.filter-price-btn-popover.active {
    border-color: var(--theme-color, #3b82f6);
    background-color: var(--theme-color, #3b82f6);
    color: white;
    font-weight: 600;
}

/* Responsive Design */

@media (max-width: 1024px) {
    .filter-attributes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-filter-modal {
        width: 375px;
    }

    .product-filter-container {
        width: 95%;
        max-height: 95vh;
    }

    .filter-attributes-grid {
        grid-template-columns: 1fr;
    }

    .filter-price-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-filter-header,
    .product-filter-body,
    .product-filter-footer {
        padding: 10px;
    }

    .product-filter-footer {
        flex-direction: column;
    }

    .product-filter-footer .button {
        width: 100%;
    }

    #product-orderby {
        width: 100%;
        min-width: auto;
    }

    /* Hide attribute dropdowns on mobile, use modal instead */
    .attribute-dropdown-wrap {
        display: none;
    }

    .product-sort-wrap {
        display: flex;
        gap: 5px;
        overflow-x: auto;
    }

    .sort-btn {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {}