/* Teaspot product card */
.ts-product-grid {
  --card-gap: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
  width: 100%;
  margin: 0 0 32px;
}

.ts-product-grid--catalog {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ts-filter-card {
  background: #ffffff;
  border-radius: var(--radius-card, 24px);
  min-height: 100%;
  box-sizing: border-box;
  padding: 20px;
}

.ts-filter-card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text, #1A1A1A);
  margin: 0 0 8px;
}

.ts-filter-card__hint {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: rgba(26, 26, 26, 0.6);
}

.ts-section-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text, #1A1A1A);
  margin: 0 0 20px;
}

.ts-card {
  --card-pad: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-card, 24px);
  padding: var(--card-pad);
  padding-bottom: 28px;
  box-sizing: border-box;
  min-width: 0;
  height: 100%;
}

.ts-card__wish {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-btn, 10px);
  background: var(--color-surface, #F2F2F2);
  color: var(--color-wish, #3F4E3E);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  box-shadow: none;
}

.ts-card__wish:hover,
.ts-card__wish:focus,
.ts-card__wish:active {
  outline: none;
  box-shadow: none;
  background: var(--color-surface-hover, #E5E3E3);
  color: var(--color-wish, #3F4E3E);
}

.ts-card__wish.is-active {
  color: var(--color-wish-active, #E50404);
}

.ts-card__wish.is-active:hover,
.ts-card__wish.is-active:focus,
.ts-card__wish.is-active:active {
  color: var(--color-wish-active, #E50404);
}

.ts-card__wish-icon {
  width: 18px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.ts-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: var(--card-media-max, 266px);
  margin: 0 auto 16px;
  text-decoration: none;
}

.ts-card__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.ts-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  line-height: 1.2;
  min-height: 18px;
}

.ts-card__star {
  width: var(--card-star, 15px);
  height: var(--card-star, 15px);
  flex-shrink: 0;
  object-fit: contain;
}

.ts-card__rating-value {
  font-size: var(--font-card-rating, 14px);
  font-weight: 700;
  color: var(--color-text, #1A1A1A);
}

.ts-card__rating-sep {
  font-size: var(--font-card-reviews, 14px);
  font-weight: 500;
  color: rgba(26, 26, 26, 0.6);
  line-height: 1;
}

.ts-card__rating-meta,
.ts-card__rating-empty {
  font-size: var(--font-card-reviews, 14px);
  font-weight: 500;
  color: rgba(26, 26, 26, 0.6);
}

.ts-card__title {
  --card-title-lines: 2;
  --card-title-lh: 1.25;
  position: relative;
  display: block;
  font-size: var(--font-card-title, 20px);
  font-weight: 700;
  line-height: var(--card-title-lh);
  color: var(--color-text, #1A1A1A);
  text-decoration: none;
  margin: 0 0 16px;
  height: calc(1em * var(--card-title-lh) * var(--card-title-lines));
  overflow: hidden;
}

.ts-card__title-text {
  display: block;
}

.ts-card__title.is-truncated::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 42%;
  height: calc(1em * var(--card-title-lh));
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 72%);
  pointer-events: none;
}

.ts-card__title:hover,
.ts-card__title:focus {
  color: var(--color-text, #1A1A1A);
  text-decoration: none;
  outline: none;
}

.ts-card__grams {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: var(--card-grams-height, 44px);
  background: var(--color-surface, #F2F2F2);
  border-radius: var(--radius-grams, 14px);
  padding: 2px;
  box-sizing: border-box;
  margin: 0 0 16px;
  overflow: hidden;
}

.ts-card__gram {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  border-radius: var(--radius-grams-active, 13px);
  font-size: var(--font-card-grams, 14px);
  font-weight: 600;
  color: rgba(26, 26, 26, 0.6);
  cursor: pointer;
  padding: 0 4px;
  outline: none;
  box-shadow: none;
  white-space: nowrap;
}

.ts-card__gram:hover,
.ts-card__gram:focus,
.ts-card__gram:active {
  outline: none;
  box-shadow: none;
}

.ts-card__gram.is-active {
  background: var(--color-grams-active, #D8DAD8);
  color: var(--color-text, #1A1A1A);
}

/* Одна граммовка — только отображение, без переключения; без фона active */
.ts-card__grams--single {
  pointer-events: none;
}

.ts-card__grams--single .ts-card__gram,
.ts-card__grams--single .ts-card__gram.is-active {
  cursor: default;
  flex: 1 1 auto;
  background: transparent;
  color: rgba(26, 26, 26, 0.6);
}

.ts-card__grams--single .ts-card__gram:disabled {
  opacity: 1;
  -webkit-appearance: none;
  appearance: none;
}

/* Бейдж характеристики (Материал и т.п.) — только значение, без переключения */
.ts-card__grams--attr .ts-card__gram {
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-card__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin: 0 0 16px;
}

.ts-card__price {
  font-size: var(--font-card-price, 28px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text, #1A1A1A);
}

.ts-card__price--sale {
  color: var(--color-sale, #E50404);
}

.ts-card__price-old {
  font-size: var(--font-card-unit, 14px);
  font-weight: 500;
  line-height: 1.3;
  color: rgba(26, 26, 26, 0.6);
  text-decoration: line-through;
}

.ts-card__unit {
  font-size: var(--font-card-unit, 14px);
  font-weight: 500;
  color: rgba(26, 26, 26, 0.6);
  line-height: 1.3;
}

.ts-card__actions {
  width: 100%;
  margin-top: auto;
}

.ts-card__cart {
  width: 100%;
  height: var(--card-grams-height, 44px);
  border: 0;
  border-radius: var(--radius-btn, 10px);
  font-size: var(--font-btn, 16px);
  font-weight: var(--font-btn-weight, 500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  outline: none;
  box-shadow: none;
}

.ts-card__actions.is-in-cart .ts-card__cart {
  display: none;
}

.ts-card__cart:hover,
.ts-card__cart:focus,
.ts-card__cart:active {
  outline: none;
  box-shadow: none;
  filter: brightness(1.05);
}

/* Как на PDP: приглушённый фон, не яркий brand-primary */
button.ts-card__cart.ts-btn--catalog.is-oos,
button.ts-card__cart.is-oos,
.ts-card__cart:disabled.is-oos,
.ts-card__cart.is-oos {
  background: #9AA396 !important;
  color: #fff !important;
  opacity: 1;
  cursor: not-allowed;
  filter: none !important;
  pointer-events: none;
}

button.ts-card__cart.ts-btn--catalog.is-oos:hover,
button.ts-card__cart.ts-btn--catalog.is-oos:focus,
button.ts-card__cart.ts-btn--catalog.is-oos:active,
.ts-card__cart.is-oos:hover,
.ts-card__cart.is-oos:focus,
.ts-card__cart.is-oos:active,
.ts-card__cart:disabled:hover,
.ts-card__cart:disabled:focus,
.ts-card__cart:disabled:active {
  background: #9AA396 !important;
  color: #fff !important;
  filter: none !important;
}

.ts-card__cart-plus {
  font-size: 18px;
  line-height: 1;
  font-weight: 500;
}

.ts-card__qty {
  display: none;
  width: 100%;
  height: var(--card-grams-height, 44px);
  border-radius: var(--radius-btn, 10px);
  background: var(--color-surface, #F2F2F2);
  color: var(--color-text, #1A1A1A);
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 0 4px;
}

.ts-card__actions.is-in-cart .ts-card__qty {
  display: inline-flex;
}

.ts-card__qty-btn {
  width: 36px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  padding: 0;
  flex-shrink: 0;
}

.ts-card__qty-btn:hover,
.ts-card__qty-btn:focus,
.ts-card__qty-btn:active {
  outline: none;
  box-shadow: none;
  background: rgba(26, 26, 26, 0.06);
}

.ts-card__qty-value {
  flex: 1 1 auto;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  min-width: 1.5em;
  user-select: none;
}

.ts-card__actions.is-busy {
  pointer-events: none;
  opacity: 0.72;
}

@media (max-width: 1280px) {
  .ts-product-grid,
  .ts-product-grid--catalog {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .ts-product-grid,
  .ts-product-grid--catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .ts-filter-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .ts-product-grid,
  .ts-product-grid--catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.ts-mobile-cols-1 .ts-product-grid,
  body.ts-mobile-cols-1 .ts-product-grid--catalog {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ts-card {
    --card-pad: 12px;
    padding-bottom: 16px;
    border-radius: 18px;
  }

  body.ts-mobile-cols-1 .ts-card {
    --card-pad: 16px;
    padding-bottom: 20px;
    border-radius: var(--radius-card, 24px);
  }

  .ts-card__wish {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }

  .ts-card__wish-icon {
    width: 14px;
    height: 12px;
  }

  .ts-card__media {
    margin-bottom: 10px;
  }

  .ts-card__rating {
    margin-bottom: 6px;
    gap: 4px;
  }

  .ts-card__rating-value,
  .ts-card__rating-meta,
  .ts-card__rating-empty {
    font-size: 12px;
  }

  .ts-card__title {
    font-size: 13px;
    margin-bottom: 10px;
  }

  body.ts-mobile-cols-1 .ts-card__title {
    font-size: 18px;
  }

  .ts-card__grams {
    height: 34px;
    margin-bottom: 10px;
    border-radius: 10px;
  }

  .ts-card__gram {
    font-size: 10px;
    padding: 0 2px;
    border-radius: 9px;
  }

  .ts-card__price-row {
    gap: 4px 8px;
    margin-bottom: 10px;
  }

  .ts-card__price {
    font-size: 18px;
  }

  body.ts-mobile-cols-1 .ts-card__price {
    font-size: 24px;
  }

  .ts-card__price-old,
  .ts-card__unit {
    font-size: 11px;
  }

  .ts-card__cart {
    height: 34px; /* = .ts-card__grams на ≤768 */
    font-size: 13px;
    gap: 4px;
  }

  .ts-card__qty {
    height: 34px;
  }

  .ts-card__qty-btn {
    width: 32px;
    height: 28px;
    font-size: 20px;
  }

  .ts-card__qty-value {
    font-size: 14px;
  }

  .ts-card__cart-plus {
    font-size: 15px;
  }

  body.ts-mobile-cols-1 .ts-card__cart {
    font-size: var(--font-btn, 16px);
  }
}
