:root {
  --ch-range-track: #d7dee8;
}
.price-slider {
  display: grid;
  gap: 6px;
}
.price-values {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}
.slider-wrap {
  position: relative;
  height: 28px;
}
.slider-wrap input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  pointer-events: none;
  appearance: none; /* стандартное свойство */
  -webkit-appearance: none; /* Chrome, Safari */
  -moz-appearance: none; /* Firefox */
  height: 28px;
  background: transparent;
}
.slider-wrap input[type="range"]::-webkit-slider-thumb {
  pointer-events: all;
  cursor: pointer;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--wp--preset--color--teal);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--wp--preset--color--teal);
}
.slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--ch-range-track);
}

/* Firefox */
.slider-wrap input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--wp--preset--color--teal);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--wp--preset--color--teal);
  cursor: pointer;
}
.slider-wrap input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--ch-range-track);
}

/* Edge Legacy / IE compatibility */
.slider-wrap input[type="range"]::-ms-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--wp--preset--color--teal);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--wp--preset--color--teal);
  cursor: pointer;
}

.slider-wrap input[type="range"]::-ms-track {
  height: 4px;
  border-radius: 999px;
  background: transparent; /* track color drawn by fills below */
  border-color: transparent;
  color: transparent;
}

.slider-wrap input[type="range"]::-ms-fill-lower,
.slider-wrap input[type="range"]::-ms-fill-upper {
  height: 4px;
  border-radius: 999px;
  background: var(--ch-range-track);
}

/* Focus styles for accessibility */
.slider-wrap input[type="range"]:focus {
  outline: none;
}
.slider-wrap input[type="range"]:focus-visible {
  outline: 2px solid var(--wp--preset--color--teal);
  outline-offset: 2px;
}
/* Skeletons */
.ch-skel {
  display: block;
  padding: 16px;
}
.skel {
  background: linear-gradient(90deg, #eceff3 25%, #f6f8fa 37%, #eceff3 63%);
  background-size: 400% 100%;
  animation: skel 1.2s ease-in-out infinite;
  border-radius: 8px;
}
/* было: aspect-ratio: 4 / 3; */
.skel-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 12px;
}
.skel-row {
  height: 14px;
  margin: 8px 0;
}
.skel-row.short {
  width: 60%;
}
.skel-btn {
  width: 120px;
  height: 36px;
  margin-top: 8px;
  border-radius: 999px;
}
@keyframes skel {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}
.badge--out {
  background: #eee;
  color: #111;
}
.badge--limited {
  background: #ffe8c2;
  color: #7a3e00;
}
.badge--new {
  background: #dfffe3;
  color: #0b5;
}
.badge--best {
  background: #e7e7ff;
  color: #3949ab;
}
.product-card__price--na {
  opacity: 0.75;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}
.product-card__image {
  display: block;
}
.product-card__img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  display: block;
}

.js-card-fade .product-card__media,
.js-card-fade .product-card__slide {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #eef2f7 0%, #e6ebf2 100%);
}

.js-card-fade .product-card__media::after,
.js-card-fade .product-card__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(238, 242, 247, 0.95) 0%,
    rgba(230, 235, 242, 0.7) 40%,
    rgba(238, 242, 247, 0.95) 100%
  );
  opacity: 1;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.js-card-fade .product-card__media.is-loaded::after,
.js-card-fade .product-card__slide.is-loaded::after {
  opacity: 0;
}

.js-card-fade .product-card__img {
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.js-card-fade .product-card__img.is-visible {
  opacity: 1;
  transform: scale(1);
}

.product-card__meta {
  display: flex;
  gap: 10px;
  align-items: center;
}
.product-card__meta .price {
  margin-left: auto;
}

.product-card__stock {
  font-size: 12px;
  opacity: 0.85;
}
.product-card__actions {
  margin-top: auto;
}
.product-card__btn {
  width: 100%;
  text-align: center;
}
.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
}
.product-card__title {
  margin: 8px 0 0 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}
.product-card__excerpt {
  margin: 6px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card__status {
  margin: 6px 0 0 0;
}
.product-card__meta,
.product-card__title,
.product-card__excerpt {
  flex-shrink: 0;
}
.product-card__media {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 1 / 1;
}
.product-card__placeholder {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef2f7 0%, #e6ebf2 100%);
}
.product-card__media.is-image-fallback,
.product-card__media .product-card__img[data-retry-state="failed"] {
  position: relative;
}
.product-card__placeholder.is-inline {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef2f7 0%, #e6ebf2 100%);
}
.product-card__actions .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 90%;
  min-height: 44px;
  padding: 0 16px;
  line-height: 1.2;
  font-weight: 600;
  font-size: 15px;
  border-radius: 8px;
  background: var(--wp--preset--color--teal);
  color: #fff;
  text-align: center;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease,
    filter 0.15s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  margin: 0 auto;
}
.product-card__actions .wp-block-button__link:hover {
  background: rgba(13, 75, 127, 0.78);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.16);
  filter: none;
}
.product-card__actions .wp-block-button__link:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}
.product-card__actions .wp-block-button__link.is-disabled,
.product-card__actions .wp-block-button__link[disabled] {
  background: #e0e0e0;
  color: #777;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
.product-card__retry {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.product-card__retry:hover {
  background: rgba(0, 0, 0, 0.85);
}
/* ===== Carousel (product card) ===== */
.product-card__carousel {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.product-card__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 0;
}
.product-card__track::-webkit-scrollbar {
  display: none;
}
.product-card__track {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.product-card__slide {
  min-width: 100%;
  scroll-snap-align: start;
}
.product-card__slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.product-card__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(17, 20, 24, 0.75);
  color: #fff;
  border: 0;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.product-card__arrow--prev {
  left: 8px;
}
.product-card__arrow--next {
  right: 8px;
}
.product-card__dots {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 0;
  z-index: 3;
}
.product-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cdd6df;
  cursor: pointer;
}
.product-card__dot.is-active {
  background: #2a9d8f;
}

/* ===== Load more button ===== */
.ch-loadmore-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  padding-top: 30px;
}
.ch-loadmore-wrap.is-hidden {
  display: none;
}

#load-more.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--wp--preset--color--teal);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14);
}
#load-more.wp-block-button__link:hover {
  background: #0d4b7fc7; /* align with primary order/buy hover */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.16);
}
#load-more.wp-block-button__link:active {
  transform: translateY(1px);
}

/* ===== Catalog filters (responsive) ===== */
.ch-filters {
  margin-bottom: 24px;
}
.ch-filters__inner {
  position: relative;
  border-radius: 22px;
  padding: 16px 30px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.92),
    rgba(244, 246, 249, 0.96)
  );
  border: 1px solid rgba(203, 213, 225, 0.85);
  box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.45);
}
.ch-filters__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(42, 157, 143, 0.22),
    rgba(42, 157, 143, 0.08)
  );
  color: #2a9d8f;
}
.ch-adv summary .ch-filters__icon {
  flex-shrink: 0;
  margin-right: 12px;
}
.ch-filters__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.ch-filters__reset-link {
  font-size: 14px;
  font-weight: 600;
  color: #2a9d8f;
  text-decoration: none;
}
.ch-filters__reset-link:hover {
  text-decoration: underline;
}

.ch-filters__grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "collection currency price"
    "search sort price";
  align-items: stretch;
  grid-auto-flow: row dense;
}
.ch-filters__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ch-filters__field--equal {
  min-width: 240px;
}
.ch-filters__field--collection {
  grid-area: collection;
}
.ch-filters__field--currency {
  grid-area: currency;
}
.ch-filters__field--price {
  grid-area: price;
}
.ch-filters__field--search {
  grid-area: search;
}
.ch-filters__field--sort {
  grid-area: sort;
}
.ch-filters__field--currency .currency-switcher {
  width: 100%;
  justify-content: flex-start;
}
.ch-filters__field--currency .currency-switcher select.ch-currency {
  width: 100%;
}
.ch-filters__field--price {
  align-self: stretch;
}
.ch-filters__field--price .ch-filters__range {
  width: 100%;
  max-width: 180px;
}
.ch-filters__field--inline .ch-filters__range {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ch-filters__range input {
  flex: 1 1 0;
  width: 100%;
}
.ch-filters__range-sep {
  color: #64748b;
  font-weight: 600;
  text-align: center;
}
.ch-filters__label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
}

.ch-filters input,
.ch-filters select {
  padding: 10px 20px;
  border: 1px solid rgba(42, 157, 143, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  box-shadow: 0 16px 32px -26px rgba(15, 23, 42, 0.55);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ch-filters input::placeholder {
  color: #94a3b8;
}
.ch-filters input:hover,
.ch-filters select:hover {
  box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.6);
}
.ch-filters input:focus,
.ch-filters select:focus {
  outline: none;
  border-color: rgba(42, 157, 143, 0.74);
  box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.22);
}
.ch-filters select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23404a5c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
  padding-right: 46px;
}
.ch-filters input[type="number"] {
  -moz-appearance: textfield;
}
.ch-filters input[type="number"]::-webkit-outer-spin-button,
.ch-filters input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ch-filters__footer {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.ch-filters__submit,
.ch-filters__reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease;
  text-decoration: none;
}
.ch-filters__submit {
  background: linear-gradient(
    135deg,
    rgba(42, 157, 143, 0.22),
    rgba(42, 157, 143, 0.12)
  );
  border-color: rgba(42, 157, 143, 0.45);
  color: #0f172a;
  box-shadow: 0 14px 32px -20px rgba(42, 157, 143, 0.55);
}
.ch-filters__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -22px rgba(42, 157, 143, 0.6);
}
.ch-filters__reset {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.18),
    rgba(15, 23, 42, 0.28)
  );
  border-color: rgba(15, 23, 42, 0.35);
  color: #f8fafc;
  box-shadow: 0 12px 28px -22px rgba(15, 23, 42, 0.55);
}
.ch-filters__reset:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px -24px rgba(15, 23, 42, 0.6);
}

.ch-adv {
  /* margin-top: 22px;
  padding: 18px; */
  border-radius: 18px;
  background: rgba(244, 247, 250, 0.9);
  border: 1px solid rgba(205, 214, 223, 0.8);
}
.ch-adv summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ch-adv summary::-webkit-details-marker {
  display: none;
}
.ch-adv summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid #1f2937;
  border-bottom: 2px solid #1f2937;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  margin-left: auto;
}
.ch-adv[open] summary::after {
  transform: rotate(-135deg);
}
.ch-adv[open] {
  background: rgba(244, 247, 250, 0.97);
}
.ch-adv-body {
  margin-top: 16px;
}
.ch-adv-body .ch-filters__grid {
  width: 100%;
}
.ch-adv-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.22);
  color: #1f2937;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .ch-filters__reset-link {
    align-self: flex-start;
  }
  .ch-filters__footer {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .ch-filters__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* две равные колонки */
    grid-template-areas:
      "collection collection" /* шапка на всю ширину */
      "currency   price"
      "search     sort";
    gap: 8px; /* опционально */
  }
}

@media (max-width: 420px) {
  .ch-filters__grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "collection"
      "currency"
      "price"
      "search"
      "sort";
  }
  .ch-filters__field--equal {
    min-width: 0;
  }
}

.ch-empty {
  margin: 8px 0 0 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  min-height: 2.5em;
  text-align: center;
}
.product-card__placeholder {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}
