/* Selected Filters Styles */
.selected-filters-container {
    margin-top: 15px;
    padding: 10px 0;
    position: relative; /* Ensure container doesn't affect parent layout */
    display: none; /* Hidden by default on all devices */
}

/* Full-width container for selected filters */
.selected-filters-full-width-container {
    width: 100%;
    background-color: #ffffff;
    padding: 15px 20px;
    margin-top: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: none; /* Hidden by default, shown via JavaScript */
}

/* Active state for filter buttons when any filter has selected items */
.filter-buttons-active .category-filter-container,
.filter-buttons-active .attribute-filter-container,
.filter-buttons-active .sorting-filter-container {
    transform: translateY(-10px);
    transition: transform 0.3s ease;
}

/* Add active state to the parent container when any filter has selected items */
body.has-selected-filters .category-filter-container,
body.has-selected-filters .attribute-filter-container,
body.has-selected-filters .sorting-filter-container {
    transform: translateY(-10px);
    transition: transform 0.3s ease;
}

.selected-filters-list {
    display: flex;
    flex-wrap: nowrap; /* Changed to nowrap for side-by-side display */
    gap: 8px;
    align-items: center;
    overflow-x: auto; /* Allow horizontal scrolling if needed */
}

.selected-filter-item {
    display: inline-flex;
    align-items: center;
    background-color: rgba(0, 93, 82, 0.1); /* Updated background color */
    border-radius: 4px; /* Updated border radius */
    padding: 6px 5px; /* Updated padding: 6px top/bottom, 5px left/right */
    font-size: 12px; /* Updated font size */
    color: #005D52; /* Updated text color */
    font-weight: 300; /* Updated font weight */
    transition: all 0.3s ease;
    cursor: pointer;
    max-width: 200px;
    position: relative;
    flex-shrink: 0; /* Prevent shrinking */
}

.selected-filter-item:hover {
    background-color: rgba(0, 93, 82, 0.15); /* Slightly darker on hover */
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.selected-filter-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #005D52; /* Updated border color */
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    color: #005D52; /* Updated icon color */
}

.selected-filter-remove:hover {
    background-color: rgba(0, 93, 82, 0.2); /* Reduced opacity hover effect */
    color: #005D52; /* Keep icon color consistent */
    transform: scale(1.1);
}

.selected-filter-remove svg {
    width: 8px;
    height: 8px;
    transition: all 0.3s ease;
}

.selected-filter-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    font-weight: 300; /* Updated font weight */
}

/* Loading state */
.selected-filter-item.removing {
    opacity: 0.7;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 1px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .selected-filters-container {
        margin-top: 10px;
        padding: 8px 0;
        display: block; /* Show on mobile devices */
    }
    
    .selected-filters-full-width-container {
        padding: 12px 15px;
        margin-top: 8px;
        display: block; /* Show on mobile devices */
    }
    
    /* Reduce the upward movement on mobile for better UX */
    body.has-selected-filters .category-filter-container,
    body.has-selected-filters .attribute-filter-container,
    body.has-selected-filters .sorting-filter-container {
        transform: translateY(-5px);
    }
    
    .selected-filter-item {
        font-size: 11px; /* Slightly smaller on mobile */
        padding: 5px 4px; /* Adjusted padding for mobile */
        max-width: 150px;
    }
    
    .selected-filter-name {
        max-width: 100px;
    }
}

/* Hide selected filters on tablet and desktop */
@media (min-width: 769px) {
    .selected-filters-container,
    .selected-filters-full-width-container {
        display: none !important; /* Force hide on tablet and desktop */
    }
    
    /* Remove the upward movement effect on desktop/tablet */
    body.has-selected-filters .category-filter-container,
    body.has-selected-filters .attribute-filter-container,
    body.has-selected-filters .sorting-filter-container {
        transform: none;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .selected-filters-full-width-container {
        background-color: #1a1a1a;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }
    
    .selected-filter-item {
        background-color: rgba(0, 93, 82, 0.2); /* Darker background for dark theme */
        border-color: #005D52;
        color: #005D52;
    }
    
    .selected-filter-item:hover {
        background-color: rgba(0, 93, 82, 0.3); /* Darker hover for dark theme */
        border-color: #005D52;
    }
    
    .selected-filter-remove {
        border-color: #005D52;
        color: #005D52;
    }
    
    .selected-filter-remove:hover {
        background-color: rgba(0, 93, 82, 0.4);
        color: #005D52;
    }
} 