/* assets/css/category.css */

:root{
  --cat-text:#111;
  --cat-muted:#666;
  --cat-line:#e6e6e6;

  --cat-pill:#47645c;      /* зелёный как на скрине */
  --cat-pill-text:#fff;

  --cat-accent:#ff6a00;    /* оранжевый */
  --cat-bg:#fff;

  --cat-card:#fff;
  --cat-shadow: 0 6px 18px rgba(0,0,0,.06);

  --cat-radius:14px;
}

.category-page{
  padding: 10px 0 18px;
  background: var(--cat-bg);
  color: var(--cat-text);
}

.cat-header{
  padding: 8px 0 8px;
}

.cat-title{
  margin: 0 0 8px 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Intro */
.cat-intro{
  position: relative;
  margin: 0 0 10px 0;
  padding: 0;
}

.cat-intro__text{
  font-size: 13.5px;
  line-height: 1.35;
  color: #222;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;

  overflow: hidden;
}

.cat-intro.is-open .cat-intro__text{
  -webkit-line-clamp: unset;
  overflow: visible;
}

.cat-intro__more{
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cat-accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}

.cat-intro__chev{
  display: inline-block;
  transform: translateY(-1px);
}

.cat-intro.is-open .cat-intro__chev{
  transform: rotate(180deg) translateY(1px);
}

/* Subcategories list (text links like on screenshot) */
.cat-subcats{
  margin: 10px 0 10px;
}

.cat-subcats__list{
  display: grid;
  gap: 4px;
}


.cat-subcats__item{
  font-size: 13px;
  line-height: 1.25;
  color: #111;
  text-decoration: none;
  display: inline-block;
  padding: 2px 0;
}

.cat-subcats__back{
  font-size: 13px;
  line-height: 1.25;
  color: var(--cat-accent); /* было #111 */
  text-decoration: none;
  display: inline-block;
  padding: 2px 0;
  font-weight: 700;
}


.cat-subcats__cnt{
  color: var(--cat-muted);
  font-weight: 600;
}

.cat-subcats__item.is-active{
  font-weight: 800;
}


/* Filters UI blocks are in filters.ui.php:
   we'll style only generic wrappers if needed later */

/* Results grid */
.cat-results{
  padding-top: 6px;
}

.cat-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.p-card{
  background: var(--cat-card);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--cat-shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.p-card__media{
  display: block;
  background: #fafafa;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.p-card__img{
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
  padding: 10px;
  background: #fff;
}

.p-card__noimg{
  height: 160px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.p-card__noimg-box{
  width: 100%;
  height: 110px;
  border-radius: 12px;
  background: #f0f0f0;
  border: 1px dashed rgba(0,0,0,.15);
}

.p-card__noimg-text{
  font-size: 12.5px;
  color: var(--cat-muted);
  font-weight: 700;
}

.p-card__body{
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
}

.p-card__title{
  font-size: 17px;
  line-height: 1.25;
  color: #111;
  text-decoration: none;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.25em * 3);
}

.p-card__brand{
  font-size: 15px;
  color: var(--cat-muted);
  line-height: 1.2;
}

/* Bottom area aligned */
.p-card__bottom{
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.p-price{
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.p-price__now{
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.p-price__old{
  font-size: 12.5px;
  color: var(--cat-muted);
  text-decoration: line-through;
}

/* Actions */
.p-actions{
  display: grid;
  gap: 8px;
}

.p-qty{
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.16);
  overflow: hidden;
  background: #fff;
}

.p-qty__btn{
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #111;
  -webkit-tap-highlight-color: transparent;
}

.p-qty__btn:disabled{
  opacity: .35;
  cursor: default;
}

.p-qty__input{
  border: 0;
  outline: none;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #111;
  width: 100%;
  appearance: textfield;
}

.p-qty__input::-webkit-outer-spin-button,
.p-qty__input::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

.p-btn{
  height: 36px;
  border-radius: 999px;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.p-btn:active{
  transform: translateY(1px);
}

.p-btn:disabled{
  opacity: .45;
  cursor: default;
}

/* Message line */
.p-msg{
  min-height: 16px;
  font-size: 12px;
  color: var(--cat-muted);
}

/* Empty state */
.cat-empty{
  padding: 14px 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--cat-radius);
  background: #fafafa;
}

.cat-empty__title{
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 4px;
}

.cat-empty__text{
  font-size: 13px;
  color: var(--cat-muted);
}

/* Pager */
.cat-pager{
  margin: 14px 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.cat-pager__arrow{
  width: 44px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #111;
  font-weight: 900;
  background: #fff;
}

.cat-pager__arrow.is-disabled{
  opacity: .35;
  pointer-events: none;
}

.cat-pager__pos{
  font-size: 14px;
  font-weight: 900;
  color: #111;
}

/* Bottom long text */
.cat-bottom-text{
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #111;
}

/* Small screens */
@media (max-width: 360px){
  .cat-grid{ gap: 10px; }
  .p-card__img, .p-card__noimg{ height: 148px; }
}

/* Button state: in cart */
.p-btn.is-in-cart{
  background: var(--cat-accent);
  border-color: var(--cat-accent);
  color: #fff;
}

/* чуть приятнее тап */
.p-btn.is-in-cart:active{
  transform: translateY(1px);
}

/* =========================================================
   CATEGORY: FILTER TOOLBAR + ACTIVE CHIPS (top area only)
   (filters.ui.php output) — БЕЗ дублей :root
   ========================================================= */

.cat-toolbar{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 10px;
}

.cat-toolbar__right{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* общая кнопка */
.cat-btn{
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  color: #111;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.cat-btn:hover{
  border-color: rgba(0,0,0,.16);
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}

.cat-btn:active{
  transform: translateY(1px);
}

.cat-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(47,107,94,.18), 0 6px 16px rgba(0,0,0,.06);
  border-color: rgba(47,107,94,.55);
}

/* кнопка "Фильтры" */
.cat-btn-filters{
  background: var(--cat-accent);
  border-color: rgba(0,0,0,0);
  color: #fff;
  font-weight: 700;
}

/* простая иконка “ползунки” */
.cat-btn-filters::before{
  content:"";
  width: 18px;
  height: 18px;
  display: inline-block;
  background:
    linear-gradient(#fff,#fff) 3px 5px/12px 2px no-repeat,
    linear-gradient(#fff,#fff) 6px 10px/9px 2px no-repeat,
    linear-gradient(#fff,#fff) 9px 15px/6px 2px no-repeat;
  opacity: .95;
  border-radius: 3px;
}

.cat-btn-filters:hover{
  filter: brightness(.95);
}

.cat-btn-filters[aria-expanded="true"]{
  box-shadow: 0 0 0 3px rgba(255,255,255,.16), 0 0 0 6px rgba(47,107,94,.22);
}

/* очистка */
.cat-btn-clear{
  background: rgba(0,0,0,.045);
  border-color: rgba(0,0,0,0);
  color: rgba(0,0,0,.78);
  font-weight: 650;
}

.cat-btn-clear:hover{
  background: rgba(0,0,0,.07);
}

/* сортировка */
.cat-toolbar__sort{
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.cat-sort__label{
  font-size: 13px;
  color: rgba(0,0,0,.62);
  white-space: nowrap;
}

.cat-sort{
  height: 40px;
  padding: 0 40px 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background-color: #fff;
  color: #111;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
  line-height: 1;
}

.cat-toolbar__sort::after{
  content:"";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(45deg);
  border-right: 2px solid rgba(0,0,0,.55);
  border-bottom: 2px solid rgba(0,0,0,.55);
  pointer-events: none;
}

.cat-sort:hover{
  border-color: rgba(0,0,0,.16);
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}

.cat-sort:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(47,107,94,.18), 0 6px 16px rgba(0,0,0,.06);
  border-color: rgba(47,107,94,.55);
}

/* chips */
.cat-active-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.05);
  color: rgba(0,0,0,.82);
  text-decoration: none;
  border: 1px solid rgba(0,0,0,0);
  transition: background-color .15s ease, transform .06s ease, box-shadow .15s ease, border-color .15s ease;
  max-width: 100%;
}

.chip:hover{
  background: rgba(0,0,0,.08);
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 6px 16px rgba(0,0,0,.05);
}

.chip:active{
  transform: translateY(1px);
}

.chip span[aria-hidden="true"]{
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0,0,0,.10);
  color: rgba(0,0,0,.70);
  font-weight: 800;
  line-height: 1;
}

/* =========================================================
   MOBILE: "Фильтры" + "Сортировка" В ОДНОЙ СТРОКЕ
   ========================================================= */
@media (max-width: 560px){
  .cat-toolbar{
    flex-wrap: nowrap;         /* ключ: не переносить */
    gap: 8px;
  }

  /* делим строку на 2 равные части */
  .cat-btn-filters{
    flex: 1 1 0;
    min-width: 0;
    padding: 0 10px;          /* чуть уже */
  }

  .cat-toolbar__right{
    flex: 1 1 0;
    min-width: 0;
    margin-left: 0;
  }

  .cat-toolbar__sort{
    width: 100%;
    min-width: 0;
    gap: 6px;
  }

  .cat-sort{
    width: 100%;
    min-width: 0;
    padding-left: 12px;
  }

  /* чтобы точно влезло: лейбл скрываем */
  .cat-sort__label{
    display: none;
  }

  /* кнопку очистки на мобиле убираем (она и так есть внутри панели) */
  .cat-btn-clear{
    display: none;
  }
}

@media (max-width: 360px){
  .cat-btn{ height: 38px; }
  .cat-sort{ height: 38px; }
}


/* =========================================================
   FILTERS OFFCANVAS — TEXT/LIST STYLE (без плашек)
   Под category.js + filters.ui.php (aria-hidden + body.filters-open)
   ========================================================= */

:root{
  --filters-bg: #fff;
  --filters-border: rgba(0,0,0,.10);
  --filters-muted: rgba(0,0,0,.60);
  --filters-text: rgba(0,0,0,.88);
  --filters-accent: var(--cat-accent, #2f6b5e);
}

/* --- Anti-flicker via aria-hidden --- */
.filters-overlay[aria-hidden="true"]{
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.filters-overlay[aria-hidden="false"]{
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.filters-panel[aria-hidden="true"]{
  visibility: hidden;
  pointer-events: none;
  transform: translateX(105%);
}
.filters-panel[aria-hidden="false"]{
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

/* lock scroll when open */
body.filters-open{ overflow: hidden; }

/* --- Overlay --- */
.filters-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.38);
  transition: opacity .18s ease, visibility .18s ease;
  z-index: 10040;
}

/* --- Panel --- */
.filters-panel{
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 92vw);
  background: var(--filters-bg);
  border-left: 1px solid var(--filters-border);
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
  transition: transform .22s ease;
  z-index: 10050;

  display: flex;
  flex-direction: column;

  will-change: transform;
  backface-visibility: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* --- Header --- */
.filters-panel__header{
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--filters-bg);
  border-bottom: 1px solid var(--filters-border);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 12px 12px;
}

.filters-panel__title{
  font-size: 16px;
  font-weight: 900;
  color: var(--filters-text);
}

.filters-close{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .06s ease;
}
.filters-close:hover{
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.18);
}
.filters-close:active{ transform: translateY(1px); }
.filters-close:focus-visible{
  outline: none;
  border-color: rgba(47,107,94,.55);
  box-shadow: 0 0 0 3px rgba(47,107,94,.16);
}

/* --- Body scroll area --- */
.filters-panel__body{
  padding: 6px 12px 10px; /* меньше боковых */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

/* --- Footer --- */
.filters-panel__footer{
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--filters-bg);
  border-top: 1px solid var(--filters-border);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

.filters-reset{
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  color: rgba(0,0,0,.88);
  font-weight: 900;
  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: background-color .15s ease, border-color .15s ease, transform .06s ease;
}
.filters-reset:hover{
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.18);
}
.filters-reset:active{ transform: translateY(1px); }

.filters-reset.is-disabled{
  opacity: .55;
  cursor: not-allowed;
  background: rgba(0,0,0,.03);
}

/* =========================================================
   CONTENT: blocks — теперь “текстовые секции” без плашек
   ========================================================= */

.filters-block{
  padding: 12px 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.filters-block + .filters-block{
  border-top: 1px solid rgba(0,0,0,.08); /* тонкий разделитель между блоками */
}

.filters-block__title{
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 900;
  color: rgba(0,0,0,.72);
  letter-spacing: .2px;
  text-transform: none; /* если захочешь капсом — скажи */
}

/* --- Navigation in filters (тоже текстом) --- */
.filters-nav{
  display: flex;
  flex-direction: column;
  gap: 0;
}

.filters-nav__link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--filters-accent);
  text-decoration: none;
  font-weight: 850;
}
.filters-nav__link:hover{ text-decoration: underline; }

.filters-nav__item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;

  text-decoration: none;
  color: rgba(0,0,0,.86);
  font-weight: 750;

  border-bottom: 1px solid rgba(0,0,0,.08);
}
.filters-nav__item:last-child{ border-bottom: 0; }

.filters-nav__item.is-active{
  color: var(--filters-accent);
  font-weight: 900;
}

.filters-nav__cnt{
  color: rgba(0,0,0,.52);
  font-weight: 800;
  white-space: nowrap;
}

/* --- Price layout --- */
.filters-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filters-col{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filters-label{
  font-size: 12px;
  color: var(--filters-muted);
  font-weight: 750;
}

.filters-input{
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  padding: 0 10px;
  background: #fff;
  color: rgba(0,0,0,.88);
  transition: box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}
.filters-input:focus{
  outline: none;
  border-color: rgba(47,107,94,.55);
  box-shadow: 0 0 0 3px rgba(47,107,94,.14);
}

/* --- Options list as rows (без карточек) --- */
.filters-options{
  display: flex;
  flex-direction: column;
  gap: 0;
}

.filters-option{
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;

  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;

  border-bottom: 1px solid rgba(0,0,0,.08);

  cursor: pointer;
  user-select: none;
}
.filters-option:last-child{ border-bottom: 0; }

.filters-option:hover{
  background: rgba(0,0,0,.02); /* очень лёгкая подсветка строки */
}

.filters-option.is-disabled{
  opacity: .50;
  cursor: not-allowed;
  background: transparent;
}

.filters-option__text{
  color: rgba(0,0,0,.88);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

.filters-option__count{
  color: rgba(0,0,0,.52);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

/* checkbox */
.filters-option input[type="checkbox"]{
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--filters-accent);
}
.filters-option input[type="checkbox"]:disabled{
  cursor: not-allowed;
}

/* --- Mobile tweaks --- */
@media (max-width: 420px){
  .filters-row{ grid-template-columns: 1fr; }
}

/* =========================================================
   CATEGORY: LOAD MORE (кнопка "Показать ещё" под пагинацией)
   ========================================================= */
.cat-loadmore{
  margin: 10px 0 6px;
  display: flex;
  justify-content: center;
}

.cat-loadmore__btn{
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.16);
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.cat-loadmore__btn:hover{
  border-color: rgba(0,0,0,.22);
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}

.cat-loadmore__btn:active{
  transform: translateY(1px);
}

.cat-loadmore__btn:disabled{
  opacity: .60;
  cursor: default;
  box-shadow: none;
}

/* subcats: компактнее, и "назад" снизу */
.cat-subcats{
  margin: 10px 0 10px;
}

.cat-subcats__list{
  display: grid;
  gap: 4px;
}

/* кнопку "назад" делаем отдельной строкой ниже списка */
.cat-subcats__back--bottom{
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,.08);
}

/* активная подкатегория: заметнее (но минималистично) */
.cat-subcats__item.is-active{
  font-weight: 900;
  color: var(--cat-text);
  position: relative;
  padding-left: 12px;
}

/* маркер слева как "текущая" */
.cat-subcats__item.is-active::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0.25em;
  bottom: 0.25em;
  width: 4px;
  border-radius: 999px;
  background: var(--cat-accent);
}

/* счётчик у активной — чуть темнее */
.cat-subcats__item.is-active .cat-subcats__cnt{
  color: rgba(0,0,0,.55);
}


