/* Новая страница категории, «Скидки и акции» и поиска (прототип ?v2=1). Контейнер: #product-category (категория), #product-search (акции, поиск) или #product-manufacturer (страница бренда). */
:root{--cc-gold:#be9e6e;--cc-gold-d:#a6874c;--cc-ink:#17171a;--cc-text:#313131;--cc-muted:#7a7a7a;--cc-line:#e8e2d8;--cc-bg:#f7f5f2}

/* подразделы — ряд плиток с прокруткой */
.subcategories_block{display:flex!important;flex-wrap:nowrap!important;gap:12px;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:thin;padding:4px 0 14px!important;margin:0 auto!important;width:auto!important;justify-content:flex-start!important}
/* лента подразделов — по ширине колонки страницы (как .container) */
@media (min-width:768px){.subcategories_block{max-width:720px}}
@media (min-width:992px){.subcategories_block{max-width:940px}}
@media (min-width:1230px){.subcategories_block{max-width:1200px}}
/* «Показать: 25/50…» не нужно — 24 товара и «Показать ещё» */
:is(#product-category,#product-search,#product-manufacturer) .sorting_item:has(#input-limit){display:none!important}
.subcategories_item{flex:0 0 132px!important;width:132px!important;max-width:none!important;margin:0!important;padding:10px 8px 12px!important;background:#fff;border:1px solid var(--cc-line);scroll-snap-align:start;display:flex!important;flex-direction:column;align-items:center;text-decoration:none!important;transition:border-color .2s}
.subcategories_item:hover{border-color:var(--cc-gold)}
.subcategories_img{height:84px!important;width:100%!important;display:flex;align-items:center;justify-content:center;margin:0 0 8px!important}
.subcategories_img img{max-height:84px!important;max-width:100%!important;width:auto!important;height:auto!important;object-fit:contain}
.subcategories_name{font-size:12px!important;line-height:1.3!important;letter-spacing:.02em;text-align:center;color:var(--cc-ink)!important;text-transform:none!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.6em}

/* полоса выгод — тот же HTML-модуль, что на главной, компактно */
.cc-benefits{margin:0 0 18px}
.cc-benefits ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--cc-line);background:var(--cc-bg)}
.cc-benefits li{padding:10px 14px;border-left:1px solid var(--cc-line);font-size:0;line-height:0}
.cc-benefits li:first-child{border-left:0}
.cc-benefits li strong{display:block;font-size:13px;line-height:1.3;font-weight:600;color:var(--cc-ink)}
.cc-benefits li a{display:inline-block;margin-top:3px;font-size:12px;line-height:1.3;color:var(--cc-gold-d);border-bottom:1px solid var(--cc-gold)}

/* карточки товаров: название мельче, не больше 3 строк; цена и кнопка аккуратнее */
:is(#product-category,#product-search,#product-manufacturer) .catalogue_name{font-size:13px!important;line-height:1.35!important;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;min-height:4.05em;height:auto!important} /* в теме на телефоне height:75px — пустое поле под коротким названием */
:is(#product-category,#product-search,#product-manufacturer) .catalogue_price{font-size:20px!important;line-height:1.2}
:is(#product-category,#product-search,#product-manufacturer) .catalogue_cart_btn{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}

/* «Показать ещё»; нумерация остаётся (для поисковиков и прямого перехода), но мельче */
.cc-more{text-align:center;margin:10px 0 18px}
.cc-more__btn{appearance:none;height:48px;min-width:260px;padding:0 30px;border:1px solid var(--cc-ink);background:#fff;color:var(--cc-ink);font-size:13px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;cursor:pointer;transition:all .2s}
.cc-more__btn:hover{background:var(--cc-ink);color:#fff}
.cc-more__btn:disabled{opacity:.6;cursor:default}
:is(#product-category,#product-search,#product-manufacturer) ul.pagination{opacity:.75;transform:scale(.9);transform-origin:center top}

/* описание раздела внизу — свёрнуто */
.cc-about{border-top:1px solid var(--cc-line);margin-top:28px;padding-top:20px}
.cc-about__text{font-size:14px;line-height:1.7;color:var(--cc-muted);position:relative;overflow:hidden}
.cc-about[data-collapsed="1"] .cc-about__text{max-height:5em}
.cc-about[data-collapsed="1"] .cc-about__text::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2.4em;background:linear-gradient(0deg,#fff,rgba(255,255,255,0))}
.cc-about__more{appearance:none;border:0;background:none;padding:6px 0;margin-top:4px;color:var(--cc-gold-d);font-weight:600;font-size:13px;letter-spacing:.06em;text-transform:uppercase;cursor:pointer}

/* фильтр: у брендов и категорий без картинок — только названия (логотипы/иконки 30px не читаются и переносят название);
   выбор — кружок перед названием (у Dream Filter выбор держался только на рамке картинки) */
.dream-filter :is([id$="-man-group"],[id$="-ctg-group"]) .image-filter img{display:none!important}
.dream-filter :is([id$="-man-group"],[id$="-ctg-group"]) .image-filter label{display:flex!important;align-items:center;gap:10px;margin:0;cursor:pointer;min-height:32px}
.dream-filter :is([id$="-man-group"],[id$="-ctg-group"]) .image-filter label::before{content:"";flex:none;width:16px;height:16px;border:1px solid #bdb5a8;border-radius:50%;background:#fff;transition:border .15s}
.dream-filter :is([id$="-man-group"],[id$="-ctg-group"]) .image-filter label:has(input:checked)::before{border:5px solid var(--cc-gold)}
.dream-filter :is([id$="-man-group"],[id$="-ctg-group"]) .image-filter label:has(input:checked) span{font-weight:600;color:var(--cc-ink)}
.dream-filter :is([id$="-man-group"],[id$="-ctg-group"]) .image-filter label span{line-height:1.3}

/* компьютер (от 992px): колонка фильтра прилипает при прокрутке */
@media (min-width:992px){
 :is(#product-category,#product-search,#product-manufacturer) #column-left{position:sticky;top:12px;align-self:flex-start;max-height:calc(100vh - 24px);overflow-y:auto;scrollbar-width:thin}
 :is(#product-category,#product-search,#product-manufacturer)>.row{display:flex;align-items:flex-start}
 .cc-bar{display:none}
}

/* телефон и планшет (до 991px; в Dream Filter «ширина мобильного режима» = 992): полоса «Фильтр | Сортировка», фильтр — панелью */
@media (max-width:991px){
 .cc-benefits ul{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cc-benefits li:nth-child(3){border-left:0}
 .cc-benefits li:nth-child(n+3){border-top:1px solid var(--cc-line)}

 :is(#product-category,#product-search,#product-manufacturer) #column-left{display:none!important}
 :is(#product-category,#product-search,#product-manufacturer) #content{width:100%!important;float:none!important}
 .page_top_block{padding-bottom:4px!important}
 :is(#product-category,#product-search,#product-manufacturer) #content{padding-top:0!important;margin-top:0!important}

 .cc-bar{position:sticky;top:56px;z-index:9990;display:grid;grid-template-columns:1fr 1fr;background:#fff;border-bottom:1px solid var(--cc-line);border-top:1px solid var(--cc-line)}
 .cc-bar__btn{position:relative;display:flex;align-items:center;justify-content:center;gap:8px;height:48px;margin:0;border:0;background:none;font-size:14px;font-weight:600;color:var(--cc-ink);cursor:pointer;overflow:hidden;white-space:nowrap}
 .cc-bar__btn+.cc-bar__btn{border-left:1px solid var(--cc-line)}
 .cc-bar__btn svg{width:18px;height:18px;flex:none}
 .cc-bar__count{color:var(--cc-gold-d)}
 .cc-bar__sort-text{overflow:hidden;text-overflow:ellipsis;max-width:160px}
 .cc-bar__sort select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:16px}
 :is(#product-category,#product-search,#product-manufacturer) .sorting_block,:is(#product-category,#product-search,#product-manufacturer) .filter_opener{display:none!important}

 /* фильтр — панель слева (на телефоне на весь экран), остальное затемнено */
 #content>.dream-filter{position:static!important;height:auto!important;padding:0!important;margin:0!important;overflow:visible!important;background:none!important;width:auto!important}
 #content>.dream-filter>.rdf-mobile-toggle{display:none!important}
 #content>.dream-filter>form{position:fixed!important;top:0;bottom:0;left:0;right:auto;width:min(440px,100%);z-index:999990;margin:0!important;padding:0 16px 88px!important;background:#fff;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;box-shadow:0 0 0 100vmax rgba(23,23,26,.45)}
 .cc-fhead{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;height:56px;margin:0 -16px 8px;padding:0 8px 0 16px;background:#fff;border-bottom:1px solid var(--cc-line);font-size:18px;font-weight:600;color:var(--cc-ink)}
 .cc-fhead button{appearance:none;border:0;background:none;width:48px;height:48px;display:flex;align-items:center;justify-content:center;color:var(--cc-ink)}
 .cc-fhead svg{width:24px;height:24px}
 .cc-ffoot{position:fixed;left:0;bottom:0;width:min(440px,100%);z-index:3;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--cc-line)}
 .cc-ffoot button{width:100%;height:48px;border:0;background:var(--cc-gold);color:#fff;font-size:14px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
 #content>.dream-filter .filter_header,#content>.dream-filter .rdf-header{display:none}
 html.cc-lock,html.cc-lock body{overflow:hidden}
}

/* телефон горизонтально и планшет (600–991px): товары по 3 в ряд */
@media (min-width:600px) and (max-width:991px){
 :is(#product-category,#product-search,#product-manufacturer) .product-layout{width:33.3333%!important;float:left}
 :is(#product-category,#product-search,#product-manufacturer) .product-layout:nth-child(3n+1){clear:left}
}

/* телефон (до 767px) */
@media (max-width:767px){
 .page_top_block h1{font-size:24px!important;margin-bottom:12px!important}
 .subcategories_block{gap:8px;margin:0!important;padding:2px 15px 12px!important;scroll-padding-left:15px}
 .subcategories_item{flex-basis:120px!important;width:120px!important;padding:8px 6px 10px!important}
 .subcategories_img{height:60px!important;margin-bottom:6px!important}
 .subcategories_img img{max-height:60px!important}
 /* название целиком: до 3 строк (раньше 2 строки в 96px — обрезалось «…и») */
 .subcategories_name{font-size:11.5px!important;line-height:1.25!important;-webkit-line-clamp:3;min-height:3.75em}

 .cc-benefits{margin:12px -15px 14px}
 .cc-benefits ul{display:flex;overflow-x:auto;scrollbar-width:none;border-left:0;border-right:0}
 .cc-benefits ul::-webkit-scrollbar{display:none}
 .cc-benefits li{flex:0 0 auto;max-width:72%;border-left:1px solid var(--cc-line)!important;border-top:0!important;padding:10px 14px}
 .cc-benefits li:first-child{border-left:0!important;padding-left:15px}
 .cc-benefits li strong{white-space:nowrap}

 :is(#product-category,#product-search,#product-manufacturer) .catalogue_name{font-size:12px!important}
 :is(#product-category,#product-search,#product-manufacturer) .catalogue_price{font-size:16px!important}
 .cc-more__btn{width:100%}
}

/* поиск: форма компактно — [запрос][разделы][Найти] в одну строку; на телефоне раздел убран (он же есть в фильтре) */
#product_search_top{display:grid;grid-template-columns:minmax(0,520px) minmax(0,300px) auto;justify-content:start;gap:10px;align-items:stretch;width:100%;max-width:1200px;margin:4px auto 18px;padding:0 15px;box-sizing:border-box}
@media (min-width:992px) and (max-width:1229px){#product_search_top{max-width:970px}}
@media (min-width:768px) and (max-width:991px){#product_search_top{max-width:750px}}
#product_search_top>.row{display:contents}
#product_search_top::before,#product_search_top::after,#product_search_top>.row::before,#product_search_top>.row::after{display:none!important;content:none!important}
#product_search_top>.row>div{width:auto!important;padding:0!important;float:none!important}
#product_search_top .search_input,#product_search_top .search_select{height:46px!important;margin:0!important}
#product_search_top .search_btn{width:auto!important;min-width:120px;height:46px!important;margin:0!important;padding:0 28px!important;background:#17171a!important;border-color:#17171a!important;color:#fff!important}
@media (max-width:767px){
 #product_search_top{grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-bottom:12px}
 #product_search_top>.row>div:nth-child(2){display:none}
 #product_search_top .search_input{font-size:16px!important}
 #product_search_top .search_btn{padding:0 18px!important}
}
/* выбор раздела в поиске: своя стрелка с отступом от края (у браузера галка прижата к рамке) */
#product_search_top .search_select{-webkit-appearance:none;appearance:none;padding:0 44px 0 14px!important;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a6874c' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 16px center!important;background-size:12px 8px!important;text-overflow:ellipsis;cursor:pointer}
