/* ==========================================================================
   X SHOP — Reusable components
   Каждый компонент — один блок с BEM-модификаторами. Без зависимостей
   от конкретных экранов.
   ========================================================================== */

/* ---------- Icon (Lucide) ---------- */

.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i--14 { width: 14px; height: 14px; stroke-width: 2.2; }
.i--16 { width: 16px; height: 16px; stroke-width: 2.1; }
.i--18 { width: 18px; height: 18px; }
.i--22 { width: 22px; height: 22px; stroke-width: 1.8; }
.i--24 { width: 24px; height: 24px; stroke-width: 1.7; }

/* ---------- Button ---------- */

.btn {
  --btn-h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--btn-h);
  padding: 0 var(--sp-5);
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), color var(--dur-2);
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn--primary {
  background: var(--c-accent);
  color: var(--c-on-accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 24px -10px rgba(40, 119, 250, 0.7);
}
.btn--primary:hover { background: var(--c-accent-hover); }
.btn--primary:active { background: var(--c-accent-press); }

.btn--secondary {
  background: var(--c-surface-2);
  color: var(--c-text);
  box-shadow: 0 0 0 1px var(--c-line) inset;
}
.btn--secondary:hover { background: var(--c-surface-3); }

.btn--ghost {
  background: transparent;
  color: var(--c-accent);
  padding: 0 var(--sp-3);
}
.btn--ghost:hover { background: var(--c-accent-soft); }

.btn--sm { --btn-h: 36px; padding: 0 var(--sp-4); font-size: var(--fs-sm); border-radius: 10px; }
.btn--block { width: 100%; }

/* ---------- Icon button ---------- */

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--c-text);
  background: var(--c-surface);
  box-shadow: 0 0 0 1px var(--c-line) inset;
  transition: background-color var(--dur-2), transform var(--dur-1);
}
.icon-btn:hover { background: var(--c-surface-2); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn--plain { background: transparent; box-shadow: none; }

.dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 0 2px var(--c-surface);
}

/* ---------- Counter badge ---------- */

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-size: 11px;
  font-weight: var(--fw-bold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- Avatar ---------- */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(140deg, #3B4560, #232A3B);
  color: var(--c-text);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-md);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--c-line-strong) inset;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 36px; height: 36px; font-size: var(--fs-sm); }

/* ---------- Store logo tile ---------- */

.store-logo {
  --logo-color: var(--c-accent);
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--logo-color) 70%, white 10%), transparent 70%),
    color-mix(in srgb, var(--logo-color) 40%, var(--c-surface-2));
  color: #fff;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 15px;
  letter-spacing: var(--tracking-display);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.store-logo img { width: 100%; height: 100%; object-fit: cover; }
.store-logo--sm { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
.store-logo--lg { width: 56px; height: 56px; border-radius: var(--r-md); font-size: 19px; }
.store-logo--all {
  background: var(--c-surface-3);
  color: var(--c-text-2);
}

/* ---------- Status chip ---------- */

.status {
  --st: var(--c-text-2);
  --st-bg: var(--c-neutral-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--st-bg);
  color: var(--st);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
/* Заказы: значения orders.status из бэкенда */
.status--new        { --st: #6FA5FF; --st-bg: var(--c-accent-soft); }
.status--processing { --st: var(--c-warning); --st-bg: var(--c-warning-soft); }
.status--done       { --st: var(--c-success); --st-bg: var(--c-success-soft); }
.status--cancelled  { --st: var(--c-text-3); --st-bg: var(--c-neutral-soft); }
/* Магазины */
.status--published  { --st: var(--c-success); --st-bg: transparent; padding: 0; height: auto; }
.status--draft      { --st: var(--c-text-3); --st-bg: transparent; padding: 0; height: auto; }

/* ---------- Delta (динамика к прошлому периоду) ---------- */

.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.delta--up { color: var(--c-success); }
.delta--down { color: var(--c-danger); }
.delta--flat { color: var(--c-text-3); }

/* ---------- Segmented control ---------- */

.segmented {
  --count: 3;
  --index: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--count), 1fr);
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  box-shadow: 0 0 0 1px var(--c-line) inset;
  isolation: isolate;
}
.segmented__thumb {
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / var(--count));
  border-radius: var(--r-pill);
  background: var(--c-surface-3);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 12px -4px rgba(0, 0, 0, 0.6);
  transform: translateX(calc(100% * var(--index)));
  transition: transform var(--dur-3) var(--ease-out);
}
.segmented__btn {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  transition: color var(--dur-2);
}
.segmented__btn[aria-checked="true"] { color: var(--c-text); }

/* ---------- Section ---------- */

.section + .section { margin-top: var(--section-gap); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  padding: 0 2px;
}
.section-head__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
}
.section-head__count {
  margin-left: 6px;
  color: var(--c-text-3);
  font-weight: var(--fw-medium);
}
.link {
  color: var(--c-accent);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.link:hover { color: var(--c-accent-hover); }

/* ---------- List group ---------- */

.list {
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: 0 0 0 1px var(--c-line) inset;
  overflow: hidden;
}

.row {
  --row-inset: 72px;
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 68px;
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  transition: background-color var(--dur-1);
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--row-inset);
  right: 0;
  height: 1px;
  background: var(--c-line);
}
a.row:hover,
button.row:hover { background: rgba(245, 247, 252, 0.025); }
a.row:active,
button.row:active { background: rgba(245, 247, 252, 0.05); }
a.row:focus-visible,
button.row:focus-visible { outline-offset: -2px; border-radius: 0; }

.row__main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.row__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.row__sub {
  font-size: var(--fs-sm);
  color: var(--c-text-2);
  line-height: var(--lh-snug);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.row__aside {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
  flex: none;
}
.row__value {
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row__chevron { color: var(--c-text-3); margin-right: -4px; }

/* ---------- Action list (внутри шторки) ---------- */

.actions {
  display: grid;
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  overflow: hidden;
}
.action {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  padding: 0 var(--sp-4);
  text-align: left;
  font-weight: var(--fw-medium);
  position: relative;
}
.action + .action::before {
  content: "";
  position: absolute;
  top: 0;
  left: 48px;
  right: 0;
  height: 1px;
  background: var(--c-line);
}
.action:hover { background: rgba(245, 247, 252, 0.03); }
.action:active { background: rgba(245, 247, 252, 0.06); }
.action .i { color: var(--c-text-2); }
.action__label { flex: 1; }
.action__check { color: var(--c-accent); }

/* ---------- Sheet (модальное окно) ---------- */

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - var(--safe-top) - 24px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--glass-highlight), var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-pop);
  transform: translateY(100%);
  transition: transform var(--dur-3) var(--ease-out);
  will-change: transform;
}
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }
.sheet-layer.is-open .sheet { transform: translateY(var(--drag, 0px)); }
.sheet-layer.is-dragging .sheet { transition: none; }

.sheet__grab {
  display: grid;
  place-items: center;
  height: 22px;
  flex: none;
  touch-action: none;
  cursor: grab;
}
.sheet__grab::before {
  content: "";
  width: 36px;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--c-line-strong);
}
.sheet__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 2px var(--sp-5) var(--sp-3);
  flex: none;
  touch-action: none;
}
.sheet__title {
  flex: 1;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}
.sheet__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--sp-4) calc(var(--sp-5) + var(--safe-bottom));
}

@media (min-width: 768px) {
  .sheet-layer { align-items: center; padding: var(--sp-6); }
  .sheet {
    max-width: 440px;
    border-radius: var(--r-xl);
    transform: translateY(24px) scale(0.98);
    opacity: 0;
    transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2);
  }
  .sheet-layer.is-open .sheet { transform: none; opacity: 1; }
  .sheet__grab { height: 12px; }
  .sheet__grab::before { display: none; }
}

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  z-index: var(--z-toast);
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  padding: 0 var(--gutter);
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 100%;
  padding: 10px 16px 10px 12px;
  border-radius: var(--r-pill);
  background: var(--glass-highlight), var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-out);
}
.toast.is-visible { opacity: 1; transform: none; }
.toast .i { color: var(--c-success); }
.toast--error .i { color: var(--c-danger); }

@media (min-width: 1024px) {
  .toast-root { bottom: 24px; padding-left: var(--sidebar-w); }
}

/* ---------- Skeleton ---------- */

.skel {
  display: block;
  border-radius: var(--r-xs);
  background:
    linear-gradient(90deg, transparent, rgba(245, 247, 252, 0.05), transparent) 0 0 / 200% 100% no-repeat,
    var(--c-surface-2);
  animation: skel 1.3s linear infinite;
}
@keyframes skel {
  from { background-position: 150% 0, 0 0; }
  to { background-position: -50% 0, 0 0; }
}

/* ---------- Empty / error state ---------- */

.state {
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: 0 0 0 1px var(--c-line) inset;
}
.state__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  color: var(--c-text-2);
  margin-bottom: var(--sp-1);
}
.state__icon--danger { color: var(--c-danger); background: var(--c-danger-soft); }
.state__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.state__text { color: var(--c-text-2); max-width: 34ch; }
.state .btn { margin-top: var(--sp-2); }

/* ---------- Demo tag (пометка демонстрационных данных) ---------- */

.tag-demo {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 6px;
  border: 1px dashed var(--c-line-strong);
  color: var(--c-text-3);
  font-size: 10.5px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  vertical-align: 2px;
  white-space: nowrap;
}

/* ---------- Внутри шторки ---------- */

.sheet .list,
.sheet .state { background: var(--c-surface-2); box-shadow: none; }
.sheet .state { padding: var(--sp-8) var(--sp-5); }
.sheet-note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 var(--sp-1) var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-text-3);
}
.sheet-note .tag-demo { margin-left: 0; }
.sheet-foot-btn { margin-top: var(--sp-3); }

.action__sub { display: block; font-size: var(--fs-xs); color: var(--c-text-3); font-weight: var(--fw-regular); }
.action__meta { color: var(--c-text-3); font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.action .row__chevron { color: var(--c-text-3); }
.action[role="radio"] .store-logo { margin-right: 2px; }

/* ==========================================================================
   Формы
   ========================================================================== */

.form-card {
  display: grid;
  gap: var(--sp-5);
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: 0 0 0 1px var(--c-line) inset;
}
.form-card + .form-card { margin-top: var(--sp-4); }
.form-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.form-card__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.form-card__text { color: var(--c-text-2); font-size: var(--fs-sm); margin-top: calc(var(--sp-4) * -1 + 4px); }

.field { display: grid; gap: var(--sp-2); min-width: 0; }
.field__label {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-2);
}
.field__label b { color: var(--c-accent); font-weight: var(--fw-semibold); }
.field__counter { color: var(--c-text-3); font-variant-numeric: tabular-nums; font-weight: var(--fw-regular); }
.field__hint { font-size: var(--fs-xs); color: var(--c-text-3); line-height: var(--lh-snug); }
.field__hint code { color: var(--c-text-2); font-family: inherit; }
.field__error { font-size: var(--fs-xs); color: var(--c-danger); line-height: var(--lh-snug); }
.field__error:empty { display: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  color: var(--c-text);
  box-shadow: 0 0 0 1px var(--c-line) inset;
  line-height: var(--lh-snug);
  transition: box-shadow var(--dur-2), background-color var(--dur-2);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--c-text-3); }
.input:hover,
.textarea:hover,
.select:hover { box-shadow: 0 0 0 1px var(--c-line-strong) inset; }
.input:focus,
.textarea:focus,
.select:focus { outline: none; box-shadow: 0 0 0 1.5px var(--c-accent) inset, 0 0 0 4px var(--c-accent-soft); }
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] { box-shadow: 0 0 0 1.5px var(--c-danger) inset; }
.textarea { min-height: 96px; resize: vertical; }
.select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7488' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.input-group {
  display: flex;
  align-items: center;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  box-shadow: 0 0 0 1px var(--c-line) inset;
  transition: box-shadow var(--dur-2);
}
.input-group:focus-within { box-shadow: 0 0 0 1.5px var(--c-accent) inset, 0 0 0 4px var(--c-accent-soft); }
.input-group[data-invalid="true"] { box-shadow: 0 0 0 1.5px var(--c-danger) inset; }
.input-group .input { background: transparent; box-shadow: none; }
.input-group__addon { padding: 0 0 0 14px; color: var(--c-text-3); white-space: nowrap; font-size: var(--fs-md); }
.input-group__addon--end { padding: 0 14px 0 0; }

/* Шаговый ввод количества */
.stepper {
  display: inline-grid;
  grid-template-columns: 44px minmax(56px, 1fr) 44px;
  align-items: center;
  min-height: 48px;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  box-shadow: 0 0 0 1px var(--c-line) inset;
}
.stepper button {
  display: grid;
  place-items: center;
  height: 48px;
  color: var(--c-text-2);
  border-radius: var(--r-sm);
}
.stepper button:hover { color: var(--c-text); }
.stepper button:active { background: rgba(245, 247, 252, 0.05); }
.stepper input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }

/* Переключатель */
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  cursor: pointer;
}
.toggle__text { display: grid; gap: 2px; }
.toggle__title { font-weight: var(--fw-medium); }
.toggle__sub { font-size: var(--fs-sm); color: var(--c-text-2); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--c-surface-3);
  transition: background-color var(--dur-2);
}
.toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform var(--dur-3) var(--ease-out);
}
.toggle input:checked + .toggle__track { background: var(--c-accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--c-accent); outline-offset: 2px; }

/* Загрузка изображения */
.upload {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--c-line-strong);
  background: var(--c-surface-2);
  color: var(--c-text-3);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-2), color var(--dur-2);
}
.upload:hover { border-color: var(--c-accent-line); color: var(--c-text-2); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload:focus-within { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.upload__body { display: grid; justify-items: center; gap: 6px; padding: var(--sp-3); font-size: var(--fs-xs); pointer-events: none; }
.upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload.has-image { border-style: solid; border-color: transparent; }
.upload__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(8, 10, 16, 0.72);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Цветовые образцы */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  transition: transform var(--dur-1);
}
.swatch:active { transform: scale(0.92); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--c-bg), 0 0 0 4px var(--sw); }

/* Фильтр-чипы (горизонтальная прокрутка) */
.chips {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter);
  scroll-padding: 0 var(--gutter);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  box-shadow: 0 0 0 1px var(--c-line) inset;
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  transition: background-color var(--dur-2), color var(--dur-2);
}
.chip__count { color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--c-text); color: var(--c-bg); box-shadow: none; }
.chip[aria-pressed="true"] .chip__count { color: rgba(8, 10, 16, 0.55); }

/* Вкладки-подчёркивания (категории) */
.tabs {
  display: flex;
  gap: var(--sp-5);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--c-line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: none;
  padding: 10px 0 12px;
  color: var(--c-text-3);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--c-text); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-accent);
}

/* Нижняя панель действий (формы, мастер) */
.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-nav);
  padding: var(--sp-3) calc(var(--gutter) + var(--safe-right)) calc(var(--sp-3) + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
}
.action-bar__inner {
  display: flex;
  gap: var(--sp-2);
  max-width: var(--content-max);
  margin: 0 auto;
}
.action-bar__inner .btn--primary { flex: 1; }
@media (min-width: 1024px) {
  .action-bar { left: var(--sidebar-w); }
  .action-bar__inner { max-width: var(--content-max-wide); justify-content: flex-end; }
  .action-bar__inner .btn--primary { flex: 0 0 auto; min-width: 220px; }
}

.btn.is-loading { pointer-events: none; }
.btn.is-loading .i { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Пометка «нет в API» */
.notice {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}
.notice .i { color: var(--c-text-3); margin-top: 1px; }
.notice--warning { background: var(--c-warning-soft); color: #F5C77E; }
.notice--warning .i { color: var(--c-warning); }

/* Pull-to-refresh */
.ptr {
  --pull: 0px;
  position: fixed;
  top: calc(var(--safe-top) + 4px);
  left: 50%;
  z-index: var(--z-toast);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-pop);
  color: var(--c-text-2);
  opacity: 0;
  transform: translateY(calc(var(--pull) - 48px)) rotate(calc(var(--pull) * 3));
  pointer-events: none;
}
.ptr.is-pulling,
.ptr.is-loading { opacity: 1; }
.ptr:not(.is-pulling) { transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2); }
.ptr.is-armed { color: var(--c-accent); }
.ptr.is-loading .ptr__icon { animation: spin 0.9s linear infinite; color: var(--c-accent); }
.ptr__icon { display: grid; }

/* QR */
.qr { width: 100%; height: auto; border-radius: 12px; }

.store-logo--xs { width: 18px; height: 18px; border-radius: 5px; font-size: 8px; letter-spacing: 0; }
