/* Фильтры слева, каталог и штатный цикл WooCommerce справа. */
.g4-catalog-layout { display:grid; grid-template-columns:260px minmax(0,1fr); align-items:start; gap:28px; clear:both; margin-bottom:38px; }
.g4-catalog-sidebar,.g4-catalog-results { min-width:0; }
.g4-catalog-sidebar { scroll-margin-top:70px; }
.g4-catalog-results { display:flow-root; }
.g4-catalog-results>.g4-catalog-selection { margin-top:0; }
.g4-catalog-results .shop-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; clear:both; margin:0; padding:0; width:100%; }
.g4-catalog-results .shop-grid::before,.g4-catalog-results .shop-grid::after { content:none; display:none; }
.g4-catalog-results .shop-grid .shop-item:not(.shop-item--type-small) { width:100%; min-width:0; max-width:100%; margin:0; padding:0; }
.g4-catalog-results .shop-item__image { min-width:0; }
.g4-catalog-results .shop-item__image-inner { width:100%; min-width:0; aspect-ratio:1; }
.g4-catalog-results .shop-item__image-inner img { display:block; width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; }
.g4-filters-drawer { margin:0; }
.g4-filters-toggle { display:none; }
.g4-filters { --wp-admin-theme-color:#c20016; clear:both; box-sizing:border-box; margin:0; padding:20px; border:1px solid #e0e4df; border-radius:12px; background:#fff; color:#242929; }
.g4-filters *, .g4-filters *::before, .g4-filters *::after { box-sizing:border-box; }
.g4-filters-result { display:block; margin:0 0 22px; color:#717878; font-size:12px; }
.g4-filters-result strong { color:#343b3b; font-weight:600; }
.g4-filters-form { margin:0; }
.g4-filters-main { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; align-items:end; }
.g4-filters .g4-filters-field { display:flex; min-width:0; margin:0; flex-direction:column; gap:9px; }
.g4-filters-field>span:not(.select2),.g4-filters-field>label,.g4-filters-price legend { margin:0; padding:0; color:#333b3b; font-size:12px; font-weight:600; line-height:1.5; }
.g4-filters .g4-filters-field select,.g4-filters .g4-filters-field input,.g4-filters-price input { display:block; width:100%; min-width:0; max-width:100%; height:44px; margin:0; padding:0 12px; border:1px solid #d8dfd9; border-radius:6px; background-color:#fafbf9; color:#303838; font:inherit; font-size:13px; line-height:normal; box-shadow:none; }
.g4-filters .g4-filters-field select { padding-right:36px; text-overflow:ellipsis; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.5 3 3 3-3' stroke='%236d7771' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 13px center; }
.g4-filters input[type=number] { appearance:textfield; -moz-appearance:textfield; }
.g4-filters input[type=number]::-webkit-inner-spin-button,.g4-filters input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.g4-filters input[type=search] { appearance:none; }
.g4-filters-field--select { position:relative; }
.g4-filters .g4-filters-field select.select2-hidden-accessible { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; }
.g4-filters .select2-container { display:block; width:100% !important; min-width:0; font-size:13px; }
.g4-filters .select2-container .select2-selection--single { display:flex; align-items:center; width:100%; height:44px; min-height:44px; margin:0; padding:0 36px 0 12px; border:1px solid #d8dfd9; border-radius:6px; background:#fafbf9; color:#303838; font:inherit; line-height:normal; }
.g4-filters .select2-container .select2-selection--single .select2-selection__rendered { display:block; padding:0; color:inherit; font:inherit; line-height:1.4; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.g4-filters .select2-container .select2-selection--single .select2-selection__arrow { top:0; right:0; width:36px; height:42px; }
.g4-filters .select2-container .select2-selection--single .select2-selection__arrow b { width:6px; height:6px; margin:-5px 0 0 -3px; border:0; border-right:1.5px solid #6d7771; border-bottom:1.5px solid #6d7771; transform:rotate(45deg); }
.g4-filters .select2-container--open .select2-selection--single .select2-selection__arrow b { margin-top:-2px; transform:rotate(225deg); }
.g4-filters .select2-container--open .select2-selection--single,.g4-filters .select2-container--focus .select2-selection--single { border-color:#b86b74; box-shadow:0 0 0 2px #c2001610; }
.g4-filters .select2-container--open .select2-selection--single { border-color:#c20016; border-radius:6px 6px 0 0; background:#fff; box-shadow:none; }
.g4-filters .select2-dropdown { border:1px solid #c20016; border-top:0; border-radius:0 0 6px 6px; background:#fff; box-shadow:none; overflow:hidden; }
.g4-filters .select2-dropdown--below,.g4-filters .select2-dropdown--above { margin-top:0; }
.g4-filters .select2-search--dropdown { padding:8px; }
.g4-filters .select2-search--dropdown .select2-search__field { height:36px; padding:0 10px; border:1px solid #d8dfd9; border-radius:5px; background:#fafbf9; font-size:13px; font-weight:400; }
.g4-filters .select2-search__field::placeholder { font-weight:400; }
.g4-filters .select2-results__options { max-height:240px; margin:0; padding:5px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#c9d0c8 transparent; }
.g4-filters .select2-container--default .select2-results>.select2-results__options { max-height:240px; }
.g4-filters .select2-results__options::before,.g4-filters .select2-results__options::after,.g4-filters .select2-results__option::before { content:none; display:none; }
.g4-filters .select2-results__option { margin:0; padding:10px; border-radius:4px; color:#38413c; font-size:13px; font-weight:400; line-height:1.5; overflow-wrap:anywhere; }
.g4-filters .select2-results__option[aria-selected=true],.g4-filters .select2-results__option[data-selected=true] { background:#f9edf0; color:#a90016; }
/* Bono задаёт синий фон через !important; переопределяем только внутри фильтров. */
.g4-filters .select2-container--default .select2-results__option--highlighted[aria-selected],.g4-filters .select2-container--default .select2-results__option--highlighted[data-selected] { background-color:#f0f3ed !important; color:#242e26; }
.g4-filters .select2-results__option[aria-disabled=true] { color:#9ba49d; background:transparent; }
.g4-filters .select2-container--open { z-index:1000; }
/* SelectWoo считает top от документа. Внутри поля привязываем список к его нижнему краю. */
.g4-filters-field--select>.select2-container--open:not(.select2) { position:absolute; top:100% !important; left:0 !important; }
.g4-filters input::placeholder { color:#8a9292; opacity:1; }
.g4-filters .g4-filters-price { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:10px; min-width:0; margin:0; padding:0; border:0; }
.g4-filters-price legend { margin-bottom:9px; }
.g4-filters-price>label { min-width:0; margin:0; }
.g4-filters-price>span { color:#939b98; font-size:12px; }
.g4-filters .g4-filters-apply { display:flex; justify-content:space-between; align-items:center; gap:16px; width:100%; min-height:46px; padding:12px 17px; margin:22px 0 0; border:1px solid #c20016; border-radius:6px; background:#c20016; color:#fff; font:inherit; font-size:13px; font-weight:700; line-height:1.5; cursor:pointer; transition:background .18s; }
.g4-filters .g4-filters-apply:hover { background:#a50013; }
.g4-filters-apply>span { font-size:19px; font-weight:400; line-height:1; }
.g4-filters-specs { margin-top:22px; border-top:1px solid #e6e9e3; }
.g4-filters-specs summary { display:flex; align-items:center; gap:9px; padding:18px 0 0; color:#303939; font-size:13px; font-weight:650; list-style:none; cursor:pointer; }
.g4-filters-specs summary::-webkit-details-marker { display:none; }
.g4-filters-specs summary>span { display:inline-flex; align-items:center; justify-content:center; min-width:22px; height:22px; padding:0 6px; border-radius:5px; background:#f0f2ed; color:#6d7672; font-size:10px; }
.g4-filters-specs summary::after { content:"+"; display:block; margin-left:auto; color:#a90016; font-size:20px; font-weight:400; }
.g4-filters-specs[open] summary::after { content:"−"; }
.g4-filters-specs-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; padding-top:20px; }
.g4-filters-active { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding-top:20px; margin-top:20px; border-top:1px solid #e6e9e3; }
.g4-filters-active>a { display:inline-flex; align-items:center; gap:12px; max-width:100%; padding:8px 11px; border:1px solid #eadbdd; border-radius:6px; color:#7f323a; background:#fcf4f5; font-size:11px; line-height:1.5; overflow-wrap:anywhere; text-decoration:none; }
.g4-filters-active>a:hover { border-color:#bf8c94; color:#a90016; }
.g4-filters-active>a>span { font-size:17px; line-height:1; }
.g4-filters-active .g4-filters-reset { border:0; background:transparent; color:#6f7873; text-decoration:underline; text-underline-offset:3px; }
.g4-filters .g4-filters-empty { margin:20px 0 0; padding:16px; background:#f5f5f0; border-radius:6px; color:#626c65; font-size:13px; line-height:1.7; }
.g4-filters-empty a { color:#a90016; text-decoration:underline; }
.g4-filters :is(input,select,button,a,summary):focus-visible { outline:2px solid #a90016; outline-offset:3px; }
.g4-filters-feedback { margin:12px 0 0; color:#a90016; font-size:11px; line-height:1.6; }
.g4-filters-feedback:empty { display:none; }
@media(min-width:1600px) { .g4-catalog-layout { grid-template-columns:280px minmax(0,1fr); gap:32px; } .g4-catalog-results .shop-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(min-width:1101px) and (max-width:1249px) { .g4-catalog-results .shop-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:1100px) {
    .g4-catalog-layout { grid-template-columns:minmax(0,1fr); gap:26px; }
    .g4-catalog-results .shop-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .g4-filters-drawer { border:1px solid #e0e4df; border-radius:10px; }
    .g4-filters-toggle { display:flex; align-items:center; gap:10px; padding:17px 20px; background:#f6f7f3; color:#2a3330; font-size:13px; font-weight:650; line-height:1.5; list-style:none; cursor:pointer; }
    .g4-filters-toggle::-webkit-details-marker { display:none; }
    .g4-filters-toggle::after { content:"+"; margin-left:auto; color:#a90016; font-size:21px; font-weight:400; }
    .g4-filters-drawer[open]>.g4-filters-toggle::after { content:"−"; }
    .g4-filters-toggle>span { min-width:22px; padding:2px 6px; border-radius:4px; background:#eee3e5; color:#a90016; text-align:center; font-size:11px; }
    .g4-filters { border:0; border-top:1px solid #e0e4df; border-radius:0; }
    .g4-filters-main,.g4-filters-specs-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .g4-filters-toggle:focus-visible { outline:2px solid #a90016; outline-offset:-4px; }
}
@media(max-width:600px) { .g4-filters { padding:21px 17px; } .g4-catalog-sidebar { scroll-margin-top:58px; } .g4-filters-main,.g4-filters-specs-grid { grid-template-columns:minmax(0,1fr); gap:17px; } .g4-filters .g4-filters-field select,.g4-filters .g4-filters-field input,.g4-filters-price input,.g4-filters .select2-container,.g4-filters .select2-search--dropdown .select2-search__field { font-size:16px; } .g4-filters-specs summary { font-size:12px; } .g4-filters-field>span:not(.select2),.g4-filters-field>label,.g4-filters-price legend { font-size:12px; } .g4-filters-active>a { font-size:11px; } }
@media(max-width:480px) { .g4-catalog-results .shop-grid { grid-template-columns:minmax(0,1fr); } }
@media(prefers-reduced-motion:reduce) { .g4-filters * { transition:none !important; } }
