/* Catalog page components & layout — Figma specification */

/* Breadcrumbs */
.catalog-heading {
  max-width: none;
  margin: 0;
  padding: 0;
}

.catalog-breadcrumb {
  height: 48px;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #F9FAFB;
}

.catalog-breadcrumb-inner {
  max-width: var(--content-max);
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 120%;
  color: #1F1C22;
  box-sizing: border-box;
}

.catalog-breadcrumb a {
  color: #1F1C22;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s ease;
}

.catalog-breadcrumb a:hover {
  color: #9747FF;
}

.catalog-breadcrumb a:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: 2px;
}

.catalog-breadcrumb i {
  color: #9747FF;
  font-size: 16px;
}

.catalog-breadcrumb span {
  color: #888E92;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Title Row */
.catalog-title-row {
  max-width: var(--content-max);
  height: 90px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-sizing: border-box;
}

.catalog-title-row h1 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 140%;
  letter-spacing: 0.02em;
  color: #1F1C22;
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
}

.catalog-title-row .catalog-title-text {
  font-size: 32px;
  font-weight: 500;
  color: #1F1C22;
}

.catalog-title-row .catalog-results-count,
.catalog-title-row h1 span:not(.catalog-title-text) {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 140%;
  letter-spacing: 0.02em;
  color: #888E92;
  white-space: nowrap;
}

/* Catalog Toolbar */
.catalog-toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.toolbar-search-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.toolbar-controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  width: 540px;
  max-width: 100%;
}

.search-wrap > i.search-icon-input {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9747FF;
  font-size: 20px;
  pointer-events: none;
}

.search-inp {
  width: 100%;
  height: 48px;
  padding: 8px 36px 8px 42px;
  background: #FFFFFF;
  border: 1px solid #AEBAC0;
  border-radius: 8px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 120%;
  color: #1F1C22;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-inp::placeholder {
  color: #888E92;
}

.search-inp:hover {
  border-color: #9747FF;
}

.search-inp:focus {
  border-color: #9747FF;
  box-shadow: var(--shadow-input-focus);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) !important;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #F9FAFB;
  color: #888E92;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.15s ease, color 0.15s ease;
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  .search-clear-btn:hover {
    background: #EEF2F6;
    color: #1F1C22;
  }
}

.search-clear-btn:active {
  transform: translateY(-50%) !important;
  background: #DDE6EB;
}

/* Custom Catalog Sort */
.catalog-sort-custom {
  position: relative;
  width: 220px;
}

.catalog-sort-trigger {
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid #AEBAC0;
  border-radius: 8px;
  padding: 0 12px;
  gap: 8px;
  cursor: pointer;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 120%;
  color: #1F1C22;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  text-align: left;
}

.catalog-sort-trigger:active {
  transform: none !important;
}

.catalog-sort-trigger:hover,
.catalog-sort-trigger.open {
  border-color: #9747FF;
}

.catalog-sort-trigger:focus-visible,
.catalog-sort-trigger.open {
  box-shadow: var(--shadow-input-focus);
}

.catalog-sort-trigger > i.ti-sort-ascending {
  color: #9747FF;
  font-size: 20px;
  flex-shrink: 0;
}

.catalog-sort-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1F1C22;
}

.catalog-sort-trigger > i.ti-chevron-down {
  color: #888E92;
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.15s ease;
}

.catalog-sort-trigger.open > i.ti-chevron-down {
  transform: rotate(180deg);
  color: #9747FF;
}

.catalog-sort-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--violet);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 6px;
  z-index: 50;
  box-sizing: border-box;
}

.catalog-sort-dropdown.open {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.catalog-sort-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 120%;
  color: #1F1C22;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-sort-opt:hover {
    background: var(--violet-soft);
    color: #9747FF;
  }
}

.catalog-sort-opt.active {
  background: rgba(151, 71, 255, 0.1);
  color: #9747FF;
  font-weight: 400;
}

.catalog-sort-opt i.ti-check {
  font-size: 16px;
  color: #9747FF;
  display: none;
}

.catalog-sort-opt.active i.ti-check {
  display: inline-block;
}

.mob-search-toggle-btn,
.mob-search-close-btn,
.view-toggle {
  display: none;
}

.mob-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  background: #9747FF;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.mob-view-btn:active {
  transform: scale(0.96);
}

@media (width > 1200px) {
  .mob-view-btn {
    display: none !important;
  }
}

/* Page Body Layout */
.page-body {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px 20px 100px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
  box-sizing: border-box;
}

/* Sidebar Filters */
.filters {
  position: sticky;
  top: 116px;
  background: #F9FAFB;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: none;
  box-shadow: none;
  box-sizing: border-box;
}

.filters-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  border: none;
}

.filters-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 140%;
  letter-spacing: 0.02em;
  color: #1F1C22;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filters-title i {
  font-size: 16px;
  color: #9747FF;
}

.filters-reset {
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 11px;
  line-height: 140%;
  letter-spacing: 0.02em;
  color: #AEBAC0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s ease;
}

.filters-reset:hover {
  color: #9747FF;
}

.filters-reset:active {
  transform: none !important;
}

.filters-reset i {
  font-size: 16px;
  color: #AEBAC0;
}

.filters-reset:hover i {
  color: #9747FF;
}

.filter-group {
  border: none;
  border-top: 1px solid #DDE6EB;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-group-head {
  width: 100%;
  height: 24px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 160%;
  letter-spacing: 0.02em;
  color: #1F1C22;
  user-select: none;
}

.filter-group-head:active {
  transform: none !important;
}

.filter-group-head i {
  font-size: 16px;
  color: #1F1C22;
  transition: transform 0.2s ease;
}

.filter-group-head.open i {
  transform: rotate(180deg);
}

.filter-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.filter-body.hidden {
  display: none;
}

.check-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  cursor: pointer;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 160%;
  color: #1F1C22;
  transition: color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .check-row:hover:not(:has(input:disabled)) {
    color: #9747FF;
  }
  .check-row:hover:not(:has(input:disabled)) input[type="checkbox"] {
    border-color: #9747FF;
  }
}

.check-row input[type="checkbox"] {
  appearance: none;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin: 0;
  background: #FFFFFF;
  border: 1px solid #AEBAC0;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check-row input[type="checkbox"]:checked {
  background: #9747FF;
  border-color: #9747FF;
}

.check-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-row input[type="checkbox"]:disabled {
  background: #F9FAFB;
  border-color: #DDE6EB;
  cursor: not-allowed;
}

.check-row:has(input:checked) {
  color: #9747FF;
}

.check-row:has(input:disabled),
.check-row.is-disabled {
  color: #A0AAB0;
  opacity: 0.38;
  pointer-events: none;
  cursor: not-allowed;
}

.check-count {
  width: 24px;
  height: 24px;
  background: #F9FAFB;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 11px;
  line-height: 140%;
  color: #888E92;
  margin-left: auto;
}

.check-row:has(input:checked) .check-count {
  color: #9747FF;
}

.check-row:has(input:disabled) .check-count,
.check-row.is-disabled .check-count {
  color: #A0AAB0;
}

.price-range {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.price-inp {
  box-sizing: border-box;
  width: 112px;
  height: 40px;
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1px solid #AEBAC0;
  border-radius: 8px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 120%;
  color: #1F1C22;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.price-inp::placeholder {
  color: #888E92;
}

.price-inp:hover {
  border-color: #9747FF;
}

.price-inp:focus {
  border-color: #9747FF;
  box-shadow: var(--shadow-input-focus);
}

.price-sep {
  width: 8px;
  height: 1px;
  background: #DDE6EB;
  color: transparent;
  flex-shrink: 0;
}

/* Catalog Main & Product Grid */
.catalog-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grid.list-view .card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 16px;
  gap: 20px;
  width: 100%;
}

.grid.list-view .card-photo {
  width: 169px;
  min-width: 169px;
  height: 169px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  flex-shrink: 0;
}

.grid.list-view .card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.grid.list-view .card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: none;
  background-image: linear-gradient(90deg, transparent 0%, #DDE6EB 50%, transparent 100%);
  background-size: 100% 1px;
  background-position: top;
  background-repeat: no-repeat;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

@media (width > 640px) {
  .grid.list-view .card {
    padding: 16px 24px;
    gap: 24px;
  }

  .grid.list-view .card-brand {
    font-size: 14px;
    font-weight: 500;
    color: #9747FF;
  }

  .grid.list-view .card-name {
    min-height: auto;
    font-size: 18px;
    font-weight: 700;
    color: #1F1C22;
    line-height: 130%;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .grid.list-view .card-specs {
    min-height: auto;
    font-size: 13px;
    line-height: 140%;
    color: #888E92;
    gap: 3px;
    padding: 2px 0;
  }

  .grid.list-view .card-price {
    font-size: 20px;
    font-weight: 700;
    color: #1F1C22;
    line-height: 120%;
  }

  .grid.list-view .card-price .card-currency {
    font-size: 18px;
    font-weight: 700;
    color: #888E92;
  }

  .grid.list-view .card-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

.card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 0 16px;
  gap: 16px;
  isolation: isolate;
  background: #FFFFFF;
  border: 1px solid var(--border, #DDE6EB);
  border-radius: var(--radius-card-desktop, 16px);
  overflow: hidden;
  text-decoration: none;
  color: #1F1C22;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  box-shadow: var(--shadow-card-hover);
}

.card:active {
  transform: scale(0.985);
}

.card.hidden-item,
.grid.list-view .card.hidden-item {
  display: none !important;
}

.card-photo {
  width: 100%;
  aspect-ratio: 294 / 237;
  position: relative;
  background: #F9FAFB;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.card-photo i {
  font-size: 48px;
  color: #AEBAC0;
}

.card-badges {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.card-badge {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 8px;
  height: 24px;
  border-radius: 16px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 11px;
  line-height: 140%;
  letter-spacing: 0.02em;
  color: #FFFFFF;
}

.badge-sold { background: #FF302B; }
.badge-reserved { background: #1F1C22; }
.badge-top { background: #FF871A; }
.badge-new { background: #86BA0F; }
.badge-sale { background: #9747FF; }
.badge-excellent { background: #86BA0F; }
.badge-good { background: #148AEA; }
.badge-fair { background: #888E92; }

.card-body {
  width: 100%;
  box-sizing: border-box;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-brand {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 140%;
  letter-spacing: 0.02em;
  color: #9747FF;
}

.card-name {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 140%;
  color: #1F1C22;
  min-height: auto;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-specs {
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 140%;
  letter-spacing: 0.02em;
  color: #888E92;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 0;
  min-height: auto;
}

.spec-tag {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.condition-badge {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 8px;
  height: 24px;
  border-radius: 16px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 11px;
  line-height: 140%;
  letter-spacing: 0.02em;
}

.condition-excellent {
  background: rgba(134, 186, 15, 0.08);
  color: #86BA0F;
}

.condition-good {
  background: rgba(20, 138, 234, 0.08);
  color: #148AEA;
}

.condition-fair {
  background: rgba(174, 186, 192, 0.08);
  color: #888E92;
}

.card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border-top: none;
  background-image: linear-gradient(90deg, transparent 0%, #DDE6EB 50%, transparent 100%);
  background-size: 100% 1px;
  background-position: top;
  background-repeat: no-repeat;
  padding-top: 10px;
}

.card-price {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 140%;
  color: #1F1C22;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-currency {
  color: #888E92;
  font-size: 12px;
  font-weight: 300;
}

.card-btn {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  background: #A6D934;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1F1C22;
  font-size: 18px;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

/* Hover-ефекти карток лише для пристроїв із мишкою (запобігає залипанню на тач-екранах) */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: #9747FF;
  }

  .card:hover .card-photo img {
    transform: scale(1.04);
  }

  .card:hover .card-btn {
    transform: translateX(3px);
    background: #9747FF;
    color: #FFFFFF;
  }

  .card:hover .card-footer {
    background-image: linear-gradient(90deg, transparent 0%, #9747FF 50%, transparent 100%);
  }
}

.empty {
  color: #888E92;
  font-family: 'Unbounded', sans-serif;
  font-size: 15px;
  padding: 60px 0;
  text-align: center;
  grid-column: 1 / -1;
}

/* Show More Button */
.show-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 0;
}

.show-more-btn {
  box-sizing: border-box;
  width: 239px;
  height: 56px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 40px;
  gap: 8px;
  background: transparent;
  border: 1px solid #9747FF;
  border-radius: 40px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 140%;
  letter-spacing: 0.03em;
  color: #9747FF;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}

.show-more-btn i {
  font-size: 20px;
  transition: transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .show-more-btn:hover {
    background: #9747FF;
    color: #FFFFFF;
  }

  .show-more-btn:hover i {
    transform: rotate(180deg);
  }
}

.show-more-btn:active {
  background: var(--violet-soft, #F6F0FF);
  transform: scale(0.98);
}

.show-more-btn.hidden {
  display: none;
}

/* Pagination */
.pagination {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 0;
}

.page-button {
  box-sizing: border-box;
  width: 50px;
  height: 50px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 10px;
  background: #F9FAFB;
  border-radius: 8px;
  border: none;
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 140%;
  letter-spacing: 0.03em;
  color: #AEBAC0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-button.page-arrow {
  color: #9747FF;
  font-size: 20px;
}

.page-button:hover:not(:disabled) {
  color: #9747FF;
  background: #f1f3f5;
}

.page-button[aria-current="page"] {
  background: #9747FF;
  color: #FFFFFF;
}

.page-button:disabled {
  cursor: not-allowed;
  color: #DDE6EB;
  opacity: 0.6;
}

/* Mobile Filter Drawer & Backdrop */
.filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31, 28, 34, 0.4);
  z-index: 1100;
  backdrop-filter: blur(2px);
  touch-action: none;
  overscroll-behavior: contain;
}

.filter-overlay.open {
  display: block;
}

.filter-drawer {
  position: fixed;
  right: 0;
  left: auto;
  top: 0;
  bottom: 0;
  width: min(336px, calc(100vw - 24px));
  padding: 0;
  background: #F9FAFB;
  border-radius: 0;
  z-index: 1110;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.filter-drawer.open {
  transform: translateX(0);
  box-shadow: -8px 0 32px rgba(31, 28, 34, 0.16);
}

html.filter-drawer-open, body.filter-drawer-open {
  overflow: hidden !important;
  height: 100% !important;
  overscroll-behavior: none !important;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #DDE6EB;
  background: #F9FAFB;
  flex-shrink: 0;
}

.drawer-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 140%;
  letter-spacing: 0.02em;
  color: #1F1C22;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-title i {
  font-size: 16px;
  color: #9747FF;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: var(--violet-soft);
  color: var(--violet);
  border-radius: 16px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 11px;
  line-height: 130%;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.drawer-count-badge.is-empty {
  background: #FEE2E2;
  color: #DC2626;
}

.drawer-close {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
  background: #1F1C22;
  color: #FFFFFF;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  transform: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .drawer-close:hover {
    background: #9747FF;
    transform: none !important;
  }
}

.drawer-close:active {
  transform: none !important;
  opacity: 0.85;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom, 14px));
  border-top: 1px solid #DDE6EB;
  background: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.drawer-reset-btn {
  height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  background: #FFFFFF;
  color: #1F1C22;
  border: 1px solid #AEBAC0;
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .drawer-reset-btn:hover {
    color: #9747FF;
    border-color: #9747FF;
    background: var(--violet-soft);
  }
}

.drawer-reset-btn:active {
  transform: scale(0.97);
}

.drawer-apply {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  background: #9747FF;
  color: #FFFFFF;
  border: none;
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .drawer-apply:hover:not(:disabled) {
    background: #8432ef;
    box-shadow: var(--shadow-btn-violet);
  }
}

.drawer-apply:active:not(:disabled) {
  transform: scale(0.97);
}

.drawer-apply:disabled {
  background: #DDE6EB;
  color: #888E92;
  cursor: not-allowed;
  opacity: 0.9;
}

.mob-filter-btn {
  display: none;
}

/* Responsive Media Queries (Range Syntax 2026) */
@media (width <= 1570px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (width <= 1200px) {
  .page-body {
    grid-template-columns: 280px 1fr;
    gap: 24px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .catalog-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }
  .toolbar-search-row {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
  }
  .toolbar-search-row .search-wrap {
    width: 100%;
    flex: 1;
  }
  .toolbar-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    width: auto;
  }
  .catalog-sort-custom {
    width: 220px;
    flex: 0 0 220px;
  }
}

@media (width <= 860px) {
  .filter-overlay {
    top: 64px;
    inset: 64px 0 0 0;
    z-index: 1000;
  }
  .filter-drawer {
    top: 64px;
    height: calc(100dvh - 64px);
    max-height: calc(100dvh - 64px);
    border-radius: 0;
    z-index: 1001;
  }
  .catalog-title-row {
    height: auto;
    padding: 16px 20px;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .catalog-title-row h1 {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    font-size: 24px;
    margin: 0;
    gap: 12px;
  }
  .catalog-title-row .catalog-title-text {
    font-size: 24px;
    font-weight: 500;
  }
  .catalog-title-row .catalog-results-count,
  .catalog-title-row h1 span:not(.catalog-title-text) {
    font-size: 16px;
    font-weight: 400;
  }
  .catalog-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }
  .toolbar-search-row {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
  }
  .toolbar-search-row .view-toggle {
    display: none;
  }
  .toolbar-search-row .search-wrap {
    width: 100%;
    flex: 1;
    position: relative;
  }
  .search-wrap > i.search-icon-input {
    display: block;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888E92;
    font-size: 18px;
    pointer-events: none;
  }
  .search-inp {
    display: block;
    width: 100%;
    height: 48px;
    padding: 10px 16px 10px 42px;
    font-size: 14px;
    border: 1px solid #DDE6EB;
    border-radius: 8px;
  }
  .toolbar-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    width: auto;
  }
  .mob-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: #9747FF;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease, transform 0.1s ease;
  }
  .mob-view-btn:active {
    transform: scale(0.96);
  }
  .mob-search-toggle-btn,
  .mob-search-close-btn {
    display: none !important;
  }
  .drawer-body .price-inp {
    font-size: 16px;
  }
  .catalog-sort-custom {
    width: 220px;
    flex: 0 0 220px;
  }
  .catalog-sort-trigger {
    height: 48px;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 12px;
  }
  .page-body {
    grid-template-columns: 1fr;
    padding: 16px 20px 64px;
    gap: 24px;
  }
  .filters {
    display: none;
  }
  .mob-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 48px;
    padding: 0 14px;
    border-radius: 8px;
    background: #9747FF;
    color: #FFFFFF;
    border: none;
    font-family: 'Unbounded', sans-serif;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease;
    flex-shrink: 0;
  }
  .mob-filter-btn i {
    font-size: 18px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .mob-view-btn:hover,
  .mob-filter-btn:hover {
    background: #8030e8;
  }
  .mob-search-toggle-btn:hover {
    border-color: #9747FF;
  }
}

@media (width <= 640px) {
  .catalog-breadcrumb {
    height: 40px;
    width: 100%;
    box-sizing: border-box;
  }

  .catalog-breadcrumb-inner {
    font-size: 11px;
    padding: 0 16px;
    gap: 6px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .catalog-breadcrumb-inner::-webkit-scrollbar {
    display: none;
  }

  .catalog-breadcrumb-inner a,
  .catalog-breadcrumb-inner i,
  .catalog-breadcrumb-inner span {
    flex-shrink: 0;
  }

  .catalog-breadcrumb-inner a {
    font-size: 11px;
  }

  .catalog-breadcrumb-inner i {
    font-size: 14px;
  }

  .catalog-breadcrumb-inner span {
    color: #888E92;
    font-size: 11px;
  }
}

@media (width <= 640px) {

  .catalog-title-row {
    height: auto;
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
  }

  .catalog-title-row h1 {
    width: 100%;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: 0.02em;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin: 0;
  }

  .catalog-title-row .catalog-title-text {
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: 0.02em;
    color: #1F1C22;
    white-space: nowrap;
  }

  .catalog-title-row .catalog-results-count,
  .catalog-title-row h1 span:not(.catalog-title-text) {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0.02em;
    color: #888E92;
    white-space: nowrap;
  }

  @media (width <= 360px) {
    .catalog-title-row h1 {
      font-size: 18px;
    }
    .catalog-title-row .catalog-title-text {
      font-size: 18px;
      line-height: 24px;
    }
    .catalog-title-row .catalog-results-count,
    .catalog-title-row h1 span:not(.catalog-title-text) {
      font-size: 14px;
      line-height: 20px;
    }
    .catalog-toolbar {
      gap: 6px;
    }
    .toolbar-search-row {
      gap: 6px;
    }
    .mob-view-btn,
    .mob-search-toggle-btn {
      width: 36px;
      height: 36px;
      min-width: 36px;
      min-height: 36px;
      font-size: 16px;
    }
    .catalog-sort-trigger,
    .mob-filter-btn {
      height: 36px;
    }
    .mob-filter-btn {
      padding: 0 8px;
      font-size: 11px;
    }
    .catalog-sort-trigger {
      padding: 0 6px;
      font-size: 12px;
    }
    .grid {
      gap: 10px;
    }
    .card-body {
      padding: 0 6px;
    }
    .grid.list-view .card-photo {
      width: 104px;
      min-width: 104px;
      height: 104px;
    }
  }

  .page-body {
    padding: 8px 16px 48px;
    gap: 20px;
  }

  .catalog-main {
    gap: 24px;
  }

  .catalog-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 0;
  }

  .toolbar-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    width: auto;
  }

  .toolbar-search-row .view-toggle {
    display: none !important;
  }

  .mob-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 18px;
  }

  .search-wrap {
    display: flex;
    align-items: center;
    width: auto;
    flex: 0 0 auto;
    position: relative;
  }

  .mob-search-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    background: #FFFFFF;
    color: #9747FF;
    border: 1px solid #DDE6EB;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  }

  .mob-search-toggle-btn:active {
    transform: scale(0.96);
  }

  .mob-search-close-btn {
    display: none;
  }

  .search-wrap > i.search-icon-input,
  .search-wrap > .search-inp,
  .search-wrap > .search-clear-btn {
    display: none;
  }

  .toolbar-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    height: 40px;
    width: auto;
    justify-content: flex-start;
  }

  .catalog-sort-custom {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .catalog-sort-trigger {
    height: 40px;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 12px;
    gap: 4px;
  }

  .catalog-sort-trigger > i.ti-sort-ascending,
  .catalog-sort-trigger > i.ti-chevron-down {
    font-size: 16px;
  }

  .catalog-sort-opt {
    padding: 8px 10px;
    font-size: 12px;
  }

  .mob-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    background: #9747FF;
    color: #FFFFFF;
    border: none;
    font-family: 'Unbounded', sans-serif;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease;
    flex-shrink: 0;
  }

  .mob-filter-btn i {
    font-size: 16px;
  }

  /* Mobile Search Active State */
  .catalog-toolbar.search-active .toolbar-controls-row {
    display: none !important;
  }

  .catalog-toolbar.search-active .toolbar-search-row {
    flex: 1;
    width: 100%;
  }

  .catalog-toolbar.search-active .mob-view-btn {
    display: none !important;
  }

  .catalog-toolbar.search-active .mob-search-toggle-btn {
    display: none !important;
  }

  .catalog-toolbar.search-active .search-wrap {
    display: flex;
    flex: 1;
    width: 100%;
    position: relative;
  }

  .catalog-toolbar.search-active .search-wrap > i.search-icon-input {
    display: flex !important;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9747FF;
    font-size: 18px;
    pointer-events: none;
  }

  .catalog-toolbar.search-active .search-inp {
    display: block !important;
    width: 100%;
    height: 40px;
    padding: 8px 36px 8px 38px;
    font-size: 14px;
    border-radius: 8px;
    outline: none;
    background: #FFFFFF;
    color: #1F1C22;
    box-sizing: border-box;
  }

  .catalog-toolbar.search-active .mob-search-close-btn {
    display: flex !important;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #EEF2F6;
    color: #1F1C22;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }

  .catalog-toolbar.search-active .mob-search-close-btn:hover {
    background: #DDE6EB;
  }

  .catalog-toolbar.search-active .mob-search-close-btn:active {
    transform: translateY(-50%) !important;
    background: #DDE6EB;
  }

  .catalog-toolbar.search-active .search-clear-btn {
    display: none !important;
  }

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

  .card {
    border-radius: var(--radius-card-mobile, 8px);
    padding: 0 0 8px;
    gap: 8px;
  }

  .card-photo {
    aspect-ratio: 156 / 126;
    border-radius: 8px 8px 0 0;
  }

  .card-badges {
    left: 8px;
    top: 8px;
    gap: 4px;
  }

  .card-badge {
    height: 16px;
    padding: 0 6px;
    border-radius: 16px;
    font-size: 9px;
    line-height: 130%;
  }

  .card-body {
    padding: 0 8px;
    gap: 4px;
  }

  .card-brand {
    font-size: 12px;
    line-height: 130%;
    font-weight: 400;
  }

  .card-name {
    font-size: 12px;
    font-size: 13px;
    line-height: 130%;
    font-weight: 400;
    min-height: auto;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-specs {
    font-size: 10px;
    line-height: 135%;
    min-height: auto;
    gap: 4px;
    padding: 5px 0;
    color: #888E92;
  }

  .card-footer {
    border-top: none;
    background-image: linear-gradient(90deg, transparent 0%, #DDE6EB 50%, transparent 100%);
    background-size: 100% 1px;
    background-position: top;
    background-repeat: no-repeat;
    padding-top: 8px;
  }

  .card-price {
    font-size: 14px;
    line-height: 140%;
    gap: 3px;
  }

  .card-currency {
    font-size: 12px;
    line-height: 140%;
    font-weight: 300;
  }

  .card-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
    border-radius: 40px;
  }

  .grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .grid.list-view .card {
    flex-direction: row;
    align-items: stretch;
    padding: 8px;
    gap: 12px;
    border-radius: var(--radius-card-mobile, 8px);
  }

  .grid.list-view .card-photo {
    width: 120px;
    min-width: 120px;
    height: 120px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .grid.list-view .card-badges {
    left: 6px;
    top: 6px;
  }

  .grid.list-view .card-body {
    padding: 0;
    gap: 4px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
  }

  .grid.list-view .card-brand {
    font-size: 11px;
    font-size: 12px;
    line-height: 130%;
    font-weight: 400;
  }

  .grid.list-view .card-name {
    font-size: 13px;
    line-height: 130%;
    font-weight: 500;
    font-weight: 400;
    min-height: auto;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .grid.list-view .card-specs {
    font-size: 10px;
    line-height: 135%;
    min-height: auto;
    gap: 3px;
    padding: 2px 0;
    color: #888E92;
  }

  .grid.list-view .spec-tag {
    font-size: 10px;
    line-height: 135%;
    font-weight: 300;
  }

  .grid.list-view .card-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    margin-top: auto;
    border-top: none;
    background-image: linear-gradient(90deg, transparent 0%, #DDE6EB 50%, transparent 100%);
    background-size: 100% 1px;
    background-position: top;
    background-repeat: no-repeat;
    width: 100%;
  }

  .grid.list-view .card-price {
    font-size: 14px;
    line-height: 140%;
    font-weight: 400;
    gap: 3px;
    display: flex;
    align-items: baseline;
  }

  .grid.list-view .card-price .price-val {
    font-size: 14px;
    font-weight: 700;
    font-weight: 400;
  }

  .grid.list-view .card-price .card-currency,
  .grid.list-view .card-currency {
    font-size: 12px;
    font-weight: 300;
    line-height: 140%;
  }

  .grid.list-view .card-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
    border-radius: 40px;
    flex-shrink: 0;
  }

  .show-more-wrap {
    width: 100%;
    margin-top: 8px;
  }

  .show-more-btn {
    width: 100%;
    max-width: 328px;
    height: 48px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 400;
    padding: 0 16px;
  }

  .pagination {
    gap: 8px;
    margin-top: 16px;
  }

  .page-button {
    width: 40px;
    height: 40px;
    font-size: 15px;
    border-radius: 8px;
    padding: 0;
  }

  .page-button.page-arrow {
    font-size: 20px;
  }
}
