/* Product Filters with Native Select Elements */

/* Filter container */
.ruoungon24h-product-filters {
    margin-bottom: 2rem;
}

/* Filter items */
.filter-item {
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
    position: relative;
}

/* Filter button styling */
.filter-button {
    height: 40px;
    padding: 0 1rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #4b5563;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-button:hover {
    background-color: #f3f4f6;
}

.filter-button.active {
    border-color: #720213;
    color: #720213;
}

.filter-button .selected-value {
    color: #720213;
    font-weight: 500;

	font-size: 13px;
}

.filter-button .dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.filter-item:has(.filter-dropdown.open) .dropdown-icon {
    transform: rotate(180deg);
}

/* Filter dropdown styling */
.filter-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    min-width: 100px;
    max-height: 300px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    display: none;
	width: 150px;
	max-width: 150px;
}

.filter-dropdown.open {
    display: block;
	position: absolute;
	top: 40px;
}

.filter-options {
    padding: 0.5rem 0;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #4b5563;
    text-decoration: none;
    transition: background-color 0.2s ease;
	font-size: 14px;
}

.filter-option:hover {
    background-color: #f3f4f6;
}

.filter-option.selected {
    color: #720213;
    font-weight: 500;
}

.filter-option .option-checkbox {
    color: #6b7280;
}

.filter-option.selected .option-checkbox {
    color: #720213;
}

.filter-option .option-count {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-left: auto;
}

.filter-option.clear-option {
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    color: #ef4444;
}

/* Active filter styling */
.filter-item.active-filter .filter-button {
    border-color: #720213;
    color: #720213;

	&>span {
		&:first-child {
			display: none;
		}
	}
}

/* Filter button styling */
#filter-toggle-button {
    height: 40px;
    padding: 0 1rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
	pointer-events: none;
}

#filter-toggle-button:hover {
    background-color: #f3f4f6;
}

#filter-toggle-button.has-active-filters {
    border-color: #720213;
    color: #720213;
}

/* Filter count badge */
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background-color: #720213;
    color: #fff;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* Active filters display */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.active-filters-label {
    font-weight: 500;
    color: #4b5563;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: #f9fafb;
    border: 1px solid #720213;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #720213;
}

.remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #720213;
    text-decoration: none;
}

.remove-filter:hover {
    color: #4b0110;
}

/* WooCommerce ordering dropdown styling */
.woocommerce-ordering select {
    height: 40px;
    padding: 0 2rem 0 1rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #4b5563;
    font-size: 0.875rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
    min-width: 150px;
}

/* Mobile styles */
@media (max-width: 768px) {
    .filter-item {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem; /* Only add margin-bottom on mobile */
    }

    .filter-button {
        width: 100%;
        justify-content: space-between;
    }

    .filter-dropdown {
        width: 100%;
        position: relative;
        margin-top: 0.25rem;
    }

    .woocommerce-ordering {
        width: 100%;
    }

    .woocommerce-ordering select {
        width: 100%;
    }
}
