/* Catalog page and product cards. */

.shell {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: clamp(30px, 4vw, 64px);
  width: auto;
  min-height: 100vh;
  margin: 0 var(--page-edge);
  overflow: hidden;
  background: var(--surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.content {
  min-width: 0;
  padding: 112px 0 56px;
}

.catalog-filters {
  min-width: 0;
  padding: 112px 0 56px;
  border-right: 1px solid #ededed;
}

.filter-form {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 0;
  padding-right: 28px;
  font-family: var(--store-font);
}

.filter-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 28px;
}

.filter-header div {
  display: grid;
  gap: 5px;
}

.filter-header span {
  color: #8b8f99;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.filter-header strong {
  color: #11141a;
  font-family: var(--display-font);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
}

.filter-reset {
  padding: 0;
  border: 0;
  background: transparent;
  color: #767b86;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.filter-group {
  border-top: 1px solid #ededed;
}

.filter-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #11141a;
  font-family: var(--display-font);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}

.filter-group-toggle span:last-child {
  color: #8b8f99;
  font-size: 18px;
  transition: transform 160ms ease;
}

.filter-group.is-collapsed .filter-group-toggle span:last-child {
  transform: none;
}

.filter-group:not(.is-collapsed) .filter-group-toggle span:last-child {
  transform: rotate(45deg);
}

.filter-options,
.price-filter-fields {
  display: grid;
  gap: 13px;
  padding: 0 0 22px;
}

.filter-group.is-collapsed .filter-options,
.filter-group.is-collapsed .price-filter-fields {
  display: none;
}

.filter-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 24px;
  color: #666c78;
  font-family: var(--store-font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.filter-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-option-marker {
  display: block;
  width: 16px;
  height: 16px;
  border: 1px solid #cfd3dc;
  background: #fff;
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}

.filter-option-marker::after {
  display: block;
  width: 8px;
  height: 5px;
  margin: 4px 0 0 3px;
  border: 2px solid #11141a;
  border-top: 0;
  border-right: 0;
  content: "";
  opacity: 0;
  transform: rotate(-45deg);
}

.filter-option input:checked + .filter-option-marker {
  border-color: var(--accent);
  background: var(--accent);
}

.filter-option input:checked + .filter-option-marker::after {
  opacity: 1;
}

.filter-option-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-option-color {
  grid-template-columns: 18px 18px minmax(0, 1fr);
}

.filter-color-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid #d7dbe3;
  border-radius: 50%;
  background: #c7cbd3;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.filter-color-swatch-black {
  background: #111111;
}

.filter-color-swatch-white {
  background: #ffffff;
}

.filter-color-swatch-red {
  background: #c92f2f;
}

.filter-color-swatch-blue {
  background: #4ca9d8;
}

.filter-color-swatch-green {
  background: #3d8f55;
}

.filter-color-swatch-gray {
  background: #8e9299;
}

.filter-color-swatch-milk {
  background: #f2eadc;
}

.filter-color-swatch-beige {
  background: #d7c6aa;
}

.filter-color-swatch-brown {
  background: #7a4d35;
}

.filter-color-swatch-multicolor {
  background: conic-gradient(#111 0 25%, #fff 0 50%, #4ca9d8 0 75%, #c92f2f 0);
}

.filter-options-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.filter-options-grid .filter-option {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 38px;
  border: 1px solid #e4e6eb;
  color: #11141a;
  font-family: var(--display-font);
  font-size: 12px;
  font-weight: 500;
}

.filter-options-grid .filter-option-marker {
  display: none;
}

.filter-options-grid .filter-option:has(input:checked) {
  border-color: #11141a;
  background: #11141a;
  color: #fff;
}

.price-filter-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.price-filter-fields label {
  display: grid;
  gap: 7px;
  color: #8b8f99;
  font-size: 12px;
  font-weight: 700;
}

.price-filter-fields input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e4e6eb;
  border-radius: 0;
  padding: 0 12px;
  color: #11141a;
  font-family: var(--store-font);
  font-size: 14px;
  font-weight: 700;
}

.filter-empty {
  margin: 0;
  color: #9aa0aa;
  font-size: 13px;
  font-weight: 600;
}

.catalog-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 42px;
}

.catalog-toolbar p {
  margin: 0 0 8px;
  color: #8b8f99;
  font-family: var(--store-font);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.catalog-toolbar h1 {
  margin: 0;
  color: #11141a;
  font-family: var(--display-font);
  font-size: clamp(32px, 3.2vw, 54px);
  font-weight: 500;
  line-height: 1;
}

.catalog-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #767b86;
  font-family: var(--store-font);
  font-size: 14px;
  font-weight: 700;
}

.filter-toggle-mobile {
  display: none;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid #e4e6eb;
  background: #fff;
  color: #11141a;
  font-family: var(--display-font);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
}

.breadcrumbs {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 26px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 30px);
  align-items: start;
  margin-top: 0;
}

.product-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 104px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--store-font);
  text-decoration: none;
}

.product-image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: transparent;
}

.product-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 220ms ease;
}

.product-card:hover img {
  transform: scale(1.025);
}

.product-card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  row-gap: 4px;
  max-width: calc(100% - 20px);
}

.badge,
.discount-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  z-index: 1;
  padding: 0 10px;
  border-radius: 2px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 22px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge {
  background: var(--accent);
  color: var(--accent-ink);
}

.discount-badge {
  background: #e42b10;
}

.product-info {
  min-height: 104px;
  padding: 14px 0 0;
}

.product-info h2 {
  display: -webkit-box;
  min-height: 52px;
  margin: 0 0 12px;
  overflow: hidden;
  color: #5f6672;
  font-family: var(--display-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 23px;
  letter-spacing: normal;
  text-transform: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-info strong {
  color: #171b22;
  font-family: var(--display-font);
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
}

.product-info .price-stack {
  gap: 7px;
  min-height: 24px;
}

.product-info .old-price {
  color: #8b8b8b;
  font-family: var(--display-font);
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  text-decoration-thickness: 1px;
}

.product-info .discount-pill {
  min-height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: #ff5c39;
  color: #fff;
  font-family: var(--text-font);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}

.product-card.is-hidden {
  display: none;
}

.catalog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 800;
}

.catalog-pagination {
  display: grid;
  justify-items: center;
  gap: 16px;
  margin-top: 40px;
}

.pagination-load-more {
  min-width: min(100%, 186px);
  min-height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: 9px;
  background: #d8d8d8;
  color: #111;
  font-family: var(--display-font);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pagination-load-more:hover:not(:disabled) {
  background: #cfcfcf;
  color: #111;
}

.pagination-load-more:disabled {
  background: #eeeeee;
  color: #9a9a9a;
  cursor: not-allowed;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
}

.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-button {
  min-width: 36px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #6f7280;
  font-family: var(--text-font);
  font-size: 14px;
  font-weight: 500;
}

.pagination-button:hover:not(:disabled),
.pagination-button.is-active {
  border-color: transparent;
  background: #f5f6f8;
  color: #111;
}

.pagination-button.is-active {
  background: #f5f6f8;
  color: #111;
  font-weight: 600;
}

.pagination-button:disabled {
  color: #d0d0d0;
  cursor: not-allowed;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .shell {
      grid-template-columns: 1fr;
      width: 100%;
      margin: 0;
      padding: 0 var(--page-gutter);
    }
  .catalog-filters {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      z-index: 50;
      width: min(340px, calc(100vw - 28px));
      padding: 28px 24px;
      overflow-y: auto;
      border-right: 1px solid #e4e6eb;
      background: #fff;
      box-shadow: 18px 0 60px rgba(17, 20, 26, 0.16);
      transform: translateX(-110%);
      transition: transform 180ms ease;
    }
  .catalog-filters.is-open {
      transform: translateX(0);
    }
  body.filters-open::before {
      position: fixed;
      inset: 0;
      z-index: 45;
      background: rgba(17, 20, 26, 0.34);
      content: "";
    }
  .filter-form {
      position: static;
      padding-right: 0;
    }
  .content {
      padding: 82px 0 36px;
    }
  .catalog-toolbar {
      align-items: flex-start;
      flex-direction: column;
      margin-bottom: 28px;
    }
  .catalog-toolbar-actions {
      justify-content: space-between;
      width: 100%;
    }
  .filter-toggle-mobile {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
  .page-head {
      align-items: flex-start;
      flex-direction: column;
    }
  .product-grid {
      grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
      gap: 16px;
    }
  .catalog-pagination {
      justify-items: stretch;
    }
}

@media (max-width: 560px) {
  .shell {
      width: 100%;
      min-height: 100vh;
      margin: 0;
      padding: 0 14px;
      border: 0;
      border-radius: 0;
      box-shadow: none;
    }
  .content {
      padding-top: 54px;
    }
  .catalog-toolbar h1 {
      font-size: 30px;
    }
  .product-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
  .pagination-button {
      min-width: 32px;
      min-height: 34px;
      padding: 0 8px;
      font-size: 13px;
    }
  .pagination-controls {
      min-height: 56px;
    }
  .pagination-pages {
      gap: 4px;
    }
}
