diff --git a/cssselect/parser.py b/cssselect/parser.py
index 97e146b..584dfea 100644
--- a/cssselect/parser.py
+++ b/cssselect/parser.py
@@ -625,6 +625,12 @@ def parse_simple_selector(stream, inside_negation=False):
                     if not (
                         len(stream.used) == 2
                         or (len(stream.used) == 3 and stream.used[0].type == "S")
+                        or (len(stream.used) >= 3 and stream.used[-3].is_delim(","))
+                        or (
+                            len(stream.used) >= 4
+                            and stream.used[-3].type == "S"
+                            and stream.used[-4].is_delim(",")
+                        )
                     ):
                         raise SelectorSyntaxError(
                             'Got immediate child pseudo-element ":scope" '

[bug] parse() fails if :scope present in second element of selector list
As of v1.1.0,  cssselect.parse() seems to have problems parsing the ":scope" psuedo-class if the input string is a selector list, and ":scope" occurs in any clause besides the first one.

Ones that successfully parse as expected: 
* ``parse(":scope > th")``
* ``parse(":scope > th, td")``
* ``parse(":scope > th, table > td")``

However, all of the following unexpectedly (at least to me) throw *SelectorSyntaxError('Got immediate child pseudo-element ":scope" not at the start of a selector')*:
* ``parse("th, :scope > td")``
* ``parse("table > th, :scope > td")``
* ``parse(":scope > th, :scope > td")``

(I'd submit a PR for this, but looking at the location of the error, I'm not familiar enough with the internals to suggest what the right thing to do is!).
diff --git a/tests/test_cssselect.py b/tests/test_cssselect.py
index 589a081..693684b 100644
--- a/tests/test_cssselect.py
+++ b/tests/test_cssselect.py
@@ -230,6 +230,14 @@ class TestCssselect(unittest.TestCase):
             ("CombinedSelector[Pseudo[Element[*]:scope] > Element[div]]", None),
             ("CombinedSelector[Element[foo] <followed> Element[bar]]", None),
         ]
+        assert parse_pseudo("foo bar, :scope > div") == [
+            ("CombinedSelector[Element[foo] <followed> Element[bar]]", None),
+            ("CombinedSelector[Pseudo[Element[*]:scope] > Element[div]]", None),
+        ]
+        assert parse_pseudo("foo bar,:scope > div") == [
+            ("CombinedSelector[Element[foo] <followed> Element[bar]]", None),
+            ("CombinedSelector[Pseudo[Element[*]:scope] > Element[div]]", None),
+        ]
         assert parse_pseudo("foo:before, bar, baz:after") == [
             ("Element[foo]", "before"),
             ("Element[bar]", None),

pip install -e .
parse_log_pytest
requirements.txt
lxml>=4.4 pytest-cov>=2.8 pytest>=5.4 sybil
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
-e git+https://github.com/scrapy/cssselect.git@1514eff03185fe96b8e49946ef528097a0179bf8#egg=cssselect
exceptiongroup==1.2.2
iniconfig==2.1.0
lxml==5.3.1
packaging==24.2
pluggy==1.5.0
pytest==8.3.5
pytest-cov==6.0.0
sybil==9.1.0
tomli==2.2.1

name: cssselect
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - cssselect==1.1.0
      - exceptiongroup==1.2.2
      - iniconfig==2.1.0
      - lxml==5.3.1
      - packaging==24.2
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - sybil==9.1.0
      - tomli==2.2.1
prefix: /opt/conda/envs/cssselect

tests/test_cssselect.py::TestCssselect::test_pseudo_elements
tests/test_cssselect.py::TestCssselect::test_argument_types tests/test_cssselect.py::TestCssselect::test_css_export tests/test_cssselect.py::TestCssselect::test_lang tests/test_cssselect.py::TestCssselect::test_parse_errors tests/test_cssselect.py::TestCssselect::test_parser tests/test_cssselect.py::TestCssselect::test_quoting tests/test_cssselect.py::TestCssselect::test_select tests/test_cssselect.py::TestCssselect::test_select_shakespeare tests/test_cssselect.py::TestCssselect::test_series tests/test_cssselect.py::TestCssselect::test_specificity tests/test_cssselect.py::TestCssselect::test_tokenizer tests/test_cssselect.py::TestCssselect::test_translation tests/test_cssselect.py::TestCssselect::test_unicode tests/test_cssselect.py::TestCssselect::test_unicode_escapes tests/test_cssselect.py::TestCssselect::test_xpath_pseudo_elements
cssselect/parser.py
cssselect/parser.py