:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --primary: #2563eb;
  --secondary: #eef2ff;
  --accent: #16a34a;
  --header: #ffffff;
  --cart-bar: #111827;
  --radius-card: 16px;
  --radius-button: 12px;
  --title-size: 28px;
  --body-size: 15px;
  --price-size: 18px;
  --button-size: 16px;
  --title-weight: 800;
  --line-height: 1.45;
  --card-gap: 12px;
  --card-padding: 14px;
  --button-height: 46px;
  --image-height: 132px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: var(--body-size);
  line-height: var(--line-height);
}

body.has-bg {
  background-image: var(--bg-image);
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

body.has-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg-overlay, rgba(247, 248, 251, 0.18));
  pointer-events: none;
}

.app-shell {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 12px 12px calc(150px + env(safe-area-inset-bottom));
}

.shop-header {
  min-height: 172px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 20px;
  background: var(--header);
  border-radius: var(--radius-card);
  overflow: hidden;
  color: var(--text);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.shop-header.hero-banner {
  background-image: linear-gradient(90deg, var(--hero-overlay, rgba(255,255,255,0.12)), transparent), var(--hero-image);
  background-size: cover;
  background-position: center;
}

.shop-header.hero-promo {
  border: 2px solid var(--accent);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: var(--product-image-fit, cover);
  background: var(--secondary);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: var(--title-size);
  line-height: 1.08;
  font-weight: var(--title-weight);
  letter-spacing: 0;
}

.shop-header p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
}

.primary-action,
.ghost-button,
.qty-button {
  min-height: var(--button-height);
  border: 0;
  border-radius: var(--radius-button);
  font-size: var(--button-size);
  font-weight: 800;
}

.primary-action {
  width: 100%;
  background: var(--primary);
  color: #fff;
  padding: 0 18px;
}

.ghost-button {
  background: var(--secondary);
  color: var(--text);
  padding: 0 14px;
}

.category-strip {
  display: flex;
  gap: 8px;
  margin: 14px -12px 8px;
  padding: 0 12px 6px;
  overflow-x: auto;
}

.category-strip button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.category-strip button.active {
  background: var(--primary);
  color: #fff;
}

.catalog {
  display: grid;
  gap: var(--card-gap);
}

.catalog.grid {
  grid-template-columns: repeat(var(--grid-columns, 2), minmax(0, 1fr));
}

.product-card {
  display: grid;
  gap: 12px;
  padding: var(--card-padding);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: 0 calc(var(--card-shadow, 12px) * 0.8) calc(var(--card-shadow, 12px) * 2.2) rgba(15, 23, 42, 0.08);
}

.catalog.list .product-card {
  grid-template-columns: minmax(92px, 0.36fr) 1fr;
  align-items: center;
}

.catalog.large .product-card {
  gap: 14px;
}

.product-image {
  display: grid;
  place-items: center;
  min-height: var(--image-height);
  border-radius: calc(var(--radius-card) - 4px);
  background: var(--secondary);
  color: var(--primary);
  font-size: 42px;
  overflow: hidden;
}

.catalog.list .product-image {
  min-height: 112px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  display: grid;
  gap: 8px;
}

.product-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.product-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.product-description {
  margin: 0;
  color: var(--muted);
}

.buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.price {
  font-size: var(--price-size);
  font-weight: 900;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-button {
  width: 42px;
  color: #fff;
  background: var(--primary);
}

.qty-count {
  min-width: 24px;
  text-align: center;
  font-weight: 900;
}

.cart-panel {
  margin-top: 16px;
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.cart-head,
.cart-total,
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-head h2 {
  margin: 0;
  font-size: 22px;
}

.cart-items {
  display: grid;
  gap: 10px;
}

.cart-line {
  padding: 10px;
  border-radius: 12px;
  background: var(--secondary);
}

.cart-line p {
  margin: 0;
}

.cart-total {
  font-size: 18px;
  font-weight: 900;
}

.order-form {
  display: grid;
  gap: 12px;
}

.form-note {
  margin: 0;
  color: var(--muted);
}

.floating-cart {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 5;
  width: min(736px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 58px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--cart-bar);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  font-weight: 900;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(18px);
  max-width: min(420px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 6;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 520px) {
  .catalog.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog.grid .product-card {
    gap: 9px;
  }

  .catalog.grid .product-title {
    font-size: 15px;
  }

  .catalog.grid .product-description {
    display: none;
  }

  .catalog.list .product-card {
    grid-template-columns: 104px 1fr;
  }
}


/* Extended product display */
.product-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.product-badge.discount {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--text);
}

.product-badge.new {
  background: color-mix(in srgb, #22c55e 20%, var(--surface));
  color: var(--text);
}

.product-badge.hit {
  background: color-mix(in srgb, #f59e0b 24%, var(--surface));
  color: var(--text);
}

.product-badge.out {
  background: color-mix(in srgb, #ef4444 18%, var(--surface));
  color: var(--text);
}

.price-block {
  display: grid;
  gap: 2px;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 800;
  font-size: calc(var(--price-size) * 0.78);
}

.product-card.is-out {
  opacity: 0.72;
}

.out-of-stock-text {
  min-height: var(--button-height);
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius-button);
  background: var(--secondary);
  color: var(--muted);
  font-weight: 900;
}


/* Navigation, search and support panels */
.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.app-drawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 21;
  width: min(340px, 88vw);
  padding: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 22px 0 60px rgba(15, 23, 42, 0.24);
  overflow-y: auto;
}

.drawer-head,
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.drawer-head strong,
.sheet-head strong {
  font-size: 20px;
}

.drawer-links {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.drawer-links button {
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--secondary);
  color: var(--text);
  text-align: left;
  padding: 0 14px;
  font-weight: 900;
}

.drawer-content {
  padding: 12px;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--secondary) 70%, var(--surface));
  color: var(--text);
  white-space: pre-line;
}

.app-panel {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  align-items: end;
  background: rgba(15, 23, 42, 0.35);
}

.panel-sheet {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
  padding: 16px 14px calc(92px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -18px 50px rgba(15, 23, 42, 0.2);
}

.search-input {
  min-height: 52px;
  border: 1px solid color-mix(in srgb, var(--muted) 26%, transparent);
  border-radius: var(--radius-button);
  padding: 0 14px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.support-text {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}

.support-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.support-actions a,
.support-actions button {
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-button);
  display: grid;
  place-items: center;
  text-decoration: none;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 18;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
  box-shadow: 0 -12px 34px rgba(15, 23, 42, 0.12);
}

.bottom-nav button {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  gap: 2px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.bottom-nav button.active,
.bottom-nav button:active {
  background: var(--secondary);
  color: var(--primary);
}

.bottom-nav span {
  font-size: 20px;
  line-height: 1;
}

.bottom-nav small {
  font-size: 10px;
  line-height: 1;
}

.back-top {
  position: fixed;
  right: 14px;
  bottom: calc(150px + env(safe-area-inset-bottom));
  z-index: 17;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

mark.search-mark {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

@media (max-width: 420px) {
  .bottom-nav small {
    font-size: 9px;
  }

  .bottom-nav button {
    min-height: 50px;
  }

  .support-actions {
    grid-template-columns: 1fr;
  }
}

/* Navigation hotfix: hidden layers and panel stacking */
[hidden] {
  display: none !important;
}

body.panel-open {
  overflow: hidden;
}

.app-panel[hidden],
.app-overlay[hidden],
.app-drawer[hidden] {
  display: none !important;
}

.app-panel {
  align-items: end;
}

.panel-sheet {
  max-height: min(74vh, 640px);
  overflow-y: auto;
}

.support-text:empty::before {
  content: "Оставьте заявку, и мы свяжемся с вами.";
}


/* Marketplace tuning */
.hero-text-backdrop .brand-row,
.hero-text-backdrop #shopSubtitle,
.hero-text-backdrop #heroButton {
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: calc(var(--radius-card) - 6px);
  background: color-mix(in srgb, var(--header) 78%, transparent);
  backdrop-filter: blur(8px);
}

.catalog.cols-1.grid { grid-template-columns: 1fr; }
.catalog.cols-2.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog.cols-3.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.catalog.market-compact,
.catalog.density-compact {
  gap: max(6px, calc(var(--card-gap) - 4px));
}

.catalog.market-compact .product-card,
.catalog.density-compact .product-card {
  gap: 7px;
  padding: max(8px, calc(var(--card-padding) - 4px));
}

.catalog.market-compact .product-image,
.catalog.density-compact .product-image {
  min-height: min(var(--image-height), 112px);
}

.catalog.market-compact .product-title,
.catalog.density-compact .product-title {
  font-size: 14px;
  line-height: 1.15;
}

.catalog.market-compact .product-description,
.catalog.density-compact .product-description {
  display: none;
}

.catalog.text-center .product-card,
.catalog.text-center .product-info,
.catalog.text-center .buy-row {
  text-align: center;
  justify-items: center;
  justify-content: center;
}

.catalog.price-button-row .buy-row {
  align-items: stretch;
}

.catalog.price-button-row .qty-control {
  margin-left: auto;
}

.catalog.price-separate .buy-row {
  display: grid;
  gap: 8px;
}

.catalog.price-separate .qty-control {
  width: 100%;
  justify-content: space-between;
}

.catalog.price-separate .qty-button {
  flex: 1;
}

.catalog.cols-3.grid .product-card {
  border-radius: max(10px, calc(var(--radius-card) - 4px));
}

.catalog.cols-3.grid .product-title {
  font-size: 13px;
}

.catalog.cols-3.grid .product-meta,
.catalog.cols-3.grid .product-description,
.catalog.cols-3.grid .product-badges {
  display: none;
}

.catalog.cols-3.grid .qty-button {
  width: 34px;
}

@media (max-width: 520px) {
  .catalog.cols-3.grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog.cols-3.grid .price {
    font-size: 13px;
  }
}

/* Marketplace fixed mobile layout + profile/search/ticker/banner */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

.app-shell {
  width: min(430px, 100%);
  max-width: 100%;
  overflow-x: clip;
  padding: 10px 10px calc(150px + env(safe-area-inset-bottom));
}

.shop-header {
  min-height: auto;
  align-content: stretch;
  gap: 0;
  padding: 12px;
  background: var(--header);
  border-radius: calc(var(--radius-card) * 0.85);
}

.brand-row {
  width: 100%;
  min-width: 0;
  align-items: center;
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.shop-header h1 {
  font-size: clamp(20px, calc(var(--title-size) * 0.82), 28px);
  overflow-wrap: anywhere;
}

.shop-header p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.header-action {
  flex: 0 0 auto;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-button);
  padding: 0 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin: 10px 0;
  padding: 0 12px;
  border-radius: var(--radius-button);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

.top-search input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--text);
  font: inherit;
  min-width: 0;
}

.promo-ticker {
  overflow: hidden;
  margin: 8px 0 10px;
  border-radius: var(--radius-button);
  background: var(--ticker-bg);
  color: var(--ticker-color);
  min-height: 34px;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  font-weight: 900;
  font-size: 14px;
  animation: ticker var(--ticker-speed) linear infinite;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.banner-carousel {
  position: relative;
  width: 100%;
  height: var(--banner-height);
  margin: 10px 0 12px;
  overflow: hidden;
  border-radius: var(--banner-radius);
  background: var(--secondary);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.banner-track {
  height: 100%;
  display: flex;
  transition: transform 0.35s ease;
  will-change: transform;
}

.banner-slide {
  flex: 0 0 100%;
  min-width: 100%;
  height: 100%;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: var(--banner-fit);
  display: block;
  background: var(--secondary);
}

.banner-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: auto;
}

.banner-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
}

.banner-dots button.active {
  width: 18px;
  background: #fff;
}

.category-strip {
  max-width: 100%;
  overscroll-behavior-x: contain;
}

.catalog {
  max-width: 100%;
  overflow-x: clip;
}

.catalog.grid {
  grid-template-columns: repeat(var(--grid-columns, 2), minmax(0, 1fr));
}

.catalog.grid.cols-4 {
  --grid-columns: 4;
}

@media (max-width: 430px) {
  .catalog.grid.cols-4 {
    --grid-columns: 3;
  }
}

.product-card {
  min-width: 0;
  overflow: hidden;
}

.product-image {
  width: 100%;
  min-height: auto;
  aspect-ratio: var(--product-image-aspect, 1 / 1);
}

.product-image img {
  object-fit: var(--product-image-fit, cover);
}

.catalog.grid .product-card {
  gap: 8px;
}

.catalog.size-tiny .product-card,
.catalog.market-compact .product-card {
  padding: max(6px, calc(var(--card-padding) * 0.75));
  gap: 6px;
}

.catalog.size-tiny .product-title,
.catalog.market-compact .product-title {
  font-size: 13px;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog.size-tiny .product-meta,
.catalog.market-compact .product-meta {
  font-size: 10px;
}

.catalog.size-tiny .product-description,
.catalog.market-compact .product-description {
  display: none;
}

.catalog.size-tiny .price,
.catalog.market-compact .price {
  font-size: clamp(13px, calc(var(--price-size) * 0.78), 16px);
  overflow-wrap: anywhere;
}

.catalog.size-tiny .old-price,
.catalog.market-compact .old-price {
  font-size: 11px;
}

.catalog.size-tiny .qty-button,
.catalog.market-compact .qty-button {
  width: 34px;
  min-height: 34px;
}

.catalog.size-tiny .qty-control,
.catalog.market-compact .qty-control {
  gap: 5px;
}

.catalog.size-small .product-card {
  padding: max(8px, calc(var(--card-padding) * 0.85));
}

.catalog.aspect-4-3 {
  --product-image-aspect: 4 / 3;
}

.catalog.aspect-3-4 {
  --product-image-aspect: 3 / 4;
}

.catalog.aspect-1-1 {
  --product-image-aspect: 1 / 1;
}

.bottom-nav {
  max-width: 430px;
  left: 50%;
  transform: translateX(-50%);
}

.floating-cart {
  max-width: 410px;
}


/* Storefront cart/product/profile redesign */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

* {
  box-sizing: border-box;
}

.app-shell {
  width: min(520px, 100%);
  max-width: 100%;
  overflow-x: hidden;
}

.shop-header {
  min-height: auto;
  align-content: center;
  padding: 14px;
}

.brand-row {
  align-items: center;
}

.brand-logo {
  width: var(--logo-size, 54px);
  height: var(--logo-size, 54px);
}

#shopTitle {
  font-family: var(--header-font, inherit);
}

.header-action {
  margin-left: auto;
  flex: 0 0 auto;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-button);
  padding: 0 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.top-search,
.catalog-tools {
  width: 100%;
  max-width: 100%;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin: 10px 0;
  padding: 10px;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.tool-select {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.tool-select select {
  min-width: 0;
}

.tool-check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--secondary);
  color: var(--text);
  font-weight: 900;
  font-size: 12px;
}

.tool-reset {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 0 10px;
  background: var(--secondary);
  color: var(--text);
  font-weight: 900;
  grid-column: 1 / -1;
}

.category-strip {
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.catalog.grid {
  grid-template-columns: repeat(var(--grid-columns, 2), minmax(0, 1fr));
}

@media (max-width: 520px) {
  .catalog.grid {
    grid-template-columns: repeat(var(--grid-columns, 2), minmax(0, 1fr));
  }
}

.product-card {
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
}

.catalog.grid .product-card {
  gap: 7px;
  padding: calc(var(--card-padding) * 0.72);
}

.catalog.grid.size-tiny .product-card,
.catalog.grid.market-compact .product-card {
  gap: 5px;
  padding: min(8px, var(--card-padding));
}

.product-image {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: var(--product-image-aspect, 1 / 1);
  height: auto;
}

.catalog.grid .product-image {
  min-height: 0;
}

.product-image img {
  object-fit: var(--product-image-fit, cover);
}

.product-info {
  min-width: 0;
}

.product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog.grid .product-title {
  font-size: clamp(12px, calc(var(--body-size) * 0.9), 15px);
}

.catalog.grid .product-meta,
.catalog.grid .product-description {
  font-size: 11px;
}

.catalog.grid .product-description {
  display: none;
}

.catalog.grid .buy-row {
  gap: 6px;
}

.catalog.grid .price {
  font-size: clamp(13px, var(--price-size), 17px);
  line-height: 1.12;
}

.catalog.grid .old-price {
  font-size: 11px;
}

.catalog.grid .qty-control {
  margin-left: auto;
}

.catalog.grid .qty-button {
  width: 34px;
  min-height: 34px;
}

.catalog.grid .qty-count {
  font-size: 13px;
}

.product-badges.on-image {
  position: absolute;
  top: 6px;
  left: 6px;
  right: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: calc(100% - 12px);
  z-index: 2;
}

body.badge-right .product-badges.on-image {
  left: auto;
  right: 6px;
  align-items: flex-end;
}

.product-badge {
  min-height: 19px;
  padding: 0 6px;
  border-radius: var(--badge-radius, 999px);
  font-size: var(--badge-size, 11px);
  line-height: 1;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.product-badge.discount {
  background: var(--badge-discount-bg, var(--accent));
  color: var(--badge-discount-color, #fff);
}

.product-badge.new {
  background: var(--badge-new-bg, #22c55e);
  color: var(--badge-new-color, #fff);
}

.product-badge.hit {
  background: var(--badge-hit-bg, #f59e0b);
  color: var(--badge-hit-color, #111827);
}

.product-badge.out {
  background: var(--badge-out-bg, #ef4444);
  color: var(--badge-out-color, #fff);
}

.cart-panel {
  margin: 0;
  display: none;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.cart-sheet {
  max-height: min(88vh, 720px);
  overflow-y: auto;
}

.bottom-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.nav-cart {
  position: relative;
}

.nav-cart b {
  position: absolute;
  top: 5px;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  font-weight: 900;
}

.product-sheet {
  max-height: min(92vh, 760px);
  overflow-y: auto;
}

.product-detail {
  display: grid;
  gap: 14px;
}

.detail-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-card);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--secondary);
  color: var(--primary);
  font-size: 54px;
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: var(--product-image-fit, cover);
}

.detail-main {
  display: grid;
  gap: 10px;
}

.detail-main h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.detail-qty {
  justify-content: flex-start;
}

.detail-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--secondary) 65%, transparent);
}

.detail-section h3,
.detail-section p {
  margin: 0;
}

.reviews-list {
  display: grid;
  gap: 8px;
}

.review-card {
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
}

.review-card p {
  margin: 5px 0 0;
}

.review-form,
.profile-form {
  display: grid;
  gap: 10px;
}

.support-intro {
  margin: 0 0 8px;
  font-weight: 900;
}

@media (max-width: 390px) {
  .catalog.grid.cols-3,
  .catalog.grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-tools {
    grid-template-columns: 1fr;
  }
}


/* Cart app blank hotfix */
.cart-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cart-head-actions .ghost-button {
  min-height: 34px;
  padding: 0 10px;
}


/* Polish pass: compact marketplace, gradients, locked cart modal, success screen */
html, body {
  max-width: 100vw;
  overflow-x: hidden !important;
  touch-action: pan-y;
}

body {
  background: var(--app-bg-main, var(--bg));
}

* {
  box-sizing: border-box;
}

.app-shell {
  width: min(430px, 100%);
  padding: 8px 8px calc(86px + env(safe-area-inset-bottom));
}

.shop-header {
  min-height: auto;
  padding: 12px;
  border-radius: 18px;
  background: var(--header-main, var(--header));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.brand-row {
  gap: 9px;
}

.brand-logo {
  width: var(--logo-size, 44px);
  height: var(--logo-size, 44px);
  border-radius: 13px;
}

#shopTitle {
  font-size: clamp(20px, calc(var(--title-size) * 0.86), 30px);
}

.eyebrow,
#shopSubtitle {
  font-size: 12px;
}

.header-action {
  min-height: 34px;
  padding: 0 11px;
  background: var(--button-main, var(--primary));
  font-size: 12px;
}

.primary-action,
.qty-button,
.tool-reset,
.support-actions a,
.support-actions button {
  background: var(--button-main, var(--primary));
}

.top-search {
  min-height: 40px;
  margin: 7px 0;
  border-radius: 14px;
}

.top-search input {
  font-size: 13px;
}

.promo-ticker {
  min-height: 30px;
  border-radius: 12px;
}

.banner-carousel {
  margin: 8px 0;
}

.banner-slide img,
.banner-slide video {
  width: 100%;
  height: 100%;
  object-fit: var(--banner-fit, cover);
  display: block;
}

.category-strip {
  margin: 8px -8px 5px;
  padding: 0 8px 4px;
}

.category-strip button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.catalog-tools.compact-tools {
  grid-template-columns: 1fr auto auto auto;
  gap: 6px;
  margin: 7px 0;
  padding: 7px;
  border-radius: 14px;
}

.sort-mini,
.category-mini,
.stock-mini {
  position: relative;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--surface-main, var(--surface));
  border: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
  font-size: 12px;
  font-weight: 900;
  color: var(--text);
}

.sort-mini span,
.category-mini span {
  font-size: 14px;
  color: var(--primary);
}

.sort-mini select,
.category-mini select {
  min-height: 32px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  color: var(--text);
  max-width: 100%;
  padding: 0 18px 0 0;
}

.category-mini select {
  max-width: 92px;
}

.stock-mini {
  background: var(--secondary);
  font-size: 11px;
  white-space: nowrap;
}

.tool-reset {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 0 9px;
}

.catalog {
  gap: max(5px, calc(var(--card-gap) * 0.7));
}

.catalog.grid {
  grid-template-columns: repeat(var(--grid-columns, 2), minmax(0, 1fr));
}

.product-card {
  min-width: 0;
  gap: 6px;
  padding: clamp(7px, calc(var(--card-padding) * 0.7), 12px);
  border-radius: clamp(12px, var(--radius-card), 18px);
  background: var(--surface-main, var(--surface));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.product-image {
  position: relative;
  min-height: unset;
  aspect-ratio: var(--product-image-aspect, 1 / 1);
  border-radius: max(10px, calc(var(--radius-card) - 6px));
  font-size: 32px;
}

.product-image img,
.product-image video,
.detail-image video,
.detail-image img,
.detail-thumbs video,
.detail-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: var(--product-image-fit, cover);
  display: block;
}

.product-meta {
  font-size: 10px;
  line-height: 1.15;
}

.product-title {
  font-size: 13px;
  line-height: 1.12;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  font-size: 11px;
  line-height: 1.2;
}

.price {
  font-size: clamp(13px, calc(var(--price-size) * 0.76), 17px);
  line-height: 1.12;
}

.old-price {
  font-size: 11px;
}

.qty-button {
  width: 34px;
  min-height: 34px;
  border-radius: 12px;
}

.qty-count {
  min-width: 16px;
  font-size: 12px;
}

.qty-control {
  gap: 5px;
}

.product-badges.on-image {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 6px;
  right: auto;
  gap: 4px;
  align-items: flex-start;
}

body.badge-right .product-badges.on-image {
  left: auto;
  right: 6px;
  align-items: flex-end;
}

.product-badge {
  min-height: 18px;
  padding: 0 6px;
  font-size: var(--badge-size, 10px);
  border-radius: var(--badge-radius, 999px);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.14);
}

.app-panel {
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(7px);
}

#cartPanel,
#successPanel {
  align-items: center;
  padding: 16px;
}

.panel-sheet {
  width: min(430px, 100%);
}

.cart-sheet {
  max-height: min(88vh, 720px);
  padding: 16px 14px 18px;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

.cart-line {
  align-items: flex-start;
  padding: 11px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--secondary) 78%, var(--surface));
}

.cart-line strong:last-child {
  white-space: nowrap;
}

.cart-total {
  padding: 13px;
  border-radius: 16px;
  background: var(--cart-bar);
  color: #fff;
}

.order-form {
  padding-top: 4px;
}

.order-form input,
.order-form textarea,
.profile-form input,
.review-form textarea,
.review-form select {
  min-height: 42px;
  border-radius: 13px;
}

.success-sheet {
  place-items: center;
  text-align: center;
  padding: 28px 18px;
  border-radius: 26px;
}

.success-emoji {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  font-size: 48px;
}

.success-sheet h2,
.success-sheet p {
  margin: 0;
}

.detail-gallery {
  display: grid;
  gap: 8px;
}

.detail-thumbs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.detail-thumbs button {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 14px;
  overflow: hidden;
  background: var(--secondary);
}

.bottom-nav {
  width: min(430px, 100%);
  padding: 6px 7px calc(6px + env(safe-area-inset-bottom));
}

.bottom-nav button {
  min-height: 48px;
}

@media (max-width: 390px) {
  .catalog-tools.compact-tools {
    grid-template-columns: 1fr auto;
  }
  .stock-mini,
  .tool-reset {
    min-height: 34px;
  }
}


/* Food showcase / Mipoliya-like dark storefront */
html, body {
  overscroll-behavior-x: none;
}
.app-shell {
  max-width: 430px;
}
.shop-header {
  min-height: auto;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0,0,0,.16);
}
.brand-row {
  min-height: 56px;
}
.header-action {
  min-width: 94px;
  min-height: 40px;
  border-radius: 999px;
  background: var(--button-bg, var(--primary));
  color: #fff;
}
.top-search {
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
}
.banner-carousel {
  margin: 12px 0 6px;
  border-radius: var(--banner-radius, 18px);
  overflow: hidden;
  box-shadow: 0 20px 56px rgba(0,0,0,.20);
}
.banner-track {
  display: flex;
}
.banner-slide {
  min-width: 100%;
}
.category-strip {
  gap: 8px;
  margin-top: 12px;
}
.category-strip button {
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
}
.catalog.rails-catalog {
  display: grid;
  gap: 18px;
}
.product-rail-section {
  display: grid;
  gap: 10px;
}
.rail-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}
.rail-head p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.rail-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
}
.rail-head button {
  min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--secondary) 70%, transparent);
  border-radius: 999px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}
.product-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 47%);
  gap: var(--card-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 2px 12px 12px;
  margin: 0 -12px;
  scrollbar-width: none;
}
.product-rail::-webkit-scrollbar {
  display: none;
}
.product-card.rail-card {
  scroll-snap-align: start;
  min-width: 0;
  gap: 8px;
  padding: max(8px, calc(var(--card-padding) - 3px));
}
.product-card.rail-card .product-image {
  min-height: unset;
  aspect-ratio: var(--product-image-aspect, 1 / 1);
}
.product-card.rail-card .product-title {
  font-size: 13px;
  line-height: 1.22;
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card.rail-card .product-meta {
  font-size: 10.5px;
}
.product-card.rail-card .price {
  font-size: 14px;
}
.product-card.rail-card .qty-control {
  margin-left: auto;
}
.product-card.rail-card .qty-button {
  width: 34px;
  min-height: 34px;
}
.product-card.rail-card .qty-count {
  display: none;
}
.catalog.rails-catalog.size-tiny .product-rail,
.catalog.rails-catalog.market-compact .product-rail {
  grid-auto-columns: minmax(132px, 43%);
}
.catalog.rails-catalog.size-small .product-rail {
  grid-auto-columns: minmax(145px, 46%);
}
.catalog.rails-catalog.size-large .product-rail {
  grid-auto-columns: minmax(180px, 58%);
}
@media (min-width: 640px) {
  .product-rail { grid-auto-columns: minmax(160px, 33%); }
  .catalog.rails-catalog.size-tiny .product-rail,
  .catalog.rails-catalog.market-compact .product-rail { grid-auto-columns: minmax(140px, 30%); }
}


/* Full food storefront layout */
:root {
  --rail-card-width: 154px;
  --deep-card: color-mix(in srgb, var(--surface) 88%, #000);
}

.app-shell {
  width: min(440px, 100%);
  padding: 10px 10px calc(96px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

body,
html {
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

.shop-header {
  min-height: auto;
  padding: 14px;
  border-radius: 18px;
  background: var(--header-main, var(--header));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.brand-row {
  align-items: center;
}

.brand-copy {
  min-width: 0;
}

.header-action {
  flex: 0 0 auto;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--button-main, var(--primary));
  color: #fff;
  font-weight: 900;
}

.top-search {
  margin: 10px 0;
  min-height: 44px;
  border-radius: 14px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}

.top-search input {
  border: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
  outline: none;
  font-weight: 800;
}

.banner-carousel {
  margin: 10px 0 14px;
}

.banner-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: var(--banner-radius);
}

.banner-slide {
  min-width: 100%;
  scroll-snap-align: start;
}

.banner-slide img,
.banner-slide video {
  width: 100%;
  height: var(--banner-height);
  object-fit: var(--banner-fit);
  border-radius: var(--banner-radius);
  display: block;
}

.quick-tiles {
  display: flex;
  gap: 8px;
  margin: 8px -10px 14px;
  padding: 0 10px 4px;
  overflow-x: auto;
}

.quick-tile {
  position: relative;
  flex: 0 0 82px;
  min-height: 78px;
  border: 0;
  border-radius: 18px;
  padding: 9px;
  text-align: left;
  color: var(--text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 88%, white), color-mix(in srgb, var(--secondary) 70%, var(--surface)));
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.16);
}

.quick-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.36)), var(--tile-image);
  background-size: cover;
  background-position: center;
  opacity: 0.72;
  pointer-events: none;
}

.quick-tile span,
.quick-tile strong,
.quick-tile small {
  position: relative;
  z-index: 1;
  display: block;
}

.quick-tile span {
  font-size: 20px;
  margin-bottom: 8px;
}

.quick-tile strong {
  font-size: 12px;
  line-height: 1.1;
}

.quick-tile small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.food-section,
.store-reviews-section {
  margin: 16px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: .01em;
}

.section-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.section-action {
  border: 0;
  border-radius: 999px;
  min-height: 30px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--secondary) 80%, transparent);
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}

.horizontal-products,
.articles-rail,
.store-reviews-rail,
.product-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -10px;
  padding: 0 10px 8px;
  scroll-snap-type: x proximity;
}

.horizontal-products .product-card,
.product-rail .product-card {
  flex: 0 0 var(--rail-card-width);
  scroll-snap-align: start;
  min-width: var(--rail-card-width);
}

.product-card {
  background: var(--surface-main, var(--surface));
  overflow: hidden;
}

.product-image {
  aspect-ratio: var(--product-image-aspect, 1 / 1);
  min-height: 0;
  height: auto;
}

.horizontal-products .product-image,
.product-rail .product-image,
.catalog.grid .product-image {
  aspect-ratio: 1 / 1;
}

.horizontal-products .product-description,
.product-rail .product-description {
  display: none;
}

.horizontal-products .qty-button,
.product-rail .qty-button,
.catalog.grid .qty-button {
  width: 34px;
  min-height: 34px;
}

.horizontal-products .qty-control .qty-button:first-child,
.product-rail .qty-control .qty-button:first-child,
.catalog.grid .qty-control .qty-button:first-child {
  display: none;
}

.horizontal-products .qty-count,
.product-rail .qty-count,
.catalog.grid .qty-count {
  display: none;
}

.product-title {
  font-size: 14px;
}

.product-meta {
  font-size: 11px;
}

.price {
  font-size: 14px;
}

.promo-blocks {
  display: flex;
  gap: 10px;
  margin: 12px -10px;
  padding: 0 10px 8px;
  overflow-x: auto;
}

.promo-card {
  position: relative;
  flex: 0 0 82%;
  min-height: 142px;
  border-radius: 20px;
  padding: 16px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(120deg, rgba(10,10,12,.75), rgba(10,10,12,.2)), var(--promo-image), linear-gradient(135deg, var(--primary), var(--accent));
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 46px rgba(0,0,0,0.24);
}

.promo-card span {
  display: inline-flex;
  min-height: 24px;
  padding: 0 10px;
  align-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 11px;
  font-weight: 900;
}

.promo-card h3 {
  margin: 20px 0 6px;
  font-size: 20px;
}

.promo-card p {
  margin: 0 0 12px;
  max-width: 26ch;
  font-weight: 700;
}

.promo-card button,
.article-card button {
  border: 0;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  background: var(--button-main, var(--primary));
  color: #fff;
  font-weight: 900;
}

.article-card {
  flex: 0 0 176px;
  padding: 8px;
  border-radius: 20px;
  background: var(--surface-main, var(--surface));
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

.article-image {
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--secondary);
  font-size: 32px;
}

.article-image img,
.article-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.article-card h3 {
  font-size: 14px;
  margin: 4px 0;
  line-height: 1.2;
}

.article-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.store-review-card {
  flex: 0 0 240px;
  padding: 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, var(--secondary));
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
}

.store-review-card strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.store-review-card span {
  color: var(--primary);
}

.store-review-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.catalog-tools {
  margin-top: 10px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.category-strip {
  margin-top: 10px;
}

.drawer-article-image {
  height: 160px;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 12px;
}

.drawer-article-image img,
.drawer-article-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-article h2 {
  margin: 6px 0 8px;
}

.drawer-article p {
  color: var(--muted);
}

.bottom-nav {
  width: min(420px, calc(100% - 24px));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  border-radius: 26px;
  background: color-mix(in srgb, var(--cart-bar) 88%, transparent);
  backdrop-filter: blur(16px);
}

@media (max-width: 420px) {
  :root { --rail-card-width: 148px; }
  .app-shell { padding-left: 8px; padding-right: 8px; }
  .quick-tiles,
  .horizontal-products,
  .articles-rail,
  .store-reviews-rail,
  .product-rail,
  .promo-blocks { margin-left: -8px; margin-right: -8px; padding-left: 8px; padding-right: 8px; }
}



/* Storefront UX v2 */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  touch-action: pan-y;
}

.app-shell,
.app-panel,
.bottom-nav {
  box-sizing: border-box;
}

.app-preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--app-bg-main, var(--bg));
  color: var(--text);
  transition: opacity .25s ease, visibility .25s ease;
}

.app-preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-card {
  width: min(280px, calc(100vw - 48px));
  min-height: 220px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 24px;
  background: var(--surface-main, var(--surface));
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  text-align: center;
}

.preloader-media {
  width: 132px;
  height: 132px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--secondary);
  font-size: 54px;
}

.preloader-media img,
.preloader-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.brand-title-image {
  display: block;
  max-width: min(220px, 54vw);
  max-height: 64px;
  object-fit: contain;
}

.product-card,
.article-card,
.promo-card,
.quick-tile,
.panel-sheet {
  border: var(--card-border-width, 0px) solid var(--card-border-color, transparent);
}

.horizontal-products,
.articles-rail,
.store-reviews-rail,
.product-rail,
.promo-blocks,
.category-strip,
.banner-track {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.horizontal-products::-webkit-scrollbar,
.articles-rail::-webkit-scrollbar,
.store-reviews-rail::-webkit-scrollbar,
.product-rail::-webkit-scrollbar,
.promo-blocks::-webkit-scrollbar,
.category-strip::-webkit-scrollbar,
.banner-track::-webkit-scrollbar {
  display: none;
}

.banner-carousel {
  border: 1px solid color-mix(in srgb, var(--muted) 24%, transparent);
  padding: 4px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.banner-track {
  border-radius: calc(var(--banner-radius) - 4px);
  overflow: hidden;
}

.banner-slide {
  position: relative;
  border-radius: calc(var(--banner-radius) - 4px);
  overflow: hidden;
}

.banner-slide-button {
  position: absolute;
  left: 14px;
  bottom: 14px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--button-main, var(--primary));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0,0,0,.22);
}

.compact-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.sort-trigger {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--secondary);
  color: var(--text);
  font-weight: 900;
  font-size: 20px;
}

.sort-mini,
.category-mini {
  flex: 1;
  min-width: 0;
}

.sort-mini select,
.category-mini select {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 0;
  background: var(--secondary);
  color: var(--text);
  padding: 0 10px;
  font-weight: 900;
}

.stock-mini[hidden] {
  display: none !important;
}

.bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 4px;
  padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  width: min(760px, calc(100% - 12px));
  left: 6px;
  right: 6px;
}

.bottom-nav button {
  min-height: 50px;
  border-radius: 16px;
}

.bottom-nav button span {
  font-size: 18px;
  line-height: 1;
}

.bottom-nav small {
  font-size: 10px;
  line-height: 1.1;
}

.cart-sheet {
  border-radius: 28px 28px 0 0;
  padding-top: 18px;
}

.rich-cart-line {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 10px;
  align-items: center;
  background: color-mix(in srgb, var(--secondary) 70%, var(--surface));
}

.cart-line-image {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface);
  font-size: 28px;
}

.cart-line-image img,
.cart-line-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-line-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cart-line-body small {
  color: var(--muted);
  font-weight: 800;
}

.cart-empty-note {
  padding: 18px;
  border-radius: 18px;
  background: var(--secondary);
  text-align: center;
}

.article-panel .panel-sheet,
.article-sheet {
  max-height: min(92vh, 760px);
  overflow-y: auto;
}

.article-detail {
  display: grid;
  gap: 14px;
}

.article-detail-image {
  height: min(260px, 50vw);
  border-radius: 22px;
  overflow: hidden;
  background: var(--secondary);
}

.article-detail-image img,
.article-detail-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-detail h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
}

.article-lead {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.article-text {
  font-size: 16px;
  line-height: 1.55;
  white-space: normal;
}

.theme-light {
  --bg: #fff7ed;
  --surface: #ffffff;
  --text: #27170f;
  --muted: #7c5f4f;
  --secondary: #ffedd5;
  --header: #ffffff;
  --cart-bar: #fff7ed;
}

.theme-light .bottom-nav,
.theme-light .panel-sheet {
  background: rgba(255,255,255,.96);
}

@media (max-width: 520px) {
  .app-shell {
    padding-inline: 10px;
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .horizontal-products .product-card,
  .product-rail .product-card {
    flex-basis: min(44vw, var(--rail-card-width));
    min-width: min(44vw, var(--rail-card-width));
  }

  .promo-card {
    flex-basis: 86%;
  }
}


/* Hotfix: centered five-item bottom menu and separate catalog page */
.bottom-nav {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  width: min(430px, calc(100% - 20px)) !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  align-items: center;
  border-radius: 22px 22px 0 0;
}

.bottom-nav button {
  min-width: 0;
  overflow: hidden;
}

.bottom-nav small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.home-page #catalogTools,
body.home-page #categories,
body.home-page #catalog {
  display: none !important;
}

body.catalog-page #homeShowcase,
body.catalog-page #quickTiles {
  display: none !important;
}

.catalog.catalog-page-list {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 10px;
}

.catalog.catalog-page-list .product-card {
  grid-template-columns: 108px 1fr;
  align-items: stretch;
  min-height: 132px;
}

.catalog.catalog-page-list .product-image {
  min-height: 108px;
  height: 108px;
  aspect-ratio: 1 / 1;
}

.catalog.catalog-page-list .product-info {
  min-width: 0;
}

.catalog.catalog-page-list .product-title {
  font-size: 16px;
}

.catalog.catalog-page-list .buy-row {
  margin-top: auto;
}

@media (max-width: 420px) {
  .bottom-nav {
    width: calc(100% - 12px) !important;
    padding-left: 4px;
    padding-right: 4px;
    gap: 2px;
  }

  .bottom-nav button {
    min-height: 48px;
    border-radius: 12px;
  }

  .bottom-nav span {
    font-size: 17px;
  }

  .bottom-nav small {
    font-size: 8.5px;
  }

  .catalog.catalog-page-list .product-card {
    grid-template-columns: 96px 1fr;
  }

  .catalog.catalog-page-list .product-image {
    min-height: 96px;
    height: 96px;
  }
}


/* Hotfix: centered bottom menu, marketplace catalog, cleaner home blocks */
.bottom-nav {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  bottom: 0 !important;
  width: min(760px, calc(100% - 12px)) !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 7px 7px calc(7px + env(safe-area-inset-bottom)) !important;
  border-radius: 22px 22px 0 0 !important;
  overflow: visible !important;
}
.bottom-nav button { min-width: 0 !important; }
#stockFilterWrap { display: none !important; }
#clearFilters { display: none !important; }
.catalog-tools.compact-tools {
  grid-template-columns: auto minmax(0,1fr) !important;
  align-items: center !important;
  gap: 8px !important;
}
.catalog-tools .category-mini { display: none !important; }
.catalog.catalog-market-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}
.catalog.catalog-market-grid .product-card {
  display: grid !important;
  grid-template-columns: 1fr !important;
  min-height: 0 !important;
  padding: 10px !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}
.catalog.catalog-market-grid .product-image {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 14px !important;
}
.catalog.catalog-market-grid .product-title { font-size: 13px !important; line-height: 1.15 !important; }
.catalog.catalog-market-grid .product-meta,
.catalog.catalog-market-grid .product-description { font-size: 10px !important; }
.catalog.catalog-market-grid .product-description { display: none !important; }
.catalog.catalog-market-grid .buy-row { align-items: end !important; }
.catalog.catalog-market-grid .price { font-size: 14px !important; }
.catalog.catalog-market-grid .qty-button { width: 32px !important; min-height: 32px !important; height: 32px !important; }
.food-section[hidden], .articles-section[hidden], .store-reviews-section[hidden] { display: none !important; }
.food-section, .articles-section, .promo-blocks, .store-reviews-section { display: block; }
.horizontal-products, .articles-rail, .store-reviews-rail {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.horizontal-products::-webkit-scrollbar,
.articles-rail::-webkit-scrollbar,
.store-reviews-rail::-webkit-scrollbar { display: none; }
@media (max-width: 420px) {
  .bottom-nav { width: calc(100% - 8px) !important; padding-left: 4px !important; padding-right: 4px !important; }
  .bottom-nav small { font-size: 8.5px !important; }
  .catalog.catalog-market-grid { gap: 8px !important; }
  .catalog.catalog-market-grid .product-card { padding: 8px !important; }
}


/* Telegram Mini App stability: no side shift, no rubber-band close gesture */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
}

body {
  position: relative;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.app-shell,
.app-panel,
.app-drawer,
.panel-sheet {
  overscroll-behavior: contain;
}

.product-rail,
.articles-rail,
.store-reviews-rail,
.quick-tiles,
.banner-track {
  overscroll-behavior-inline: contain;
  touch-action: pan-x;
}

.app-preloader {
  will-change: opacity, visibility;
}

.app-preloader.is-hidden {
  transition-duration: .32s;
}


/* Homepage functional cleanup patch */
.home-showcase {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quick-tiles.quick-scroll {
  display: flex;
  overflow-x: auto;
  grid-template-columns: none;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.quick-tiles.quick-scroll .quick-tile {
  flex: 0 0 132px;
  scroll-snap-align: start;
}

.promo-blocks.promo-wide-layout {
  display: grid;
  gap: 10px;
}

.promo-blocks.promo-wide-layout .promo-card {
  min-height: 156px;
}

.catalog-page .home-showcase,
.catalog-page .quick-tiles {
  display: none !important;
}

.home-page .catalog,
.home-page .catalog-tools,
.home-page .category-strip {
  display: none !important;
}


/* Marketplace/cart/product visual polish patch */
.catalog-page-head {
  display: none;
  margin: 8px 0 10px;
  padding: 14px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: var(--card-border-width, 0px) solid var(--card-border-color, transparent);
  box-shadow: 0 14px 34px rgba(0,0,0,.12);
}
body.catalog-page .catalog-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.catalog-page-head p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 900; }
.catalog-page-head h2 { margin: 2px 0 0; font-size: 22px; line-height: 1.05; }
.catalog-page-head span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
body.home-page .catalog-page-head { display: none !important; }

.catalog-tools.compact-tools {
  position: sticky;
  top: 6px;
  z-index: 7;
  margin: 8px 0 10px !important;
  padding: 8px !important;
  border: 1px solid color-mix(in srgb, var(--secondary) 70%, transparent);
  border-radius: 18px !important;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 36px rgba(0,0,0,.12);
}
.sort-trigger {
  width: 38px !important;
  min-height: 38px !important;
  border-radius: 14px !important;
  background: var(--button-main, var(--primary)) !important;
  color: #fff !important;
}
.sort-mini select {
  min-height: 38px !important;
  border-radius: 14px !important;
  font-weight: 900;
}

.catalog.catalog-market-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  padding-bottom: 12px;
}
@media (min-width: 720px) {
  .catalog.catalog-market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
.catalog.catalog-market-grid .product-card,
.horizontal-products .product-card,
.product-rail .product-card {
  position: relative;
  border: var(--card-border-width, 0px) solid var(--card-border-color, transparent) !important;
  background: var(--surface-main, var(--surface)) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.16) !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
.catalog.catalog-market-grid .product-card:active,
.horizontal-products .product-card:active { transform: scale(.985); }
.catalog.catalog-market-grid .product-image,
.horizontal-products .product-image,
.product-rail .product-image {
  background: color-mix(in srgb, var(--secondary) 70%, transparent) !important;
}
.catalog.catalog-market-grid .product-info { gap: 5px !important; }
.catalog.catalog-market-grid .product-title { min-height: 30px; }
.catalog.catalog-market-grid .product-meta { opacity: .82; }
.catalog.catalog-market-grid .buy-row { gap: 6px !important; }
.catalog.catalog-market-grid .price-block { min-width: 0; }
.catalog.catalog-market-grid .price { white-space: normal; }
.catalog.catalog-market-grid .old-price { font-size: 11px !important; }
.catalog.catalog-market-grid .qty-control {
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--secondary) 62%, transparent);
}
.catalog.catalog-market-grid .qty-count { min-width: 18px; font-size: 12px; }
.catalog.catalog-market-grid .product-badges {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 2;
  max-width: calc(100% - 14px);
}
body.badge-right .catalog.catalog-market-grid .product-badges { left: auto; right: 7px; justify-content: flex-end; }

.app-panel {
  background: rgba(10, 12, 18, .58) !important;
  backdrop-filter: blur(8px);
}
.panel-sheet {
  border: 1px solid color-mix(in srgb, var(--secondary) 62%, transparent);
  box-shadow: 0 -22px 70px rgba(0,0,0,.35);
}
.cart-sheet {
  max-height: min(86vh, 740px);
  overflow: hidden;
  display: grid !important;
  grid-template-rows: auto minmax(90px, 1fr) auto auto auto;
}
.cart-sheet .cart-items {
  overflow-y: auto;
  padding-right: 2px;
}
.rich-cart-line {
  align-items: center !important;
  grid-template-columns: 58px 1fr auto;
  display: grid !important;
  gap: 10px !important;
  padding: 10px !important;
  border-radius: 18px !important;
  background: color-mix(in srgb, var(--secondary) 56%, var(--surface)) !important;
}
.cart-line-image {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface);
}
.cart-line-image img, .cart-line-image video { width: 100%; height: 100%; object-fit: cover; }
.cart-line-body { min-width: 0; }
.cart-line-body strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-body small { color: var(--muted); font-weight: 800; }
.cart-total {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--cart-bar);
  color: #fff;
}
.order-form {
  padding-top: 4px;
}
.order-form input, .order-form textarea {
  border-radius: 14px;
}

.product-sheet, .article-sheet {
  max-height: min(92vh, 780px);
  overflow: hidden;
}
.product-sheet #productModalBody,
.article-sheet #articleModalBody {
  overflow-y: auto;
  padding-right: 2px;
}
.product-detail { gap: 14px !important; }
.detail-image {
  position: relative;
  min-height: 260px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--secondary);
}
.detail-image img, .detail-image video { width: 100%; height: 100%; object-fit: cover; display:block; }
.detail-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.detail-thumbs::-webkit-scrollbar { display: none; }
.detail-thumbs button {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  background: var(--secondary);
}
.detail-thumbs button.active { border-color: var(--primary); }
.detail-thumbs img, .detail-thumbs video { width: 100%; height: 100%; object-fit: cover; }
.detail-main {
  padding: 12px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--secondary) 44%, transparent);
}
.detail-main h2 { margin: 0 0 6px; line-height: 1.08; }
.detail-section {
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--secondary) 36%, transparent);
}
.detail-section h3 { margin: 0 0 6px; }
.article-detail-image {
  border-radius: 22px;
  overflow: hidden;
  max-height: 280px;
}
.article-detail-image img, .article-detail-image video { width: 100%; height: 100%; object-fit: cover; display:block; }
.article-detail h2 { line-height: 1.08; }
.article-text { line-height: 1.55; }

.bottom-nav {
  box-shadow: 0 -16px 44px rgba(0,0,0,.24) !important;
  backdrop-filter: blur(18px);
}
.bottom-nav button.active {
  background: color-mix(in srgb, var(--primary) 18%, transparent) !important;
}
@media (max-width: 420px) {
  .rich-cart-line { grid-template-columns: 52px 1fr; }
  .rich-cart-line > strong { grid-column: 2; justify-self: start; }
  .detail-image { min-height: 220px; }
}


/* Admin iframe preview mode */
body.admin-preview-mode {
  overscroll-behavior: contain;
}

body.admin-preview-mode .app-shell {
  width: 100%;
  max-width: 420px;
  padding: 10px 10px calc(96px + env(safe-area-inset-bottom));
}

body.admin-preview-mode .app-preloader {
  pointer-events: none;
}

body.admin-preview-mode .bottom-nav {
  max-width: 420px;
}


/* Homepage visual editor controls */
.home-showcase {
  gap: var(--home-section-gap, 14px) !important;
}

.food-section,
.articles-section,
.store-reviews-section,
.promo-blocks {
  border-radius: var(--home-section-radius, 20px);
  padding: var(--home-section-padding, 0px);
}

.quick-tiles {
  gap: var(--quick-tile-gap, 8px);
}

.quick-tiles.quick-grid {
  display: grid;
  grid-template-columns: repeat(var(--quick-tile-columns, 3), minmax(0, 1fr));
  margin: 8px 0 14px;
  padding: 0 0 4px;
  overflow: visible;
}

.quick-tiles.quick-grid .quick-tile {
  flex: none;
  width: 100%;
}

.quick-tile {
  min-height: var(--quick-tile-height, 96px);
  border-radius: var(--quick-tile-radius, 18px);
}

.quick-style-soft .quick-tile::before,
.quick-style-minimal .quick-tile::before {
  display: none;
}

.quick-style-soft .quick-tile {
  background: color-mix(in srgb, var(--surface-main, var(--surface)) 88%, var(--secondary));
}

.quick-style-minimal .quick-tile {
  min-height: calc(var(--quick-tile-height, 96px) * .78);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
  box-shadow: none;
}

.quick-style-photo .quick-tile small,
.quick-style-photo .quick-tile strong,
.quick-style-photo .quick-tile span {
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
}

.hide-section-kickers .section-kicker {
  display: none !important;
}

.promo-card {
  min-height: var(--promo-card-height, 142px);
  border-radius: var(--promo-radius, 20px);
}

.promo-blocks.promo-text-backdrop .promo-card h3,
.promo-blocks.promo-text-backdrop .promo-card p {
  display: table;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(4px);
}

.promo-button-square .promo-card button {
  border-radius: 10px;
}

.promo-button-ghost .promo-card button {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.34);
}

.article-size-compact .article-card { flex-basis: 148px; }
.article-size-normal .article-card { flex-basis: 176px; }
.article-size-large .article-card { flex-basis: 220px; }

@media (max-width: 420px) {
  .quick-tiles.quick-grid.quick-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* Vertical scroll stability fix */
html,
body {
  height: auto !important;
  min-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}
body.panel-open {
  overflow: hidden !important;
  touch-action: none;
}
.app-shell {
  min-height: 100dvh;
  overflow-y: visible !important;
  touch-action: pan-y;
}
.product-rail,
.articles-rail,
.store-reviews-rail,
.quick-tiles,
.banner-track,
.horizontal-products {
  touch-action: pan-x pan-y;
}
body.nav-flat .bottom-nav {
  border-radius: 0 !important;
  box-shadow: 0 -6px 22px rgba(15, 23, 42, 0.12) !important;
}
body.nav-glass .bottom-nav {
  background: color-mix(in srgb, var(--surface) 72%, transparent) !important;
  backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent) !important;
}
.bottom-nav button[hidden] {
  display: none !important;
}


/* Scroll hotfix: internal app scroll + modal body scroll */
html,
body {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

body {
  position: fixed !important;
  inset: 0 !important;
  min-height: 100dvh !important;
  touch-action: pan-y !important;
}

.app-shell {
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  overscroll-behavior-x: none !important;
  touch-action: pan-y !important;
  scroll-behavior: smooth;
}

body.panel-open {
  overflow: hidden !important;
  touch-action: pan-y !important;
}

body.panel-open .app-shell {
  overflow: hidden !important;
}

.app-panel {
  overflow: hidden !important;
  touch-action: none;
}

.panel-sheet {
  min-height: 0 !important;
  max-height: min(92dvh, 780px) !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
}

.product-sheet,
.article-sheet {
  grid-template-rows: auto minmax(0, 1fr) !important;
}

#productModalBody,
#articleModalBody {
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
  padding-right: 2px;
}

.cart-sheet {
  grid-template-rows: auto minmax(96px, 1fr) auto auto auto !important;
}

.cart-sheet .cart-items {
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

#supportPanel .panel-sheet,
#profilePanel .panel-sheet {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

.horizontal-products,
.articles-rail,
.store-reviews-rail,
.quick-tiles,
.detail-thumbs,
.category-strip {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-inline: contain !important;
  touch-action: pan-x pan-y !important;
}


/* Hotfix: stable banners, solid bottom menu, compact product sheet */
.banner-carousel {
  isolation: isolate;
}

.banner-track {
  min-width: 100% !important;
}

.banner-slide img,
.banner-slide video {
  width: 100% !important;
  height: 100% !important;
  object-fit: var(--banner-fit, cover) !important;
  display: block !important;
}

.bottom-nav,
body.nav-glass .bottom-nav,
body.nav-flat .bottom-nav,
.theme-light .bottom-nav {
  background: var(--cart-bar, #160d08) !important;
  background-image: none !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid color-mix(in srgb, var(--muted, #8b8b8b) 24%, transparent) !important;
  box-shadow: 0 -18px 46px rgba(0, 0, 0, 0.42) !important;
}

.bottom-nav button {
  background: transparent !important;
  position: relative;
  z-index: 1;
}

.bottom-nav button.active,
.bottom-nav button:active {
  background: color-mix(in srgb, var(--primary, #ff8a1d) 18%, transparent) !important;
}

.qty-button,
button[data-action][data-id] {
  position: relative;
  z-index: 6;
  touch-action: manipulation;
}

.product-card .qty-control,
.product-card .qty-button {
  pointer-events: auto;
}

.product-sheet,
.article-sheet {
  padding: 16px 14px calc(18px + env(safe-area-inset-bottom)) !important;
  max-height: min(88dvh, 720px) !important;
}

.product-sheet #productModalBody,
.article-sheet #articleModalBody {
  padding-bottom: 10px !important;
}

.product-detail {
  padding-bottom: 4px !important;
}

.detail-image {
  min-height: min(58vw, 330px) !important;
}

@supports not (color: color-mix(in srgb, black, white)) {
  .bottom-nav,
  body.nav-glass .bottom-nav,
  body.nav-flat .bottom-nav,
  .theme-light .bottom-nav {
    background: #160d08 !important;
    border-color: rgba(255,255,255,.14) !important;
  }

  .bottom-nav button.active,
  .bottom-nav button:active {
    background: rgba(255, 138, 29, .18) !important;
  }
}

/* Hotfix: banners load reliably, cart buttons do not open product, product sheet keeps scroll position */
.banner-carousel {
  background: var(--surface, #1f140e) !important;
  overflow: hidden !important;
  contain: paint;
}
.banner-track {
  display: flex !important;
  flex-wrap: nowrap !important;
  height: 100% !important;
  width: 100% !important;
  overflow: visible !important;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
.banner-slide {
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  background: color-mix(in srgb, var(--surface, #20120b) 86%, #000);
}
.banner-slide .banner-media,
.banner-slide img,
.banner-slide video {
  display: block !important;
  width: 100% !important;
  min-width: 100% !important;
  height: 100% !important;
  object-fit: var(--banner-fit, cover) !important;
  transform: translateZ(0);
}
.product-card .buy-row,
.product-card .qty-control,
.product-card .qty-button,
.detail-qty,
.detail-qty .qty-button {
  position: relative !important;
  z-index: 50 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
}
.product-card .qty-button,
.detail-qty .qty-button,
.cart-line .qty-button {
  -webkit-tap-highlight-color: transparent;
}
.product-card:active:has(.qty-button:active),
.product-card:focus-within:has(.qty-button:focus) {
  transform: none !important;
  filter: none !important;
}
.product-sheet {
  min-height: auto !important;
  max-height: min(92dvh, 760px) !important;
  padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
  grid-template-rows: auto minmax(0, auto) !important;
}
.product-sheet #productModalBody {
  height: auto !important;
  max-height: calc(min(92dvh, 760px) - 74px) !important;
  overflow-y: auto !important;
  padding-bottom: 6px !important;
  scroll-behavior: auto !important;
}
.product-detail {
  min-height: 0 !important;
  padding-bottom: 0 !important;
}
.detail-gallery,
.detail-main,
.detail-section {
  scroll-margin-top: 12px;
}
.bottom-nav,
body.nav-glass .bottom-nav,
body.nav-flat .bottom-nav,
.theme-light .bottom-nav {
  background: var(--cart-bar, #160d08) !important;
  opacity: 1 !important;
  background-image: none !important;
}


/* Hotfix: catalog modal layering, stable banners, sticky catalog controls */
html,
body,
.app-shell {
  background-color: var(--bg, #160d08) !important;
}

.app-shell {
  min-height: 100dvh;
}

/* При открытом окне скрываем нижнее меню, чтобы оно не давило снизу и не просвечивало под карточкой товара. */
body.panel-open .bottom-nav {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.app-panel {
  z-index: 80 !important;
  background: color-mix(in srgb, var(--bg, #160d08) 92%, #000 8%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.panel-sheet,
.product-sheet,
.article-sheet,
.cart-sheet {
  background: var(--surface, #24150e) !important;
  color: var(--text, #fff) !important;
  opacity: 1 !important;
}

.product-sheet {
  width: min(430px, 100%) !important;
  max-height: min(92dvh, 760px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
}

.product-sheet #productModalBody {
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  padding: 0 2px calc(12px + env(safe-area-inset-bottom)) !important;
  scroll-behavior: auto !important;
  background: var(--surface, #24150e) !important;
}

.product-detail {
  gap: 18px !important;
  padding-bottom: 0 !important;
  background: var(--surface, #24150e) !important;
}

.detail-gallery,
.detail-main,
.detail-section {
  position: relative;
  z-index: 2;
  background-color: var(--surface, #24150e);
}

.detail-image,
.product-image,
.article-card-image,
.promo-card,
.quick-tile {
  background-color: var(--secondary, #3a2418) !important;
}

.detail-image img,
.detail-image video,
.product-image img,
.product-image video,
.article-card-image img,
.article-card-image video {
  background-color: var(--secondary, #3a2418) !important;
  transform: translateZ(0);
}

/* Баннерам даём фон-копию изображения. Даже если тег img/video ещё грузится, белого пустого слайда не будет. */
.banner-carousel {
  background: var(--surface, #24150e) !important;
  border-color: color-mix(in srgb, var(--muted, #b7a89d) 22%, transparent) !important;
  contain: paint;
}

.banner-track {
  display: flex !important;
  flex-wrap: nowrap !important;
  height: 100% !important;
  overflow: visible !important;
  transition: transform .35s ease !important;
  will-change: transform;
}

.banner-slide {
  position: relative;
  height: 100% !important;
  background-image: var(--banner-bg) !important;
  background-size: var(--banner-fit, cover) !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: var(--secondary, #3a2418) !important;
  transform: translateZ(0);
}

.banner-slide .banner-media {
  width: 100% !important;
  height: 100% !important;
  object-fit: var(--banner-fit, cover) !important;
  display: block !important;
  opacity: 1 !important;
  background: transparent !important;
}

/* Каталог: фильтр и категории остаются на месте, товары прокручиваются под ними. */
body.catalog-page .catalog-tools {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  margin-top: 8px !important;
  background: color-mix(in srgb, var(--bg, #160d08) 94%, transparent) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .16) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.catalog-page .category-strip {
  position: sticky !important;
  top: 68px !important;
  z-index: 29 !important;
  margin-top: 8px !important;
  margin-bottom: 10px !important;
  padding-top: 4px !important;
  padding-bottom: 8px !important;
  background: color-mix(in srgb, var(--bg, #160d08) 94%, transparent) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Убираем белые вспышки и системные рамки при горизонтальных свайпах. */
.horizontal-products,
.articles-rail,
.store-reviews-rail,
.quick-tiles,
.category-strip,
.detail-thumbs,
.catalog,
.home-showcase {
  background-color: transparent !important;
  -webkit-tap-highlight-color: transparent;
}

.horizontal-products > *,
.articles-rail > *,
.store-reviews-rail > *,
.product-card,
.banner-slide,
.promo-card,
.quick-tile {
  backface-visibility: hidden;
  transform: translateZ(0);
}

@supports not (color: color-mix(in srgb, black, white)) {
  .app-panel { background: #160d08 !important; }
  body.catalog-page .catalog-tools,
  body.catalog-page .category-strip { background: #160d08 !important; }
}


/* Hotfix: banner frames/manual swipe + home buttons + media preload polish */
.banner-carousel {
  height: auto !important;
  min-height: calc(var(--banner-height, 150px) + 12px) !important;
  margin: 12px 0 18px !important;
  padding: 6px !important;
  border: 1px solid color-mix(in srgb, var(--muted, #b7a89d) 28%, transparent) !important;
  border-radius: calc(var(--banner-radius, 18px) + 8px) !important;
  background: color-mix(in srgb, var(--surface, #24150e) 92%, #000 8%) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .24) !important;
  overflow: hidden !important;
}

.banner-track {
  width: 100% !important;
  height: var(--banner-height, 150px) !important;
  display: flex !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-inline: contain !important;
  touch-action: pan-x pan-y !important;
  transform: none !important;
  transition: none !important;
  border-radius: var(--banner-radius, 18px) !important;
}

.banner-slide {
  flex: 0 0 100% !important;
  min-width: 100% !important;
  width: 100% !important;
  height: var(--banner-height, 150px) !important;
  scroll-snap-align: center !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: var(--banner-radius, 18px) !important;
  border: 1px solid color-mix(in srgb, var(--muted, #b7a89d) 20%, transparent) !important;
  background-image: var(--banner-bg) !important;
  background-size: var(--banner-fit, cover) !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: var(--secondary, #3a2418) !important;
}

.banner-slide .banner-media,
.banner-slide img,
.banner-slide video {
  width: 100% !important;
  height: 100% !important;
  object-fit: var(--banner-fit, cover) !important;
  display: block !important;
  border-radius: calc(var(--banner-radius, 18px) - 1px) !important;
  background: transparent !important;
}

.banner-dots {
  bottom: 10px !important;
  z-index: 4 !important;
  pointer-events: auto !important;
}

.banner-dots button {
  cursor: pointer;
}

/* Не показываем системные белые пустышки, пока изображения догружаются. */
.product-image,
.detail-image,
.article-image,
.article-detail-image,
.cart-line-image,
.quick-tile,
.promo-card {
  background-color: var(--secondary, #3a2418) !important;
}

.product-image img,
.product-image video,
.detail-image img,
.detail-image video,
.article-image img,
.article-image video,
.article-detail-image img,
.article-detail-image video,
.cart-line-image img,
.cart-line-image video,
.quick-tile img,
.promo-card img {
  opacity: 0;
  transition: opacity .18s ease;
}

.product-image img.media-loaded,
.product-image video.media-loaded,
.detail-image img.media-loaded,
.detail-image video.media-loaded,
.article-image img.media-loaded,
.article-image video.media-loaded,
.article-detail-image img.media-loaded,
.article-detail-image video.media-loaded,
.cart-line-image img.media-loaded,
.cart-line-image video.media-loaded,
.quick-tile img.media-loaded,
.promo-card img.media-loaded,
.banner-slide img.media-loaded,
.banner-slide video.media-loaded {
  opacity: 1;
}

.product-image img.media-error,
.detail-image img.media-error,
.article-image img.media-error,
.cart-line-image img.media-error,
.banner-slide img.media-error {
  opacity: .35;
}

/* Каталог: панель сортировки и категории не должны уезжать вместе с товарами. */
body.catalog-page .catalog-tools.compact-tools {
  position: sticky !important;
  top: 0 !important;
  z-index: 45 !important;
}

body.catalog-page .category-strip {
  position: sticky !important;
  top: 58px !important;
  z-index: 44 !important;
}

/* Нажатия на кнопки главной должны быть явно интерактивными. */
.section-action,
.article-card button,
.promo-card button,
.banner-slide-button {
  pointer-events: auto !important;
  cursor: pointer;
}


/* Hotfix: fixed catalog controls that never scroll away with product cards */
body.catalog-page.catalog-fixed-controls .shop-header,
body.catalog-page.catalog-fixed-controls .top-search,
body.catalog-page.catalog-fixed-controls #promoTicker,
body.catalog-page.catalog-fixed-controls #bannerCarousel,
body.catalog-page.catalog-fixed-controls .quick-tiles,
body.catalog-page.catalog-fixed-controls #homeShowcase {
  display: none !important;
}

body.catalog-page.catalog-fixed-controls .app-shell {
  padding-top: calc(var(--catalog-fixed-height, 118px) + 10px) !important;
}

body.catalog-page.catalog-fixed-controls #catalogTools.compact-tools,
body.catalog-page.catalog-fixed-controls .catalog-tools.compact-tools {
  position: fixed !important;
  top: calc(env(safe-area-inset-top, 0px) + 4px) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) translateZ(0) !important;
  width: min(740px, calc(100% - 20px)) !important;
  max-width: calc(100% - 20px) !important;
  z-index: 120 !important;
  margin: 0 !important;
  padding: 8px !important;
  border-radius: 18px !important;
  background: color-mix(in srgb, var(--surface, #24150e) 96%, #000 4%) !important;
  border: 1px solid color-mix(in srgb, var(--muted, #b7a89d) 18%, transparent) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .34) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.catalog-page.catalog-fixed-controls #categories.category-strip,
body.catalog-page.catalog-fixed-controls .category-strip {
  position: fixed !important;
  top: calc(env(safe-area-inset-top, 0px) + var(--catalog-tools-height, 56px) + 10px) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) translateZ(0) !important;
  width: min(740px, calc(100% - 20px)) !important;
  max-width: calc(100% - 20px) !important;
  z-index: 119 !important;
  margin: 0 !important;
  padding: 7px 2px 10px !important;
  border-radius: 18px !important;
  background: color-mix(in srgb, var(--bg, #160d08) 94%, #000 6%) !important;
  border: 1px solid color-mix(in srgb, var(--muted, #b7a89d) 14%, transparent) !important;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .22) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-inline: contain !important;
  touch-action: pan-x !important;
}

body.catalog-page.catalog-fixed-controls #catalog {
  margin-top: 0 !important;
  padding-top: 0 !important;
  scroll-margin-top: calc(var(--catalog-fixed-height, 118px) + 16px) !important;
}

body.catalog-page.catalog-fixed-controls .catalog-tools.compact-tools + .category-strip {
  margin-top: 0 !important;
}

body.catalog-page.catalog-fixed-controls .sort-mini,
body.catalog-page.catalog-fixed-controls .category-mini,
body.catalog-page.catalog-fixed-controls .stock-mini {
  background: color-mix(in srgb, var(--surface, #24150e) 96%, #000 4%) !important;
}

@supports not (color: color-mix(in srgb, black, white)) {
  body.catalog-page.catalog-fixed-controls #catalogTools.compact-tools,
  body.catalog-page.catalog-fixed-controls .catalog-tools.compact-tools {
    background: #24150e !important;
    border-color: rgba(255,255,255,.12) !important;
  }
  body.catalog-page.catalog-fixed-controls #categories.category-strip,
  body.catalog-page.catalog-fixed-controls .category-strip {
    background: #160d08 !important;
    border-color: rgba(255,255,255,.10) !important;
  }
}

/* Hotfix: фиксированные фильтры каталога не должны перекрывать карточку товара, профиль, поддержку или корзину */
body.panel-open #catalogTools,
body.panel-open #categories,
body.panel-open.catalog-fixed-controls #catalogTools,
body.panel-open.catalog-fixed-controls #categories {
  display: none !important;
  pointer-events: none !important;
}

body.panel-open.catalog-fixed-controls .app-shell {
  padding-top: 12px !important;
}

.app-panel {
  z-index: 520 !important;
}

.app-overlay {
  z-index: 500 !important;
}

.panel-sheet {
  position: relative;
  z-index: 530 !important;
}

/* Информационные страницы вместо бокового меню */
.info-page {
  display: grid;
  gap: 16px;
  padding: 4px 0 18px;
}

.info-page h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
}

.info-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.info-review-list {
  display: grid;
  gap: 10px;
}

.info-review {
  padding: 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--secondary) 72%, var(--surface) 28%);
  border: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
}

.info-review strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.info-review p {
  margin: 8px 0 0;
  color: var(--muted);
}

/* Светлая тема теперь меняет всю палитру, а не отдельные куски */
body.theme-light {
  background: #fff7ed !important;
  color: #24140c !important;
}

body.theme-light .app-shell,
body.theme-light .food-section,
body.theme-light .shop-header,
body.theme-light .top-search,
body.theme-light .product-card,
body.theme-light .quick-tile,
body.theme-light .promo-card,
body.theme-light .article-card,
body.theme-light .store-review-card,
body.theme-light .panel-sheet,
body.theme-light .bottom-nav,
body.theme-light .catalog-tools,
body.theme-light .category-strip,
body.theme-light .sort-mini,
body.theme-light .category-mini,
body.theme-light .stock-mini {
  background: #ffffff !important;
  color: #24140c !important;
  border-color: rgba(124, 91, 74, .18) !important;
  box-shadow: 0 16px 36px rgba(124, 91, 74, .14) !important;
}

body.theme-light .product-image,
body.theme-light .detail-image,
body.theme-light .detail-thumbs button,
body.theme-light .banner-slide,
body.theme-light .promo-ticker {
  background: #ffedd5 !important;
  color: #24140c !important;
}

body.theme-light .bottom-nav button,
body.theme-light .section-kicker,
body.theme-light .product-meta,
body.theme-light .form-note,
body.theme-light .article-lead,
body.theme-light .drawer-content,
body.theme-light .product-description,
body.theme-light .old-price {
  color: #7a5b4a !important;
}

body.theme-light .bottom-nav button.active,
body.theme-light .primary-action,
body.theme-light .qty-button,
body.theme-light .header-action,
body.theme-light .section-action,
body.theme-light .sort-trigger,
body.theme-light .category-strip button.active {
  background: linear-gradient(135deg, #f59e0b, #f97316) !important;
  color: #ffffff !important;
}

body.theme-light .category-strip button,
body.theme-light .ghost-button,
body.theme-light .quick-tile small,
body.theme-light .product-badge {
  background: #ffedd5 !important;
  color: #24140c !important;
}

body.theme-light .app-panel,
body.theme-light .app-overlay {
  background: rgba(36, 20, 12, .34) !important;
}


/* Stable marketplace card layout */
.catalog-market-grid .product-card,
.catalog.grid .product-card,
.horizontal-products .product-card,
.product-rail .product-card,
.rail-card {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: stretch;
  min-height: 100%;
  contain: layout paint;
}
.catalog-market-grid .product-image,
.catalog.grid .product-image,
.horizontal-products .product-image,
.product-rail .product-image,
.rail-card .product-image {
  width: 100%;
  aspect-ratio: var(--product-image-aspect, 1 / 1);
  min-height: 0 !important;
  height: auto !important;
  background: color-mix(in srgb, var(--secondary) 72%, #050505);
}
.product-image img,
.product-image video {
  width: 100%;
  height: 100%;
  object-fit: var(--product-image-fit, cover);
  display: block;
}
.product-card .product-info {
  display: grid;
  grid-template-rows: auto minmax(2.45em, auto) minmax(0, auto) 1fr auto;
  align-content: start;
  height: 100%;
}
.product-card .product-meta {
  min-height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.product-card .product-title {
  min-height: 2.45em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .product-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}
.product-card .buy-row {
  align-self: end;
  margin-top: auto;
}
.catalog-market-grid .product-card,
.catalog.grid .product-card {
  min-height: 255px;
}
.horizontal-products .rail-card,
.product-rail .rail-card {
  min-height: 248px;
}


/* Info pages and collection stage */
.info-page {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
}

.info-visual {
  min-height: 172px;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 18px;
  position: relative;
  background:
    radial-gradient(circle at 78% 12%, rgba(255,255,255,.22), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 42%, #140b07), color-mix(in srgb, var(--accent) 48%, #080606));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 18px 46px rgba(0,0,0,.24);
}

.info-visual::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  pointer-events: none;
}

.info-visual span {
  font-size: 62px;
  line-height: 1;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,.28));
}

.info-visual strong {
  font-size: 24px;
  color: #fff8ec;
  max-width: 14ch;
}

.info-visual small,
.info-eyebrow {
  color: rgba(255,255,255,.76);
  font-weight: 900;
  letter-spacing: .02em;
}

.info-eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
}

.info-page h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.info-bullets {
  margin: 0;
  padding: 12px 12px 12px 30px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--secondary) 72%, transparent);
  color: var(--text);
}

.info-bullets li + li {
  margin-top: 6px;
}

.info-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.info-product-grid .product-card {
  min-width: 0;
}

.info-product-grid .product-description,
.info-product-grid .product-meta {
  display: none;
}

.info-review-list {
  display: grid;
  gap: 10px;
}

.info-review {
  padding: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 78%, var(--secondary));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 18%, transparent);
}

.info-review strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.info-review p {
  margin: 8px 0 0;
  color: var(--muted);
}

.collection-page .info-product-grid {
  margin-top: 4px;
}


/* Swipe navigation and product gallery swipe */
.detail-gallery,
.detail-image {
  touch-action: pan-y;
  user-select: none;
}

.detail-image {
  position: relative;
  cursor: grab;
  background: color-mix(in srgb, var(--secondary) 72%, #000000);
}

.detail-image:active {
  cursor: grabbing;
}

.gallery-swipe-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  min-width: 30px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.app-panel,
.app-drawer {
  overscroll-behavior: contain;
}

.product-modal-body,
.article-modal-body,
.panel-sheet {
  overscroll-behavior: contain;
}


/* Hardfix: quantity buttons must never trigger page/modal scroll or product opening */
button[data-action][data-id],
.qty-button,
.qty-control,
.product-card .buy-row {
  touch-action: manipulation !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
  scroll-margin: 0 !important;
  scroll-snap-align: none !important;
}

button[data-action][data-id]:focus,
button[data-action][data-id]:focus-visible,
.qty-button:focus,
.qty-button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.info-product-grid .product-card,
.horizontal-products .product-card,
.product-rail .product-card,
.catalog .product-card {
  scroll-margin: 0 !important;
}

.info-product-grid .qty-control,
.horizontal-products .qty-control,
.product-rail .qty-control,
.catalog .qty-control {
  position: relative !important;
  z-index: 80 !important;
  isolation: isolate;
}

.info-product-grid .qty-button,
.horizontal-products .qty-button,
.product-rail .qty-button,
.catalog .qty-button {
  position: relative !important;
  z-index: 90 !important;
}

#articleModalBody,
#productModalBody,
.app-shell {
  overflow-anchor: none !important;
}

/* Desktop-only quantity button stability */
@media (hover: hover) and (pointer: fine) {
  .qty-button,
  button[data-action][data-id] {
    user-select: none;
    -webkit-user-select: none;
  }

  .qty-button:focus {
    outline: none;
  }
}

/* marketplace_catalog_filter_cards_patch */
html,
body {
  max-width: 100%;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
}

.app-shell {
  overflow-x: clip;
}

body.catalog-page .catalog-page-head {
  display: none !important;
}

.market-filter-bar {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
  padding: 8px !important;
  border-radius: 18px !important;
  background: color-mix(in srgb, var(--surface, #141832) 94%, #000 6%) !important;
  border: 1px solid color-mix(in srgb, var(--muted, #c8b79c) 18%, transparent) !important;
}

.catalog-tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.catalog-count-pill {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 0 5px;
  white-space: nowrap;
}

.catalog-count-pill strong {
  font-size: 13px;
  line-height: 1;
}

.catalog-count-pill span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.sort-trigger {
  flex: 0 0 auto;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--button-main, var(--primary));
  color: #fff;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
  touch-action: manipulation;
}

.sort-trigger span {
  font-size: 14px;
  line-height: 1;
}

.sort-trigger small {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
}

.sort-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 1px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y;
}

.sort-chip-row::-webkit-scrollbar { display: none; }

.market-sort-chip,
.stock-mini,
.tool-reset {
  flex: 0 0 auto;
  min-height: 30px !important;
  border-radius: 999px !important;
  padding: 0 10px !important;
  border: 1px solid color-mix(in srgb, var(--muted, #c8b79c) 18%, transparent) !important;
  background: color-mix(in srgb, var(--surface, #141832) 88%, var(--secondary, #202544) 12%) !important;
  color: var(--text) !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  white-space: nowrap;
  touch-action: manipulation;
}

.market-sort-chip.active,
.market-sort-chip[aria-pressed="true"] {
  background: var(--button-main, var(--primary)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.stock-mini input {
  width: 15px !important;
  height: 15px !important;
  accent-color: var(--primary);
}

.stock-mini:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 34%, var(--surface)) !important;
  color: var(--text) !important;
}

.tool-reset {
  color: var(--muted) !important;
}

.native-sort,
.catalog-tools .category-mini {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.catalog-page.catalog-fixed-controls .app-shell {
  padding-top: calc(var(--catalog-fixed-height, 112px) + 6px) !important;
}

body.catalog-page.catalog-fixed-controls #catalogTools.compact-tools,
body.catalog-page.catalog-fixed-controls .catalog-tools.compact-tools {
  top: calc(env(safe-area-inset-top, 0px) + 3px) !important;
  width: min(740px, calc(100% - 14px)) !important;
  max-width: calc(100% - 14px) !important;
  border-radius: 18px !important;
  z-index: 160 !important;
}

body.catalog-page.catalog-fixed-controls #categories.category-strip,
body.catalog-page.catalog-fixed-controls .category-strip {
  top: calc(env(safe-area-inset-top, 0px) + var(--catalog-tools-height, 74px) + 7px) !important;
  width: min(740px, calc(100% - 14px)) !important;
  max-width: calc(100% - 14px) !important;
  padding: 6px 5px 8px !important;
  border-radius: 18px !important;
  z-index: 159 !important;
}

.category-strip {
  gap: 7px !important;
  scroll-padding-inline: 10px;
}

.category-strip button {
  min-height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 11px !important;
  border: 1px solid color-mix(in srgb, var(--muted, #c8b79c) 16%, transparent) !important;
  background: color-mix(in srgb, var(--surface, #141832) 90%, var(--secondary, #202544) 10%) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  touch-action: pan-x manipulation;
}

.category-strip button span {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-strip button small {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--secondary, #202544) 78%, #000 6%);
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
}

.category-strip button.active {
  background: var(--button-main, var(--primary)) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.category-strip button.active small {
  background: rgba(255,255,255,.22);
  color: #fff;
}

.catalog.catalog-market-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  align-items: start !important;
  contain: layout paint;
}

@media (min-width: 560px) {
  .catalog.catalog-market-grid {
    grid-template-columns: repeat(var(--catalog-mobile-columns, 3), minmax(0, 1fr)) !important;
  }
}

.catalog.catalog-market-grid .product-card {
  position: relative;
  grid-template-rows: auto 1fr !important;
  gap: 6px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 8px !important;
  border-radius: 16px !important;
  background: var(--surface-main, var(--surface)) !important;
  border: var(--card-border-width, 0) solid var(--card-border-color, transparent) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .16) !important;
  contain: layout paint;
  content-visibility: auto;
  contain-intrinsic-size: 240px;
}

.catalog.catalog-market-grid .product-image {
  position: relative;
  overflow: hidden !important;
  border-radius: 13px !important;
  aspect-ratio: 1 / 1 !important;
  background: color-mix(in srgb, var(--secondary, #202544) 92%, #000 8%) !important;
  isolation: isolate;
}

.product-image.is-loading::before,
.product-image:not(.no-media):not(.is-loaded)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(110deg,
    color-mix(in srgb, var(--secondary, #202544) 88%, #000 12%) 0%,
    color-mix(in srgb, var(--surface, #141832) 78%, #fff 12%) 42%,
    color-mix(in srgb, var(--secondary, #202544) 88%, #000 12%) 78%);
  background-size: 220% 100%;
  animation: marketImageSkeleton 1.05s ease-in-out infinite;
}

.product-image.is-loaded::before,
.product-image.no-media::before,
.product-image.is-error::before {
  display: none !important;
}

.product-image > img,
.product-image > video,
.product-image > span,
.product-image .product-badges {
  position: relative;
  z-index: 1;
}

.product-image > span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

@keyframes marketImageSkeleton {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.catalog.catalog-market-grid .product-info {
  display: grid !important;
  grid-template-rows: auto auto 1fr !important;
  gap: 5px !important;
  min-width: 0 !important;
}

.catalog.catalog-market-grid .product-meta {
  min-height: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px !important;
  line-height: 1.1 !important;
}

.catalog.catalog-market-grid .product-title {
  min-height: 31px !important;
  font-size: 13px !important;
  line-height: 1.18 !important;
  letter-spacing: -.01em;
}

.catalog.catalog-market-grid .buy-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 6px !important;
  min-height: 36px;
}

.catalog.catalog-market-grid .price-block {
  min-width: 0 !important;
  align-self: end;
}

.catalog.catalog-market-grid .price {
  font-size: 13px !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere;
}

.catalog.catalog-market-grid .old-price {
  font-size: 10px !important;
  line-height: 1 !important;
}

.catalog.catalog-market-grid .qty-control,
.horizontal-products .qty-control,
.product-rail .qty-control {
  flex: 0 0 auto !important;
  display: grid !important;
  grid-template-columns: 30px 20px 30px !important;
  align-items: center !important;
  justify-content: end !important;
  gap: 3px !important;
  min-width: 86px !important;
  min-height: 32px !important;
  margin-left: 0 !important;
  contain: layout paint;
  touch-action: manipulation;
}

.catalog.catalog-market-grid .qty-button,
.horizontal-products .qty-button,
.product-rail .qty-button {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  line-height: 1 !important;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.catalog.catalog-market-grid .qty-count,
.horizontal-products .qty-count,
.product-rail .qty-count {
  min-width: 20px !important;
  display: inline-grid !important;
  place-items: center !important;
  font-size: 12px !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums;
}

.catalog.catalog-market-grid .product-card:active:has(.qty-button:active),
.catalog.catalog-market-grid .product-card:focus-within:has(.qty-button:focus) {
  transform: none !important;
}

.catalog.catalog-market-grid .product-badges.on-image {
  top: 5px !important;
  left: 5px !important;
  gap: 3px !important;
}

.catalog.catalog-market-grid .product-badge {
  min-height: 18px !important;
  padding: 0 6px !important;
  font-size: 9.5px !important;
  border-radius: 999px !important;
}

.home-page .shop-header {
  min-height: 126px !important;
  padding: 14px !important;
}

.home-page .top-search {
  margin: 8px 0 !important;
  min-height: 42px !important;
}

.home-page .food-section,
.home-page .articles-section,
.home-page .store-reviews-section {
  padding: 12px !important;
  border-radius: 18px !important;
}

.home-page .section-head h2 {
  font-size: 18px !important;
}

.home-page .horizontal-products {
  gap: 8px !important;
}

.home-page .horizontal-products .product-card {
  width: min(148px, 42vw) !important;
  padding: 8px !important;
  border-radius: 16px !important;
}

.home-page .horizontal-products .product-title {
  font-size: 12.5px !important;
  min-height: 29px !important;
}

@supports not (color: color-mix(in srgb, black, white)) {
  .market-filter-bar,
  .market-sort-chip,
  .stock-mini,
  .tool-reset,
  .category-strip button {
    background: #141832 !important;
    border-color: rgba(255,255,255,.12) !important;
  }
}


/* marketplace_catalog_filter_cards_patch specificity fixes */
.catalog-tools.compact-tools.market-filter-bar {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: stretch !important;
}

#stockFilterWrap:not([hidden]) {
  display: inline-flex !important;
  align-items: center !important;
}

#clearFilters:not([hidden]) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* wb_catalog_filter_next_patch: Wildberries-like compact catalog controls */
body.catalog-page .catalog-page-head {
  display: none !important;
}

.catalog-tools.compact-tools.wb-filter-bar,
body.catalog-page .catalog-tools.compact-tools.wb-filter-bar,
body.catalog-page.catalog-fixed-controls #catalogTools.catalog-tools.compact-tools.wb-filter-bar {
  display: block !important;
  grid-template-columns: none !important;
  padding: 0 !important;
  margin: 0 auto !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.wb-filter-row {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface, #17120f) 88%, #000 12%);
  border: 1px solid color-mix(in srgb, var(--muted, #d6c2aa) 12%, transparent);
  box-shadow: 0 10px 24px rgba(0,0,0,.20);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.wb-filter-row::-webkit-scrollbar {
  display: none;
}

.catalog-tools .wb-select-pill.native-sort,
body.catalog-page .catalog-tools .wb-select-pill.native-sort,
.catalog-tools.compact-tools .wb-select-pill.native-sort {
  position: relative !important;
  width: auto !important;
  height: 32px !important;
  min-height: 32px !important;
  overflow: hidden !important;
  clip-path: none !important;
  white-space: nowrap !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--muted, #d6c2aa) 14%, transparent) !important;
  background: color-mix(in srgb, var(--surface, #17120f) 74%, #fff 7%) !important;
  color: var(--text) !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  touch-action: manipulation;
}

.wb-select-pill select {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  border: 0 !important;
}

.wb-pill-icon {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--button-main, var(--primary));
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.wb-pill-main {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-select-pill small {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: color-mix(in srgb, var(--muted, #d6c2aa) 92%, var(--text) 8%);
  font-size: 10px;
  font-weight: 900;
}

#stockFilterWrap.wb-stock-toggle:not([hidden]),
.catalog-tools .wb-stock-toggle:not([hidden]) {
  flex: 0 0 auto !important;
  min-height: 32px !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--muted, #d6c2aa) 14%, transparent) !important;
  background: color-mix(in srgb, var(--surface, #17120f) 74%, #fff 7%) !important;
  color: var(--text) !important;
  font-size: 11px !important;
  font-weight: 950 !important;
}

.wb-stock-toggle input {
  width: 13px !important;
  height: 13px !important;
  margin: 0 !important;
  accent-color: var(--primary);
}

.wb-stock-toggle:has(input:checked) {
  background: var(--button-main, var(--primary)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

#clearFilters.wb-reset:not([hidden]),
.catalog-tools .wb-reset:not([hidden]) {
  flex: 0 0 auto !important;
  min-height: 32px !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--muted, #d6c2aa) 12%, transparent) !important;
  background: transparent !important;
  color: color-mix(in srgb, var(--muted, #d6c2aa) 92%, var(--text) 8%) !important;
  font-size: 11px !important;
  font-weight: 950 !important;
}

.wb-count.catalog-count-pill {
  flex: 0 0 auto;
  margin-left: auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--secondary, #2b211b) 72%, transparent);
  color: color-mix(in srgb, var(--muted, #d6c2aa) 92%, var(--text) 8%);
  white-space: nowrap;
}

.wb-count.catalog-count-pill span {
  font-size: 10.5px;
  font-weight: 950;
  color: inherit;
}

body.catalog-page.catalog-fixed-controls #catalogTools.wb-filter-bar,
body.catalog-page.catalog-fixed-controls .catalog-tools.wb-filter-bar {
  top: calc(env(safe-area-inset-top, 0px) + 3px) !important;
  width: min(740px, calc(100% - 14px)) !important;
  max-width: calc(100% - 14px) !important;
  z-index: 180 !important;
}

body.catalog-page.catalog-fixed-controls #categories.category-strip,
body.catalog-page.catalog-fixed-controls .category-strip {
  top: calc(env(safe-area-inset-top, 0px) + var(--catalog-tools-height, 43px) + 5px) !important;
  width: min(740px, calc(100% - 14px)) !important;
  max-width: calc(100% - 14px) !important;
  margin: 0 auto !important;
  padding: 4px 5px !important;
  border-radius: 18px !important;
  background: color-mix(in srgb, var(--surface, #17120f) 88%, #000 12%) !important;
  border: 1px solid color-mix(in srgb, var(--muted, #d6c2aa) 10%, transparent) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.16) !important;
  z-index: 179 !important;
}

.category-strip {
  gap: 5px !important;
  min-height: 38px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-strip button {
  flex: 0 0 auto !important;
  min-height: 29px !important;
  height: 29px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--muted, #d6c2aa) 12%, transparent) !important;
  background: color-mix(in srgb, var(--surface, #17120f) 75%, #fff 6%) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
}

.category-strip button span {
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-strip button small {
  min-width: 18px;
  min-height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--secondary, #2b211b) 70%, transparent);
  color: color-mix(in srgb, var(--muted, #d6c2aa) 96%, #fff 4%);
  font-size: 9.5px;
  font-weight: 950;
}

.category-strip button.active {
  background: var(--button-main, var(--primary)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.category-strip button.active small {
  background: rgba(255,255,255,.22);
  color: #fff;
}

.wb-quick-sort[hidden],
.sort-trigger[hidden] {
  display: none !important;
}

body.catalog-page.catalog-fixed-controls .app-shell {
  padding-top: calc(var(--catalog-fixed-height, 92px) + 4px) !important;
}

@media (max-width: 520px) {
  .wb-filter-row {
    min-height: 40px;
    padding: 4px;
  }

  .catalog-tools .wb-select-pill.native-sort,
  #stockFilterWrap.wb-stock-toggle:not([hidden]),
  #clearFilters.wb-reset:not([hidden]),
  .wb-count.catalog-count-pill {
    height: 30px !important;
    min-height: 30px !important;
    padding-inline: 8px !important;
  }

  .wb-pill-main {
    max-width: 64px;
  }

  .wb-select-pill small {
    max-width: 72px;
  }

  .category-strip button span {
    max-width: 74px;
  }
}

@supports not (color: color-mix(in srgb, black, white)) {
  .wb-filter-row,
  body.catalog-page.catalog-fixed-controls #categories.category-strip {
    background: #17120f !important;
    border-color: rgba(255,255,255,.10) !important;
  }

  .catalog-tools .wb-select-pill.native-sort,
  #stockFilterWrap.wb-stock-toggle:not([hidden]),
  .category-strip button {
    background: #251c17 !important;
    border-color: rgba(255,255,255,.12) !important;
  }
}

/* Next patch: WB-style product gallery, sticky buy bar and stronger cart modal */
.product-media-count {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 4;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 0 7px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.product-sheet {
  width: min(440px, 100%) !important;
  border-radius: 28px 28px 0 0 !important;
}

.product-sheet .sheet-head {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 52px;
  margin: -2px -2px 10px;
  padding: 8px 4px 10px;
  background: var(--surface, #24150e);
}

.product-sheet .sheet-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.wb-product-detail {
  gap: 12px !important;
  padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
}

.wb-detail-gallery {
  display: grid;
  gap: 8px;
  margin: 0 -2px;
}

.wb-detail-gallery .detail-image {
  min-height: 0 !important;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 24px !important;
  background: color-mix(in srgb, var(--secondary) 78%, #000000) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.wb-detail-gallery .detail-image img,
.wb-detail-gallery .detail-image video {
  width: 100%;
  height: 100%;
  object-fit: var(--product-image-fit, cover);
  display: block;
}

.detail-media-topline {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  z-index: 7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.detail-media-counter,
.detail-video-label {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(0, 0, 0, .46);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.detail-video-label {
  background: color-mix(in srgb, var(--primary) 78%, #000 22%);
}

.detail-nav-button {
  position: absolute;
  top: 50%;
  z-index: 8;
  width: 34px;
  height: 44px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .36);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  display: grid;
  place-items: center;
  line-height: 1;
  touch-action: manipulation;
}

.detail-nav-prev { left: 8px; }
.detail-nav-next { right: 8px; }

.detail-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 8;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,.34);
}

.detail-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.46);
}

.detail-dots span.active {
  width: 16px;
  background: #fff;
}

.wb-detail-thumbs {
  padding: 0 2px 2px !important;
  gap: 7px !important;
}

.wb-detail-thumbs button {
  position: relative;
  flex-basis: 58px !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 16px !important;
  background: color-mix(in srgb, var(--secondary) 70%, #000) !important;
  opacity: .76;
}

.wb-detail-thumbs button.active {
  opacity: 1;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.wb-detail-thumbs .video-thumb > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0,0,0,.22);
  font-size: 18px;
  font-weight: 900;
}

.wb-detail-main,
.wb-detail-section {
  border: 1px solid color-mix(in srgb, var(--secondary) 58%, transparent);
  background: color-mix(in srgb, var(--secondary) 38%, var(--surface)) !important;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.detail-title-row h2 {
  margin: 0;
  min-width: 0;
  font-size: 20px;
  line-height: 1.12;
}

.detail-stock {
  flex: 0 0 auto;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.detail-stock.in {
  color: #062d16;
  background: #5cff91;
}

.detail-stock.out {
  color: #fff;
  background: #ef4444;
}

.detail-price-block {
  margin-top: 8px;
}

.detail-price-block .price {
  font-size: 22px;
}

.detail-info-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.detail-info-pills span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-spec-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.detail-spec-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-spec-grid strong {
  font-size: 13px;
  line-height: 1.2;
}

.detail-buybar {
  position: sticky;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px -2px calc(-8px - env(safe-area-inset-bottom));
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: color-mix(in srgb, var(--surface) 94%, #000 6%);
  border-top: 1px solid color-mix(in srgb, var(--secondary) 62%, transparent);
  box-shadow: 0 -14px 34px rgba(0,0,0,.28);
}

.detail-buybar-price {
  display: grid;
  gap: 2px;
  min-width: 92px;
}

.detail-buybar-price small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.detail-buybar-price strong {
  font-size: 18px;
  line-height: 1.05;
}

.detail-buybar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.detail-buybar .detail-qty {
  min-height: 42px;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--secondary) 58%, transparent);
}

.detail-buybar .qty-button {
  width: 34px;
  min-height: 34px;
  height: 34px;
  border-radius: 999px;
}

.detail-cart-link {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.cart-summary-card,
.cart-empty-state {
  border-radius: 20px;
  padding: 13px;
  background: color-mix(in srgb, var(--secondary) 44%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--secondary) 62%, transparent);
}

.cart-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-summary-card div {
  display: grid;
  gap: 2px;
}

.cart-summary-card strong {
  font-size: 16px;
}

.cart-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cart-summary-card button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.rich-cart-line {
  position: relative;
  padding-right: 36px !important;
}

.cart-remove {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .25);
  color: #fff;
  font-weight: 900;
  line-height: 1;
}

.cart-line-total {
  align-self: end;
  white-space: nowrap;
  font-size: 13px;
}

.cart-empty-state {
  display: grid;
  gap: 10px;
  text-align: center;
}

.cart-empty-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
  font-size: 28px;
}

.cart-empty-state strong {
  font-size: 18px;
}

.cart-empty-state .primary-action {
  width: 100%;
}

.cart-head-actions #clearCart[hidden] {
  display: none !important;
}

.order-form button:disabled {
  opacity: .55;
  filter: grayscale(.2);
}

@media (max-width: 380px) {
  .detail-title-row {
    display: grid;
  }
  .detail-spec-grid {
    grid-template-columns: 1fr;
  }
  .detail-buybar {
    gap: 8px;
  }
  .detail-cart-link {
    padding: 0 11px;
  }
  .detail-buybar-price strong {
    font-size: 16px;
  }
}

/* Next patch: admin-controlled catalog, gallery and cart options */
body.catalog-filter-static .catalog-tools {
  position: relative !important;
  top: auto !important;
}

body.catalog-filter-static .category-strip,
body.catalog-filter-static .market-category-strip {
  position: relative !important;
  top: auto !important;
}

body.catalog-filter-compact .catalog-tools {
  padding: 8px 10px !important;
  border-radius: 16px !important;
}

body.catalog-filter-compact .market-filter-row {
  gap: 6px !important;
}

body.catalog-filter-compact .market-sort-pill,
body.catalog-filter-compact .market-stock-pill,
body.catalog-filter-compact .market-reset-pill,
body.catalog-filter-compact .market-count-pill {
  min-height: 34px !important;
  padding-inline: 9px !important;
  font-size: 11px !important;
}

body.catalog-filter-minimal .catalog-tools {
  padding: 6px 8px !important;
  background: color-mix(in srgb, var(--surface) 84%, transparent) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}

body.catalog-filter-minimal .market-stock-pill,
body.catalog-filter-minimal .market-reset-pill,
body.catalog-filter-minimal .market-count-pill,
body.hide-catalog-counter .market-count-pill,
body.hide-catalog-counter #catalogCount {
  display: none !important;
}

body.hide-media-badges .product-media-count {
  display: none !important;
}

body.detail-gallery-compact .wb-detail-gallery .detail-image {
  aspect-ratio: 4 / 3;
  border-radius: 20px !important;
}

body.detail-gallery-large .product-sheet {
  width: min(480px, 100%) !important;
}

body.detail-gallery-large .wb-detail-gallery .detail-image {
  aspect-ratio: 1 / 1;
  border-radius: 28px !important;
}

body.detail-thumbs-hidden .wb-detail-thumbs {
  display: none !important;
}

body.detail-buybar-static .wb-product-detail {
  padding-bottom: 14px !important;
}

body.detail-buybar-static .detail-buybar,
.detail-buybar.is-static {
  position: relative !important;
  bottom: auto !important;
  margin: 8px 0 0 !important;
  border-radius: 22px !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.18) !important;
}

body.cart-no-images .rich-cart-line,
.rich-cart-line:has(.cart-line-image) {
  grid-template-columns: 58px 1fr auto;
}

body.cart-no-images .rich-cart-line {
  grid-template-columns: 1fr auto !important;
}

body.cart-no-images .rich-cart-line .cart-line-body {
  padding-left: 0;
}

body.cart-no-images .rich-cart-line .cart-line-total {
  grid-column: 2;
}

@supports not selector(:has(*)) {
  body:not(.cart-no-images) .rich-cart-line {
    grid-template-columns: 58px 1fr auto;
  }
}

/* Store reviews form */
.store-review-form {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, var(--secondary));
  border: 1px solid color-mix(in srgb, var(--secondary) 70%, transparent);
}

.store-review-form h3 {
  margin: 0;
  font-size: 18px;
}

/* Checkout UX improvements */
.checkout-options {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 8px;
}

.checkout-options legend {
  padding: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.checkout-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.checkout-choice {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-button);
  background: color-mix(in srgb, var(--secondary) 72%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

.checkout-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.checkout-choice span {
  display: grid;
  gap: 3px;
}

.checkout-choice b {
  font-size: 14px;
}

.checkout-choice small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.2;
}

.checkout-choice:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.order-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  border-radius: var(--radius-button);
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

@media (max-width: 420px) {
  .checkout-choice-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile network optimization: faster first paint for Telegram WebView/VPN/proxy */
.food-section,
.promo-blocks,
.articles-section,
.store-reviews-section,
.cart-panel,
.catalog {
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}

html.low-data-mode .banner-track,
html.low-data-mode .ticker-track,
html.low-data-mode .product-image::before,
html.low-data-mode .detail-image::before,
html.low-data-mode .cart-line-image::before {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
}

html.low-data-mode .banner-slide video,
html.low-data-mode .detail-image video,
html.low-data-mode .product-image video {
  display: none !important;
}

html.low-data-mode .app-preloader .preloader-card {
  min-height: 168px;
  padding: 18px;
}

html.low-data-mode .preloader-media {
  width: 88px;
  height: 88px;
}

@media (max-width: 560px) {
  .app-preloader .preloader-card {
    min-height: 172px;
  }

  .preloader-media {
    width: 96px;
    height: 96px;
  }
}

/* cart_scroll_responsiveness_next_patch: cart must scroll as one sheet in Telegram WebView */
body.cart-open {
  overflow: hidden !important;
  touch-action: pan-y !important;
}

#cartPanel.app-panel,
body.cart-open #cartPanel {
  display: grid !important;
  align-items: end !important;
  overflow: hidden !important;
  touch-action: pan-y !important;
  overscroll-behavior: contain !important;
  background: color-mix(in srgb, var(--bg, #160d08) 96%, #000 4%) !important;
}

#cartPanel .cart-sheet,
body.cart-open .cart-sheet {
  width: min(430px, 100%) !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 8px) !important;
  min-height: min(62dvh, 520px) !important;
  margin: auto auto 0 !important;
  display: flex !important;
  flex-direction: column !important;
  grid-template-rows: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y !important;
  padding: 14px 14px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-top: 72px;
  border-radius: 26px 26px 0 0 !important;
}

#cartPanel .sheet-head {
  position: sticky !important;
  top: -14px !important;
  z-index: 8 !important;
  padding: 10px 0 12px !important;
  margin: -14px 0 8px !important;
  background: linear-gradient(180deg, var(--surface, #17152b) 78%, color-mix(in srgb, var(--surface, #17152b) 0%, transparent)) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#cartPanel .cart-items,
body.cart-open .cart-items {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  touch-action: pan-y !important;
}

#cartPanel .cart-total,
#cartPanel .order-form,
#cartPanel .form-note,
#cartPanel .checkout-options,
#cartPanel label,
#cartPanel input,
#cartPanel select,
#cartPanel textarea,
#cartPanel button {
  touch-action: manipulation;
}

#cartPanel .order-form {
  flex: 0 0 auto !important;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
}

#cartPanel .primary-action[type="submit"] {
  position: sticky;
  bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .24);
}

#cartPanel .cart-empty-state {
  min-height: 220px;
}

#cartPanel .rich-cart-line {
  scroll-margin-top: 78px;
}

@supports not (height: 100dvh) {
  #cartPanel .cart-sheet,
  body.cart-open .cart-sheet {
    max-height: calc(100vh - 8px) !important;
  }
}

@media (max-width: 420px) {
  #cartPanel .cart-sheet,
  body.cart-open .cart-sheet {
    width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  #cartPanel .checkout-choice-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Tap response polish: avoid dead zones in panels and bottom actions */
.app-panel button,
.app-panel input,
.app-panel select,
.app-panel textarea,
.bottom-nav button,
.section-action,
.quick-tile,
.promo-card button,
.article-card button,
.product-card button {
  -webkit-tap-highlight-color: transparent;
}

.app-panel button,
.bottom-nav button,
.section-action,
.quick-tile,
.promo-card button,
.article-card button,
.product-card button {
  touch-action: manipulation !important;
}

/* cart_open_start_hotfix_next_patch: hidden modals must stay hidden on app start */
#cartPanel.app-panel[hidden],
body.cart-open #cartPanel.app-panel[hidden],
#supportPanel.app-panel[hidden],
#productPanel.app-panel[hidden],
#profilePanel.app-panel[hidden],
#articlePanel.app-panel[hidden],
#successPanel.app-panel[hidden],
.app-panel[hidden] {
  display: none !important;
}

#cartPanel.app-panel:not([hidden]),
body.cart-open #cartPanel.app-panel:not([hidden]) {
  display: grid !important;
}

/* Krasnoyarsk address autocomplete */
.address-field {
  position: relative;
  display: grid;
  gap: 6px;
}

.address-field label {
  margin: 0;
}

.address-suggest-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.address-suggest-status.is-loading {
  color: var(--primary);
}

.address-suggest-status.is-error {
  color: #ef4444;
}

.address-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 2px);
  z-index: 70;
  max-height: min(290px, 44vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 94%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--secondary) 72%, var(--primary));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.26);
}

.address-suggestion {
  width: 100%;
  border: 0;
  border-radius: 13px;
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  background: color-mix(in srgb, var(--secondary) 48%, transparent);
  color: var(--text);
  text-align: left;
  font: inherit;
}

.address-suggestion:active {
  transform: scale(0.99);
}

.address-suggestion strong {
  font-size: 13px;
  line-height: 1.18;
}

.address-suggestion small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.address-suggestion .address-suggestion-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.address-suggestion .address-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 13%, transparent);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
}

.address-suggestion.is-street-only .address-chip.house-needed {
  background: color-mix(in srgb, #f59e0b 28%, transparent);
}

.address-suggestions-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

body.low-data-mode .address-suggestions {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}


/* Address edit hotfix: selected address remains editable in Telegram WebView */
.address-input-row {
  position: relative;
  display: block;
  width: 100%;
}

.address-input-row input {
  width: 100%;
  padding-right: 44px !important;
}

.address-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 30px;
  height: 30px;
  min-height: 30px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--secondary) 82%, transparent);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  z-index: 2;
  touch-action: manipulation;
}

.address-clear[hidden] {
  display: none !important;
}

.address-clear:active {
  transform: translateY(-50%) scale(0.94);
}

.address-field.has-selected-address .address-input-row input {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--primary));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.address-suggest-status.is-selected,
.address-field.has-selected-address .address-suggest-status {
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
}

.address-field.has-address-value .address-suggest-status {
  padding-right: 4px;
}

/* address_no_autojump_touch_media_next_patch: prevent Telegram ghost taps after address choice */
#cartPanel .address-field,
#cartPanel .address-input-row,
#cartPanel .address-suggestions {
  touch-action: pan-y !important;
  overscroll-behavior: contain !important;
}

#cartPanel .address-suggestion,
#cartPanel .address-clear {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent;
}

#cartPanel .address-suggestions[hidden] {
  display: none !important;
  pointer-events: none !important;
}

#cartPanel .address-suggestions:not([hidden]) {
  pointer-events: auto !important;
}

#cartPanel select[name="deliveryTime"] {
  scroll-margin-top: 92px;
}

/* mobile_touch_media_cache_next_patch: phone touch reaction and scroll polish */
.tap-active {
  opacity: 0.94;
  transition: opacity 0.08s ease, filter 0.08s ease !important;
  filter: brightness(1.04);
}

button,
a,
[role="button"],
[data-product-open],
[data-quick-action],
.checkout-choice,
.address-suggestion,
.qty-button,
.detail-cart-link,
.bottom-nav button,
.primary-action,
.ghost-button,
.section-action {
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation;
}

.cart-sheet,
.panel-sheet,
#productModalBody,
#articleModalBody,
#supportPanel .panel-sheet,
#profilePanel .panel-sheet,
.address-suggestions,
.app-drawer {
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
}

.horizontal-products,
.articles-rail,
.store-reviews-rail,
.product-rail,
.category-strip,
.wb-filter-row,
.sort-chip-row,
.detail-thumbs,
.banner-dots {
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-inline: contain !important;
  touch-action: pan-x pan-y !important;
}

#cartPanel input,
#cartPanel select,
#cartPanel textarea {
  font-size: 16px !important;
}

body.low-data-mode .tap-active {
  transition: none !important;
  filter: none !important;
}

/* Promo codes checkout block */
.cart-total-rich {
  display: grid;
  gap: 8px;
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-total-row span {
  color: rgba(255,255,255,.76);
  font-weight: 800;
}

.cart-total-row strong {
  white-space: nowrap;
}

.cart-discount-row {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.16);
  color: #bbf7d0;
}

.cart-discount-row span,
.cart-discount-row strong {
  color: #bbf7d0;
}

.cart-pay-row {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.22);
  font-size: 18px;
}

.promo-code-box {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--secondary) 50%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
}

.promo-code-box label {
  display: grid;
  gap: 7px;
  font-weight: 900;
}

.promo-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.promo-code-row input {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  border-radius: var(--radius-button);
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
}

.promo-code-row .ghost-button {
  min-height: 44px;
  white-space: nowrap;
}

.promo-clear {
  width: 44px;
  padding: 0 !important;
  font-size: 20px;
}

.promo-code-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.promo-code-status.is-loading {
  color: var(--primary);
}

.promo-code-status.is-ok {
  color: #15803d;
}

.promo-code-status.is-error {
  color: #dc2626;
}

@media (max-width: 430px) {
  .promo-code-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .promo-code-row .promo-clear {
    grid-column: 2;
  }
  .promo-code-row #applyPromoCode {
    padding-inline: 10px;
  }
}


/* Delivery checkout calculator */
.cart-delivery-row strong {
  color: var(--text);
}
.checkout-delivery-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--secondary) 72%, var(--surface));
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
.checkout-delivery-note.is-warning {
  background: color-mix(in srgb, #f59e0b 20%, var(--surface));
  color: var(--text);
}
.checkout-choice.is-disabled {
  opacity: 0.55;
}
.checkout-choice.is-disabled span {
  filter: grayscale(0.25);
}
.address-field[hidden] {
  display: none !important;
}


/* VPN / proxy safe mode */
html.vpn-safe-mode *,
html.vpn-safe-mode *::before,
html.vpn-safe-mode *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
html.vpn-safe-mode .banner-carousel,
html.vpn-safe-mode .promo-ticker video,
html.vpn-safe-mode video {
  display: none !important;
}
html.vpn-safe-mode .app-preloader {
  background: #f7f8fb !important;
  color: #111827 !important;
}
html.vpn-safe-mode .preloader-card {
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
}


/* Client order history */
.profile-orders {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--secondary) 48%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
}

.profile-orders-head,
.my-order-top,
.my-order-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-orders-head strong {
  font-size: 17px;
}

.small-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.my-orders-list {
  display: grid;
  gap: 10px;
}

.my-orders-empty {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
}

.my-orders-empty p {
  margin: 0;
  color: var(--muted);
}

.my-order-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.my-order-card.is-cancelled {
  opacity: 0.78;
}

.my-order-top strong,
.my-order-total b {
  font-size: 16px;
  font-weight: 900;
}

.my-order-top small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 800;
}

.my-order-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.my-order-status.status-done {
  background: color-mix(in srgb, #22c55e 20%, var(--surface));
}

.my-order-status.status-cancelled {
  background: color-mix(in srgb, #ef4444 18%, var(--surface));
}

.my-order-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.my-order-progress span {
  min-height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 13%, var(--surface));
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.my-order-progress span.active {
  background: color-mix(in srgb, var(--primary) 82%, var(--accent));
  color: #fff;
}

.my-order-items {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 750;
}

.my-order-note {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.my-order-history {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--muted) 16%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 420px) {
  .my-order-progress span {
    font-size: 9px;
    min-height: 24px;
  }
}

/* Client order repeat actions */

.my-order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--muted) 14%, transparent);
}

.my-order-actions .ghost-button {
  width: 100%;
  min-height: 40px;
}

@media (max-width: 420px) {
  .my-order-actions {
    grid-template-columns: 1fr;
  }
}

/* Smooth shop hotfix: banner buttons, video performance and clear checkout blocking state */
.banner-slide .banner-media,
.banner-slide img,
.banner-slide video {
  pointer-events: none !important;
}
.banner-slide-button {
  z-index: 6 !important;
  pointer-events: auto !important;
  transform: translateZ(0);
}
.primary-action.needs-min-order {
  background: color-mix(in srgb, var(--accent, #f97316) 72%, #ef4444) !important;
  color: #fff !important;
}
.checkout-delivery-note.is-warning {
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, #f59e0b 18%, var(--surface, #fff));
  color: var(--text, #111827);
  font-weight: 900;
}
.product-image img,
.cart-line-image img,
.detail-image img,
.banner-slide img {
  image-rendering: auto;
}

/* Patch: hide photo-count badges everywhere on product cards and details */
.product-media-count,
.detail-media-counter {
  display: none !important;
}

/* Patch: search suggestions. Typing no longer jumps to catalog; Enter commits search. */
.top-search {
  position: relative !important;
  z-index: 120;
}

.search-suggest-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 160;
  display: grid;
  gap: 6px;
  max-height: min(340px, 58vh);
  overflow-y: auto;
  padding: 8px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, #000 4%);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.search-suggest-box[hidden] {
  display: none !important;
}

.search-suggest-item,
.search-suggest-show-all {
  width: 100%;
  border: 0;
  text-align: left;
  font: inherit;
  color: var(--text);
}

.search-suggest-item {
  min-height: 62px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--secondary) 58%, transparent);
}

.search-suggest-media {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--secondary) 70%, #000 6%);
  font-size: 22px;
}

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

.search-suggest-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.search-suggest-copy strong,
.search-suggest-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggest-copy strong {
  font-size: 14px;
  line-height: 1.15;
}

.search-suggest-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-suggest-show-all {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--button-main, var(--primary));
  color: #fff;
  font-weight: 900;
  text-align: center;
}

.search-suggest-empty {
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--secondary) 55%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

/* ux_profile_admin_desktop_patch: профиль, 3:4 карточки, светлая тема, логотип и desktop */
.header-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.header-social-links[hidden] { display: none !important; }
.header-social-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, var(--secondary));
  text-decoration: none;
  font-weight: 900;
  border: 1px solid color-mix(in srgb, var(--muted) 16%, transparent);
}
.header-social-link span { font-size: 16px; }
.header-social-link b { font-size: 12px; }
.shop-header.hero-logo-cover,
.shop-header.hero-logo-full {
  position: relative;
  isolation: isolate;
  min-height: clamp(190px, 34vw, 360px);
  align-content: end;
}
.shop-header.hero-logo-cover .brand-logo,
.shop-header.hero-logo-full .brand-logo {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit;
  object-fit: var(--header-logo-fit, contain);
  opacity: .92;
  background: transparent;
}
.shop-header.hero-logo-cover::before,
.shop-header.hero-logo-full::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.48));
  pointer-events: none;
}
.shop-header.hero-logo-cover .brand-row,
.shop-header.hero-logo-full .brand-row,
.shop-header.hero-logo-cover .header-social-links,
.shop-header.hero-logo-full .header-social-links {
  padding: 10px;
  border-radius: 18px;
  background: rgba(0,0,0,.26);
  backdrop-filter: blur(10px);
}
.shop-header.hero-logo-cover .brand-copy,
.shop-header.hero-logo-full .brand-copy,
.shop-header.hero-logo-cover .eyebrow,
.shop-header.hero-logo-full .eyebrow,
.shop-header.hero-logo-cover h1,
.shop-header.hero-logo-full h1,
.shop-header.hero-logo-cover p,
.shop-header.hero-logo-full p {
  color: #fff !important;
}
.shop-header.hero-logo-full .brand-row {
  display: none;
}
.shop-header.hero-logo-full .header-social-links {
  justify-content: center;
}
.catalog-market-grid .product-image,
.catalog.grid .product-image,
.horizontal-products .product-image,
.product-rail .product-image,
.rail-card .product-image,
.catalog-page-list .product-image {
  aspect-ratio: 3 / 4 !important;
}
.product-card-extra-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#profilePanel .panel-sheet {
  padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
}
#profilePanel #profileLogout,
#profilePanel #clearAppCache,
#profilePanel #refreshMyOrders {
  position: relative;
  z-index: 20;
  pointer-events: auto !important;
  cursor: pointer;
}
#profilePanel #profileLogout,
#profilePanel #clearAppCache {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  background: color-mix(in srgb, var(--secondary) 88%, var(--surface));
}
#profilePanel .my-order-actions .ghost-button {
  pointer-events: auto !important;
}
body.theme-light,
body.theme-light .app-shell,
body.theme-light .catalog-page-head,
body.theme-light .food-section,
body.theme-light .store-reviews-section {
  background: #fff7ed !important;
  color: #24140c !important;
}
body.theme-light .product-card,
body.theme-light .rail-card,
body.theme-light .quick-tile,
body.theme-light .promo-card,
body.theme-light .review-card,
body.theme-light .article-card,
body.theme-light .cart-line,
body.theme-light .cart-summary-card,
body.theme-light .panel-sheet,
body.theme-light .top-search,
body.theme-light .catalog-tools,
body.theme-light .category-strip,
body.theme-light .info-review,
body.theme-light .checkout-choice,
body.theme-light .address-suggestion {
  background: #ffffff !important;
  color: #24140c !important;
  border-color: rgba(124, 95, 79, .18) !important;
}
body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light .product-title,
body.theme-light .price,
body.theme-light .cart-total,
body.theme-light .detail-title-row h2,
body.theme-light .detail-section h3,
body.theme-light .section-head h2,
body.theme-light .catalog-page-head h2,
body.theme-light .profile-form label,
body.theme-light .order-form label {
  color: #24140c !important;
}
body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  background: #fffaf5 !important;
  color: #24140c !important;
  border-color: rgba(124, 95, 79, .26) !important;
}
body.theme-light input::placeholder,
body.theme-light textarea::placeholder {
  color: #9a7b67 !important;
}
body.theme-light .product-description,
body.theme-light .product-meta,
body.theme-light .product-card-extra-meta,
body.theme-light .form-note,
body.theme-light .section-kicker,
body.theme-light small,
body.theme-light .old-price {
  color: #7a5b4a !important;
}
body.theme-light .bottom-nav {
  background: rgba(255, 255, 255, .96) !important;
  border-color: rgba(124, 95, 79, .20) !important;
  box-shadow: 0 -16px 40px rgba(124, 95, 79, .16) !important;
}
body.theme-light .bottom-nav button:not(.active) {
  color: #7a5b4a !important;
}
body.theme-light .search-suggest-box,
body.theme-light .search-suggest-item,
body.theme-light .search-suggest-show-all {
  background: #ffffff !important;
  color: #24140c !important;
}

@media (min-width: 900px) {
  .app-shell {
    width: min(1380px, 100%) !important;
    padding-inline: clamp(18px, 3vw, 42px) !important;
  }
  .shop-header,
  .banner-carousel,
  .promo-ticker,
  .top-search,
  .catalog-tools,
  .category-strip,
  .catalog-page-head,
  .home-showcase {
    max-width: 100% !important;
  }
  .catalog.grid,
  .catalog-market-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  .catalog.catalog-page-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .catalog.catalog-page-list .product-card {
    grid-template-columns: 1fr !important;
  }
  .horizontal-products,
  .product-rail {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible !important;
  }
  .horizontal-products .product-card,
  .product-rail .product-card {
    min-width: 0 !important;
    flex-basis: auto !important;
  }
  .bottom-nav {
    width: min(860px, calc(100% - 44px)) !important;
    border-radius: 24px !important;
    bottom: 18px !important;
  }
  .app-panel {
    align-items: center !important;
  }
  .panel-sheet {
    border-radius: 28px !important;
    max-height: min(86vh, 900px) !important;
    overflow-y: auto !important;
    padding-bottom: 28px !important;
  }
  .product-sheet,
  #productPanel .panel-sheet {
    width: min(1180px, calc(100% - 44px)) !important;
  }
  .wb-product-detail {
    grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr) !important;
    align-items: start;
  }
}

/* ui_theme_desktop_preloader_fix_patch: финальная полировка темы, карточек, прелоадера и desktop */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Ссылки в шапке показываем даже если ссылка ещё не заполнена — как подсказку/кнопку-заготовку. */
.header-social-link.is-static {
  cursor: default;
  opacity: .78;
}
.shop-header .header-social-links {
  position: relative;
  z-index: 3;
}

/* Прелоадер: загруженная картинка/видео может стать фоном на весь экран, а не маленьким квадратом. */
.app-preloader.has-media-fullscreen {
  overflow: hidden;
  background: #0f172a;
}
.app-preloader.has-media-fullscreen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,.10), transparent 36%),
    linear-gradient(180deg, rgba(0,0,0,.20), rgba(0,0,0,.58));
  pointer-events: none;
}
.app-preloader.has-media-fullscreen .preloader-card {
  position: relative;
  z-index: 2;
  width: min(440px, calc(100vw - 36px));
  min-height: 0;
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(15, 23, 42, .42);
  color: #fff;
  box-shadow: 0 22px 70px rgba(0,0,0,.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.app-preloader.has-media-fullscreen .preloader-media {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
  background: #0f172a;
}
.app-preloader.has-media-fullscreen .preloader-media img,
.app-preloader.has-media-fullscreen .preloader-media video,
.app-preloader.has-media-fullscreen .preloader-full-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-preloader.has-media-fullscreen #preloaderText {
  position: relative;
  z-index: 3;
  font-size: clamp(18px, 3vw, 30px);
  line-height: 1.1;
  text-shadow: 0 3px 18px rgba(0,0,0,.45);
}

/* Карточки: плашки Акция/Хит/Новинка всегда сверху справа и не сдвигают фото/текст. */
.product-image {
  position: relative !important;
}
.product-image .product-badges.on-image,
.catalog.catalog-market-grid .product-badges.on-image,
.horizontal-products .product-badges.on-image,
.product-rail .product-badges.on-image,
.rail-card .product-badges.on-image,
.catalog.grid .product-badges.on-image {
  position: absolute !important;
  top: 7px !important;
  right: 7px !important;
  left: auto !important;
  z-index: 8 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  max-width: calc(100% - 14px) !important;
  pointer-events: none !important;
}
.product-image .product-badges.on-image .product-badge,
.catalog.catalog-market-grid .product-badge,
.horizontal-products .product-badge,
.product-rail .product-badge {
  min-height: 20px !important;
  max-width: 100% !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.18) !important;
}
.product-image > img,
.product-image > video,
.product-image > span {
  position: relative;
  z-index: 1;
}

/* Карточки одной высоты: название, цена и плюсик держатся на одном уровне. */
.product-card,
.rail-card,
.catalog .product-card,
.horizontal-products .product-card,
.product-rail .product-card {
  display: grid !important;
  grid-template-rows: auto 1fr !important;
  align-content: stretch !important;
  height: 100% !important;
  min-width: 0 !important;
}
.product-card .product-info,
.rail-card .product-info,
.catalog .product-card .product-info,
.horizontal-products .product-card .product-info,
.product-rail .product-card .product-info {
  display: grid !important;
  grid-template-rows: minmax(18px, auto) minmax(42px, auto) minmax(18px, auto) 1fr auto !important;
  align-content: stretch !important;
  min-height: 0 !important;
  height: 100% !important;
}
.horizontal-products .product-description,
.product-rail .product-description,
.rail-card .product-description {
  display: none !important;
}
.product-card .buy-row,
.rail-card .buy-row,
.catalog .product-card .buy-row,
.horizontal-products .product-card .buy-row,
.product-rail .product-card .buy-row {
  align-self: end !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 8px !important;
  min-height: 48px !important;
  margin-top: auto !important;
}
.product-card .price-block,
.rail-card .price-block {
  min-width: 0 !important;
  align-self: end !important;
}
.product-card .price,
.rail-card .price {
  overflow-wrap: anywhere;
}
.horizontal-products .product-card,
.product-rail .product-card {
  min-height: clamp(300px, 48vw, 380px) !important;
}

/* Светлая тема: не оставляем белый текст на белых/кремовых карточках. */
body.theme-light,
body.theme-light * {
  text-shadow: none;
}
body.theme-light {
  --bg: #fff7ed !important;
  --surface: #ffffff !important;
  --text: #24140c !important;
  --muted: #735646 !important;
  --secondary: #ffedd5 !important;
  --cart-bar: #ffffff !important;
  background: #fff7ed !important;
  color: #24140c !important;
}
body.theme-light .app-shell,
body.theme-light .food-section,
body.theme-light .shop-header,
body.theme-light .top-search,
body.theme-light .product-card,
body.theme-light .rail-card,
body.theme-light .quick-tile,
body.theme-light .promo-card,
body.theme-light .article-card,
body.theme-light .store-review-card,
body.theme-light .review-card,
body.theme-light .cart-sheet,
body.theme-light .cart-line,
body.theme-light .cart-summary-card,
body.theme-light .promo-code-box,
body.theme-light .checkout-choice,
body.theme-light .address-suggestion,
body.theme-light .panel-sheet,
body.theme-light .wb-detail-main,
body.theme-light .wb-detail-section,
body.theme-light .profile-orders,
body.theme-light .my-order-card,
body.theme-light .info-review,
body.theme-light .detail-buybar,
body.theme-light .search-suggest-box,
body.theme-light .search-suggest-item,
body.theme-light .search-suggest-show-all {
  background: #ffffff !important;
  color: #24140c !important;
  border-color: rgba(115, 86, 70, .18) !important;
}
body.theme-light .cart-summary-card,
body.theme-light .cart-summary-card *,
body.theme-light .cart-total,
body.theme-light .cart-total *,
body.theme-light .cart-line,
body.theme-light .cart-line *,
body.theme-light .promo-code-box,
body.theme-light .promo-code-box *,
body.theme-light .profile-orders,
body.theme-light .profile-orders *,
body.theme-light .my-order-card,
body.theme-light .my-order-card *,
body.theme-light .wb-detail-section,
body.theme-light .wb-detail-section *,
body.theme-light .wb-detail-main,
body.theme-light .wb-detail-main *,
body.theme-light .detail-buybar,
body.theme-light .detail-buybar * {
  color: #24140c !important;
}
body.theme-light .form-note,
body.theme-light .section-kicker,
body.theme-light .product-meta,
body.theme-light .product-card-extra-meta,
body.theme-light .product-description,
body.theme-light .old-price,
body.theme-light .article-card p,
body.theme-light .profile-orders-head span,
body.theme-light .my-order-card small,
body.theme-light .detail-spec-grid small,
body.theme-light .detail-info-pills span,
body.theme-light .detail-buybar-price small {
  color: #735646 !important;
}
body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  background: #fffaf5 !important;
  color: #24140c !important;
  border-color: rgba(115, 86, 70, .25) !important;
}
body.theme-light input::placeholder,
body.theme-light textarea::placeholder {
  color: #9d7d6b !important;
}
body.theme-light .promo-card::before {
  background: linear-gradient(90deg, rgba(255,255,255,.62), rgba(255,255,255,.12)) !important;
}
body.theme-light .promo-card.has-image,
body.theme-light .promo-card.has-image * {
  color: #24140c !important;
}
body.theme-light .bottom-nav {
  background: rgba(255,255,255,.97) !important;
  color: #24140c !important;
}
body.theme-light .bottom-nav button:not(.active) {
  color: #735646 !important;
}
body.theme-light .bottom-nav button.active,
body.theme-light .primary-action,
body.theme-light .qty-button,
body.theme-light .detail-cart-link,
body.theme-light .section-action {
  color: #ffffff !important;
}

/* Модальное окно товара: единый уровень, без выезда за экран и с запасом под buy-bar. */
#productPanel .panel-sheet,
.product-sheet {
  max-width: min(100%, 760px) !important;
  overflow: hidden !important;
}
#productModalBody {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0 !important;
}
.wb-product-detail {
  min-width: 0 !important;
  overflow: visible !important;
}
.wb-detail-gallery,
.wb-detail-main,
.wb-detail-section {
  min-width: 0 !important;
}
@media (max-width: 720px) {
  #productPanel .panel-sheet,
  .product-sheet {
    width: 100% !important;
    max-height: calc(100dvh - 96px) !important;
    border-radius: 28px 28px 0 0 !important;
  }
  #productModalBody {
    max-height: calc(100dvh - 164px) !important;
  }
  .wb-product-detail {
    padding-bottom: calc(124px + env(safe-area-inset-bottom)) !important;
  }
  .wb-detail-gallery .detail-image {
    aspect-ratio: 4 / 3 !important;
    max-height: 54dvh !important;
  }
  .detail-buybar {
    margin: 8px 0 calc(-116px - env(safe-area-inset-bottom)) !important;
  }
}

/* Desktop: магазин как сайт, без бокового выезда. Внутренний размер окна Telegram всё равно задаёт сам Telegram. */
@media (min-width: 900px) {
  .app-shell {
    width: 100% !important;
    max-width: none !important;
    padding-left: clamp(24px, 4vw, 72px) !important;
    padding-right: clamp(24px, 4vw, 72px) !important;
  }
  .catalog.grid,
  .catalog.catalog-market-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  }
  .horizontal-products,
  .product-rail {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
  }
  .product-sheet,
  #productPanel .panel-sheet {
    width: min(1120px, calc(100vw - 56px)) !important;
  }
}

/* light_profile_cards_modal_polish_patch: финальная полировка светлой темы, профиля, карточек и модалки товара */

/* Светлая тема: на главной всё читается, плитки и промо-блоки не сливаются с фоном. */
body.theme-light .section-head,
body.theme-light .section-head *,
body.theme-light .food-section,
body.theme-light .articles-section,
body.theme-light .store-reviews-section,
body.theme-light .home-showcase,
body.theme-light .quick-tiles,
body.theme-light .promo-blocks {
  color: #24140c !important;
  text-shadow: none !important;
}

body.theme-light .quick-tile {
  background: linear-gradient(160deg, #fffaf5 0%, #ffedd5 100%) !important;
  color: #24140c !important;
  border: 1px solid rgba(124, 95, 79, .16) !important;
  box-shadow: 0 14px 34px rgba(124, 95, 79, .14) !important;
}
body.theme-light .quick-tile::before {
  opacity: .16 !important;
  background-image: var(--tile-image) !important;
  background-size: cover !important;
  background-position: center !important;
}
body.theme-light .quick-tile span,
body.theme-light .quick-tile strong,
body.theme-light .quick-tile small {
  color: #24140c !important;
  text-shadow: none !important;
}
body.theme-light .quick-tile small {
  display: inline-block !important;
  width: fit-content !important;
  max-width: 100% !important;
  padding: 2px 5px !important;
  border-radius: 7px !important;
  background: rgba(255, 237, 213, .88) !important;
  color: #6f4e3c !important;
}

body.theme-light .promo-blocks {
  border-radius: 24px !important;
}
body.theme-light .promo-card {
  background: linear-gradient(135deg, #fffaf5 0%, #ffedd5 100%) !important;
  color: #24140c !important;
  border: 1px solid rgba(124, 95, 79, .16) !important;
  box-shadow: 0 16px 42px rgba(124, 95, 79, .13) !important;
  overflow: hidden !important;
  isolation: isolate !important;
}
body.theme-light .promo-card::before {
  background: linear-gradient(90deg, rgba(255,250,245,.84), rgba(255,250,245,.44)) !important;
  opacity: 1 !important;
}
body.theme-light .promo-card span,
body.theme-light .promo-card h3,
body.theme-light .promo-card p {
  color: #24140c !important;
  text-shadow: none !important;
}
body.theme-light .promo-card h3,
body.theme-light .promo-card p {
  display: table !important;
  width: fit-content !important;
  max-width: min(96%, 420px) !important;
  padding: 4px 8px !important;
  border-radius: 10px !important;
  background: rgba(222, 211, 200, .88) !important;
}
body.theme-light .promo-card span {
  display: table !important;
  width: fit-content !important;
  padding: 3px 7px !important;
  border-radius: 999px !important;
  background: rgba(255, 237, 213, .94) !important;
  color: #5f4638 !important;
}
body.theme-light .promo-card button {
  color: #ffffff !important;
  background: linear-gradient(135deg, #f59e0b, #f97316) !important;
}

/* Профиль: заголовки полей больше не накладываются на подсказку. */
#profilePanel .profile-form {
  gap: 14px !important;
}
#profilePanel .form-note,
#profilePanel .profile-form > p {
  display: block !important;
  margin: 0 0 14px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
}
#profilePanel .profile-form label {
  display: grid !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.15 !important;
  min-height: 0 !important;
  color: var(--text) !important;
}
#profilePanel .profile-form input {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}
body.theme-light #profilePanel .profile-form label,
body.theme-light #profilePanel .profile-form .form-note {
  color: #24140c !important;
}

/* Карточки в лентах: одинаковая ширина/высота, плашки всегда в правом верхнем углу, цена и плюсик не пляшут. */
.horizontal-products,
.product-rail {
  align-items: stretch !important;
  scroll-snap-type: x proximity !important;
}
.horizontal-products .product-card,
.product-rail .product-card,
.product-card.rail-card {
  flex: 0 0 var(--rail-card-width) !important;
  width: var(--rail-card-width) !important;
  min-width: var(--rail-card-width) !important;
  max-width: var(--rail-card-width) !important;
  min-height: 348px !important;
  height: 348px !important;
  box-sizing: border-box !important;
}
.horizontal-products .product-image,
.product-rail .product-image,
.product-card.rail-card .product-image {
  aspect-ratio: 3 / 4 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 178px !important;
}
.horizontal-products .product-info,
.product-rail .product-info,
.product-card.rail-card .product-info {
  grid-template-rows: minmax(18px, auto) minmax(42px, auto) minmax(0, auto) 1fr auto !important;
  gap: 7px !important;
}
.horizontal-products .product-title,
.product-rail .product-title,
.product-card.rail-card .product-title {
  min-height: 2.45em !important;
  max-height: 2.45em !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.horizontal-products .product-meta,
.product-rail .product-meta,
.product-card.rail-card .product-meta {
  min-height: 18px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.horizontal-products .buy-row,
.product-rail .buy-row,
.product-card.rail-card .buy-row {
  grid-template-columns: minmax(0, 1fr) 34px !important;
  align-items: end !important;
  min-height: 46px !important;
}
.horizontal-products .price,
.product-rail .price,
.product-card.rail-card .price {
  font-size: 13px !important;
  line-height: 1.12 !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
.horizontal-products .old-price,
.product-rail .old-price,
.product-card.rail-card .old-price {
  font-size: 11px !important;
  line-height: 1.05 !important;
}
.product-image .product-badges.on-image,
.wb-detail-gallery .detail-image .product-badges.on-image,
.catalog.catalog-market-grid .product-badges.on-image,
.horizontal-products .product-badges.on-image,
.product-rail .product-badges.on-image,
.rail-card .product-badges.on-image {
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  text-align: right !important;
}

/* Модалка товара: не вылезает за окно Mini App, фото вертикальное 3:4, контент в одном уровне. */
#productPanel.app-panel:not([hidden]) {
  overflow: hidden !important;
  align-items: flex-end !important;
}
#productPanel .panel-sheet,
#productPanel .product-sheet,
.product-sheet {
  box-sizing: border-box !important;
  width: min(100%, 620px) !important;
  max-width: calc(100vw - 0px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: hidden !important;
}
#productPanel .sheet-head {
  box-sizing: border-box !important;
  min-width: 0 !important;
}
#productPanel .sheet-head strong {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
#productModalBody {
  box-sizing: border-box !important;
  width: 100% !important;
  overflow-x: hidden !important;
}
.wb-product-detail {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}
.wb-detail-gallery {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  overflow: hidden !important;
}
.wb-detail-gallery .detail-image {
  aspect-ratio: 3 / 4 !important;
  width: min(100%, 420px) !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 24px !important;
}
.wb-detail-gallery .detail-image img,
.wb-detail-gallery .detail-image video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.wb-detail-thumbs,
.detail-thumbs {
  max-width: 100% !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
}
.wb-detail-main,
.wb-detail-section,
.detail-buybar {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
.detail-title-row h2 {
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 720px) {
  #productPanel .panel-sheet,
  #productPanel .product-sheet,
  .product-sheet {
    width: 100% !important;
    max-width: 100vw !important;
    max-height: calc(100dvh - 72px) !important;
    border-radius: 28px 28px 0 0 !important;
  }
  #productModalBody {
    max-height: calc(100dvh - 132px) !important;
  }
  .wb-product-detail {
    padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important;
  }
  .wb-detail-gallery .detail-image {
    width: min(86vw, 390px) !important;
    aspect-ratio: 3 / 4 !important;
    max-height: none !important;
  }
  .detail-buybar {
    position: sticky !important;
    bottom: 0 !important;
    margin: 10px 0 0 !important;
    z-index: 15 !important;
  }
}

@media (max-width: 390px) {
  :root { --rail-card-width: 148px; }
  .horizontal-products .product-card,
  .product-rail .product-card,
  .product-card.rail-card {
    min-height: 336px !important;
    height: 336px !important;
  }
  .horizontal-products .price,
  .product-rail .price,
  .product-card.rail-card .price {
    font-size: 12px !important;
  }
  .wb-detail-gallery .detail-image {
    width: min(84vw, 340px) !important;
  }
}

/* Внутри Telegram Desktop код не может раздвинуть внешнее окно Telegram, но магазин должен аккуратно влезать в доступную ширину. */
@media (min-width: 900px) {
  .horizontal-products .product-card,
  .product-rail .product-card,
  .product-card.rail-card {
    --rail-card-width: 210px;
    min-height: 410px !important;
    height: 410px !important;
  }
  .horizontal-products .product-image,
  .product-rail .product-image,
  .product-card.rail-card .product-image {
    max-height: 245px !important;
  }
}

/* telegram_miniapp_focus_fix_next_patch: mini app focus, preloader, profile, cards, light theme */
body:not([data-app-booted="1"]) .app-shell {
  visibility: hidden !important;
}

body:not([data-app-booted="1"]) #appPreloader {
  visibility: visible !important;
  opacity: 1 !important;
}

#appPreloader {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  display: grid !important;
  place-items: center !important;
  background: var(--background, #f6efe4) !important;
}

#appPreloader .preloader-card {
  width: min(88vw, 360px) !important;
  min-height: 212px;
  padding: 22px 18px !important;
  border-radius: 30px !important;
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16) !important;
}

#appPreloader .preloader-media {
  width: min(34vw, 102px);
  height: min(34vw, 102px);
  margin: 0 auto 14px;
  border-radius: 28px;
}

#appPreloader .preloader-card strong {
  font-size: clamp(22px, 4.7vw, 32px);
  line-height: 1.12;
  text-align: center;
}

@media (max-width: 980px) {
  .horizontal-products .product-card,
  .product-rail .product-card,
  .horizontal-products .rail-card,
  .product-rail .rail-card,
  .rail-card {
    flex: 0 0 clamp(168px, 48vw, 188px) !important;
    min-width: clamp(168px, 48vw, 188px) !important;
    max-width: clamp(168px, 48vw, 188px) !important;
    min-height: 340px !important;
  }
}

.product-card,
.rail-card {
  display: flex !important;
  flex-direction: column !important;
}

.product-card .product-info,
.rail-card .product-info {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
}

.product-card .product-title,
.rail-card .product-title {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  min-height: 2.7em;
}

.product-card .buy-row,
.rail-card .buy-row {
  margin-top: auto !important;
  align-items: flex-end !important;
}

.product-card .price-block,
.rail-card .price-block {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.product-image .product-badges,
.product-badges.on-image,
.catalog.catalog-market-grid .product-badges.on-image {
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  bottom: auto !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
}

.product-badges.on-image .product-badge,
.product-image .product-badges .product-badge {
  align-self: flex-end;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

#profilePanel .panel-sheet,
#productPanel .panel-sheet,
#cartPanel .panel-sheet,
#supportPanel .panel-sheet,
#articlePanel .panel-sheet {
  width: min(94vw, 560px) !important;
  max-width: min(94vw, 560px) !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
}

#profilePanel .sheet-head,
#productPanel .sheet-head {
  align-items: flex-start !important;
  gap: 12px !important;
  margin-bottom: 10px !important;
}

#profilePanel .sheet-head strong,
#productPanel .sheet-head strong {
  display: block !important;
  line-height: 1.1 !important;
  margin: 0 !important;
}

#profilePanel .form-note {
  display: block !important;
  margin: 0 0 14px !important;
  line-height: 1.42 !important;
}

#profilePanel .profile-form {
  display: grid !important;
  gap: 12px !important;
}

#profilePanel .profile-form label {
  display: grid !important;
  gap: 6px !important;
  align-items: start !important;
  margin: 0 !important;
  line-height: 1.25 !important;
  font-weight: 900;
}

#profilePanel .profile-form input {
  margin-top: 0 !important;
}

#productPanel .wb-detail-gallery .detail-image,
#productPanel .detail-image {
  aspect-ratio: 3 / 4 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: min(56vh, 560px) !important;
  overflow: hidden !important;
  border-radius: 24px !important;
}

#productPanel .wb-detail-gallery .detail-image img,
#productPanel .wb-detail-gallery .detail-image video,
#productPanel .detail-image img,
#productPanel .detail-image video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

#productPanel .detail-thumbs {
  padding-bottom: 2px;
}

body.theme-light .quick-tile,
body.theme-light .promo-card,
body.theme-light .article-card,
body.theme-light .review-card,
body.theme-light .product-card,
body.theme-light .panel-sheet,
body.theme-light .profile-orders,
body.theme-light .food-section,
body.theme-light .articles-section,
body.theme-light .store-reviews-section {
  background: #fff8f0 !important;
  border-color: #eedfcd !important;
  box-shadow: 0 14px 34px rgba(133, 98, 61, 0.08) !important;
}

body.theme-light .quick-tile *,
body.theme-light .promo-card *,
body.theme-light .article-card *,
body.theme-light .review-card *,
body.theme-light .product-card *,
body.theme-light .panel-sheet *,
body.theme-light .profile-orders * {
  text-shadow: none !important;
}

body.theme-light .section-kicker,
body.theme-light .section-subtitle,
body.theme-light .form-note,
body.theme-light .product-meta,
body.theme-light .old-price,
body.theme-light .quick-tile small,
body.theme-light .promo-card p,
body.theme-light .article-card p,
body.theme-light .profile-orders-head p {
  color: #7c6046 !important;
}

body.theme-light .section-title,
body.theme-light .product-title,
body.theme-light .price,
body.theme-light .quick-tile strong,
body.theme-light .promo-card h3,
body.theme-light .article-card h3,
body.theme-light .sheet-head strong,
body.theme-light label,
body.theme-light .profile-orders-head strong,
body.theme-light .my-order-card strong,
body.theme-light .my-order-row strong {
  color: #2a1f15 !important;
}

body.theme-light .top-search,
body.theme-light .top-search input {
  background: #fff9f3 !important;
  color: #2b2118 !important;
  border-color: #ead8c2 !important;
}

body.theme-light .top-search input::placeholder {
  color: #9a7a5d !important;
}

body.theme-light .promo-card,
body.theme-light .quick-tile,
body.theme-light .article-card,
body.theme-light .product-card,
body.theme-light .profile-orders,
body.theme-light .my-order-card {
  border: 1px solid #efdfcf !important;
}

/* home_catalog_cards_profile_note_next_patch: home product cards = catalog size, remove profile intro overlap */
#profilePanel .panel-sheet > p.form-note {
  display: none !important;
}

#profilePanel .profile-form {
  margin-top: 8px !important;
  gap: 14px !important;
}

#profilePanel .profile-form label {
  display: grid !important;
  gap: 7px !important;
  line-height: 1.2 !important;
}

/* В Telegram Mini App карточки на главной, в хитах, новинках и подборках должны быть одного формата с каталогом. */
.home-page .horizontal-products,
.home-page .product-rail,
.horizontal-products,
.product-rail {
  gap: var(--card-gap, 12px) !important;
  scroll-padding-left: 10px;
}

.home-page .horizontal-products .product-card,
.home-page .product-rail .product-card,
.home-page .horizontal-products .rail-card,
.home-page .product-rail .rail-card {
  flex: 0 0 calc((100% - var(--card-gap, 12px)) / 2) !important;
  min-width: calc((100% - var(--card-gap, 12px)) / 2) !important;
  max-width: calc((100% - var(--card-gap, 12px)) / 2) !important;
  width: calc((100% - var(--card-gap, 12px)) / 2) !important;
  min-height: 0 !important;
  height: auto !important;
}

.home-page .horizontal-products .product-image,
.home-page .product-rail .product-image,
.home-page .horizontal-products .rail-card .product-image,
.home-page .product-rail .rail-card .product-image {
  width: 100% !important;
  aspect-ratio: 3 / 4 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.home-page .horizontal-products .product-info,
.home-page .product-rail .product-info {
  min-height: 150px !important;
}

.home-page .horizontal-products .product-title,
.home-page .product-rail .product-title {
  min-height: 2.65em !important;
}

.home-page .horizontal-products .price,
.home-page .product-rail .price {
  line-height: 1.16 !important;
  white-space: normal !important;
  word-break: normal !important;
}

.home-page .horizontal-products .buy-row,
.home-page .product-rail .buy-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 8px !important;
}

.home-page .horizontal-products .qty-control,
.home-page .product-rail .qty-control {
  justify-self: end !important;
}

@media (max-width: 430px) {
  .home-page .horizontal-products .product-card,
  .home-page .product-rail .product-card,
  .home-page .horizontal-products .rail-card,
  .home-page .product-rail .rail-card {
    flex-basis: calc((100% - var(--card-gap, 12px)) / 2) !important;
    min-width: calc((100% - var(--card-gap, 12px)) / 2) !important;
    max-width: calc((100% - var(--card-gap, 12px)) / 2) !important;
  }
}

/* profile_cards_final_alignment_patch: финальное выравнивание подборок и профиля */
#profilePanel .panel-sheet > p.form-note,
#profilePanel > .panel-sheet > p.form-note {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#profilePanel .panel-sheet {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding-top: 20px !important;
}

#profilePanel .sheet-head {
  margin: 0 0 8px !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
}

#profilePanel .profile-form {
  display: grid !important;
  gap: 14px !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
}

#profilePanel .profile-form label {
  position: static !important;
  transform: none !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: auto !important;
  line-height: 1.18 !important;
  font-size: 15px !important;
  font-weight: 950 !important;
}

#profilePanel .profile-form input {
  position: static !important;
  transform: none !important;
  display: block !important;
  width: 100% !important;
  min-height: 48px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

#profilePanel .profile-orders {
  margin-top: 2px !important;
  flex: 0 0 auto !important;
}

/* Карточки в окнах "Акции" и "Подборка" — такой же компактный формат, как в каталоге. */
#articleModalBody .info-product-grid,
.info-product-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  align-items: stretch !important;
}

#articleModalBody .info-product-grid .product-card,
.info-product-grid .product-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 330px !important;
  height: 330px !important;
  max-height: 330px !important;
  padding: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#articleModalBody .info-product-grid .product-image,
.info-product-grid .product-image {
  width: 100% !important;
  aspect-ratio: 3 / 4 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 190px !important;
  flex: 0 0 auto !important;
  border-radius: 16px !important;
}

#articleModalBody .info-product-grid .product-image img,
#articleModalBody .info-product-grid .product-image video,
.info-product-grid .product-image img,
.info-product-grid .product-image video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

#articleModalBody .info-product-grid .product-info,
.info-product-grid .product-info {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
}

#articleModalBody .info-product-grid .product-meta,
.info-product-grid .product-meta {
  display: none !important;
}

#articleModalBody .info-product-grid .product-title,
.info-product-grid .product-title {
  min-height: 2.55em !important;
  max-height: 2.55em !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.18 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

#articleModalBody .info-product-grid .buy-row,
.info-product-grid .buy-row {
  margin-top: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 6px !important;
  min-height: 42px !important;
}

#articleModalBody .info-product-grid .price-block,
.info-product-grid .price-block {
  min-height: 36px !important;
  justify-content: end !important;
  align-self: end !important;
  min-width: 0 !important;
}

#articleModalBody .info-product-grid .price,
.info-product-grid .price {
  font-size: 13.5px !important;
  line-height: 1.12 !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  letter-spacing: -0.02em !important;
}

#articleModalBody .info-product-grid .old-price,
.info-product-grid .old-price {
  font-size: 11px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

#articleModalBody .info-product-grid .qty-control,
.info-product-grid .qty-control {
  justify-self: end !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px !important;
  border-radius: 16px !important;
}

#articleModalBody .info-product-grid .qty-button,
.info-product-grid .qty-button {
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 12px !important;
  font-size: 15px !important;
}

#articleModalBody .info-product-grid .qty-count,
.info-product-grid .qty-count {
  min-width: 18px !important;
  font-size: 12px !important;
}

#articleModalBody .info-product-grid .product-badges.on-image,
.info-product-grid .product-badges.on-image {
  top: 7px !important;
  right: 7px !important;
  left: auto !important;
  bottom: auto !important;
  max-width: calc(100% - 14px) !important;
  align-items: flex-end !important;
}

#articleModalBody .info-product-grid .product-badge,
.info-product-grid .product-badge {
  min-height: 20px !important;
  padding: 0 7px !important;
  font-size: 10.5px !important;
}

@media (max-width: 390px) {
  #articleModalBody .info-product-grid .product-card,
  .info-product-grid .product-card {
    height: 318px !important;
    max-height: 318px !important;
    padding: 9px !important;
  }

  #articleModalBody .info-product-grid .price,
  .info-product-grid .price {
    font-size: 12.5px !important;
  }

  #articleModalBody .info-product-grid .qty-button,
  .info-product-grid .qty-button {
    width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
  }
}


/* modal_price_buttons_no_overlap_final_patch:
   Fix narrow product cards inside promo/action modal grids:
   price and quantity controls must never overlap. */
#articleModalBody .info-product-grid .product-card,
.info-product-grid .product-card {
  overflow: hidden !important;
}

#articleModalBody .info-product-grid .product-info,
.info-product-grid .product-info {
  min-height: 0 !important;
  overflow: hidden !important;
}

#articleModalBody .info-product-grid .buy-row,
.info-product-grid .buy-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 6px !important;
  width: 100% !important;
  margin-top: auto !important;
  overflow: visible !important;
}

#articleModalBody .info-product-grid .price-block,
.info-product-grid .price-block {
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 42px !important;
  overflow: hidden !important;
  padding-right: 4px !important;
}

#articleModalBody .info-product-grid .price,
.info-product-grid .price {
  display: block !important;
  max-width: 100% !important;
  font-size: 12px !important;
  line-height: 1.08 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

#articleModalBody .info-product-grid .old-price,
.info-product-grid .old-price {
  display: block !important;
  max-width: 100% !important;
  margin-top: 2px !important;
  font-size: 10px !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#articleModalBody .info-product-grid .qty-control,
.info-product-grid .qty-control {
  justify-self: end !important;
  align-self: end !important;
  position: relative !important;
  z-index: 2 !important;
  flex: 0 0 auto !important;
  max-width: 78px !important;
  gap: 4px !important;
  padding: 3px !important;
  margin: 0 !important;
  background: color-mix(in srgb, var(--secondary, #eef2ff) 84%, transparent) !important;
}

#articleModalBody .info-product-grid .qty-button,
.info-product-grid .qty-button {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

#articleModalBody .info-product-grid .qty-count,
.info-product-grid .qty-count {
  min-width: 12px !important;
  max-width: 18px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  text-align: center !important;
}

@media (max-width: 430px) {
  #articleModalBody .info-product-grid .buy-row,
  .info-product-grid .buy-row {
    grid-template-columns: 1fr auto !important;
    gap: 4px !important;
  }

  #articleModalBody .info-product-grid .price,
  .info-product-grid .price {
    font-size: 11px !important;
    letter-spacing: -0.04em !important;
  }

  #articleModalBody .info-product-grid .qty-control,
  .info-product-grid .qty-control {
    max-width: 72px !important;
  }

  #articleModalBody .info-product-grid .qty-button,
  .info-product-grid .qty-button {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
  }
}


/* all_cards_qty_minus_final_patch:
   Minus / count / plus must be visible on every product card:
   catalog, home rails, promo/action modals and product selections. */
.product-card .qty-control,
.catalog .product-card .qty-control,
.horizontal-products .product-card .qty-control,
.product-rail .product-card .qty-control,
.info-product-grid .product-card .qty-control,
#articleModalBody .info-product-grid .product-card .qty-control {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  gap: 4px !important;
  padding: 3px !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--secondary, #eef2ff) 86%, transparent) !important;
  min-width: 86px !important;
  max-width: 94px !important;
  margin-left: auto !important;
}

.product-card .qty-control .qty-button,
.catalog .product-card .qty-control .qty-button,
.horizontal-products .product-card .qty-control .qty-button,
.product-rail .product-card .qty-control .qty-button,
.info-product-grid .product-card .qty-control .qty-button,
#articleModalBody .info-product-grid .product-card .qty-control .qty-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  flex: 0 0 28px !important;
}

/* Earlier marketplace CSS hid the minus button in compact/catalog cards.
   This override brings it back everywhere. */
.product-card .qty-control .qty-button:first-child,
.catalog.grid .qty-control .qty-button:first-child,
.horizontal-products .qty-control .qty-button:first-child,
.product-rail .qty-control .qty-button:first-child,
.rail-card .qty-control .qty-button:first-child,
.info-product-grid .qty-control .qty-button:first-child,
#articleModalBody .info-product-grid .qty-control .qty-button:first-child {
  display: inline-flex !important;
}

.product-card .qty-count,
.catalog.grid .qty-count,
.horizontal-products .qty-count,
.product-rail .qty-count,
.rail-card .qty-count,
.info-product-grid .qty-count,
#articleModalBody .info-product-grid .qty-count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 14px !important;
  max-width: 22px !important;
  height: 28px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  text-align: center !important;
  flex: 0 0 auto !important;
}

.product-card .buy-row,
.catalog .product-card .buy-row,
.horizontal-products .product-card .buy-row,
.product-rail .product-card .buy-row,
.info-product-grid .product-card .buy-row,
#articleModalBody .info-product-grid .product-card .buy-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 6px !important;
  width: 100% !important;
}

.product-card .price-block,
.catalog .product-card .price-block,
.horizontal-products .product-card .price-block,
.product-rail .product-card .price-block,
.info-product-grid .product-card .price-block,
#articleModalBody .info-product-grid .product-card .price-block {
  min-width: 0 !important;
  overflow: hidden !important;
  padding-right: 2px !important;
}

.product-card .price,
.catalog .product-card .price,
.horizontal-products .product-card .price,
.product-rail .product-card .price,
.info-product-grid .product-card .price,
#articleModalBody .info-product-grid .product-card .price {
  max-width: 100% !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

@media (max-width: 430px) {
  .product-card .qty-control,
  .catalog .product-card .qty-control,
  .horizontal-products .product-card .qty-control,
  .product-rail .product-card .qty-control,
  .info-product-grid .product-card .qty-control,
  #articleModalBody .info-product-grid .product-card .qty-control {
    min-width: 80px !important;
    max-width: 86px !important;
    gap: 3px !important;
    padding: 3px !important;
  }

  .product-card .qty-control .qty-button,
  .catalog .product-card .qty-control .qty-button,
  .horizontal-products .product-card .qty-control .qty-button,
  .product-rail .product-card .qty-control .qty-button,
  .info-product-grid .product-card .qty-control .qty-button,
  #articleModalBody .info-product-grid .product-card .qty-control .qty-button {
    width: 26px !important;
    min-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    flex-basis: 26px !important;
    border-radius: 9px !important;
  }

  .product-card .qty-count,
  .catalog.grid .qty-count,
  .horizontal-products .qty-count,
  .product-rail .qty-count,
  .rail-card .qty-count,
  .info-product-grid .qty-count,
  #articleModalBody .info-product-grid .qty-count {
    min-width: 12px !important;
    max-width: 18px !important;
    height: 26px !important;
    font-size: 11px !important;
  }
}

/* interface_stability_next_patch:
   финальная стабилизация Mini App после all_cards_qty_minus_patch. */
:root {
  --stable-card-height: clamp(304px, 76vw, 352px);
  --stable-home-card-width: calc((100% - var(--card-gap, 12px)) / 2);
  --stable-card-image-aspect: 1 / 1;
}

.product-card,
.catalog .product-card,
.catalog.grid .product-card,
.catalog.catalog-market-grid .product-card,
.horizontal-products .product-card,
.product-rail .product-card,
.info-product-grid .product-card,
#articleModalBody .info-product-grid .product-card {
  position: relative !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  align-content: stretch !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.catalog.grid .product-card,
.catalog.catalog-market-grid .product-card,
.horizontal-products .product-card,
.product-rail .product-card,
.info-product-grid .product-card,
#articleModalBody .info-product-grid .product-card {
  min-height: var(--stable-card-height) !important;
  height: var(--stable-card-height) !important;
}

.horizontal-products,
.product-rail {
  align-items: stretch !important;
  gap: var(--card-gap, 12px) !important;
  scroll-padding-left: 10px !important;
}

.home-page .horizontal-products .product-card,
.home-page .product-rail .product-card,
.home-page .horizontal-products .rail-card,
.home-page .product-rail .rail-card {
  flex: 0 0 var(--stable-home-card-width) !important;
  width: var(--stable-home-card-width) !important;
  min-width: var(--stable-home-card-width) !important;
  max-width: var(--stable-home-card-width) !important;
}

.product-card .product-image,
.catalog.grid .product-card .product-image,
.catalog.catalog-market-grid .product-card .product-image,
.horizontal-products .product-card .product-image,
.product-rail .product-card .product-image,
.info-product-grid .product-card .product-image {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: var(--stable-card-image-aspect) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 0 0 auto !important;
}

.product-card .product-info,
.catalog .product-card .product-info,
.horizontal-products .product-card .product-info,
.product-rail .product-card .product-info,
.info-product-grid .product-card .product-info {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: minmax(16px, auto) minmax(2.45em, auto) minmax(0, auto) minmax(0, 1fr) auto !important;
  align-content: stretch !important;
  gap: 6px !important;
}

.product-card .product-meta,
.product-card .product-title,
.product-card .product-card-extra-meta,
.product-card .product-description {
  min-width: 0 !important;
}

.product-card .product-title {
  min-height: 2.45em !important;
  max-height: 2.45em !important;
  line-height: 1.22 !important;
}

.product-card .product-description {
  max-height: 2.7em !important;
  line-height: 1.35 !important;
}

.product-card .buy-row,
.catalog .product-card .buy-row,
.horizontal-products .product-card .buy-row,
.product-rail .product-card .buy-row,
.info-product-grid .product-card .buy-row,
#articleModalBody .info-product-grid .product-card .buy-row {
  align-self: end !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 6px !important;
  width: 100% !important;
  min-height: 38px !important;
  margin-top: auto !important;
}

.product-card .price-block,
.catalog .product-card .price-block,
.horizontal-products .product-card .price-block,
.product-rail .product-card .price-block,
.info-product-grid .product-card .price-block {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.product-card .price,
.catalog .product-card .price,
.horizontal-products .product-card .price,
.product-rail .product-card .price,
.info-product-grid .product-card .price,
#productPanel .price {
  display: flex !important;
  align-items: baseline !important;
  gap: 3px !important;
  max-width: 100% !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  line-height: 1.08 !important;
  letter-spacing: -0.03em !important;
}

.product-card .price-value,
#productPanel .price-value {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.product-card .price-unit,
#productPanel .price-unit {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 42% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: var(--muted) !important;
  font-size: .72em !important;
  letter-spacing: -0.02em !important;
}

.product-card .qty-control,
.catalog .product-card .qty-control,
.horizontal-products .product-card .qty-control,
.product-rail .product-card .qty-control,
.info-product-grid .product-card .qty-control {
  justify-self: end !important;
  align-self: end !important;
  min-width: 82px !important;
  max-width: 88px !important;
  width: 88px !important;
  margin-left: 0 !important;
  z-index: 6 !important;
}

.product-card .qty-control .qty-button,
.catalog .product-card .qty-control .qty-button,
.horizontal-products .product-card .qty-control .qty-button,
.product-rail .product-card .qty-control .qty-button,
.info-product-grid .product-card .qty-control .qty-button {
  width: 26px !important;
  min-width: 26px !important;
  height: 26px !important;
  min-height: 26px !important;
  flex: 0 0 26px !important;
}

.product-card .qty-count,
.catalog.grid .product-card .qty-count,
.horizontal-products .product-card .qty-count,
.product-rail .product-card .qty-count,
.info-product-grid .product-card .qty-count {
  display: inline-flex !important;
  min-width: 14px !important;
  max-width: 18px !important;
  height: 26px !important;
}

.product-card .product-badges.on-image,
.product-image .product-badges.on-image,
.catalog .product-badges.on-image,
.catalog.catalog-market-grid .product-badges.on-image,
.horizontal-products .product-badges.on-image,
.product-rail .product-badges.on-image,
.rail-card .product-badges.on-image {
  position: absolute !important;
  top: 7px !important;
  right: 7px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 8 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  max-width: calc(100% - 14px) !important;
  pointer-events: none !important;
}

.product-card .product-badge {
  max-width: 100% !important;
  min-height: 20px !important;
  padding: 0 7px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  box-shadow: 0 7px 18px rgba(15, 23, 42, .16) !important;
}

body.theme-light .home-showcase,
body.theme-light .food-section,
body.theme-light .rail-head h2,
body.theme-light .rail-head p,
body.theme-light .section-head h2,
body.theme-light .section-head p,
body.theme-light .section-title,
body.theme-light .quick-tile strong,
body.theme-light .quick-tile small {
  color: #2a1f15 !important;
}

body.theme-light .promo-blocks {
  background: transparent !important;
}

body.theme-light .promo-blocks .promo-card {
  color: #2a1f15 !important;
  border: 1px solid rgba(158, 107, 63, .20) !important;
  box-shadow: 0 16px 34px rgba(124, 91, 74, .15) !important;
}

body.theme-light .promo-blocks .promo-card:nth-child(1) {
  background: radial-gradient(circle at 20% 12%, rgba(255,255,255,.72), transparent 34%), linear-gradient(135deg, #fff2c8, #ffe1a3) !important;
}

body.theme-light .promo-blocks .promo-card:nth-child(2) {
  background: radial-gradient(circle at 20% 12%, rgba(255,255,255,.72), transparent 34%), linear-gradient(135deg, #ffe5ee, #ffd5e4) !important;
}

body.theme-light .promo-blocks .promo-card span,
body.theme-light .promo-blocks .promo-card h3,
body.theme-light .promo-blocks .promo-card p {
  color: #2a1f15 !important;
  text-shadow: none !important;
}

body.theme-light .promo-blocks .promo-card button {
  background: #2a1f15 !important;
  color: #fff7ed !important;
}

#profilePanel .profile-form {
  display: grid !important;
  gap: 14px !important;
  margin: 0 0 14px !important;
}

#profilePanel .profile-form label {
  position: static !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.18 !important;
  font-size: 14px !important;
  font-weight: 950 !important;
  color: var(--text) !important;
  transform: none !important;
}

#profilePanel .profile-form input {
  position: static !important;
  display: block !important;
  width: 100% !important;
  min-height: 50px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  box-sizing: border-box !important;
  transform: none !important;
}

#profilePanel .profile-orders {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.banner-slide video[data-banner-video],
.preloader-full-media {
  background: color-mix(in srgb, var(--secondary, #eef2ff) 82%, #000) !important;
}

@media (max-width: 430px) {
  :root {
    --stable-card-height: clamp(294px, 78vw, 336px);
  }

  .product-card .price,
  .catalog .product-card .price,
  .horizontal-products .product-card .price,
  .product-rail .product-card .price,
  .info-product-grid .product-card .price {
    font-size: clamp(12px, 3.4vw, 14px) !important;
  }

  .product-card .qty-control,
  .catalog .product-card .qty-control,
  .horizontal-products .product-card .qty-control,
  .product-rail .product-card .qty-control,
  .info-product-grid .product-card .qty-control {
    width: 82px !important;
    min-width: 78px !important;
    max-width: 82px !important;
  }
}

/* price_profile_overlap_hotfix_patch: цена в карточке + профиль без наложений */
/* В узких карточках цена должна занимать всю строку, а счётчик количества — отдельную строку снизу. */
.catalog.catalog-market-grid .product-card .buy-row,
.catalog.grid .product-card .buy-row,
.horizontal-products .product-card .buy-row,
.product-rail .product-card .buy-row,
.info-product-grid .product-card .buy-row,
#articleModalBody .info-product-grid .product-card .buy-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto !important;
  align-items: end !important;
  justify-items: stretch !important;
  gap: 6px !important;
  width: 100% !important;
  min-height: 66px !important;
  overflow: visible !important;
}

.catalog.catalog-market-grid .product-card .price-block,
.catalog.grid .product-card .price-block,
.horizontal-products .product-card .price-block,
.product-rail .product-card .price-block,
.info-product-grid .product-card .price-block,
#articleModalBody .info-product-grid .product-card .price-block {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
  display: grid !important;
  gap: 2px !important;
}

.catalog.catalog-market-grid .product-card .price,
.catalog.grid .product-card .price,
.horizontal-products .product-card .price,
.product-rail .product-card .price,
.info-product-grid .product-card .price,
#articleModalBody .info-product-grid .product-card .price {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
  line-height: 1.08 !important;
  letter-spacing: -0.025em !important;
}

.catalog.catalog-market-grid .product-card .price-value,
.catalog.grid .product-card .price-value,
.horizontal-products .product-card .price-value,
.product-rail .product-card .price-value,
.info-product-grid .product-card .price-value,
#articleModalBody .info-product-grid .product-card .price-value {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  font-size: clamp(13px, 3.45vw, 15px) !important;
  font-weight: 950 !important;
  color: var(--text) !important;
}

.catalog.catalog-market-grid .product-card .price-unit,
.catalog.grid .product-card .price-unit,
.horizontal-products .product-card .price-unit,
.product-rail .product-card .price-unit,
.info-product-grid .product-card .price-unit,
#articleModalBody .info-product-grid .product-card .price-unit {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  font-size: clamp(10px, 2.75vw, 12px) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.015em !important;
  color: var(--muted) !important;
}

.catalog.catalog-market-grid .product-card .old-price,
.catalog.grid .product-card .old-price,
.horizontal-products .product-card .old-price,
.product-rail .product-card .old-price,
.info-product-grid .product-card .old-price,
#articleModalBody .info-product-grid .product-card .old-price {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  font-size: clamp(10px, 2.7vw, 12px) !important;
  line-height: 1.05 !important;
}

.catalog.catalog-market-grid .product-card .qty-control,
.catalog.grid .product-card .qty-control,
.horizontal-products .product-card .qty-control,
.product-rail .product-card .qty-control,
.info-product-grid .product-card .qty-control,
#articleModalBody .info-product-grid .product-card .qty-control {
  grid-row: 2 !important;
  justify-self: end !important;
  align-self: end !important;
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  margin: 0 !important;
}

/* Чуть больше воздуха снизу, чтобы цена, старая цена и счётчик не обрезались. */
.catalog.catalog-market-grid .product-card,
.catalog.grid .product-card,
.horizontal-products .product-card,
.product-rail .product-card,
.info-product-grid .product-card,
#articleModalBody .info-product-grid .product-card {
  overflow: hidden !important;
}

@media (max-width: 430px) {
  :root {
    --stable-card-height: clamp(324px, 86vw, 366px);
  }

  .horizontal-products .product-card,
  .product-rail .product-card,
  .product-card.rail-card {
    min-height: var(--stable-card-height) !important;
    height: var(--stable-card-height) !important;
    max-height: var(--stable-card-height) !important;
  }

  .catalog.catalog-market-grid .product-card,
  .catalog.grid .product-card,
  .info-product-grid .product-card,
  #articleModalBody .info-product-grid .product-card {
    min-height: var(--stable-card-height) !important;
    height: var(--stable-card-height) !important;
    max-height: var(--stable-card-height) !important;
  }
}

/* Профиль: обычный вертикальный поток. Кнопки очистки больше не перекрывают историю заказов. */
#profilePanel .panel-sheet {
  display: block !important;
  width: min(94vw, 560px) !important;
  max-width: min(94vw, 560px) !important;
  max-height: min(90dvh, 760px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 18px 14px calc(96px + env(safe-area-inset-bottom)) !important;
  box-sizing: border-box !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

#profilePanel .sheet-head,
#profilePanel .profile-form,
#profilePanel .profile-orders,
#profilePanel #profileLogout,
#profilePanel #clearAppCache {
  position: static !important;
  transform: none !important;
  z-index: auto !important;
  float: none !important;
  clear: both !important;
}

#profilePanel .sheet-head {
  display: flex !important;
  margin: 0 0 14px !important;
}

#profilePanel .profile-form {
  display: grid !important;
  gap: 12px !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
}

#profilePanel .profile-orders {
  display: grid !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 0 14px !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  flex: none !important;
}

#profilePanel .profile-orders-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 8px !important;
}

#profilePanel .my-orders-list,
#profilePanel .my-order-card,
#profilePanel .my-orders-empty {
  position: static !important;
  transform: none !important;
  overflow: visible !important;
  max-height: none !important;
}

#profilePanel #profileLogout,
#profilePanel #clearAppCache {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 8px 0 0 !important;
}

#profilePanel #clearAppCache {
  margin-bottom: 12px !important;
}

/* cards_vertical_uniform_hotfix_patch:
   Единый вертикальный формат карточек как в модальном блоке "Акции":
   картинка сверху, плашки справа, цена полностью видна, − / количество / + всегда внизу. */
:root {
  --uniform-product-card-min: clamp(386px, 104vw, 438px);
  --uniform-product-image-ratio: 3 / 4;
  --uniform-product-gap: 7px;
}

.catalog.catalog-market-grid,
.catalog.grid,
.info-product-grid,
#articleModalBody .info-product-grid {
  align-items: stretch !important;
  grid-auto-rows: 1fr !important;
}

.horizontal-products,
.product-rail {
  align-items: stretch !important;
}

.home-page .horizontal-products,
.home-page .product-rail {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: calc((100% - var(--card-gap, 12px)) / 2) !important;
  overflow-x: auto !important;
  align-items: stretch !important;
}

.catalog.catalog-market-grid .product-card,
.catalog.grid .product-card,
.horizontal-products .product-card,
.product-rail .product-card,
.product-card.rail-card,
.info-product-grid .product-card,
#articleModalBody .info-product-grid .product-card {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  align-content: stretch !important;
  align-items: stretch !important;
  min-height: var(--uniform-product-card-min) !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.home-page .horizontal-products .product-card,
.home-page .product-rail .product-card,
.home-page .horizontal-products .rail-card,
.home-page .product-rail .rail-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
}

.catalog.catalog-market-grid .product-image,
.catalog.grid .product-image,
.horizontal-products .product-image,
.product-rail .product-image,
.product-card.rail-card .product-image,
.info-product-grid .product-image,
#articleModalBody .info-product-grid .product-image {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: var(--uniform-product-image-ratio) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}

.catalog.catalog-market-grid .product-image img,
.catalog.grid .product-image img,
.horizontal-products .product-image img,
.product-rail .product-image img,
.info-product-grid .product-image img,
#articleModalBody .info-product-grid .product-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.catalog.catalog-market-grid .product-info,
.catalog.grid .product-info,
.horizontal-products .product-info,
.product-rail .product-info,
.product-card.rail-card .product-info,
.info-product-grid .product-info,
#articleModalBody .info-product-grid .product-info {
  display: grid !important;
  grid-template-rows: minmax(17px, auto) minmax(2.55em, auto) minmax(0, auto) minmax(0, 1fr) auto !important;
  align-content: stretch !important;
  gap: var(--uniform-product-gap) !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: visible !important;
}

.catalog.catalog-market-grid .product-meta,
.catalog.grid .product-meta,
.horizontal-products .product-meta,
.product-rail .product-meta,
.product-card.rail-card .product-meta,
.info-product-grid .product-meta,
#articleModalBody .info-product-grid .product-meta {
  min-height: 17px !important;
  max-height: 17px !important;
  line-height: 17px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.catalog.catalog-market-grid .product-title,
.catalog.grid .product-title,
.horizontal-products .product-title,
.product-rail .product-title,
.product-card.rail-card .product-title,
.info-product-grid .product-title,
#articleModalBody .info-product-grid .product-title {
  min-height: 2.55em !important;
  max-height: 2.55em !important;
  line-height: 1.22 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  margin: 0 !important;
}

.catalog.catalog-market-grid .product-description,
.catalog.grid .product-description,
.horizontal-products .product-description,
.product-rail .product-description,
.product-card.rail-card .product-description,
.info-product-grid .product-description,
#articleModalBody .info-product-grid .product-description {
  display: none !important;
}

.catalog.catalog-market-grid .buy-row,
.catalog.grid .buy-row,
.horizontal-products .buy-row,
.product-rail .buy-row,
.product-card.rail-card .buy-row,
.info-product-grid .buy-row,
#articleModalBody .info-product-grid .buy-row {
  align-self: end !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto !important;
  justify-items: end !important;
  align-items: end !important;
  gap: 7px !important;
  width: 100% !important;
  min-height: 96px !important;
  margin-top: auto !important;
  overflow: visible !important;
}

.catalog.catalog-market-grid .price-block,
.catalog.grid .price-block,
.horizontal-products .price-block,
.product-rail .price-block,
.product-card.rail-card .price-block,
.info-product-grid .price-block,
#articleModalBody .info-product-grid .price-block {
  display: grid !important;
  justify-items: end !important;
  align-items: end !important;
  width: 100% !important;
  min-height: 58px !important;
  padding: 0 !important;
  text-align: right !important;
  overflow: visible !important;
}

.catalog.catalog-market-grid .price,
.catalog.grid .price,
.horizontal-products .price,
.product-rail .price,
.product-card.rail-card .price,
.info-product-grid .price,
#articleModalBody .info-product-grid .price {
  display: grid !important;
  grid-template-columns: 1fr !important;
  justify-items: end !important;
  gap: 2px !important;
  width: 100% !important;
  max-width: 100% !important;
  text-align: right !important;
  white-space: normal !important;
  overflow: visible !important;
  line-height: 1.08 !important;
  letter-spacing: -0.02em !important;
}

.catalog.catalog-market-grid .price-value,
.catalog.grid .price-value,
.horizontal-products .price-value,
.product-rail .price-value,
.product-card.rail-card .price-value,
.info-product-grid .price-value,
#articleModalBody .info-product-grid .price-value {
  display: block !important;
  max-width: 100% !important;
  font-size: clamp(18px, 5.2vw, 22px) !important;
  line-height: 1.06 !important;
  font-weight: 950 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  color: var(--text) !important;
}

.catalog.catalog-market-grid .price-unit,
.catalog.grid .price-unit,
.horizontal-products .price-unit,
.product-rail .price-unit,
.product-card.rail-card .price-unit,
.info-product-grid .price-unit,
#articleModalBody .info-product-grid .price-unit {
  display: block !important;
  max-width: 100% !important;
  font-size: clamp(13px, 3.7vw, 16px) !important;
  line-height: 1.06 !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  color: var(--muted) !important;
}

.catalog.catalog-market-grid .old-price,
.catalog.grid .old-price,
.horizontal-products .old-price,
.product-rail .old-price,
.product-card.rail-card .old-price,
.info-product-grid .old-price,
#articleModalBody .info-product-grid .old-price {
  justify-self: end !important;
  width: auto !important;
  max-width: 100% !important;
  font-size: clamp(12px, 3.4vw, 14px) !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.catalog.catalog-market-grid .qty-control,
.catalog.grid .qty-control,
.horizontal-products .qty-control,
.product-rail .qty-control,
.product-card.rail-card .qty-control,
.info-product-grid .qty-control,
#articleModalBody .info-product-grid .qty-control {
  grid-row: 2 !important;
  justify-self: end !important;
  align-self: end !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 98px !important;
  min-width: 98px !important;
  max-width: 98px !important;
  gap: 6px !important;
  padding: 5px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--secondary, #fff1dc) 88%, transparent) !important;
  box-shadow: 0 8px 18px rgba(249, 115, 22, .16) !important;
  position: relative !important;
  z-index: 9 !important;
  overflow: visible !important;
}

.catalog.catalog-market-grid .qty-button,
.catalog.grid .qty-button,
.horizontal-products .qty-button,
.product-rail .qty-button,
.product-card.rail-card .qty-button,
.info-product-grid .qty-button,
#articleModalBody .info-product-grid .qty-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  flex: 0 0 32px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

.catalog.catalog-market-grid .qty-button:first-child,
.catalog.grid .qty-button:first-child,
.horizontal-products .qty-button:first-child,
.product-rail .qty-button:first-child,
.product-card.rail-card .qty-button:first-child,
.info-product-grid .qty-button:first-child,
#articleModalBody .info-product-grid .qty-button:first-child {
  display: inline-flex !important;
}

.catalog.catalog-market-grid .qty-count,
.catalog.grid .qty-count,
.horizontal-products .qty-count,
.product-rail .qty-count,
.product-card.rail-card .qty-count,
.info-product-grid .qty-count,
#articleModalBody .info-product-grid .qty-count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 16px !important;
  max-width: 22px !important;
  height: 32px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  text-align: center !important;
}

.product-card .product-badges.on-image,
.product-image .product-badges.on-image,
.catalog .product-badges.on-image,
.catalog.catalog-market-grid .product-badges.on-image,
.horizontal-products .product-badges.on-image,
.product-rail .product-badges.on-image,
.rail-card .product-badges.on-image,
.info-product-grid .product-badges.on-image,
#articleModalBody .info-product-grid .product-badges.on-image {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 12 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  pointer-events: none !important;
}

@media (max-width: 430px) {
  :root {
    --uniform-product-card-min: clamp(394px, 108vw, 430px);
  }

  .catalog.catalog-market-grid .product-card,
  .catalog.grid .product-card,
  .horizontal-products .product-card,
  .product-rail .product-card,
  .product-card.rail-card,
  .info-product-grid .product-card,
  #articleModalBody .info-product-grid .product-card {
    padding: 10px !important;
  }

  .catalog.catalog-market-grid .price-value,
  .catalog.grid .price-value,
  .horizontal-products .price-value,
  .product-rail .price-value,
  .product-card.rail-card .price-value,
  .info-product-grid .price-value,
  #articleModalBody .info-product-grid .price-value {
    font-size: clamp(17px, 5vw, 20px) !important;
  }
}


/* catalog_image_3x4_hotfix_patch:
   Точечная правка только каталога: фото в сетке каталога больше не квадратные,
   а такие же вертикальные 3/4, как на главной и в блоках акций/подборок. */
#catalog.catalog.catalog-market-grid,
#catalog.catalog.catalog-market-grid.aspect-1-1,
#catalog.catalog.catalog-market-grid.aspect-3-4 {
  --product-image-aspect: 3 / 4 !important;
  --stable-card-image-aspect: 3 / 4 !important;
  --uniform-product-image-ratio: 3 / 4 !important;
}

#catalog.catalog.catalog-market-grid .product-card,
#catalog.catalog.catalog-market-grid.aspect-1-1 .product-card,
#catalog.catalog.catalog-market-grid.aspect-3-4 .product-card {
  grid-template-rows: auto minmax(0, 1fr) !important;
  height: auto !important;
  min-height: var(--uniform-product-card-min, clamp(394px, 108vw, 430px)) !important;
  max-height: none !important;
  overflow: visible !important;
}

#catalog.catalog.catalog-market-grid .product-card > .product-image,
#catalog.catalog.catalog-market-grid .product-card > .product-image.image-shell,
#catalog.catalog.catalog-market-grid.aspect-1-1 .product-card > .product-image,
#catalog.catalog.catalog-market-grid.aspect-3-4 .product-card > .product-image {
  width: 100% !important;
  aspect-ratio: 3 / 4 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 0 0 auto !important;
  overflow: hidden !important;
  border-radius: 14px !important;
}

#catalog.catalog.catalog-market-grid .product-card > .product-image > img,
#catalog.catalog.catalog-market-grid .product-card > .product-image > video,
#catalog.catalog.catalog-market-grid .product-card > .product-image.image-shell > img,
#catalog.catalog.catalog-market-grid .product-card > .product-image.image-shell > video {
  width: 100% !important;
  height: 100% !important;
  object-fit: var(--product-image-fit, cover) !important;
  display: block !important;
}

/* cart_button_wb_next_patch:
   Карточки товаров теперь как WB: без +/- и количества на самой карточке,
   только компактная кнопка корзины. Количество меняется внутри корзины. */
.product-card .card-buy-row,
.catalog .product-card .card-buy-row,
.horizontal-products .product-card .card-buy-row,
.product-rail .product-card .card-buy-row,
.info-product-grid .product-card .card-buy-row,
#articleModalBody .info-product-grid .product-card .card-buy-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 42px !important;
  align-items: end !important;
  gap: 8px !important;
  width: 100% !important;
  margin-top: auto !important;
  min-height: 48px !important;
}

.product-card .card-buy-row .price-block,
.catalog .product-card .card-buy-row .price-block,
.horizontal-products .product-card .card-buy-row .price-block,
.product-rail .product-card .card-buy-row .price-block,
.info-product-grid .product-card .card-buy-row .price-block,
#articleModalBody .info-product-grid .product-card .card-buy-row .price-block {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
  align-self: end !important;
}

.product-card .card-buy-row .price,
.catalog .product-card .card-buy-row .price,
.horizontal-products .product-card .card-buy-row .price,
.product-rail .product-card .card-buy-row .price,
.info-product-grid .product-card .card-buy-row .price,
#articleModalBody .info-product-grid .product-card .card-buy-row .price {
  display: grid !important;
  gap: 2px !important;
  white-space: normal !important;
  overflow: visible !important;
  line-height: 1.06 !important;
}

.product-card .card-buy-row .price-value,
.catalog .product-card .card-buy-row .price-value,
.horizontal-products .product-card .card-buy-row .price-value,
.product-rail .product-card .card-buy-row .price-value,
.info-product-grid .product-card .card-buy-row .price-value,
#articleModalBody .info-product-grid .product-card .card-buy-row .price-value {
  display: block !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  font-size: clamp(17px, 4.5vw, 20px) !important;
  line-height: 1.08 !important;
}

.product-card .card-buy-row .price-unit,
.catalog .product-card .card-buy-row .price-unit,
.horizontal-products .product-card .card-buy-row .price-unit,
.product-rail .product-card .card-buy-row .price-unit,
.info-product-grid .product-card .card-buy-row .price-unit,
#articleModalBody .info-product-grid .product-card .card-buy-row .price-unit {
  display: block !important;
  margin-left: 0 !important;
  color: var(--muted, #6b7280) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

.product-card .card-buy-row .old-price,
.catalog .product-card .card-buy-row .old-price,
.horizontal-products .product-card .card-buy-row .old-price,
.product-rail .product-card .card-buy-row .old-price,
.info-product-grid .product-card .card-buy-row .old-price,
#articleModalBody .info-product-grid .product-card .card-buy-row .old-price {
  display: block !important;
  max-width: 100% !important;
  overflow: visible !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  line-height: 1.05 !important;
}

.card-cart-button,
.product-card .card-cart-button,
.catalog .product-card .card-cart-button,
.horizontal-products .product-card .card-cart-button,
.product-rail .product-card .card-cart-button,
.info-product-grid .product-card .card-cart-button,
#articleModalBody .info-product-grid .card-cart-button {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 15px !important;
  background: linear-gradient(135deg, #ffb000, #ff7a00) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(249, 115, 22, .34) !important;
  cursor: pointer !important;
  z-index: 14 !important;
  flex: 0 0 42px !important;
  align-self: end !important;
  -webkit-tap-highlight-color: transparent !important;
}

.card-cart-button .card-cart-icon,
.product-card .card-cart-button .card-cart-icon {
  display: block !important;
  font-size: 20px !important;
  line-height: 1 !important;
  transform: translateY(-1px) !important;
  filter: saturate(1.1) brightness(1.1) !important;
}

.card-cart-button .card-cart-count,
.product-card .card-cart-button .card-cart-count {
  position: absolute !important;
  top: -7px !important;
  right: -7px !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 5px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ef4444 !important;
  color: #fff !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  box-shadow: 0 4px 10px rgba(239, 68, 68, .35) !important;
}

.card-cart-button .card-cart-count[hidden],
.product-card .card-cart-button .card-cart-count[hidden] {
  display: none !important;
}

.product-card .qty-control,
.catalog .product-card .qty-control,
.horizontal-products .product-card .qty-control,
.product-rail .product-card .qty-control,
.info-product-grid .product-card .qty-control,
#articleModalBody .info-product-grid .qty-control {
  display: none !important;
}

#cartPanel .qty-control,
.cart-line .qty-control,
.rich-cart-line .qty-control {
  display: flex !important;
}

.detail-buybar .detail-qty {
  display: none !important;
}

.detail-buybar-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.detail-add-cart-button {
  position: relative !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  width: min(260px, 100%) !important;
  min-height: 58px !important;
  padding: 8px 18px !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, #ffb000, #ff7a00) !important;
  color: #fff !important;
  box-shadow: 0 14px 28px rgba(249, 115, 22, .35) !important;
  font-size: 18px !important;
  line-height: 1.05 !important;
  font-weight: 950 !important;
}

.detail-add-cart-button small {
  display: block !important;
  color: rgba(255, 255, 255, .92) !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
}

.detail-add-cart-button small[hidden] {
  display: none !important;
}

.detail-buybar {
  grid-template-columns: minmax(0, .9fr) minmax(160px, 1.15fr) !important;
  gap: 10px !important;
}

@media (max-width: 430px) {
  .product-card .card-buy-row,
  .catalog .product-card .card-buy-row,
  .horizontal-products .product-card .card-buy-row,
  .product-rail .product-card .card-buy-row,
  .info-product-grid .product-card .card-buy-row,
  #articleModalBody .info-product-grid .product-card .card-buy-row {
    grid-template-columns: minmax(0, 1fr) 40px !important;
    min-height: 46px !important;
    gap: 7px !important;
  }

  .card-cart-button,
  .product-card .card-cart-button,
  .catalog .product-card .card-cart-button,
  .horizontal-products .product-card .card-cart-button,
  .product-rail .product-card .card-cart-button,
  .info-product-grid .product-card .card-cart-button,
  #articleModalBody .info-product-grid .card-cart-button {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 14px !important;
  }

  .detail-buybar {
    grid-template-columns: minmax(0, .78fr) minmax(158px, 1.22fr) !important;
  }

  .detail-add-cart-button {
    min-height: 56px !important;
    border-radius: 17px !important;
    font-size: 17px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* catalog_cart_right_detail_space_hotfix_patch:
   1) В каталоге кнопка корзины всегда справа, цена слева.
   2) Каталожные карточки не разъезжаются и не показывают пустые белые блоки в Telegram WebView.
   3) В карточке товара убран лишний пустой низ под кнопкой «В корзину». */
#catalog.catalog.catalog-market-grid {
  align-items: stretch !important;
  grid-auto-rows: 1fr !important;
}

#catalog.catalog.catalog-market-grid .product-card {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  height: 100% !important;
  min-height: 394px !important;
  max-height: none !important;
  content-visibility: visible !important;
  contain-intrinsic-size: auto !important;
  contain: layout paint !important;
}

#catalog.catalog.catalog-market-grid .product-image,
#catalog.catalog.catalog-market-grid .product-card > .product-image.image-shell {
  aspect-ratio: 3 / 4 !important;
  height: auto !important;
  min-height: 0 !important;
}

#catalog.catalog.catalog-market-grid .product-info {
  display: grid !important;
  grid-template-rows: auto minmax(2.36em, auto) minmax(0, auto) 1fr auto !important;
  height: 100% !important;
  min-height: 0 !important;
  align-content: stretch !important;
}

#catalog.catalog.catalog-market-grid .product-title {
  min-height: 2.36em !important;
  max-height: 2.36em !important;
  overflow: hidden !important;
}

#catalog.catalog.catalog-market-grid .product-card-extra-meta,
#catalog.catalog.catalog-market-grid .product-description {
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
}

#catalog.catalog.catalog-market-grid .card-buy-row,
#catalog.catalog.catalog-market-grid .product-card .card-buy-row,
#catalog.catalog.catalog-market-grid .buy-row.card-buy-row {
  direction: ltr !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 42px !important;
  grid-template-areas: "price cart" !important;
  align-items: end !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 58px !important;
  margin-top: auto !important;
}

#catalog.catalog.catalog-market-grid .card-buy-row .price-block,
#catalog.catalog.catalog-market-grid .product-card .card-buy-row .price-block {
  grid-area: price !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: start !important;
  align-self: end !important;
  text-align: left !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

#catalog.catalog.catalog-market-grid .card-buy-row .price,
#catalog.catalog.catalog-market-grid .card-buy-row .price-value,
#catalog.catalog.catalog-market-grid .card-buy-row .price-unit,
#catalog.catalog.catalog-market-grid .card-buy-row .old-price {
  text-align: left !important;
}

#catalog.catalog.catalog-market-grid .card-cart-button,
#catalog.catalog.catalog-market-grid .product-card .card-cart-button {
  grid-area: cart !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: end !important;
  margin: 0 !important;
}

@media (max-width: 430px) {
  #catalog.catalog.catalog-market-grid .product-card {
    min-height: 388px !important;
  }

  #catalog.catalog.catalog-market-grid .card-buy-row,
  #catalog.catalog.catalog-market-grid .product-card .card-buy-row,
  #catalog.catalog.catalog-market-grid .buy-row.card-buy-row {
    grid-template-columns: minmax(0, 1fr) 40px !important;
    grid-template-areas: "price cart" !important;
    min-height: 56px !important;
  }
}

#productPanel .product-sheet,
#productPanel.panel-sheet,
#productPanel .panel-sheet {
  padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
}

#productPanel #productModalBody,
#productModalBody.product-modal-body {
  padding-bottom: 0 !important;
}

#productPanel .wb-product-detail,
#productPanel .product-detail.wb-product-detail {
  padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
  margin-bottom: 0 !important;
}

#productPanel .detail-buybar,
#productPanel .product-detail .detail-buybar {
  margin: 8px 0 0 !important;
  padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
}

@media (max-width: 720px) {
  #productPanel .wb-product-detail,
  #productPanel .product-detail.wb-product-detail {
    padding-bottom: calc(6px + env(safe-area-inset-bottom)) !important;
  }

  #productPanel .detail-buybar,
  #productPanel .product-detail .detail-buybar {
    margin: 8px 0 0 !important;
  }
}

/* browser_mini_frame_hotfix_patch:
   Браузерная версия /app/ теперь выглядит как Telegram Mini App:
   мобильная ширина по центру, 2 колонки карточек, нижнее меню в пределах mini app. */
@media (min-width: 900px) {
  :root {
    --browser-mini-frame-width: 430px;
    --browser-mini-frame-gap: 12px;
    --uniform-product-card-min: 430px;
  }

  html,
  body {
    overflow-x: hidden !important;
  }

  body:not(.admin-preview-mode) .app-shell {
    width: min(var(--browser-mini-frame-width), 100vw) !important;
    max-width: var(--browser-mini-frame-width) !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--browser-mini-frame-gap) !important;
    padding-right: var(--browser-mini-frame-gap) !important;
    padding-bottom: calc(116px + env(safe-area-inset-bottom)) !important;
    box-sizing: border-box !important;
  }

  body:not(.admin-preview-mode) .shop-header,
  body:not(.admin-preview-mode) .top-search,
  body:not(.admin-preview-mode) .promo-ticker,
  body:not(.admin-preview-mode) .banner-carousel,
  body:not(.admin-preview-mode) .catalog-tools,
  body:not(.admin-preview-mode) .category-strip,
  body:not(.admin-preview-mode) .home-showcase,
  body:not(.admin-preview-mode) .food-section,
  body:not(.admin-preview-mode) .articles-section,
  body:not(.admin-preview-mode) .store-reviews-section,
  body:not(.admin-preview-mode) .catalog-page-head,
  body:not(.admin-preview-mode) .cart-panel,
  body:not(.admin-preview-mode) .quick-tiles,
  body:not(.admin-preview-mode) .promo-blocks {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body:not(.admin-preview-mode) .catalog.grid,
  body:not(.admin-preview-mode) .catalog.catalog-market-grid,
  body:not(.admin-preview-mode) .catalog.catalog-page-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--card-gap, 12px) !important;
  }

  body:not(.admin-preview-mode) .catalog.catalog-page-list .product-card {
    grid-template-columns: 1fr !important;
  }

  body:not(.admin-preview-mode) .horizontal-products,
  body:not(.admin-preview-mode) .product-rail,
  body:not(.admin-preview-mode) .home-page .horizontal-products,
  body:not(.admin-preview-mode) .home-page .product-rail {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: calc((100% - var(--card-gap, 12px)) / 2) !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    align-items: stretch !important;
    scroll-snap-type: x proximity !important;
  }

  body:not(.admin-preview-mode) .horizontal-products .product-card,
  body:not(.admin-preview-mode) .product-rail .product-card,
  body:not(.admin-preview-mode) .product-card.rail-card {
    min-width: 0 !important;
    width: 100% !important;
    flex: none !important;
    scroll-snap-align: start !important;
  }

  body:not(.admin-preview-mode) .bottom-nav,
  body:not(.admin-preview-mode).nav-glass .bottom-nav,
  body:not(.admin-preview-mode).nav-flat .bottom-nav,
  body:not(.admin-preview-mode).theme-light .bottom-nav {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    width: min(calc(var(--browser-mini-frame-width) - 16px), calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    transform: translateX(-50%) !important;
    border-radius: 24px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    z-index: 70 !important;
  }

  body:not(.admin-preview-mode) .floating-cart {
    left: 50% !important;
    right: auto !important;
    width: min(calc(var(--browser-mini-frame-width) - 24px), calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    transform: translateX(-50%) !important;
    bottom: calc(84px + env(safe-area-inset-bottom)) !important;
  }

  body:not(.admin-preview-mode) .toast {
    left: 50% !important;
    width: min(calc(var(--browser-mini-frame-width) - 24px), calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    transform: translateX(-50%) translateY(18px) !important;
  }

  body:not(.admin-preview-mode) .toast.show {
    transform: translateX(-50%) translateY(0) !important;
  }

  body:not(.admin-preview-mode) .app-panel {
    align-items: end !important;
    justify-items: center !important;
  }

  body:not(.admin-preview-mode) .panel-sheet,
  body:not(.admin-preview-mode) #productPanel .panel-sheet,
  body:not(.admin-preview-mode) .product-sheet,
  body:not(.admin-preview-mode) #cartPanel .panel-sheet,
  body:not(.admin-preview-mode) #profilePanel .panel-sheet,
  body:not(.admin-preview-mode) #supportPanel .panel-sheet {
    width: min(var(--browser-mini-frame-width), 100vw) !important;
    max-width: var(--browser-mini-frame-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    border-radius: 28px 28px 0 0 !important;
    max-height: calc(100dvh - 46px) !important;
    padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  body:not(.admin-preview-mode) .app-drawer {
    left: max(0px, calc((100vw - var(--browser-mini-frame-width)) / 2)) !important;
    width: min(340px, calc(100vw - 24px)) !important;
    max-width: var(--browser-mini-frame-width) !important;
  }

  body:not(.admin-preview-mode).catalog-page.catalog-fixed-controls #catalogTools.wb-filter-bar,
  body:not(.admin-preview-mode).catalog-page.catalog-fixed-controls .catalog-tools.wb-filter-bar,
  body:not(.admin-preview-mode).catalog-page.catalog-fixed-controls #categories.category-strip,
  body:not(.admin-preview-mode).catalog-page.catalog-fixed-controls .category-strip {
    left: 50% !important;
    right: auto !important;
    width: min(calc(var(--browser-mini-frame-width) - 14px), calc(100vw - 14px)) !important;
    max-width: calc(100vw - 14px) !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:not(.admin-preview-mode) .banner-track,
  body:not(.admin-preview-mode) .promo-block,
  body:not(.admin-preview-mode) .quick-tile,
  body:not(.admin-preview-mode) .article-card {
    max-width: 100% !important;
  }
}


/* Header title empty-state hotfix: if admin title is cleared, do not show or reserve space for fallback text */
#shopTitle[hidden],
.shop-header.no-title #shopTitle {
  display: none !important;
}

#shopSubtitle[hidden],
#shopContacts[hidden] {
  display: none !important;
}
