/* live-catalog: route-scoped PDP and catalog toolbar surfaces. */

/* PDP care guide: one article card in the info column, under the specs. */
.pdp-care {
  margin-top: 22px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-panel);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.pdp-care__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 0;
}

.pdp-care__eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--leaf-dark);
}

.pdp-care__all {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .78rem;
  color: var(--leaf-dark);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.pdp-care__all:hover {
  text-decoration: underline;
}

.pdp-care__body {
  display: flex;
  gap: 16px;
  padding: 14px 18px 18px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.pdp-care__thumb {
  flex: none;
  width: 104px;
  height: 104px;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface-matte);
}

.pdp-care__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdp-care__txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pdp-care__kicker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #b8401f; /* darker clay — AA contrast (5.5:1) on white vs --clay's 3.25:1 */
  margin-bottom: 6px;
}

.pdp-care__ttl {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.22;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -.01em;
}

.pdp-care__body:hover .pdp-care__ttl {
  color: var(--leaf-dark);
}

.pdp-care__time {
  font-size: .76rem;
  color: var(--text-3);
  font-weight: 600;
}

/* ────────────────────────────────────────────────────────────────────────────
   PDP redesign pass (mockup): gallery left + de-paneled buy-box + offers list.
   Appended last so it overrides the earlier purchase-shelf rules by source order.
   ──────────────────────────────────────────────────────────────────────────── */

/* 1. Hero: square gallery (size-capped to the viewport height so it fits a laptop)
   + 468px info column, the pair centered in the container. */
body[data-page-type='seo_product'] .pdp-hero {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 3.5vw, 48px);
  align-items: start;
}
/* Fixed 500px photo column (flush-left, square) + info that fills the rest — matches the
   mockup and bounds the photo height for laptops. Gallery wrapper is the sticky element
   so photo + thumbs travel together. */
body[data-page-type='seo_product'] .pdp-hero__gallery {
  position: sticky;
  top: 90px;
  align-self: start;
}
body[data-page-type='seo_product'] .pdp-hero__photo {
  /* relative (not static) so the crossfade image layers + preloader overlays anchor here */
  position: relative;
  top: auto;
  aspect-ratio: 1 / 1;
  max-height: none;
  border-radius: 16px;
}

/* 1a. Thumbnail strip (only rendered when >1 image exists). */
.pdp-hero__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.pdp-thumb {
  width: 74px;
  height: 74px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: #eef2f1;
}
.pdp-thumb.is-active {
  border-color: var(--leaf-dark);
}
.pdp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* live-tune: PDP gallery crossfade + preloader. A thumbnail click fades the new photo in
   over the current one instead of hard-swapping src. Two stacked layers (.pdp-hero__img)
   cross-fade via .is-active; a spinner + shimmer cover the photo while the next frame loads.
   The JS (initPdpGallery, main.js) swaps which layer is active and keeps data-pdp-main-img on
   the visible one. .pdp-hero__photo is the positioning context (set to relative above). */
.pdp-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 420ms ease;
  will-change: opacity;
}
.pdp-hero__img.is-active {
  opacity: 1;
}
.pdp-hero__spinner {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(246, 248, 247, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.pdp-hero__spinner i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(25, 167, 123, 0.2);
  border-top-color: var(--leaf-dark, #19a77b);
  animation: pdpSpin 0.7s linear infinite;
}
@keyframes pdpSpin {
  to { transform: rotate(360deg); }
}
.pdp-hero__shimmer {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  background-size: 220% 100%;
  animation: pdpShimmer 1.1s ease-in-out infinite;
}
@keyframes pdpShimmer {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}
.pdp-hero__photo.is-loading .pdp-hero__spinner,
.pdp-hero__photo.is-loading .pdp-hero__shimmer {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .pdp-hero__img { transition: none; }
  .pdp-hero__spinner i,
  .pdp-hero__shimmer { animation: none; }
}

/* 2. Buy-box: drop the panel; stock on top, price left + CTA right in one row. */
body[data-page-type='seo_product'] .pdp-hero__buy {
  display: block;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
body[data-page-type='seo_product'] .pdp-hero__buy .pdp-hero__stock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
body[data-page-type='seo_product'] .pdp-hero__buy-price {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  flex: none;
}
body[data-page-type='seo_product'] .pdp-hero__price-wrap {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1;
}
body[data-page-type='seo_product'] .pdp-hero__price {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -.025em;
  white-space: nowrap;
}
body[data-page-type='seo_product'] .pdp-hero__price-note {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
}
body[data-page-type='seo_product'] .pdp-hero__buy .cart-action,
body[data-page-type='seo_product'] .pdp-hero__buy .catalog-product-card__cart-form {
  flex: 0 0 auto;
}
body[data-page-type='seo_product'] .pdp-hero__buy .btn {
  height: 54px;
  min-height: 54px;
  padding: 0 30px;
  font-size: 15px;
}
body[data-page-type='seo_product'] .pdp-hero__buy .qty-wrap {
  height: 54px;
  min-height: 54px;
}

/* PDP mobile: stack the price block above the full-width CTA. The buy-price row is flex-row at all
   widths (price ⇄ button), and on ≤767px the CTA goes width:100% (rule near line 3974). In a row
   that full-width button squeezes the price-wrap to width:0, so «за 1 шт» wraps to a «за/1/шт»
   column and «750 ₽» overlaps the button. Stacking the row fixes it. Must out-specify the
   no-media flex-direction:row at body[data-page-type='seo_product'] .pdp-hero__buy-price above. */
@media (max-width: 767px) {
  body[data-page-type='seo_product'] .pdp-hero__buy-price {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
}

/* 2a. Trust row. */
.pdp-hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-2);
}
.pdp-trust__i {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.pdp-trust__i svg {
  width: 16px;
  height: 16px;
  color: var(--leaf-dark);
  flex: none;
}

/* 3. Specs as a bordered card (mockup); empty values muted. */
body[data-page-type='seo_product'] .pdp-hero__params {
  margin-top: 24px;
  border: 1px solid var(--border-2);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
body[data-page-type='seo_product'] .pdp-hero__param {
  padding: 13px 18px;
  border-bottom: 0;
  font-size: .9rem;
}
body[data-page-type='seo_product'] .pdp-hero__param + .pdp-hero__param {
  border-top: 1px solid var(--border-2);
}
body[data-page-type='seo_product'] .pdp-hero__param-v {
  text-align: right;
}
.pdp-hero__param-v.is-empty {
  color: var(--text-3);
  font-weight: 600;
}

/* Stock as a tinted pill (mockup), coloured by availability tone; dot follows the text. */
body[data-page-type='seo_product'] .pdp-hero__buy .pdp-hero__stock {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: rgba(15, 109, 75, .08);
  color: var(--leaf-dark);
}
body[data-page-type='seo_product'] .pdp-hero__buy .pdp-hero__stock--low {
  background: rgba(181, 154, 74, .16);
  color: #8a5a12;
}
body[data-page-type='seo_product'] .pdp-hero__buy .pdp-hero__stock--last,
body[data-page-type='seo_product'] .pdp-hero__buy .pdp-hero__stock--muted {
  background: rgba(180, 82, 26, .12);
  color: var(--clay-dark);
}
body[data-page-type='seo_product'] .pdp-hero__buy .pdp-hero__stock .pdp-hero__stock-dot {
  background: currentColor;
}

/* Code chip in the meta row (mockup): monospace, green surface. */
body[data-page-type='seo_product'] .pdp-hero__meta-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .3px;
  color: var(--leaf-dark);
  background: rgba(15, 109, 75, .08);
  padding: 4px 10px;
  border-radius: 999px;
}
body[data-page-type='seo_product'] .pdp-hero__meta-code:hover {
  background: rgba(15, 109, 75, .14);
}

/* 5. Offers comparison list. */
.pdp-offers-list {
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: 16px;
  overflow: hidden;
}
.pdp-offer-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
}
.pdp-offer-row + .pdp-offer-row {
  border-top: 1px solid var(--border-2);
}
.pdp-offer-row.is-current {
  background: rgba(15, 109, 75, .07);
}
.pdp-offer-row__media {
  display: block;
  flex: none;
}
.pdp-offer-row__img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  background: rgba(15, 109, 75, .06);
}
.pdp-offer-row__main {
  min-width: 0;
}
.pdp-offer-row__code {
  display: block;
  font-weight: 800;
  font-size: .95rem;
}
.pdp-offer-row__here {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 109, 75, .12);
  color: var(--leaf-dark);
  font-size: .7rem;
  font-weight: 800;
  vertical-align: middle;
}
.pdp-offer-row__stock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: .8rem;
  color: var(--text-2);
}
.pdp-offer-row__price {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pdp-offer-row__unit {
  font-size: .72rem;
  color: var(--text-3);
  font-weight: 600;
}
.pdp-offer-row__action {
  justify-self: end;
}
.pdp-offer-row__action .cart-action {
  display: inline-flex;
  align-items: center;
}
.pdp-offer-row__open {
  justify-self: end;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}
.pdp-offer-row__open a {
  color: var(--leaf-dark);
}
.pdp-offer-row__current {
  color: var(--text-3);
  font-weight: 600;
}

/* Responsive: hero collapses ≤920 (per spec), offers list restacks ≤767. */
@media (max-width: 920px) {
  body[data-page-type='seo_product'] .pdp-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  body[data-page-type='seo_product'] .pdp-hero__gallery {
    position: static;
    top: auto;
    width: auto;
  }
}
@media (max-width: 767px) {
  .pdp-offer-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas:
      "media main price"
      "media action open";
    gap: 6px 12px;
    padding: 12px 14px;
  }
  .pdp-offer-row__media { grid-area: media; align-self: center; }
  .pdp-offer-row__main { grid-area: main; }
  .pdp-offer-row__price { grid-area: price; text-align: right; align-self: center; }
  .pdp-offer-row__action { grid-area: action; justify-self: start; align-self: center; }
  .pdp-offer-row__open { grid-area: open; align-self: center; }
  .pdp-offer-row__img {
    width: 52px;
    height: 52px;
  }
}

/* ===========================================================================
   PDP size-switcher (Phase C) — from the FG mockup repo-package/pdp-sizes.
   Scope: .pdp-sizes / .pdp-size + a few hooks to .pdp-hero / .prod-card. Uses
   existing FG tokens. The only adaptation vs the mockup: the preorder-mode
   stepper selector points at the real [data-stepper] hook (FG has no
   .cart-stepper / .pdp-hero__qty class).
   =========================================================================== */
.pdp-sizes { margin: 4px 0 20px; }
.pdp-sizes__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.pdp-sizes__label { font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--ink); }
.pdp-sizes__hint { font-size: .76rem; font-weight: 600; color: var(--text-3); }
.pdp-sizes__list { display: flex; flex-direction: column; gap: 9px; }

.pdp-size {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px;
  width: 100%; padding: 13px 16px; border: 1.6px solid var(--border-1); border-radius: var(--r-card);
  background: var(--cloud); color: inherit; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.pdp-size:hover { border-color: var(--border-s); }
.pdp-size:focus-visible { outline: 2px solid var(--leaf-dark); outline-offset: 2px; }
.pdp-size.is-active {
  border-color: var(--leaf-dark);
  background: linear-gradient(180deg, var(--mint), color-mix(in oklab, var(--mint), #fff 45%));
  box-shadow: 0 14px 34px -28px rgba(7, 27, 20, .5);
}
.pdp-size__radio { width: 21px; height: 21px; border-radius: 50%; border: 2px solid var(--border-s); display: grid; place-items: center; transition: border-color .15s var(--ease); }
.pdp-size.is-active .pdp-size__radio { border-color: var(--leaf-dark); }
.pdp-size__radio::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--leaf-dark); transform: scale(0); transition: transform .15s var(--ease); }
.pdp-size.is-active .pdp-size__radio::after { transform: scale(1); }
.pdp-size__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pdp-size__d { font-family: var(--font-display); font-weight: 800; font-size: 1.06rem; letter-spacing: -.01em; color: var(--ink); }
.pdp-size__h { font-size: .78rem; font-weight: 600; color: var(--text-3); }
.pdp-size__right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }
.pdp-size__price { font-family: var(--font-display); font-weight: 800; font-size: 1.06rem; color: var(--ink); }
.pdp-size__stock { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; color: var(--text-2); }
.pdp-size__stock-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.pdp-size__stock-dot--ok { background: var(--leaf); }
.pdp-size__stock-dot--low { background: #e6a817; }
.pdp-size__stock-dot--last { background: var(--clay); }
.pdp-size__stock-dot--pre { background: transparent; border: 1.5px solid var(--text-4); }

/* hooks to the existing right column */
.pdp-hero__photo img { transition: opacity .25s var(--ease); }
.pdp-hero__photo.is-swapping img { opacity: 0; }
.pdp-preorder-note.is-hidden { display: none; }
/* Size switcher toggles these via pdp-sizes.js; `is-hidden` is scoped (not global), so hide them explicitly:
   the size-dependent «Почти разобрали» badge, and the primary item's multi-photo gallery (thumb strip +
   crossfade/loader layers) which no longer applies once a single-photo size is chosen. */
.pdp-hero__photo-badges [data-badge].is-hidden,
.pdp-hero__gallery [data-pdp-thumbs].is-hidden,
.pdp-hero__photo [data-pdp-fade-img].is-hidden,
.pdp-hero__photo [data-pdp-shimmer].is-hidden,
.pdp-hero__photo [data-pdp-spinner].is-hidden { display: none; }
.pdp-hero__stock-dot--pre { background: transparent; border: 1.5px solid var(--text-4); }

.pdp-badge { display: inline-flex; align-items: center; font-family: var(--font-display); font-weight: 700; font-size: .74rem; padding: 6px 12px; border-radius: var(--r-pill); box-shadow: 0 8px 20px -12px rgba(7, 27, 20, .5); }
.pdp-badge--warn { background: var(--sun); color: #7a531a; }
.pdp-badge--new { background: #cfe6f5; color: #1f5d86; }
.pdp-badge--pre { background: #f3ddd4; color: var(--clay-dark); }
.pdp-badge--hit { background: var(--leaf-dark); color: #fff; }

/* catalog card size chips (used by C3) */
.prod-card__sizes { display: flex; gap: 6px; flex-wrap: wrap; }
.prod-card__sz { font-family: var(--font-display); font-weight: 700; font-size: .7rem; color: var(--text-2); padding: 3px 8px; border-radius: var(--r-pill); border: 1px solid var(--border-1); }
.prod-card__sz--pre { color: var(--text-3); border-style: dashed; border-color: var(--border-s); }

@media (max-width: 479px) {
  .pdp-size { padding: 12px 14px; gap: 12px; }
  .pdp-size__d, .pdp-size__price { font-size: 1rem; }
}

/* ==========================================================================
   Catalog toolbar v2 — Variant A. Category, availability and view form the
   primary row; search and sorting share the secondary row. Category options
   remain real URLs and the menu only enhances their disclosure.
   ========================================================================== */
.catalog-toolbar--v2 {
  position: relative;
  display: block;
  margin-bottom: clamp(24px, 3vw, 36px);
  padding: 16px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-card);
  background: #fff;
  box-shadow: var(--el-1);
}

.catalog-toolbar--v2 .catalog-toolbar__form {
  display: grid;
  gap: 14px;
}

.catalog-toolbar--v2 .catalog-toolbar__row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.catalog-toolbar--v2 .ctb-field {
  position: relative;
  min-width: 260px;
}

.catalog-toolbar--v2 .ctb-field--grow {
  flex: 1 1 340px;
}

.catalog-toolbar--v2 .ctb-field__icon {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.catalog-toolbar--v2 .ctb-field input {
  height: 48px;
  min-height: 48px;
  padding: 0 48px 0 44px;
  border-color: var(--border-1);
  background: #fff;
  font-size: .98rem;
}

.catalog-toolbar--v2 .ctb-field input:hover {
  border-color: var(--border-1);
}

.catalog-toolbar--v2 .ctb-field input:focus {
  border-color: var(--leaf-dark);
  background: #fff;
}

.catalog-toolbar--v2 .catalog-search-clear {
  right: 2px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  opacity: 1;
}

.catalog-toolbar--v2 .catalog-search-clear.is-hidden {
  display: none;
}

.catalog-toolbar--v2 .catalog-search-clear svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.catalog-toolbar--v2 .ctb-seg {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 48px;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-field);
  background: var(--sand);
}

.catalog-toolbar--v2 .ctb-seg a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: calc(var(--r-field) - 4px);
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease), box-shadow .16s var(--ease);
}

.catalog-toolbar--v2 .ctb-seg a:hover {
  color: var(--leaf-dark);
}

.catalog-toolbar--v2 .ctb-seg a.is-on {
  background: #fff;
  color: var(--leaf-dark);
  box-shadow: 0 1px 4px rgba(11, 26, 20, .13);
}

.catalog-toolbar--v2 .ctb-seg strong {
  color: var(--text-3);
  font-size: .8rem;
  font-weight: 800;
}

.catalog-toolbar--v2 .ctb-seg a.is-on strong {
  color: var(--leaf);
}

.catalog-toolbar--v2 .ctb-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 3px rgba(25, 167, 123, .16);
}

body[data-page-type='shop'] .catalog-toolbar--v2 .ctb-sort {
  position: relative;
  flex: 0 1 278px;
  min-width: 220px;
  min-height: 48px;
}

body[data-page-type='shop'] .catalog-toolbar--v2 .ctb-sort::after {
  content: none;
}

.catalog-toolbar--v2 .ctb-sort__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 48px;
  min-height: 48px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-field);
  background: #fff;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.catalog-toolbar--v2 .ctb-sort__btn:hover,
.catalog-toolbar--v2 .ctb-sort.is-open .ctb-sort__btn {
  border-color: var(--leaf-dark);
  box-shadow: var(--el-1);
}

.catalog-toolbar--v2 .ctb-sort__btn:focus-visible {
  outline: 2px solid var(--leaf-dark);
  outline-offset: 2px;
}

.catalog-toolbar--v2 .ctb-sort__label {
  flex: none;
  color: var(--text-4);
  font-size: .833333em;
  font-weight: 700;
  white-space: nowrap;
}

.catalog-toolbar--v2 .ctb-sort__val {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-toolbar--v2 .ctb-sort__chev {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--text-3);
}

.catalog-toolbar--v2 .ctb-sort__chev svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s var(--ease);
}

.catalog-toolbar--v2 .ctb-sort.is-open .ctb-sort__chev svg {
  transform: rotate(180deg);
}

.catalog-toolbar--v2 .ctb-sort__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 2px;
  width: min(260px, calc(100vw - 32px));
  max-height: 0;
  overflow: hidden;
  padding: 0 8px;
  border: 0 solid var(--border-2);
  border-radius: var(--r-card);
  background: #fff;
  box-shadow: var(--el-2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s var(--ease), transform .16s var(--ease), max-height .2s var(--ease), padding .2s var(--ease), border-width .2s var(--ease), visibility 0s linear .2s;
}

.catalog-toolbar--v2 .ctb-sort.is-open .ctb-sort__menu {
  max-height: 340px;
  padding: 8px;
  border-width: 1px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.catalog-toolbar--v2 .ctb-sort__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.catalog-toolbar--v2 .ctb-sort__opt:hover,
.catalog-toolbar--v2 .ctb-sort__opt:focus-visible {
  outline: none;
  background: var(--sand);
}

.catalog-toolbar--v2 .ctb-sort__opt.is-cur {
  color: var(--leaf-dark);
  background: var(--border-2);
}

.catalog-toolbar--v2 .ctb-sort__check {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--leaf-dark);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.catalog-toolbar--v2 .ctb-sort__opt.is-cur .ctb-sort__check {
  opacity: 1;
}

.catalog-toolbar--v2 .ctb-sort__fallback {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.catalog-toolbar--v2 .ctb-sort__fallback a {
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text-1);
  font-family: var(--font-display);
  font-weight: 700;
}

.catalog-toolbar--v2 .ctb-sort__fallback a[aria-current='page'] {
  color: var(--leaf-dark);
  background: var(--border-2);
}

.catalog-toolbar--v2 .ctb-view {
  display: inline-flex;
  flex: none;
  min-height: 48px;
  padding: 2px 4px;
  border-color: var(--border-2);
  background: var(--sand);
  margin-left: auto;
}

.catalog-toolbar--v2 .ctb-view button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
}

.catalog-toolbar--v2 .ctb-view button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.catalog-toolbar--v2 .ctb-scope {
  position: relative;
  flex: none;
}

.catalog-toolbar--v2 .ctb-scope__btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: min(320px, 40vw);
  height: 48px;
  min-height: 48px;
  padding: 0 8px 0 16px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-field);
  background: #fff;
  color: var(--text-1);
  font-family: var(--font-display);
  cursor: pointer;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.catalog-toolbar--v2 .ctb-scope__btn:hover {
  border-color: var(--border-1);
  box-shadow: var(--el-1);
}

.catalog-toolbar--v2 .ctb-scope__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--leaf-dark);
  background: rgba(15, 109, 75, .09);
}

.catalog-toolbar--v2 .ctb-scope__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.catalog-toolbar--v2 .ctb-scope__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
  line-height: 1;
}

.catalog-toolbar--v2 .ctb-scope__text small {
  color: var(--text-4);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.catalog-toolbar--v2 .ctb-scope__text strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-toolbar--v2 .ctb-scope__chevron {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--text-3);
}

.catalog-toolbar--v2 .ctb-scope__chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .16s var(--ease);
}

.catalog-toolbar--v2 .ctb-scope.is-open .ctb-scope__chevron svg {
  transform: rotate(180deg);
}

.catalog-toolbar--v2 .ctb-scope__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  width: min(340px, calc(100vw - 32px));
  max-height: min(420px, 62vh);
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-card);
  background: #fff;
  box-shadow: var(--el-2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s var(--ease);
}

.catalog-toolbar--v2 .ctb-scope.is-open .ctb-scope__menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.catalog-toolbar--v2 .ctb-scope__list > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: .94rem;
  font-weight: 600;
}

.catalog-toolbar--v2 .ctb-scope__all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-hairline);
  border-radius: 0;
  color: var(--leaf-dark);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
}

.catalog-toolbar--v2 .ctb-scope__all-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.catalog-toolbar--v2 .ctb-scope__all-label svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.catalog-toolbar--v2 .ctb-scope__list {
  display: grid;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.catalog-toolbar--v2 .ctb-scope__list > a:hover {
  background: var(--sand);
}

.catalog-toolbar--v2 .ctb-scope__list > a.is-cur {
  background: var(--border-2);
  color: var(--leaf-dark);
}

.catalog-toolbar--v2 .ctb-scope__all small,
.catalog-toolbar--v2 .ctb-scope__list > a small {
  color: var(--text-4);
  font-size: .8rem;
  font-weight: 700;
}

.catalog-toolbar--v2 .ctb-scope__list > a.is-cur small {
  color: var(--leaf-dark);
}

.catalog-toolbar--v2 :is(a, button, input, select):focus-visible {
  outline: 2px solid var(--leaf-dark);
  outline-offset: 2px;
}

@media (max-width: 1023px) {
  .catalog-toolbar--v2 .catalog-toolbar__row {
    flex-wrap: wrap;
  }

  .catalog-toolbar--v2 .catalog-toolbar__row--primary .ctb-scope {
    flex: 1 1 240px;
  }

  .catalog-toolbar--v2 .ctb-scope__btn {
    width: 100%;
    max-width: none;
  }

  .catalog-toolbar--v2 .ctb-seg {
    flex: 1 1 auto;
  }

  .catalog-toolbar--v2 .ctb-seg a {
    flex: 1 1 auto;
  }
}

@media (max-width: 767px) {
  .catalog-filters .catalog-toolbar--v2 {
    margin-bottom: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .catalog-toolbar--v2 .ctb-field {
    min-width: 100%;
  }

  .catalog-toolbar--v2 .catalog-toolbar__form {
    gap: 12px;
  }

  .catalog-toolbar--v2 .ctb-seg {
    flex-basis: 100%;
    width: 100%;
  }

  body[data-page-type='shop'] .catalog-toolbar--v2 .ctb-sort {
    flex: 1 1 180px;
    min-width: 0;
  }

  body[data-page-type='shop'] .catalog-toolbar--v2 .ctb-sort.is-open {
    flex-basis: 100%;
  }

  .catalog-toolbar--v2 .ctb-sort__menu {
    position: static;
    width: 100%;
    margin-top: 0;
    transform: none;
  }

  .catalog-toolbar--v2 .ctb-sort.is-open .ctb-sort__menu {
    max-height: min(340px, 50vh);
    margin-top: 7px;
    transform: none;
  }

  .catalog-toolbar--v2 .ctb-view {
    display: inline-flex;
    margin-left: auto;
  }

  .catalog-toolbar--v2 .ctb-scope {
    width: 100%;
  }

  .catalog-toolbar--v2 .ctb-scope__btn {
    width: 100%;
  }

  .catalog-toolbar--v2 .ctb-scope__menu {
    position: static;
    width: 100%;
    max-height: 0;
    margin-top: 0;
    padding-block: 0;
    overflow: hidden;
    border-width: 0;
    transform: none;
  }

  .catalog-toolbar--v2 .ctb-scope.is-open .ctb-scope__menu {
    max-height: min(360px, 50vh);
    margin-top: 7px;
    border-width: 1px;
    transform: none;
  }

  .catalog-toolbar--v2 .ctb-scope__list {
    max-height: min(280px, 40vh);
  }
}

@media (max-width: 479px) {
  .catalog-toolbar--v2 {
    padding: 8px;
  }

  .catalog-toolbar--v2 .ctb-seg a {
    gap: 4px;
    padding-inline: 7px;
    font-size: .72rem;
  }

  .catalog-toolbar--v2 .ctb-scope__btn {
    min-width: 0;
  }

  .catalog-toolbar--v2 .ctb-scope__text strong {
    font-size: .94rem;
  }
}
