@import url("../miniapp-prototype/theme.css");

@font-face {
  font-family: "Amatic SC";
  src: url("../../fonts/AmaticSC-Bold.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

/*
 * Независимая рабочая тема для staging.
 *
 * Добавляйте новые правила ниже. Production продолжает использовать
 * miniapp-prototype, пока MINIAPP_THEME не будет переключена явно.
 */

:root {
  /*
   * Интерфейс магазина всегда светлый. `only light` запрещает Android WebView
   * автоматически инвертировать страницу вслед за тёмной темой устройства.
   */
  color-scheme: only light;
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-text: #1d2521;
  --color-text-muted: #707873;
  --color-primary: #2e4439;
  --color-primary-pressed: #24372e;
  --color-primary-soft: #edf4f0;
  --color-border: #e5eae7;
  --color-button: #eee9ff;
  --color-button-selected: #e1d8fa;
  --color-button-pressed: #d4c7f4;
  --color-button-text: #51447a;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-card: none;
  /*
   * Некоторые Android WebView возвращают нижний safe-area повторно, хотя
   * системная панель уже исключена из viewport. Ограничение защищает навигацию
   * от большого пустого блока, а на iPhone сохраняет место под home indicator.
   */
  --app-safe-area-bottom: clamp(
    0px,
    env(safe-area-inset-bottom, 0px),
    34px
  );
}

html,
body {
  background: var(--color-bg);
}

html,
body,
#root {
  min-height: 100%;
}

body {
  color: var(--color-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

html[data-platform-os="android"] {
  --app-safe-area-bottom: 0px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(76px + var(--app-safe-area-bottom));
}

button {
  -webkit-tap-highlight-color: transparent;
}

.header {
  padding: 24px 16px 14px;
}

.store-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.store-logo {
  display: block;
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  object-fit: contain;
}

.store-brand-copy {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
}

.header h1 {
  margin: 0 0 12px;
  color: var(--color-text);
  font-family: "Amatic SC", "Arial Narrow", sans-serif;
  font-size: 3.45rem;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.header .store-location {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 3px 5px 3px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 550;
  line-height: 1.3;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.header .store-location:active {
  background: #f1f1f2;
  color: var(--color-text);
}

.header .store-location:focus-visible {
  outline: 3px solid #d9cff4;
  outline-offset: 2px;
}

.store-location svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.store-location .store-location-chevron {
  width: 12px;
  height: 12px;
  margin-left: 1px;
}

.store-picker {
  position: relative;
}

.store-picker-popover {
  position: absolute;
  z-index: 100;
  top: calc(100% + 8px);
  left: 50%;
  display: grid;
  width: min(276px, calc(100vw - 28px));
  padding: 7px;
  gap: 3px;
  border: 1px solid #e9e6ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(30, 27, 38, 0.13);
  transform: translateX(-50%);
  animation: store-popover-in 0.14s ease-out;
}

.store-picker-popover::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-top: 1px solid #e9e6ef;
  border-left: 1px solid #e9e6ef;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}

.store-picker-popover .pickup-store {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
}

.store-picker-popover .pickup-store + .pickup-store {
  border-top: 1px solid #efedf2;
  border-radius: 0 0 11px 11px;
}

.store-picker-popover .pickup-store-marker {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 10px;
  background: var(--color-button);
  color: var(--color-button-text);
}

.store-picker-popover .pickup-store-marker svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.store-picker-popover .pickup-store h3 {
  margin: 0 0 4px;
  color: var(--color-text);
  font-size: 0.82rem;
}

.store-picker-popover .pickup-store p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.73rem;
  line-height: 1.35;
}

@keyframes store-popover-in {
  from {
    opacity: 0;
    transform: translate(-50%, -4px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.test-mode-notice {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #eceeec;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: #7a807c;
  font-size: 0.75rem;
}

.test-mode-notice strong {
  color: #5f6561;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content {
  padding-bottom: 20px;
}

/* Верхний уровень каталога: самостоятельные категории без служебного «Все». */
.catalog-navigation {
  display: flex;
  gap: 7px;
  padding: 8px 16px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.catalog-navigation::-webkit-scrollbar,
.catalog-product-rail::-webkit-scrollbar {
  display: none;
}

.catalog-navigation-item {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.catalog-navigation-item.active {
  border-color: transparent;
  background: var(--color-button);
  color: var(--color-button-text);
}

.catalog-navigation-item:active {
  transform: scale(0.97);
}

.catalog-navigation-item:focus-visible,
.btn-add:focus-visible,
.btn-qty:focus-visible,
.fallback-main-button:focus-visible {
  outline: 3px solid #d9cff4;
  outline-offset: 2px;
}

/* Подкатегории идут вертикально, товары внутри — горизонтальным свайпом. */
.catalog-view {
  transition: opacity 0.15s ease;
}

.catalog-view.loading {
  opacity: 0.48;
  pointer-events: none;
}

.catalog-section {
  padding: 3px 0 22px;
}

.catalog-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 10px;
}

.catalog-section-heading h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.catalog-section-heading span {
  color: #9aa09c;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.catalog-product-rail {
  display: grid;
  /*
   * Три карточки читаются целиком, край четвёртой остаётся видимым и без
   * текстовой инструкции подсказывает горизонтальный свайп.
   */
  grid-auto-columns: calc((100% - 18px) / 3.18);
  grid-auto-flow: column;
  gap: 8px;
  padding: 0 34px 5px 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-padding-inline: 16px;
  scroll-snap-type: x proximity;
  touch-action: pan-x pan-y;
}

.catalog-product-card,
.catalog-placeholder {
  min-width: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scroll-snap-align: start;
}

.catalog-product-card img,
.catalog-placeholder-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 15px;
  background: #eef1ef;
  object-fit: cover;
}

.catalog-product-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.catalog-product-open:focus-visible {
  outline: 3px solid #d9cff4;
  outline-offset: 3px;
}

.catalog-product-info {
  display: block;
  padding: 7px 1px 0;
}

.catalog-product-name {
  display: -webkit-box;
  min-height: 2.5em;
  margin: 0 0 4px;
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.68rem;
  font-weight: 450;
  line-height: 1.25;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-product-price {
  display: block;
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.catalog-product-actions {
  width: 100%;
}

.catalog-product-card .btn-add,
.catalog-product-card .qty-control {
  min-height: 34px;
  margin-top: 7px;
}

.catalog-product-card .btn-add {
  padding: 7px 4px;
  font-size: 0.65rem;
}

.catalog-product-card .btn-qty {
  width: 30px;
  height: 32px;
}

.catalog-placeholder-image {
  display: grid;
  place-items: center;
  border: 1px dashed #dfe3e0;
  background:
    linear-gradient(145deg, #fafbfa, #f4f6f5);
}

.catalog-placeholder-image svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #c4cac6;
  stroke-linecap: round;
  stroke-width: 1.3;
}

.catalog-placeholder > p {
  margin: 7px 1px 0;
  color: #a0a6a2;
  font-size: 0.66rem;
  line-height: 1.25;
}

.catalog-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 10px;
  padding: 0 16px 8px;
}

.catalog-product-grid .catalog-product-card,
.catalog-product-grid .catalog-placeholder {
  scroll-snap-align: none;
}

.catalog-product-grid .catalog-product-card img,
.catalog-product-grid .catalog-placeholder-image {
  border-radius: var(--radius-lg);
}

.catalog-product-grid .catalog-product-info {
  padding-top: 9px;
}

.catalog-product-grid .catalog-product-name {
  min-height: 2.45em;
  margin-bottom: 5px;
  font-size: 0.82rem;
  font-weight: 450;
  line-height: 1.24;
}

.catalog-product-grid .catalog-product-price {
  font-size: 0.96rem;
  font-weight: 750;
}

.catalog-product-grid .catalog-product-card .btn-add,
.catalog-product-grid .catalog-product-card .qty-control {
  min-height: 38px;
  margin-top: 9px;
}

.catalog-product-grid .catalog-product-card .btn-add {
  padding: 8px 10px;
  font-size: 0.76rem;
}

.catalog-product-grid .catalog-product-card .btn-qty {
  width: 38px;
  height: 36px;
}

.catalog-product-grid .catalog-placeholder > p {
  font-size: 0.72rem;
}

.catalog-empty {
  width: calc(100vw - 32px);
  margin: 0;
  padding: 24px 18px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.btn-add {
  min-height: 38px;
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--color-button);
  color: var(--color-button-text);
  font-size: 0.76rem;
  font-weight: 650;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.btn-add:active {
  background: var(--color-button-pressed);
  transform: scale(0.97);
}

.qty-control {
  min-height: 38px;
  margin-top: 9px;
  border: 1px solid #d7ccf3;
  border-radius: 12px;
  background: var(--color-button-selected);
}

.btn-qty {
  width: 38px;
  height: 36px;
  color: var(--color-button-text);
  font-size: 1.15rem;
  border-radius: 11px;
  transition:
    background 0.12s ease,
    transform 0.12s ease;
}

.btn-qty:active {
  background: var(--color-button-pressed);
  transform: scale(0.92);
}

.qty-num {
  color: var(--color-text);
  font-size: 0.82rem;
}

/* Остальные экраны получают ту же спокойную систему поверхностей. */
.cart-item,
.checkout-summary,
.qr-wrapper,
.card,
.store-card {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: none;
}

.cart-item,
.card {
  border-radius: var(--radius-lg);
}

.cart-item-subtotal,
.checkout-summary strong,
.qr-amount,
.info-page h3 {
  color: var(--color-primary);
}

.form-group input {
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.form-group input:focus {
  border-color: #87a493;
  box-shadow: 0 0 0 3px #e6f0ea;
}

.checkout-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 12px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.checkout-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--color-button-text);
}

.checkout-consent a {
  color: var(--color-button-text);
}

.checkout-section-title {
  margin: 4px 0 12px;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.checkout-recipient-toggle {
  margin: 2px 0 18px;
  color: var(--color-text);
}

.pay-tab.active {
  border-color: #d7cef1;
  background: var(--color-button);
  color: var(--color-button-text);
}

.fallback-main-button,
.btn-submit {
  border-radius: var(--radius-md);
  background: var(--color-button);
  color: var(--color-button-text);
  box-shadow: none;
}

.fallback-main-button:active,
.btn-submit:active {
  background: var(--color-button-pressed);
}

.fallback-main-button {
  bottom: calc(76px + var(--app-safe-area-bottom));
}

.app-bottom-nav {
  position: fixed;
  z-index: 900;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  width: min(100%, var(--page-width));
  margin: 0 auto;
  padding: 6px 12px calc(6px + var(--app-safe-area-bottom));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(225, 229, 226, 0.9);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -8px 26px rgba(34, 42, 37, 0.06);
  backdrop-filter: blur(16px);
}

.app-bottom-nav-item {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #858d88;
  cursor: pointer;
  flex-direction: column;
  font-size: 0.67rem;
  font-weight: 600;
  gap: 2px;
  line-height: 1.1;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.app-bottom-nav-item:active {
  transform: scale(0.96);
}

.app-bottom-nav-item:focus-visible {
  outline: 3px solid #d9cff4;
  outline-offset: -2px;
}

.app-bottom-nav-icon {
  position: relative;
  display: grid;
  width: 42px;
  height: 28px;
  place-items: center;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.app-bottom-nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.app-bottom-nav-item.active {
  color: var(--color-button-text);
}

.app-bottom-nav-item.active .app-bottom-nav-icon {
  background: var(--color-button);
}

.app-bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 9px;
  background: #6b5a98;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 750;
  line-height: 1;
}

.product-modal-backdrop {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 44px;
  background: rgba(20, 24, 22, 0.48);
  animation: product-backdrop-in 0.18s ease-out;
}

.product-modal {
  position: relative;
  display: flex;
  width: min(100%, 560px);
  max-height: min(88dvh, 780px);
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: #ffffff;
  box-shadow: 0 -12px 44px rgba(18, 25, 21, 0.2);
  color: var(--color-text);
  flex-direction: column;
  animation: product-modal-in 0.2s ease-out;
}

.product-modal-handle {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 50%;
  width: 38px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 3px rgba(31, 35, 33, 0.18);
  transform: translateX(-50%);
}

.product-modal-close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(225, 229, 226, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 16px rgba(30, 35, 32, 0.12);
  color: var(--color-text);
  cursor: pointer;
  font-size: 1.55rem;
  font-weight: 300;
  line-height: 1;
}

.product-modal-close:focus-visible,
.product-modal-thumbnails button:focus-visible {
  outline: 3px solid #d9cff4;
  outline-offset: 2px;
}

.product-modal-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.product-modal-image {
  display: block;
  width: 100%;
  max-height: 46dvh;
  aspect-ratio: 1 / 1;
  background: #eef1ef;
  object-fit: cover;
}

.product-modal-thumbnails {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.product-modal-thumbnails::-webkit-scrollbar {
  display: none;
}

.product-modal-thumbnails button {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  padding: 2px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
}

.product-modal-thumbnails button.active {
  border-color: #8b78bd;
}

.product-modal-thumbnails img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.product-modal-body {
  padding: 16px 16px 20px;
}

.product-modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.product-modal-heading h2 {
  margin: 0 0 8px;
  color: var(--color-text);
  font-size: 1.18rem;
  line-height: 1.25;
}

.product-modal-heading > strong {
  flex: 0 0 auto;
  color: var(--color-text);
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.product-availability {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: #edf4f0;
  color: #426051;
  font-size: 0.7rem;
  font-weight: 650;
}

.product-availability.out_of_stock {
  background: #f2f3f2;
  color: #777e7a;
}

.product-availability.limited {
  background: #fff4ce;
  color: #6b5714;
}

.product-description,
.product-modal-loading,
.product-modal-error {
  margin: 15px 0 0;
  color: var(--color-text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.product-modal-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff4e5;
  color: #765525;
}

.product-facts {
  display: grid;
  margin-top: 16px;
  gap: 7px;
}

.product-facts span {
  position: relative;
  padding-left: 18px;
  color: #5e6762;
  font-size: 0.76rem;
  line-height: 1.4;
}

.product-facts span::before {
  position: absolute;
  top: 0.45em;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aa98d8;
  content: "";
}

.product-composition {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.product-composition h3 {
  margin: 0 0 9px;
  color: var(--color-text);
  font-size: 0.9rem;
}

.product-composition p,
.product-composition ul {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.product-composition ul {
  padding-left: 18px;
}

.product-composition li + li {
  margin-top: 4px;
}

.product-modal-action {
  flex: 0 0 auto;
  padding: 10px 16px calc(10px + var(--app-safe-area-bottom));
  border-top: 1px solid var(--color-border);
  background: #ffffff;
}

.product-modal-action .btn-add,
.product-modal-action .qty-control {
  min-height: 46px;
  margin: 0;
}

.product-modal-action .btn-add:disabled {
  background: #f0f1f0;
  color: #8b918d;
  cursor: default;
  transform: none;
}

@keyframes product-backdrop-in {
  from {
    opacity: 0;
  }
}

@keyframes product-modal-in {
  from {
    transform: translateY(24px);
  }
}

@media (min-width: 600px) {
  .product-modal-backdrop {
    align-items: center;
    padding: 24px;
  }

  .product-modal {
    border-radius: 24px;
  }
}

.profile-page {
  position: relative;
  display: flex;
  min-height: 300px;
  align-items: center;
  padding: 44px 24px 56px;
  color: var(--color-text-muted);
  flex-direction: column;
  text-align: center;
}

.profile-page-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 22px;
  background: var(--color-button);
  color: var(--color-button-text);
}

.profile-page-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.profile-page h2 {
  margin: 0 0 8px;
  color: var(--color-text);
  font-size: 1.15rem;
}

.profile-page p {
  max-width: 310px;
  margin: 0 0 14px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.profile-page > span {
  padding: 6px 10px;
  border-radius: 10px;
  background: #f3f5f4;
  color: #7c847f;
  font-size: 0.7rem;
  font-weight: 600;
}

.info-page .business-details {
  max-width: 560px;
  padding: 0;
}

.info-document-content h2 {
  margin: 24px 0 8px;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
}

.info-document-content a,
.info-document-error a {
  color: var(--color-button-text);
}

.info-document-content strong {
  color: var(--color-text);
}

.info-document-status {
  color: var(--color-text-muted);
}

.info-document-error {
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.info-document-error p {
  margin-bottom: 6px;
}

.info-page .business-name {
  margin: 0 0 12px;
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.45;
}

.info-page .business-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 7px 0 0;
  padding: 0;
  line-height: 1.4;
}

.info-page .business-label {
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 400;
}

.info-page .business-value {
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 400;
}

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

.info-page .store-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.info-page .store-photo-placeholder {
  position: relative;
  display: grid;
  min-height: 130px;
  place-items: center;
  background: linear-gradient(145deg, #f2f5f3, #f7f4ff);
  color: var(--color-text-muted);
  font-size: 0.74rem;
}

.info-page .store-photo-placeholder::before {
  position: absolute;
  margin-top: -25px;
  content: "✿";
  font-size: 1.25rem;
  opacity: 0.55;
}

.info-page .store-photo-placeholder span {
  padding-top: 24px;
}

.info-page .store-card-body {
  padding: 12px;
}

.info-page .store-card-body h3 {
  margin: 0;
  font-size: 0.84rem;
}

.info-page .store-card-body p {
  margin: 5px 0 0;
  color: var(--color-text-muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.field-todo {
  display: inline-block;
  min-width: 28px;
  padding: 1px 9px 2px;
  border-radius: 5px;
  background: #ffef91;
  color: #594900;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.mini-footer {
  border-top: 1px solid var(--color-border);
  background: #f8f8f9;
}

.mini-footer a,
.mini-footer button {
  color: #7a827d;
}

.mini-footer a:hover,
.mini-footer a:active,
.mini-footer button:hover,
.mini-footer button:active,
.mini-footer button[aria-current="page"] {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

@media (max-width: 360px) {
  .store-brand {
    gap: 8px;
  }

  .store-logo {
    width: 96px;
    height: 96px;
    flex-basis: 96px;
  }

  .header h1 {
    margin-bottom: 10px;
    font-size: 3rem;
  }

  .header .store-location {
    font-size: 0.78rem;
  }

  .catalog-product-rail,
  .catalog-product-grid,
  .catalog-section-heading {
    padding-right: 12px;
    padding-left: 12px;
  }

  .catalog-navigation {
    padding-right: 12px;
    padding-left: 12px;
  }

  .catalog-product-rail {
    grid-auto-columns: calc((100% - 18px) / 3.18);
    padding-right: 30px;
    scroll-padding-inline: 12px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .catalog-navigation-item,
  .btn-add {
    transition: none;
  }

  .store-picker-popover {
    animation: none;
  }

  .product-modal-backdrop,
  .product-modal {
    animation: none;
  }
}

.profile-page .profile-admin-link {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid #e2e7e4;
  border-radius: 5px;
  background: #f8f9f8;
  color: #8a918d;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
}

/* Служебная панель магазина: отдельный интерфейс по адресу /admin. */
.admin-shell,
.admin-login {
  min-height: 100vh;
  min-height: 100dvh;
  background: #f4f6f5;
}

.admin-login {
  position: relative;
  display: grid;
  padding: 24px;
  place-items: center;
}

.admin-login-back {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 9px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #fff;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.admin-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 8px 28px rgb(29 37 33 / 6%);
}

.admin-login-card {
  display: grid;
  width: min(100%, 390px);
  gap: 18px;
  padding: 30px;
}

.admin-kicker {
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-login h1,
.admin-topbar h1,
.admin-section-heading h2 {
  margin: 0;
}

.admin-login label,
.admin-form label,
.admin-inline-form label,
.admin-order label {
  display: grid;
  gap: 7px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-login input,
.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-inline-form input,
.admin-inline-form select,
.admin-order select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #ccd5d0;
  border-radius: 10px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
}

.admin-form textarea {
  min-height: 100px;
  resize: vertical;
}

.admin-primary,
.admin-actions button,
.admin-section-heading button,
.admin-account button,
.admin-inline-form button {
  min-height: 40px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

button.admin-primary {
  background: var(--color-primary);
  color: #fff;
}

button.admin-danger {
  background: #fff0f0;
  color: #a33232;
}

.admin-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff0f0;
  color: #a33232;
  font-size: 0.8rem;
}

.admin-max-identity {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.8rem;
}

.admin-max-identity span {
  color: var(--color-text-muted);
  font-size: 0.74rem;
}

.admin-max-identity .admin-copy-id {
  width: fit-content;
  margin-top: 5px;
  padding: 5px 8px;
  border: 1px solid #ccd9d2;
  border-radius: 6px;
  background: #fff;
  color: var(--color-primary);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

button.admin-link-button {
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--color-button-text);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}

.admin-topbar h1 {
  margin-top: 4px;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.admin-back-button {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.admin-account,
.admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-account span {
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 12px clamp(18px, 4vw, 56px) 0;
  background: #fff;
}

.admin-tabs button {
  padding: 12px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.admin-tabs button.active {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
}

.admin-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px clamp(14px, 4vw, 40px) 60px;
}

.admin-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-section-heading p {
  margin: 5px 0 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.admin-order-list,
.admin-user-list {
  display: grid;
  gap: 14px;
}

.admin-order {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.admin-order header,
.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-order header div,
.admin-user > div:first-child {
  display: grid;
  gap: 4px;
}

.admin-order header span,
.admin-user span,
.admin-product span {
  color: var(--color-text-muted);
  font-size: 0.74rem;
}

.admin-order p,
.admin-order ul {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-badge {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 800;
}

.admin-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.admin-product {
  display: grid;
  overflow: hidden;
  gap: 5px;
  padding: 0 0 14px;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-product img,
.admin-product-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf1ef;
}

.admin-product-placeholder {
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
}

.admin-product strong,
.admin-product > span:last-child {
  margin-inline: 14px;
}

.admin-form,
.admin-inline-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.admin-form fieldset {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.admin-form .admin-check {
  display: flex;
  align-items: center;
}

.admin-form .admin-check input {
  width: 18px;
  min-height: 18px;
}

.admin-inline-form {
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
  margin-bottom: 18px;
}

.admin-user {
  padding: 14px 16px;
}

.admin-delivery-status {
  display: grid;
  gap: 4px;
  margin-bottom: 22px;
  padding: 13px 15px;
  border: 1px solid #e6cfc7;
  border-radius: 12px;
  background: #fff6f2;
  color: #8a4633;
  font-size: 0.8rem;
}

.admin-delivery-status.ready {
  border-color: #cce0d4;
  background: #eff8f2;
  color: var(--color-primary);
}

.admin-delivery-status span,
.admin-store-card span {
  color: var(--color-text-muted);
  font-size: 0.74rem;
}

.admin-subheading {
  margin: 26px 0 12px;
  font-size: 1rem;
}

.admin-store-grid,
.admin-delivery-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.admin-store-card,
.admin-offer {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.admin-store-card > div:first-child {
  display: grid;
  gap: 4px;
}

.admin-coordinate-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-store-card label {
  display: grid;
  gap: 7px;
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.admin-store-card input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #ccd5d0;
  border-radius: 10px;
  font: inherit;
}

.admin-delivery-form {
  max-width: 680px;
  margin-bottom: 16px;
}

.admin-delivery-form > button:not(.admin-primary) {
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-offer header {
  display: flex;
  justify-content: space-between;
}

.admin-offer p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .admin-topbar,
  .admin-order header,
  .admin-user {
    align-items: flex-start;
  }

  .admin-topbar,
  .admin-user {
    flex-direction: column;
  }

  .admin-inline-form {
    grid-template-columns: 1fr;
  }

  .admin-account {
    justify-content: space-between;
    width: 100%;
  }

  .admin-coordinate-fields {
    grid-template-columns: 1fr;
  }
}
