/* ==========================================================================
   X SHOP — S3 Товары и форма товара
   ========================================================================== */

.products__head { justify-content: space-between; }
.products__count { color: var(--c-text-3); font-weight: var(--fw-medium); margin-left: 4px; }
.products__tools { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.products__tools .store-switch { justify-self: start; }
.products__tabs { margin-bottom: var(--sp-3); align-items: center; }
.products__demo { flex: none; display: flex; align-items: center; }
.products__filters { margin-bottom: var(--sp-4); }
.products__summary { margin: 0 2px var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-3); }

@media (min-width: 1024px) {
  .products { max-width: 880px; }
  .products__tools { grid-template-columns: auto 1fr; align-items: center; }
}

/* Поиск */
.search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  background: var(--c-surface);
  box-shadow: 0 0 0 1px var(--c-line) inset;
  color: var(--c-text-3);
  transition: box-shadow var(--dur-2);
}
.search:focus-within { box-shadow: 0 0 0 1.5px var(--c-accent) inset, 0 0 0 4px var(--c-accent-soft); color: var(--c-text-2); }
.search__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--c-text);
}
.search__input:focus { outline: none; }
.search__input::placeholder { color: var(--c-text-3); }
.search__input::-webkit-search-cancel-button { filter: invert(0.6); }

/* Строка товара */
.thumb {
  --logo-color: var(--c-accent);
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--logo-color) 45%, transparent), transparent 70%),
    var(--c-surface-2);
  color: color-mix(in srgb, var(--logo-color) 55%, white);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 14px;
  box-shadow: 0 0 0 1px var(--c-line) inset;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod { min-height: 76px; }
.prod.is-hidden .thumb,
.prod.is-hidden .row__title { opacity: 0.5; }

.stock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--c-text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stock--low { color: var(--c-warning); }
.stock--out { color: var(--c-danger); }
.stock--hidden { color: var(--c-text-3); }

/* Форма товара */
.pform { max-width: 720px; }
.pform__notice { margin-bottom: var(--sp-4); }
.pform__delete { margin-top: var(--sp-4); color: var(--c-danger); }
.pform__delete:hover { background: var(--c-danger-soft); }
.store-switch--field { justify-self: start; }

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: var(--sp-2);
}
.photo {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo--add { border-radius: var(--r-sm); }
.photo__badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(8, 10, 16, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: var(--fw-semibold);
}

.variants { display: grid; gap: var(--sp-2); }
.variants:empty { display: none; }
.variant {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 10px 6px 10px 14px;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
}
.variant__main { flex: 1; min-width: 0; display: grid; }
.variant__main strong { font-weight: var(--fw-semibold); }
.variant__main span { font-size: var(--fs-sm); color: var(--c-text-2); }
.variant .icon-btn { width: 36px; height: 36px; color: var(--c-text-2); }
.variant-form { display: grid; gap: var(--sp-4); }

/* Подтверждение в шторке */
.sheet-text { color: var(--c-text-2); margin: 0 var(--sp-1) var(--sp-5); }
.sheet-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--danger:hover { background: #F2646D; }
