.catalog-wrap {
  display: grid;
  grid-template-columns: 320px minmax(0,1fr);
  gap: 12px;
}

@media (max-width:1024px) {
  .catalog-wrap {
    grid-template-columns: 1fr;
  }
}

.toolbar-top {
  display: none;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 12px;
}

.toolbar-top .sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.toolbar-top .sort select,.chips .sort-desktop select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 8px 32px 8px 10px;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23343a40' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
  cursor: pointer;
}

.toolbar-top .sort select:focus,.chips .sort-desktop select:focus {
  border-color: #000;
  outline: none;
}

.filters {
  border: 1px solid #eef0f3;
  border-radius: 16px;
  padding: 16px;
  position: sticky;
  top: 100px;
  height: fit-content;
  background: var(--white);
}

.filters__header {
  display: flex;
  align-items: center;
  justify-content: center;
}

.filters__header span {
  font: 700 20px/1.2 "Comfortaa",system-ui,sans-serif;
  color: black;
  margin: 0;
}

.filters__close {
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.group {
  border-top: 1px solid #f2f3f5;
  padding: 10px 0;
}

.group:first-of-type {
  border-top: 0;
}

.group > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group > summary::-webkit-details-marker {
  display: none;
}

.group[open] > summary {
  color: var(--a);
}

.group:not([open]) > summary {
  color: var(--muted);
}

.inline {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.dash {
  opacity: .5;
}

.filters__actions {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.filters__actions.bottom {
  margin-top: 12px;
}

.check,.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
}

.muted {
  color: #6c757d;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  --bd: #e9ecef;
  --bg: #f8f9fa;
  --fg: #374151;
  display: inline-flex;
  align-items: center;
}

.tag__control {
  display: none;
}

.tag__label {
  border: 1px solid var(--bd);
  background: var(--bg);
  color: var(--fg);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.tag:hover .tag__label {
  border-color: #d5dae0;
}

.tag__control:checked + .tag__label {
  --bd: #2563eb;
  --bg: #e8f0ff;
  --fg: #1f2937;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2f7;
  border: 1px solid #dde3ea;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

.chip span {
  opacity: .6;
}

.chip--ghost {
  background: transparent;
  border: 1px dashed #cbd5e1;
  text-decoration: none;
  color: #334155;
  padding: 6px 10px;
  border-radius: 999px;
}

.w-full {
  width: 100%;
}

.show-filters {
  display: none;
}

.product-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill,minmax(140px,1fr));
}

@media (min-width:403px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
  }
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.page {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: var(--a);
  background: var(--white);
  transition: all .2s;
}

.page.current {
  border-style: dashed;
  pointer-events: none;
  font-weight: bold;
}

.page:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.dots {
  color: #9ca3af;
  padding: 0 4px;
}

@media (max-width:1024px) {
  .show-filters {
    display: inline-flex;
  }

  .filters {
    padding-bottom: 70px;
    position: fixed;
    inset: auto 0 0 0;
    transform: translateY(110%);
    max-height: 78vh;
    overflow: auto;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -10px 30px rgba(0,0,0,.08);
    z-index: 40;
    transition: transform .25s;
  }

  .filters.open {
    transform: translateY(0);
  }

  .toolbar-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 12px;
  }

  .sort-desktop {
    display: none;
  }
}

@media (min-width:1025px) {
  .filters__close {
    display: none;
  }

  .chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
  }

  .chips .sort-desktop {
    margin-left: auto;
    display: flex;
    align-items: center;
  }
}

.check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.check span {
  position: relative;
  padding-left: 28px;
  line-height: 20px;
}

.check span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border: 2px solid #000;
  border-radius: 6px;
  background: var(--white);
  box-sizing: border-box;
}

.check input[type="checkbox"]:checked + span::before {
  background: #000;
}

.check input[type="checkbox"]:checked + span::after {
  content: "✓";
  position: absolute;
  left: 3px;
  top: -1px;
  font-size: 18px;
  color: var(--white);
  line-height: 20px;
}

.catalog-wrap>*,.product-grid>* {
  min-width: 0;
}

@media (max-width:600px) {
  .filters {
    bottom: 64px;
    max-height: calc(100dvh - 170px);
    padding-bottom: 16px;
  }
}
