/* Общий каталог товаров /catalog (2026-09-24): плотная сетка, рубрикатор и фильтры слева */
.mall { --c-text: #1d4a5c; --c-muted: #8a98a3; --c-line: #e3ecef; --c-accent: #2fb489; --c-sale: #e0493c; padding-bottom: 40px; }
.mall-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.mall-title { margin: 0 !important; }
.mall-title__count { font-size: 16px; font-weight: 400; color: var(--c-muted); vertical-align: middle; margin-left: 6px; }
.mall-search { display: flex; flex: 0 1 420px; min-width: 240px; }
.mall-search input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--c-line); border-right: 0; border-radius: 20px 0 0 20px; font-size: 14px; }
.mall-search button { height: 40px; padding: 0 18px; border: 0; border-radius: 0 20px 20px 0; background: var(--c-accent); color: #fff; font-weight: 700; cursor: pointer; }

.mall-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.mall-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; font-size: 14px; }
.mall-box { background: #fff; border: 1px solid var(--c-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.mall-box > summary, .mall-sub > summary { font-weight: 700; color: var(--c-text); cursor: pointer; padding: 4px 0; list-style: none; }
.mall-box > summary::-webkit-details-marker, .mall-sub > summary::-webkit-details-marker { display: none; }
.mall-box > summary:after, .mall-sub > summary:after { content: '▾'; float: right; color: var(--c-muted); }
.mall-box:not([open]) > summary:after, .mall-sub:not([open]) > summary:after { content: '▸'; }
.mall-cats { list-style: none; margin: 6px 0 0; padding: 0; }
.mall-cats li a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; margin: 0 -8px; border-radius: 6px; color: var(--c-text); text-decoration: none; line-height: 18px; }
.mall-cats li a:hover { background: #f1f7f9; }
.mall-cats li.active a { background: #e3f6ef; font-weight: 700; }
.mall-cats i, .mall-shops i { font-style: normal; color: var(--c-muted); font-size: 12px; }
.mall-sub { border-top: 1px solid var(--c-line); padding-top: 8px; margin-top: 8px; }
.mall-sub:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.mall-shops { margin-top: 6px; }
.mall-shops label { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; color: var(--c-text); line-height: 18px; }
.mall-shops label span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mall-shops .mall-more { display: none; }
.mall-shops.expanded .mall-more { display: flex; }
.mall-shops__more { display: inline-block; margin-top: 4px; font-size: 13px; }
.mall-shops.expanded .mall-shops__more { display: none; }
.mall-price { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.mall-price input { width: 100%; min-width: 0; height: 32px; padding: 0 8px; border: 1px solid var(--c-line); border-radius: 6px; font-size: 13px; }
.mall-check { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; color: var(--c-text); cursor: pointer; }
.mall-filters__buttons { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.mall-filters__buttons .btn { padding-left: 22px !important; padding-right: 22px !important; }
.mall-reset { font-size: 13px; color: var(--c-muted); }
.mall-shops-link { display: inline-block; margin: 4px 2px; font-size: 13px; }

.mall-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.mall-sort { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; }
.mall-sort a, .mall-sort span { padding: 6px 12px; border-radius: 16px; text-decoration: none; color: var(--c-text); background: #f1f7f9; }
.mall-sort span.active { background: var(--c-text); color: #fff; }
.mall-chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.mall-chips a { padding: 4px 10px; border-radius: 14px; border: 1px solid var(--c-line); color: var(--c-text); text-decoration: none; }

.mall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.mall-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-line); border-radius: 10px; padding: 10px; transition: box-shadow .2s, border-color .2s; }
.mall-card:hover { box-shadow: 0 6px 18px rgba(66, 112, 131, .18); border-color: transparent; }
.mall-card__link { display: flex; flex-direction: column; flex: 1; color: var(--c-text); text-decoration: none; }
.mall-card__img { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; margin-bottom: 8px; background: #fff; overflow: hidden; }
.mall-card__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mall-card__badge { position: absolute; left: 0; top: 0; padding: 2px 6px; border-radius: 6px; background: var(--c-sale); color: #fff; font-style: normal; font-size: 12px; font-weight: 700; }
.mall-card__shop { font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); margin-bottom: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mall-card__name { font-size: 13px; line-height: 17px; height: 51px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.mall-card:hover .mall-card__name { color: #0b7a5a; }
.mall-card__bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.mall-card__price { white-space: nowrap; overflow: hidden; }
.mall-card__price b { font-size: 17px; color: var(--c-accent); }
.mall-card__price s { font-size: 12px; color: var(--c-muted); }
.mall-card__cart { flex: 0 0 34px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #e3f6ef; cursor: pointer; position: relative; }
.mall-card__cart:before { content: '+'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; color: var(--c-accent); font-weight: 700; }
.mall-card__cart:hover { background: var(--c-accent); }
.mall-card__cart:hover:before { color: #fff; }
.mall-card__cart.added { background: var(--c-accent); }
.mall-card__cart.added:before { content: '✓'; color: #fff; font-size: 16px; }

.mall-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; padding: 0; margin: 28px 0 0; }
.mall-pager li a, .mall-pager li span { display: block; min-width: 36px; padding: 8px 10px; text-align: center; border-radius: 8px; background: #f1f7f9; color: var(--c-text); text-decoration: none; }
.mall-pager li.active a { background: var(--c-text); color: #fff; }
.mall-pager li.disabled span { opacity: .4; }
.mall-empty { font-size: 16px; margin: 40px 0; }

@media (max-width: 900px) {
  .mall-layout { grid-template-columns: 1fr; }
  .mall-side { position: static; max-height: none; }
  .mall-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
@media (max-width: 480px) {
  .mall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mall-card { padding: 8px; }
  .mall-card__price b { font-size: 15px; }
  .mall-search { flex-basis: 100%; }
}
/* на сайте все checkbox спрятаны под кастомные — в каталоге показываем обычные */
.mall input[type=checkbox] { position: static !important; left: auto !important; opacity: 1 !important; width: 16px !important; height: 16px !important; margin: 0; flex: 0 0 16px; accent-color: #2fb489; cursor: pointer; }

/* справочная цена в рублях (только ru) */
.mall-card__rub { display: block; font-size: 11px; line-height: 14px; color: #8a98a3; font-weight: 400; }
.mall-card__cart_link:before { content: '→'; font-size: 18px; }

/* значки в кружке рисуем CSS, а не символом шрифта — точно по центру (2026-09-24) */
.mall-card__cart { color: #2fb489; }
.mall-card__cart:hover, .mall-card__cart.added { color: #fff; }
.mall-card__cart:before {
  content: '' !important; display: block !important;
  position: absolute; left: 50% !important; top: 50% !important; right: auto !important; bottom: auto !important;
  width: 14px; height: 14px; transform: translate(-50%, -50%);
  background: linear-gradient(currentColor, currentColor) center / 14px 2.5px no-repeat,
              linear-gradient(currentColor, currentColor) center / 2.5px 14px no-repeat;
  border-radius: 1px;
}
.mall-card__cart.added:before {                      /* галочка */
  width: 12px; height: 7px; background: none;
  border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: translate(-50%, -65%) rotate(-45deg);
}
.mall-card__cart_link:before {                       /* стрелка Garage Sale */
  width: 8px; height: 8px; background: none;
  border-top: 2.5px solid currentColor; border-right: 2.5px solid currentColor;
  transform: translate(-65%, -50%) rotate(45deg);
}

/* подразделы по полу в одежде и обуви (2026-09-24) */
.mall-subcats { list-style: none; margin: 0 0 4px; padding: 0 0 0 14px; }
.mall-subcats li a { padding-top: 3px !important; padding-bottom: 3px !important; font-size: 13px; }

/* левое меню — «резиновое»: без ограничения высоты и внутренней прокрутки, растёт вместе со страницей (2026-09-24) */
.mall-side { position: static !important; top: auto !important; max-height: none !important; overflow: visible !important; }

/* блок «Популярные товары» на главной (2026-09-24): 2 ряда по 4, как акции */
.mall.mall--index { padding-bottom: 0; }
.mall-grid.mall-grid--index { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; max-width: 1000px; margin: 24px auto 30px; }
.mall--index .mall-card { text-align: left; line-height: 1.4; white-space: normal; }
@media (max-width: 991px) { .mall-grid.mall-grid--index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.mall-grid.mall-grid--index { grid-auto-rows: 1fr; }
.mall-title__count { white-space: nowrap; }   /* «1 707» не разрывать на две строки (2026-09-25) */
/* подкатегории одежды в левом меню (2026-09-25) */
.mall-cats li.mall-cats__sub { margin-left: 12px; border-left: 2px solid #e3ecef; }
.mall-cats li.mall-cats__sub a { padding-left: 10px; font-size: 13px; }
.mall-cats li.mall-cats__sub.active { border-left-color: #2fb489; }
