.smd-product-categories {
  --smd-category-accent: #f33b50;
  --smd-category-accent-soft: #fff2f3;
  --smd-category-green: #0f3f30;
  --smd-category-border: #e9e2dc;
  --smd-category-text: #292624;
  --smd-category-muted: #746e69;
  box-sizing: border-box;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(15, 63, 48, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 42px rgba(247, 90, 69, 0.16), 0 0 0 4px rgba(247, 90, 69, 0.045);
  color: var(--smd-category-text);
  font-family: inherit;
}

.smd-product-categories *,
.smd-product-categories *::before,
.smd-product-categories *::after {
  box-sizing: border-box;
}

.smd-product-categories__title {
  margin: 0 4px 8px;
  padding: 8px 7px 12px;
  border-bottom: 1px solid var(--smd-category-border);
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

.smd-product-categories__list {
  display: grid;
  gap: 12px;
  max-height: min(68vh, 600px);
  margin: 0 !important;
  padding: 3px 20px 3px 3px !important;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-color: rgba(15, 63, 48, 0.36) transparent;
  scrollbar-width: thin;
  list-style: none !important;
}

.smd-product-categories__list::-webkit-scrollbar {
  width: 5px;
}

.smd-product-categories__list::-webkit-scrollbar-track {
  background: transparent;
}

.smd-product-categories__list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(15, 63, 48, 0.3);
}

.smd-product-categories__item {
  margin: 0;
  padding: 0;
  transition: opacity 180ms ease;
}

.smd-product-categories__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--smd-category-muted);
  font-size: 15px;
  line-height: 1.35;
  text-decoration: none;
  transform: translateX(0) scale(1);
  transform-origin: left center;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.smd-product-categories__link::after {
  content: "\2197";
  flex: 0 0 auto;
  margin-left: 10px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.smd-product-categories__link:hover,
.smd-product-categories__link:focus-visible {
  border-color: rgba(15, 63, 48, 0.14);
  background: rgba(15, 63, 48, 0.045);
  color: var(--smd-category-text);
  transform: translateX(3px);
}

.smd-product-categories__link:hover::after,
.smd-product-categories__link:focus-visible::after,
.smd-product-categories__item.is-active > .smd-product-categories__link::after {
  opacity: 1;
  transform: translateX(0);
}

.smd-product-categories__link:focus-visible {
  outline: 2px solid var(--smd-category-accent);
  outline-offset: 2px;
}

.smd-product-categories__item.is-active > .smd-product-categories__link {
  border-color: rgba(15, 63, 48, 0.28);
  background: linear-gradient(110deg, rgba(15, 63, 48, 0.075) 0%, #ffffff 88%);
  box-shadow: 0 8px 20px rgba(15, 63, 48, 0.13);
  color: var(--smd-category-accent);
  font-weight: 700;
  transform: translateX(7px) scale(1.025);
}

.smd-product-categories__item.is-active > .smd-product-categories__link::after {
  color: var(--smd-category-green);
}

.smd-product-categories__item.is-navigating > .smd-product-categories__link {
  border-color: rgba(15, 63, 48, 0.32);
  background: linear-gradient(110deg, rgba(15, 63, 48, 0.1) 0%, #ffffff 88%);
  box-shadow: 0 9px 24px rgba(15, 63, 48, 0.17);
  color: var(--smd-category-accent);
  animation: smd-category-confirm 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.smd-product-categories__item.is-navigating > .smd-product-categories__link::after {
  color: var(--smd-category-green);
  opacity: 1;
  animation: smd-category-arrow-confirm 700ms ease both;
}

.smd-product-categories__item.is-loading > .smd-product-categories__link::after {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(15, 63, 48, 0.18);
  border-top-color: var(--smd-category-green);
  border-radius: 50%;
  content: "";
  opacity: 1;
  transform: none;
  animation: smd-category-loading 650ms linear infinite;
}

:is(.smd-product-categories__list, .smd-product-categories__children).is-selecting > :is(.smd-product-categories__item, .smd-product-categories__group):not(.is-flight-target) {
  opacity: 0.48;
}

:is(.smd-product-categories__list, .smd-product-categories__children).is-selecting > .smd-product-categories__item.is-active:not(.is-flight-target) {
  position: static;
  padding-bottom: 0;
  background: transparent;
}

.smd-product-categories__item.is-navigating {
  position: relative;
  z-index: 4;
}

.smd-product-categories :is(.smd-product-categories__item, .smd-product-categories__group).is-flight-target {
  position: relative;
  z-index: 3;
}

.smd-product-categories__item--master,
.smd-product-categories__group--standalone {
  overflow: hidden;
  border: 1px solid rgba(15, 63, 48, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 20px rgba(247, 90, 69, 0.12), 0 0 0 2px rgba(247, 90, 69, 0.03);
}

.smd-product-categories__item--master > .smd-product-categories__link {
  min-height: 47px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(120deg, var(--smd-category-green) 0%, #17634f 100%);
  box-shadow: 0 7px 18px rgba(15, 63, 48, 0.2);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.smd-product-categories__item--master > .smd-product-categories__link::after {
  color: #fff;
  opacity: 0.7;
}

.smd-product-categories__item--master > .smd-product-categories__link:hover,
.smd-product-categories__item--master > .smd-product-categories__link:focus-visible {
  background: linear-gradient(120deg, #17634f 0%, #20765f 100%);
  color: #fff;
  transform: none;
}

.smd-product-categories__item--master.is-active > .smd-product-categories__link {
  border: 0;
  background: linear-gradient(120deg, var(--smd-category-green) 0%, #17634f 100%);
  box-shadow: inset 0 0 0 2px var(--smd-category-accent), 0 7px 18px rgba(15, 63, 48, 0.2);
  color: #fff;
  transform: none;
}

.smd-product-categories__item--master.is-active > .smd-product-categories__link::after {
  color: #fff;
}

.smd-product-categories__item--master.has-active-descendant {
  border-color: rgba(247, 90, 69, 0.34);
}

.smd-product-categories__children {
  display: grid;
  gap: 1px;
  margin: 0 !important;
  padding: 7px !important;
  background: rgba(255, 255, 255, 0.96);
  list-style: none !important;
}

.smd-product-categories__children .smd-product-categories__link {
  min-height: 40px;
  padding: 7px 10px;
}

.smd-product-categories__children .smd-product-categories__item--master {
  margin: 5px 2px;
  border-color: rgba(15, 63, 48, 0.2);
}

.smd-product-categories__children .smd-product-categories__item--master > .smd-product-categories__link {
  min-height: 40px;
  background: #e4f1ec;
  box-shadow: none;
  color: var(--smd-category-green);
  font-size: 14px;
}

.smd-product-categories__children .smd-product-categories__item--master > .smd-product-categories__link::after {
  color: var(--smd-category-green);
}

.smd-product-categories__children .smd-product-categories__item--master > .smd-product-categories__link:hover,
.smd-product-categories__children .smd-product-categories__item--master > .smd-product-categories__link:focus-visible {
  background: #d6e9e1;
  color: var(--smd-category-green);
}

.smd-product-categories__children .smd-product-categories__item.is-active > .smd-product-categories__link {
  border: 1px solid rgba(243, 59, 80, 0.38);
  border-radius: 9px;
  background: linear-gradient(105deg, var(--smd-category-accent-soft) 0%, #ffffff 92%);
  box-shadow: inset 4px 0 0 var(--smd-category-accent), 0 6px 16px rgba(247, 90, 69, 0.12);
  color: var(--smd-category-accent);
  transform: none;
}

.smd-product-categories__group-title {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 63, 48, 0.14);
  background: #eaf4f0;
  color: var(--smd-category-green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@keyframes smd-category-confirm {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(0.985);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes smd-category-arrow-confirm {
  0% {
    transform: translateX(-3px);
  }

  100% {
    transform: translateX(2px);
  }
}

@keyframes smd-category-loading {
  to {
    transform: rotate(360deg);
  }
}

.smd-product-categories__item.is-active {
  position: relative;
  z-index: 2;
}

@media (max-width: 640px) {
  .smd-product-categories {
    padding: 7px;
  }

  .smd-product-categories__item.is-active > .smd-product-categories__link {
    transform: translateX(5px) scale(1.015);
  }

  .smd-product-categories__item--master.is-active > .smd-product-categories__link {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .smd-product-categories__link,
  .smd-product-categories__link::after,
  .smd-product-categories__item {
    transition: none;
    animation: none !important;
  }
}
