/* =======================================================
   COMPONENTS.CSS — кнопки, карточки товаров, чипсы, формы
   ======================================================= */

/* ── Кнопки ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-m);
  padding: 11px 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.btn-primary:hover  { background: var(--primary-dark); }
.btn-primary:active { transform: scale(.98); }

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-m);
  padding: 11px 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-m);
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-sm { padding: 7px 14px; font-size: 11px; }

/* ── Чипсы-фильтры ── */
.chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 30px;
  border: 1.5px solid var(--ink-30);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-60);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.chip:hover,
.chip.active  { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.chip.hot     { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.chip svg     { width: 14px; height: 14px; }

/* ── Сетка товаров ── */
.products-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

/* ── Карточка товара ── */
.prod-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1.5px solid var(--ink-10);
  transition: all .2s;
  cursor: pointer;
  position: relative;
}
.prod-card:hover {
  border-color: var(--primary-mid);
  box-shadow: 0 8px 24px rgba(45, 122, 79, .1);
  transform: translateY(-3px);
}

.prod-badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.prod-badge.new  { background: var(--primary); color: #fff; }
.prod-badge.sale { background: var(--accent); color: #fff; }
.prod-badge.hit  { background: var(--accent2); color: #fff; }

.prod-img {
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}
.prod-img svg    { width: 60px; height: 60px; color: var(--ink-30); }
.prod-img img    { width: 100%; height: 100%; object-fit: contain; }

.prod-info       { padding: 12px; }

.prod-sku        { font-size: 10px; color: var(--ink-60); margin-bottom: 2px; }
.prod-sku span   { background: #FFF7D6; color: #92600A; font-weight: 600; padding: 1px 5px; border-radius: 3px; font-size: 10px; }

.prod-brand      { font-size: 11px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }

.prod-name {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.4;
  font-weight: 500;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
a.prod-name:hover { color: var(--primary); }

.prod-auth       { font-size: 11px; color: var(--ink-60); line-height: 1.4; }
.prod-auth a     { color: var(--primary); text-decoration: underline; }

.prod-auth--block {
  background: var(--primary-light);
  border-radius: var(--radius-m);
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

/* Цена (авторизованный) */
.prod-price-block  { margin: 6px 0 2px; }
.prod-price-old    { font-size: 11px; color: var(--ink-60); text-decoration: line-through; display: block; margin-bottom: 1px; }
.prod-price-row    { display: flex; align-items: baseline; gap: 4px; }
.prod-price        { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--accent); }
.prod-price-unit   { font-size: 10px; color: var(--ink-60); }

/* Наличие */
.prod-stock        { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; margin: 6px 0 8px; }
.prod-stock.in-stock  { color: var(--primary); }
.prod-stock.low-stock { color: var(--accent2); }
.prod-stock.no-stock  { color: var(--ink-60); }
.prod-stock svg       { flex-shrink: 0; }

/* Кнопки действий карточки */
.prod-actions { display: flex; flex-direction: row; align-items: center; gap: 5px; }

.prod-qty-ctrl {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--ink-30);
  border-radius: var(--radius-m);
  overflow: hidden;
  flex-shrink: 0;
}
.prod-qty-btn {
  width: 26px; height: 28px;
  border: none;
  background: var(--ink-10);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.prod-qty-btn:hover { background: var(--ink-30); }
.prod-qty-input,
.pli-qty-input {
  width: 34px; height: 28px;
  border: none;
  border-left: 1.5px solid var(--ink-30);
  border-right: 1.5px solid var(--ink-30);
  text-align: center;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  padding: 0;
  -moz-appearance: textfield;
}
.prod-qty-input::-webkit-inner-spin-button,
.prod-qty-input::-webkit-outer-spin-button,
.pli-qty-input::-webkit-inner-spin-button,
.pli-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.prod-fav-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  border: 1.5px solid var(--ink-30);
  border-radius: var(--radius-m);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-60);
  transition: all .2s;
}
.prod-fav-btn:hover       { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.prod-fav-btn.active      { border-color: var(--accent); background: var(--accent); color: #fff; }
.prod-fav-btn svg         { width: 13px; height: 13px; }

.prod-cart-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.prod-cart-btn:hover  { background: var(--accent-dark); }
.prod-cart-btn:active { transform: scale(.93); }
.prod-cart-btn svg    { width: 14px; height: 14px; flex-shrink: 0; }
.prod-cart-btn.added  { background: var(--primary); }

.prod-quick-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.prod-quick-btn:hover  { background: var(--primary-dark); }
.prod-quick-btn:active { transform: scale(.93); }
.prod-quick-btn svg    { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Бренды-строка ── */
.brands-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.brand-chip {
  background: var(--surface);
  border: 1.5px solid var(--ink-10);
  border-radius: var(--radius-m);
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
  min-width: 120px; height: 52px;
}
.brand-chip:hover         { border-color: var(--primary); background: var(--primary-light); }
.brand-chip span          { font-family: var(--font-display); font-size: 11px; font-weight: 700; color: var(--ink-60); letter-spacing: .3px; }
.brand-chip:hover span    { color: var(--primary); }

/* ── Пустое состояние ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--ink-60);
  text-align: center;
}
.empty-state svg { width: 48px; height: 48px; color: var(--ink-30); }
.empty-state h3  { font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.empty-state p   { font-size: 13px; }

/* ── Toast-уведомления корзины ── */
.evr-toast {
  position: fixed;
  z-index: 9999;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-m);
  box-shadow: 0 4px 20px rgba(0,0,0,.22);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .22s, transform .22s;
  pointer-events: none;
  max-width: 280px;
  white-space: normal;
  text-align: center;
}
.evr-toast.show { opacity: 1; }
.evr-toast--ok  { background: #1f7a3e; }
.evr-toast--err {
  background: #c0392b;
  /* ошибки — по центру снизу */
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
}
.evr-toast--err.show { opacity: 1; }

/* Стрелка вверх (тост под иконкой на десктопе) */
.evr-toast--arrow-top::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top: none;
  border-bottom-color: #1f7a3e;
}
/* Стрелка вниз (тост над mob-nav) */
.evr-toast--arrow-bottom::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom: none;
  border-top-color: #1f7a3e;
}

/* ── Состояния кнопки корзины ── */
.btn-loading { opacity: .6; pointer-events: none; }
.btn-cart.added { background: #22963c !important; }

/* ── Анимация счётчика корзины ── */
@keyframes badge-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); }
  70%  { transform: scale(.88); }
  100% { transform: scale(1); }
}
.badge-pop {
  animation: badge-pop .35s cubic-bezier(.36,.07,.19,.97) both;
}

/* ── Анимация смены цены ── */
@keyframes price-flash {
  0%   { opacity: 1; }
  30%  { opacity: .3; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.price-updated {
  animation: price-flash .35s ease both;
}

