/* ======================
   Category products list (desktop baseline)
====================== */

.category-products-list .product-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;

  background: var(--color-bg);
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.category-products-list .product-row:hover {
  border-color: var(--color-border-dark);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.10);
}

.category-products-list .product-row,
.category-products-list .product-row * {
  min-width: 0;
}

.category-products-list .product-image {
  width: 140px;
  height: 140px;
  padding-right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.category-products-list .product-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.category-products-list .product-info {
  overflow: hidden;
}

.category-products-list .product-info a,
.category-products-list .product-info strong,
.category-products-list .product-info span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.category-products-list .product-info a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s ease;
}

.category-products-list .product-info a:hover,
.category-products-list .product-info a:focus,
.category-products-list .product-info a:active {
  color: var(--color-accent-light);
}

.category-products-list .product-buy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.category-products-list .product-buy > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* ======================
   Layout
====================== */

.category-products-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}

.category-products-sidebar {
  position: sticky;
  top: 90px;
}

/* ======================
   Product filters
====================== */

.product-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;

  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.product-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-filter-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-primary);
}

.product-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;

  min-height: 24px;
  padding: 2px 4px;

  font-size: 14px;
  line-height: 1.3;
  color: var(--color-text);
  cursor: pointer;
}

.product-filter-option:hover {
  background: var(--color-bg-soft);
  border-radius: var(--radius-sm);
}

.product-filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;

  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.product-filter-option span {
  word-break: break-word;
}

.product-filter-availability {
  display: grid;
  grid-template-columns: 16px 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.product-filter-availability img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.product-filter-availability span {
  white-space: normal;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
}

.product-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.product-filter-submit {
  padding: 6px 12px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: 1px solid var(--color-primary-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
}

.product-filter-submit:hover {
  background: var(--color-primary-dark);
}

.product-filter-reset {
  padding: 6px 12px;
  background: var(--color-bg-soft);
  color: var(--color-text-mid);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
}

.product-filter-reset:hover {
  background: var(--color-bg-muted);
  text-decoration: none;
}

/* ======================
   Price slider
====================== */

.price-range-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-mid);
}

.price-slider {
  position: relative;
  height: 32px;
  margin-top: 6px;
}

.price-slider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 13px;

  height: 6px;
  border-radius: 999px;
  background: var(--color-border-dark);
}

.price-slider::after {
  content: "";
  position: absolute;
  left: var(--range-left, 0%);
  right: calc(100% - var(--range-right, 100%));
  top: 13px;

  height: 6px;
  border-radius: 999px;
  background: var(--color-primary);
}

.price-slider input[type="range"] {
  position: absolute;
  left: -8px;
  top: 6px;

  width: calc(100% + 8px);

  height: 20px;

  background: transparent;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  z-index: 3;
}

.price-slider input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
  border: none;
}

.price-slider input[type="range"]::-moz-range-track {
  background: transparent;
  border: none;
}

.price-slider input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;

  background: var(--color-primary);
  border: 2px solid var(--color-bg);
  box-shadow: var(--shadow-soft);

  cursor: pointer;
  pointer-events: auto;

  appearance: none;
  -webkit-appearance: none;
}

.price-slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;

  background: var(--color-primary);
  border: 2px solid var(--color-bg);
  box-shadow: var(--shadow-soft);

  cursor: pointer;
  pointer-events: auto;
}

/* ======================
   Responsive
====================== */

@media (max-width: 900px) {
  .category-products-layout {
    grid-template-columns: 1fr;
  }

  .category-products-sidebar {
    position: static;
  }
}