@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-cyrillic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-ext.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-cyrillic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-latin-ext.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --color-bg: #f7f3ed;
  --color-surface: #fffcf8;
  --color-text: #292722;
  --color-text-secondary: #514d47;
  --color-accent: #b63d24;
  --color-accent-hover: #9a3320;
  --color-accent-ink: #fffaf6;
  --color-border: #e4ddd3;
  --color-success: #3d5345;
  --color-success-bg: #e7eee8;
  --color-danger: #8a3a32;
  --color-danger-bg: #f3e7e4;
  --color-order: #5c5340;
  --color-order-bg: #efe8da;
  --color-banner: #3f3428;
  --color-banner-bg: #efe6d8;
  --color-media: #efe8dc;
  --font-display: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-ui: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-body: 1.0625rem;
  --text-small: 0.9375rem;
  --text-button: 1.0625rem;
  --text-title: clamp(1.7rem, 5vw, 2.15rem);
  --text-card: 1.1875rem;
  --text-price: 1.375rem;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 48px;
  --page-pad-x: clamp(16px, 5.4vw, 24px);
  --maxw-home: 32rem;
  --maxw-catalog: 72rem;
  --duration: 160ms;
  --shadow-dialog: 0 18px 40px rgba(41, 39, 34, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  --tg-safe-top: 0px;
  --tg-viewport-height: 100vh;
  --tg-viewport-height: 100dvh;
}

html {
  margin: 0;
  background: var(--color-bg);
}

html:not(.js) .js-only {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

.page {
  width: min(100%, var(--maxw-home));
  margin: 0 auto;
  padding: max(var(--space-24), env(safe-area-inset-top, 0px), var(--tg-safe-top))
    max(var(--page-pad-x), env(safe-area-inset-right, 0px))
    max(var(--space-32), env(safe-area-inset-bottom, 0px))
    max(var(--page-pad-x), env(safe-area-inset-left, 0px));
}

.page-catalog {
  width: min(100%, var(--maxw-catalog));
}

.banner {
  margin: 0 0 var(--space-16);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-sm);
  background: var(--color-banner-bg);
  color: var(--color-banner);
  font-size: var(--text-small);
  font-weight: 500;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-8);
}

.logo {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-8);
}

.hero h1,
.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.lead {
  margin: 0;
  max-width: 36ch;
  color: var(--color-text);
  font-size: 1.1875rem;
  font-weight: 550;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.range {
  margin: var(--space-4) 0 0;
  color: var(--color-text);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.hero-cta {
  display: flex;
  justify-content: center;
  margin: var(--space-24) 0 0;
}

.hero-cta .btn {
  width: auto;
  min-width: 16rem;
  padding-left: var(--space-24);
  padding-right: var(--space-24);
}

.fulfillment {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-20) 0 0;
  color: var(--color-text);
  font-size: var(--text-body);
  font-weight: 550;
  text-align: center;
  line-height: 1.45;
}

.fulfillment span {
  display: block;
}

.home-contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8) var(--space-12);
  margin-top: var(--space-20);
  font-size: var(--text-body);
  font-weight: 550;
  color: var(--color-text);
}

.home-contacts a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.home-contacts a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.preview {
  display: grid;
  gap: var(--space-12);
  margin-top: var(--space-32);
  align-items: stretch;
}

.preview-item {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-16);
  min-height: 5.5rem;
  padding: var(--space-8);
  padding-right: var(--space-16);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color var(--duration) ease, background-color var(--duration) ease;
}

.preview-item:hover {
  border-color: #d4ccc0;
}

.preview-item:active {
  background: #f8f3ec;
}

.preview-media {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-media);
}

.preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-media.media-contain img {
  object-fit: contain;
  padding: 4px;
  background: var(--color-surface);
}

.preview-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.preview-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.25;
}

.preview-price {
  color: var(--color-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  text-align: center;
  font-family: var(--font-ui);
  font-size: var(--text-button);
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: break-word;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--duration) ease, border-color var(--duration) ease, color var(--duration) ease;
}

.btn-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: currentColor;
}

.icon-svg {
  width: 22px;
  height: 22px;
  display: block;
}

.btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-ink);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-primary:active {
  background: #872c1b;
  border-color: #872c1b;
}

.btn:focus-visible,
.chip:focus-visible,
.back:focus-visible,
.contact-link:focus-visible,
.home-contacts a:focus-visible,
.preview-item:focus-visible,
.icon-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-primary:focus-visible {
  outline-color: var(--color-text);
}

.btn:disabled,
.chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-header {
  display: grid;
  gap: var(--space-8);
  margin-bottom: var(--space-20);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  min-height: 44px;
  margin-left: calc(var(--space-8) * -1);
  padding: 0 var(--space-8);
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: var(--text-small);
  text-decoration: none;
  border-radius: 8px;
}

.back .btn-icon {
  width: 18px;
  height: 18px;
}

.back .icon-svg {
  width: 18px;
  height: 18px;
}

.back:hover {
  color: var(--color-text);
  background: rgba(41, 39, 34, 0.05);
}

.updated,
.empty {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
}

.filters {
  display: flex;
  gap: var(--space-8);
  margin: 0 calc(var(--page-pad-x) * -1) var(--space-20);
  padding: 2px var(--page-pad-x);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-16);
  border: 1px solid #d8d0c4;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 650;
  font-size: var(--text-small);
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--duration) ease, border-color var(--duration) ease, color var(--duration) ease;
}

.chip:hover {
  border-color: #c4bbb0;
  background: #faf6f0;
}

.chip:active {
  background: #f3eee6;
}

.chip.is-active {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-surface);
}

.chip.is-active:hover {
  background: #1f1d1a;
  border-color: #1f1d1a;
  color: var(--color-surface);
}

.chip-variant {
  min-height: 44px;
  padding: 0 var(--space-12);
  font-weight: 650;
}

.chip-variant.is-active {
  background: #f4e8e3;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.empty-state {
  display: grid;
  gap: var(--space-16);
  padding: var(--space-32) var(--space-16);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.empty-state[hidden],
.card[hidden] {
  display: none;
}

.grid {
  display: grid;
  gap: var(--space-20);
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card:hover {
  border-color: #d8d0c4;
}

.media {
  aspect-ratio: 4 / 3;
  width: 100%;
  flex: 0 0 auto;
  background: var(--color-media);
  overflow: hidden;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.media-contain {
  background: var(--color-surface);
}

.media-contain img {
  object-fit: contain;
  padding: var(--space-8);
}

.media-empty {
  display: grid;
  place-items: center;
  color: var(--color-text-secondary);
  padding: var(--space-24);
  text-align: center;
  font-size: var(--text-small);
  font-weight: 500;
}

.body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--space-16) var(--space-16) var(--space-20);
  gap: var(--space-8);
}

.card-title-slot {
  min-height: calc(var(--text-card) * 1.3 * 2);
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-card);
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.card-desc-slot {
  min-height: calc(var(--text-small) * 1.45 * 2);
}

.desc {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.variant-slot {
  display: flex;
  align-items: center;
  min-height: var(--tap);
}

.variant-slot > noscript {
  display: none;
}

html:not(.js) .variant-slot > noscript {
  display: contents;
}

.meta,
.variant-fallback {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
  overflow-wrap: break-word;
}

.variant-fallback {
  padding-left: 1.15rem;
}

.variant-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8);
  width: 100%;
}

.price {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-price);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.unit {
  margin-left: var(--space-8);
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
}

.stock {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  width: max-content;
  margin: 0;
  font-size: var(--text-small);
  font-weight: 550;
  color: var(--color-success);
}

.stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.stock-out {
  color: var(--color-danger);
}

.stock-order {
  color: var(--color-order);
}

.btn-order {
  width: 100%;
  flex: 0 0 auto;
}

/* --- Управление корзиной на карточке ----------------------------------- */

.card-actions {
  display: grid;
  gap: var(--space-8);
  margin-top: auto;
}

.cart-control {
  display: grid;
  gap: var(--space-8);
  justify-items: start;
}

.cart-control .btn-cart-add {
  width: 100%;
}

.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  overflow: hidden;
}

.qty-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 1.375rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--duration) ease;
}

.qty-btn:hover {
  background: #f3eee6;
}

.qty-btn:active {
  background: #ece5d9;
}

.qty-value {
  display: grid;
  place-items: center;
  min-width: 2.5ch;
  padding: 0 var(--space-4);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.qty-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -4px;
}

.contact-actions {
  display: grid;
  gap: var(--space-4);
}

.contact-actions-stack {
  gap: var(--space-8);
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-8);
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-12);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-small);
  overflow-wrap: break-word;
  touch-action: manipulation;
  transition: background-color var(--duration) ease, border-color var(--duration) ease;
}

.contact-link:hover {
  background: #f6f1ea;
  border-color: #d4ccc0;
}

.contact-link:active {
  background: #efe8df;
}

.contact-link .icon-svg {
  width: 18px;
  height: 18px;
}

.contact-bar {
  display: none;
}

.order-dialog {
  width: min(calc(100% - 32px), 26rem);
  max-height: min(88vh, 40rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: inherit;
  box-shadow: var(--shadow-dialog);
}

.order-dialog::backdrop {
  background: rgba(41, 39, 34, 0.4);
}

.order-sheet {
  display: grid;
  gap: var(--space-16);
  padding: var(--space-20);
  padding-bottom: max(var(--space-20), env(safe-area-inset-bottom, 0px));
}

.order-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-12);
}

.order-sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -8px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.icon-button:hover {
  background: rgba(41, 39, 34, 0.06);
}

.order-product {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.order-meta {
  margin: -8px 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 767px) {
  .hero-cta .btn {
    width: 100%;
    min-width: 0;
  }

  .page-catalog {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
  }

  html.js .contact-bar.js-only,
  .contact-bar.contact-bar-static {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 12px var(--page-pad-x) max(12px, env(safe-area-inset-bottom, 0px));
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
  }

  .order-dialog {
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }
}

@media (min-width: 720px) {
  .preview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-12);
  }

  .preview-item {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
  }

  .preview-media {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 0;
  }

  .preview-copy {
    padding: var(--space-12) var(--space-16) var(--space-16);
  }
}

@media (min-width: 768px) {
  .page-catalog {
    --maxw-catalog: 46rem;
  }

  .filters {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    flex-wrap: wrap;
    overflow: visible;
    gap: var(--space-8);
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

@media (min-width: 1100px) {
  .page-catalog {
    --maxw-catalog: 68rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Корзина: нижняя панель --------------------------------------------- */

.cart-bar {
  display: none;
}

html.js .cart-bar.js-only {
  display: block;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px var(--page-pad-x) max(12px, env(safe-area-inset-bottom, 0px));
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.btn-cart-bar {
  gap: var(--space-8);
  justify-content: space-between;
}

.cart-bar-title {
  flex: 0 0 auto;
}

.cart-bar-meta {
  min-width: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.92;
}

@media (min-width: 768px) {
  html.js .cart-bar.js-only {
    left: 50%;
    right: auto;
    bottom: 24px;
    transform: translateX(-50%);
    width: min(26rem, calc(100% - 48px));
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dialog);
  }

  .page-catalog {
    padding-bottom: 7.5rem;
  }
}

/* --- Корзина: экран (диалог) --------------------------------------------- */

.cart-dialog {
  width: min(calc(100% - 32px), 30rem);
  max-height: min(calc(var(--tg-viewport-height) * 0.9), 42rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: inherit;
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}

.cart-dialog::backdrop,
.order-dialog::backdrop {
  background: rgba(41, 39, 34, 0.4);
}

.cart-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding: var(--space-20);
  padding-bottom: max(var(--space-20), env(safe-area-inset-bottom, 0px));
  max-height: min(calc(var(--tg-viewport-height) * 0.9), 42rem);
}

.cart-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-12);
  flex: 0 0 auto;
}

.cart-sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.cart-notice {
  flex: 0 0 auto;
  margin: 0;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-sm);
  background: var(--color-order-bg);
  color: var(--color-order);
  font-size: var(--text-small);
  font-weight: 500;
}

.cart-empty {
  flex: 0 0 auto;
  display: grid;
  gap: var(--space-16);
  padding: var(--space-24) var(--space-16);
}

.cart-items {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: var(--space-12);
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-item {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  grid-template-areas:
    "media info remove"
    "media side side";
  align-items: center;
  gap: var(--space-8) var(--space-12);
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.cart-media {
  grid-area: media;
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-media);
}

.cart-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  grid-area: info;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cart-item-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.cart-item-meta {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
  overflow-wrap: break-word;
}

.cart-item-price {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.cart-item-side {
  grid-area: side;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  width: 100%;
}

.cart-item-total {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cart-remove {
  grid-area: remove;
  width: 36px;
  height: 36px;
  margin: 0;
  color: var(--color-text-secondary);
}

.cart-footer {
  flex: 0 0 auto;
  display: grid;
  gap: var(--space-12);
  padding-top: var(--space-16);
  border-top: 1px solid var(--color-border);
}

.cart-totals {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-12);
}

.cart-count {
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
}

.cart-total {
  font-family: var(--font-ui);
  font-size: var(--text-price);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.cart-hint {
  margin: calc(var(--space-8) * -1) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.45;
}

.cart-hint-warn {
  color: var(--color-danger);
}

@media (min-width: 768px) {
  .cart-item {
    grid-template-columns: 4rem minmax(0, 1fr) auto auto;
    grid-template-areas: "media info side remove";
  }

  .cart-media {
    width: 4rem;
    height: 4rem;
  }

  .cart-remove {
    align-self: start;
  }
}

/* --- Telegram Mini App: тема и системные области -------------------------- */

html[data-tg-theme="dark"] {
  color-scheme: dark;
}

html[data-tg-theme="dark"] .cart-dialog::backdrop,
html[data-tg-theme="dark"] .order-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

html[data-tg-theme="dark"] .cart-dialog,
html[data-tg-theme="dark"] .order-dialog {
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-tg-theme="dark"] .qty-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-tg-theme="dark"] .qty-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

/* Нативная кнопка Telegram перекрывает нижний край: не дублируем CTA. */
html.tg-mainbutton .cart-dialog [data-checkout] {
  display: none;
}

html.tg-mainbutton .cart-dialog .cart-footer {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

[data-checkout-max]{width:100%;margin-top:10px}
[data-order-fallback]{margin-top:16px}
[data-order-fallback] label{display:block;font-size:14px}
[data-order-text]{display:block;width:100%;padding:12px;margin:8px 0 12px;font:inherit;font-size:14px;border:1px solid #c6ccbd;border-radius:8px;resize:vertical}

/* Start screen: brand, phone, destinations. Products live in /catalog. */
.page-start { padding-top: max(24px, env(safe-area-inset-top, 0px)); }
.page-start .hero { gap: 10px; }
.page-start .lead { font-size: 1rem; color: var(--color-text-secondary); font-weight: 450; }
.start-phone { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin: 14px auto 0; color: var(--color-text); text-decoration: none; font-size: 1.1875rem; font-weight: 600; width: fit-content; }
.start-phone:hover { color: var(--color-accent); }
.start-manager { display: flex; width: fit-content; min-height: 48px; margin: 8px auto 0; padding: 12px 18px; }
.start-actions { display: grid; gap: 16px; margin-top: 20px; }
.start-socials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.start-socials .start-social { min-width: 0; padding: 14px 8px; min-height: 52px; font-size: 1rem; }
.start-social[aria-disabled="true"] { color: var(--color-text-secondary); background: var(--color-bg); border-style: dashed; cursor: default; }
.start-catalog { width: 100%; display: flex; justify-content: space-between; min-height: 56px; padding: 16px 20px; }
.start-fulfillment { margin-top: 24px; color: var(--color-text-secondary); font-size: .9375rem; font-weight: 400; }
.start-phone:focus-visible, .start-manager:focus-visible, .start-social:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 4px; border-radius: 8px; }

/* Display the supplied 1280×1246 brand image through its content bounds.
   The original file stays intact; only the surrounding white space is clipped. */
.logo-zoom { display: block; position: relative; overflow: hidden; width: 148px; aspect-ratio: 420 / 660; flex-shrink: 0; background: #fff; }
.logo-zoom .logo { position: absolute; width: 304.761905%; max-width: none; height: auto; left: -102.380952%; top: -35.151515%; border: 0; border-radius: 0; padding: 0; background: #fff; }

.logo-transparent { display: block; position: relative; overflow: hidden; width: 160px; aspect-ratio: 790 / 1140; flex-shrink: 0; background: transparent; }
.logo-transparent .logo { position: absolute; width: 157.341772%; max-width: none; height: auto; left: -28.481013%; top: -3.947368%; border: 0; border-radius: 0; padding: 0; background: transparent; }
