body.app-theme .catalog-head-neo--compact {
  padding: 0.72rem 0.86rem;
  border: 1px solid #d7e4ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: 0 10px 24px rgba(21, 62, 145, 0.09);
}

body.app-theme .catalog-head-neo__top--compact {
  display: grid;
  gap: 0.42rem;
}

body.app-theme .catalog-head-neo__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

body.app-theme .catalog-head-neo__title {
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: #0f1f47;
}

body.app-theme .catalog-head-neo__count {
  display: inline-flex;
  align-items: center;
  min-height: 1.72rem;
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  border: 1px solid #cfe0ff;
  background: #eef4ff;
  color: #32547f;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

body.app-theme .catalog-head-neo__filters {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}

body.app-theme .catalog-active-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.62rem;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  border: 1px solid #d2e1ff;
  background: #ffffff;
  color: #2b4169;
  font-size: 0.77rem;
  font-weight: 600;
  text-decoration: none;
}

body.app-theme .catalog-active-chip--clear {
  border-color: #b9d0ff;
  background: #eaf3ff;
  color: #184da4;
}

body.app-theme .catalog-active-chip--clear:hover {
  background: #deebff;
  border-color: #99bbff;
  color: #0f3f8d;
}

@media (max-width: 767.98px) {
  body.app-theme .catalog-head-neo--compact {
    padding: 0.58rem 0.62rem;
    border-radius: 14px;
  }

  body.app-theme .catalog-head-neo__title {
    font-size: 1.05rem;
  }

  body.app-theme .catalog-head-neo__count {
    font-size: 0.72rem;
    min-height: 1.55rem;
    padding-inline: 0.5rem;
  }

  body.app-theme .catalog-active-chip {
    min-height: 1.52rem;
    font-size: 0.72rem;
  }
}

body.app-theme .site-header-v3__cart-pill-inline .cart-badge-total {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.22rem 0.56rem;
  color: #ffffff;
  font-size: clamp(0.74rem, 0.9vw, 0.88rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, rgba(11, 69, 168, 0.52) 0%, rgba(52, 42, 168, 0.58) 100%);
  border: 1px solid rgba(255, 255, 255, 0.34);
}

@media (max-width: 1260px) {
  body.app-theme .site-header-v3__cart-pill {
    width: clamp(8.55rem, 22vw, 10.9rem);
    min-width: 8.55rem;
  }
}

/* Product card rating badge: adaptive on narrow cards */
body.app-theme .products-grid .product-card__rating,
body.app-theme #product-grid .product-card__rating {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.24rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

body.app-theme .products-grid .product-card__rating > span,
body.app-theme #product-grid .product-card__rating > span {
  min-width: 0;
}

body.app-theme .products-grid .product-card__rating > span:nth-child(2),
body.app-theme .products-grid .product-card__rating > span:nth-child(3),
body.app-theme #product-grid .product-card__rating > span:nth-child(2),
body.app-theme #product-grid .product-card__rating > span:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px) {
  body.app-theme .products-grid .product-card__rating,
  body.app-theme #product-grid .product-card__rating {
    font-size: 0.68rem;
    padding: 0.17rem 0.34rem;
    column-gap: 0.2rem;
  }
}

/* Product card footer: horizontal grid alignment + smaller ruble sign */
body.app-theme .products-grid .product-card__footer,
body.app-theme #product-grid .product-card__footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.42rem;
}

body.app-theme .products-grid .product-card__price,
body.app-theme #product-grid .product-card__price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18rem;
  line-height: 1;
  white-space: nowrap;
}

body.app-theme .products-grid .product-card__currency,
body.app-theme #product-grid .product-card__currency {
  font-size: 0.72em;
  font-weight: 700;
  opacity: 0.88;
  transform: translateY(-0.04em);
}

body.app-theme .products-grid .product-card__footer .cart-control--icon,
body.app-theme #product-grid .product-card__footer .cart-control--icon {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 0.22rem;
}

body.app-theme .products-grid .product-card__footer .cart-control--icon .stepper,
body.app-theme #product-grid .product-card__footer .cart-control--icon .stepper {
  align-items: center;
  gap: 0.22rem;
  margin: 0;
}

body.app-theme .products-grid .product-card__footer .cart-control--icon .qty,
body.app-theme .products-grid .product-card__footer .cart-control--icon .cart-step-btn,
  body.app-theme #product-grid .product-card__footer .cart-control--icon .qty,
  body.app-theme #product-grid .product-card__footer .cart-control--icon .cart-step-btn {
  width: 1.96rem;
  min-width: 1.96rem;
  height: 1.96rem;
  min-height: 1.96rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Cart control visibility contract:
   default -> only cart icon button
   in-cart -> hide icon button, show qty stepper */
body.app-theme .products-grid .cart-control--icon .add.hidden,
body.app-theme .products-grid .cart-control--icon .stepper.hidden,
body.app-theme #product-grid .cart-control--icon .add.hidden,
body.app-theme #product-grid .cart-control--icon .stepper.hidden {
  display: none;
}

body.app-theme .products-grid .cart-control--icon:not(.is-in-cart) .stepper,
body.app-theme #product-grid .cart-control--icon:not(.is-in-cart) .stepper {
  display: none;
}

body.app-theme .products-grid .cart-control--icon:not(.is-in-cart) .add,
body.app-theme #product-grid .cart-control--icon:not(.is-in-cart) .add {
  display: inline-flex;
}

body.app-theme .products-grid .cart-control--icon.is-in-cart .add,
body.app-theme #product-grid .cart-control--icon.is-in-cart .add {
  display: none;
}

body.app-theme .products-grid .cart-control--icon.is-in-cart .stepper,
body.app-theme #product-grid .cart-control--icon.is-in-cart .stepper {
  display: inline-flex;
}

/* Catalog toolbar: strict compact mode (icons only + filter) */
body.app-theme .catalog-head-neo__controls .catalog-toolbar--single-row,
body.app-theme .catalog-toolbar.catalog-toolbar--neo2026.catalog-toolbar--single-row {
  min-height: 2.42rem;
  height: 2.42rem;
  padding: 0.22rem 0.34rem;
  gap: 0.32rem;
  flex-wrap: nowrap;
  overflow: hidden;
}

body.app-theme .catalog-head-neo__controls .catalog-filter-dropdown,
body.app-theme .catalog-toolbar.catalog-toolbar--neo2026 .catalog-filter-dropdown {
  flex: 0 0 auto;
}

body.app-theme .catalog-head-neo__controls .catalog-filter-dropdown__summary,
body.app-theme .catalog-toolbar.catalog-toolbar--neo2026 .catalog-filter-dropdown__summary {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  gap: 0;
}

body.app-theme .catalog-head-neo__controls .catalog-filter-dropdown__summary span,
body.app-theme .catalog-toolbar.catalog-toolbar--neo2026 .catalog-filter-dropdown__summary span {
  display: none;
}

body.app-theme .catalog-head-neo__controls .catalog-toolbar__pills,
body.app-theme .catalog-toolbar.catalog-toolbar--neo2026 .catalog-toolbar__pills {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

body.app-theme .catalog-head-neo__controls .catalog-toolbar__pills::-webkit-scrollbar,
body.app-theme .catalog-toolbar.catalog-toolbar--neo2026 .catalog-toolbar__pills::-webkit-scrollbar {
  display: none;
}

body.app-theme .catalog-head-neo__controls .catalog-sort-pill,
body.app-theme .catalog-toolbar.catalog-toolbar--neo2026 .catalog-sort-pill {
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  flex: 0 0 auto;
}

body.app-theme .catalog-head-neo__controls .catalog-sort-pill__text,
body.app-theme .catalog-toolbar.catalog-toolbar--neo2026 .catalog-sort-pill__text {
  display: none;
}

body.app-theme .catalog-head-neo__controls .catalog-sort-pill__icon,
body.app-theme .catalog-toolbar.catalog-toolbar--neo2026 .catalog-sort-pill__icon {
  margin: 0;
  width: 1.2rem;
  height: 1.2rem;
}

/* Catalog header: compact 2-row layout */
body.app-theme .catalog-head-neo--compact {
  padding: 0.58rem 0.72rem;
}

body.app-theme .catalog-head-neo__top--compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

body.app-theme .catalog-head-neo__main {
  width: 100%;
  min-height: 2rem;
}

body.app-theme .catalog-head-neo__controls {
  margin-top: 0.42rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem;
}

body.app-theme .catalog-head-neo__controls > .mb-2 {
  margin-bottom: 0;
}

body.app-theme .catalog-head-neo__controls .catalog-toolbar--single-row {
  min-height: 2.28rem;
  padding: 0.3rem 0.38rem;
  border-radius: 12px;
  gap: 0.34rem;
}

body.app-theme .catalog-head-neo__controls .catalog-filter-dropdown__summary {
  min-height: 1.95rem;
  height: 1.95rem;
  border-radius: 999px;
}

body.app-theme .catalog-head-neo__controls .catalog-sort-pill {
  min-height: 1.95rem;
  height: 1.95rem;
  padding: 0.2rem 0.55rem;
}

body.app-theme .catalog-head-neo__controls .catalog-sort-pill__icon {
  width: 1.5rem;
  height: 1.5rem;
}

@media (max-width: 767.98px) {
  body.app-theme .catalog-head-neo--compact {
    padding: 0.5rem 0.55rem;
  }

  body.app-theme .catalog-head-neo__top--compact {
    gap: 0.35rem;
  }

  body.app-theme .catalog-head-neo__controls {
    margin-top: 0.34rem;
  }
}
