.tm-block-products {
  margin-top: 0;
  margin-bottom: 0;
  container-type: inline-size;
  --tm-products-columns: 4;
  --tm-products-gap: 1rem;
  --tm-products-visible-columns: var(--tm-products-columns);
}

.tm-block-products__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  margin: 0 0 1rem;
}

.tm-block-products__title {
  margin: 0;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}

.tm-block-products__nav {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex: 0 0 auto;
}

.tm-block-products__nav-btn {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.tm-block-products__nav-btn span {
  display: block;
  font-size: 1.65rem;
  line-height: 1;
  transform: translateY(-1px);
}

.tm-block-products__nav-btn:hover:not(:disabled),
.tm-block-products__nav-btn:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .12);
}

.tm-block-products__nav-btn:disabled {
  opacity: .38;
  cursor: default;
}

.tm-shop-products ul.products {
  display: grid;
  grid-template-columns: repeat(var(--tm-products-columns), minmax(0, 1fr));
  gap: var(--tm-products-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tm-block-products--carousel .tm-shop-products {
  overflow: hidden;
}

.tm-block-products--carousel .tm-shop-products ul.products {
  display: flex !important;
  grid-template-columns: none;
  flex-wrap: nowrap;
  gap: var(--tm-products-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tm-block-products--carousel .tm-shop-products ul.products::-webkit-scrollbar {
  display: none;
}

.tm-shop-products ul.products::before,
.tm-shop-products ul.products::after {
  display: none;
  content: none;
}

.tm-shop-products ul.products li.product {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  float: none;
  clear: none;
  padding: 0;
  list-style: none;
}

.tm-shop-products .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.tm-block-products--carousel .tm-shop-products ul.products li.product {
  flex: 0 0 calc((100% - (var(--tm-products-gap) * (var(--tm-products-visible-columns) - 1))) / var(--tm-products-visible-columns));
  min-width: 0;
  scroll-snap-align: start;
}

.tm-shop-products ul.products li.product img {
  border-radius: .75rem;
  margin-bottom: .75rem;
}

.tm-shop-products ul.products li.product .woocommerce-loop-product__title {
  font-size: 1rem;
  margin: .25rem 0 .5rem;
}

.tm-shop-products ul.products li.product .price {
  font-weight: 700;
}

.tm-shop-products .tm-product-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
  transition: transform .18s ease, box-shadow .18s ease;
  background: #fff;
}

.tm-shop-products .tm-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .09);
}

.tm-shop-products .tm-product-card__media,
.tm-shop-products .tm-product-card__body {
  position: relative;
  z-index: 2;
}

.tm-shop-products .tm-product-card__media { padding: .55rem .55rem 0; }

.tm-shop-products .tm-product-card__image-wrap {
  border-radius: .85rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.tm-shop-products .tm-product-card__img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  padding: .55rem;
  background: #fff;
}

.tm-shop-products .tm-product-card__img-hover,
.tm-shop-products .tm-product-card__actions,
.tm-shop-products .tm-product-card__view {
  display: none !important;
}

.tm-shop-products .tm-product-card__badges {
  position: absolute;
  top: .75rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.tm-shop-products .tm-product-card__badges--left { left: .75rem; }
.tm-shop-products .tm-product-card__badges--right { right: .75rem; align-items: flex-end; }

.tm-shop-products .tm-badge-chip {
  padding: .25rem .55rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .01em;
  display: inline-flex;
  align-items: center;
}

.tm-shop-products .tm-badge-chip--new { background: #f5d7d7; color: #0f172a !important; }
.tm-shop-products .tm-badge-chip--soft { background: rgba(255,255,255,.94); color: #334155 !important; }
.tm-shop-products .tm-badge-chip.text-bg-dark { background: #0f172a !important; color: #fff !important; }
.tm-shop-products .tm-badge-chip.text-bg-danger { background: #dc2626 !important; color: #fff !important; }
.tm-shop-products .tm-badge-chip.text-bg-warning { background: #f59e0b !important; color: #0f172a !important; }

.tm-shop-products .tm-product-card__body { padding: .75rem .75rem .8rem; }

.tm-shop-products .tm-product-card__meta-top {
  min-width: 0;
}

.tm-shop-products .tm-product-card__brand,
.tm-shop-products .tm-product-card__category {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.55rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tm-shop-products .tm-product-card__brand {
  background: color-mix(in srgb, var(--tm-accent) 18%, #ffffff);
  color: #0f172a;
}

.tm-shop-products .tm-product-card__category { background: #f1f5f9; color: #64748b; }

.tm-shop-products .tm-product-card__title {
  font-size: .9rem;
  line-height: 1.35;
  font-weight: 600;
  min-height: 2.45rem;
  margin: 0;
  color: #111827;
  overflow-wrap: anywhere;
  word-break: normal;
}

.tm-shop-products .tm-product-card__rating {
  color: #64748b;
  font-size: .72rem;
  line-height: 1.2;
}

.tm-shop-products .tm-product-card__rating .star-rating {
  margin: 0;
  font-size: .78rem;
}

.tm-shop-products .tm-product-card__rating-count,
.tm-shop-products .tm-product-card__rating-empty {
  font-size: .72rem;
}

.tm-shop-products .tm-product-card__price-wrap {
  border-top: 1px solid rgba(15,23,42,.08);
}

.tm-shop-products .tm-product-card__price-row {
  gap: .5rem;
}

.tm-shop-products .tm-product-card__price .price {
  display: flex;
  gap: .35rem;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 0;
  line-height: 1.2;
  min-width: 0;
}

.tm-shop-products .tm-product-card__price ins {
  text-decoration: none;
  color: #0f172a;
  font-weight: 800;
}

.tm-shop-products .tm-product-card__price ins bdi,
.tm-shop-products .tm-product-card__price > .price > bdi {
  font-size: 1.08rem;
}

.tm-shop-products .tm-product-card__price del { color: #94a3b8; font-size: .78rem; }

.tm-shop-products .tm-product-card__cart,
.tm-shop-products .tm-product-card__cart .button,
.tm-shop-products .tm-product-card__cart a.button,
.tm-shop-products .tm-product-card__cart .added_to_cart {
  position: relative;
  z-index: 4;
}

.tm-shop-products .tm-product-card__cart {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .4rem;
}

.tm-shop-products .tm-product-card__cart .button,
.tm-shop-products .tm-product-card__cart a.button,
.tm-shop-products .tm-product-card__cart .added_to_cart {
  width: auto;
  margin: 0 !important;
  border-radius: .55rem !important;
  text-align: center;
  padding: .42rem .65rem !important;
  font-size: .72rem !important;
  line-height: 1.1;
  white-space: nowrap;
}

.tm-shop-products .tm-product-card__bottom {
  min-height: 1rem;
}

.tm-shop-products .tm-product-card__stock {
  font-weight: 600;
  font-size: .72rem;
}

.tm-shop-products .tm-product-card__stock--in { color: #15803d; }
.tm-shop-products .tm-product-card__stock--low { color: #b45309; }
.tm-shop-products .tm-product-card__stock--out { color: #b91c1c; }

.tm-shop-products .tm-product-card__sku {
  font-size: .68rem;
  color: #64748b;
}

@media (max-width: 991.98px) {
  .tm-shop-products .tm-product-card__title { min-height: auto; }
  .tm-shop-products .tm-product-card__price-row {
    flex-wrap: wrap;
    align-items: stretch !important;
  }
  .tm-shop-products .tm-product-card__cart .button,
  .tm-shop-products .tm-product-card__cart a.button,
  .tm-shop-products .tm-product-card__cart .added_to_cart {
    width: 100%;
  }
}

.tm-shop-products .tm-product-card__image-link,
.tm-shop-products .tm-product-card__title-link {
  color: inherit;
  text-decoration: none;
}

.tm-shop-products .tm-product-card__image-link:hover,
.tm-shop-products .tm-product-card__title-link:hover {
  color: inherit;
}

.tm-shop-products .tm-product-card__cart .button,
.tm-shop-products .tm-product-card__cart a.button,
.tm-shop-products .tm-product-card__cart .added_to_cart,
.tm-shop-products .tm-loop-add-to-cart {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: var(--tm-accent) !important;
  border-color: var(--tm-accent) !important;
  color: var(--tm-accent-text) !important;
  min-height: 32px;
}

.tm-shop-products .tm-product-card__cart .added_to_cart {
  width: 100%;
  justify-content: center;
  background: color-mix(in srgb, var(--tm-accent) 18%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--tm-accent) 18%, #ffffff) !important;
  color: #0f172a !important;
}

.tm-shop-products .tm-product-card__cart .button:hover,
.tm-shop-products .tm-product-card__cart a.button:hover,
.tm-shop-products .tm-product-card__cart .added_to_cart:hover,
.tm-shop-products .tm-loop-add-to-cart:hover {
  filter: brightness(.98);
}

@media (max-width: 575.98px) {
  .tm-block-products {
    --tm-products-visible-columns: 1;
  }

  .tm-block-products__header {
    align-items: flex-start;
  }

  .tm-block-products__title {
    font-size: 1.2rem;
  }

  .tm-shop-products ul.products {
    grid-template-columns: 1fr;
  }
}

@container (max-width: 420px) {
  .tm-shop-products {
    --tm-products-gap: .75rem;
    --tm-products-visible-columns: 1;
  }

  .tm-shop-products ul.products {
    grid-template-columns: 1fr !important;
  }

  .tm-block-products--carousel .tm-shop-products ul.products li.product {
    flex-basis: 100%;
  }

  .tm-block-products__header {
    align-items: flex-start;
  }

  .tm-block-products__title {
    font-size: 1.2rem;
  }

  .tm-shop-products .tm-product-card__title {
    min-height: auto;
  }
}

@container (min-width: 421px) and (max-width: 760px) {
  .tm-shop-products {
    --tm-products-visible-columns: 2;
  }

  .tm-shop-products ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

[data-tm-shop-sidebar] .tm-block-products {
  --tm-products-gap: .75rem;
}

[data-tm-shop-sidebar] .tm-block-products .tm-shop-products ul.products {
  grid-template-columns: 1fr !important;
}

[data-tm-shop-sidebar] .tm-block-products--carousel .tm-shop-products ul.products li.product {
  flex-basis: 100%;
}

[data-tm-shop-sidebar] .tm-block-products .tm-product-card__title {
  min-height: auto;
}

.tm-product-block__inner {
  width: 100%;
}

.tm-product-block__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tm-product-block__list--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.tm-product-block__list--carousel {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 8px;
}

.tm-product-block__list--carousel .product {
  min-width: 270px;
  flex: 0 0 270px;
}

.tm-product-block__hint {
  margin-top: 12px;
  font-size: 0.95rem;
  color: #606060;
}

.tm-block-products {
  padding-top: var(--tm-products-margin-top, 0px);
  padding-bottom: var(--tm-products-margin-bottom, 20px);
}
