/* css/catalog-stock.css — метки наличия. catalog.css не трогаем. */
.engine-item.is-out { opacity: .45; }
.engine-item.is-out:hover { opacity: .7; }
.engine-item.is-in { opacity: 1; }
.engine-item .stock-note {
  display: inline-block;
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.engine-item.is-in .stock-note { background: #e8f7ee; color: #15803d; }
.engine-item.is-out .stock-note { background: #f1f1f1; color: #888; }
.engine-item .stock-note.muted { background: #f3f4f6; color: #6b7280; }
.engine-item.is-pending { opacity: 1; }
.engine-item.is-hit { outline: 2px solid #ff4000; outline-offset: 1px; }

/* Карточка: бейдж под кодом, код никогда не складывается в столбик.
 * Специфичность с запасом поверх css/catalog.css (его не правим). */
a.engine-item.engine-item {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.engine-item.engine-item .engine-code.engine-code {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
.engine-item.engine-item .stock-note.stock-note {
  white-space: nowrap;
  margin-top: 4px;
  margin-left: 0;
  font-size: 12px;
  max-width: 100%;
}
/* Ховер всегда оранжевый с белым текстом — даже поверх инлайн-подсветки
 * поиска (style="background:#fff3cd"), иначе белый текст на светлом. */
a.engine-item.engine-item:hover {
  background: #ff4000 !important;
  border-color: #ff4000 !important;
  color: #fff !important;
}
a.engine-item.engine-item:hover .engine-code.engine-code { color: #fff !important; }
.brand-link.no-stock { opacity: .55; }
/* Ссылка бренда: суффикс строкой ниже, сетку не рвёт. */
.brand-link.brand-link {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.brand-link .stock-suffix {
  display: block;
  font-size: 11px;
  font-weight: normal;
  color: #9ca3af;
  white-space: nowrap;
  max-width: 100%;
}
/* unknown: нейтрально, без серости. */
.brand-link.is-pending { opacity: 1; }
.catalog-stock-badge, .catalog-nav-badge {
  background: #fff3cd;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 14px;
}

/* Модалка пустой модели (VIN-модалку не трогаем). */
.stock-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.stock-modal-overlay.active { display: flex; }
.stock-modal {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.stock-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #888;
}
.stock-modal-close:hover { color: #000; }
.stock-modal-img {
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  margin-bottom: 16px;
}
.stock-modal-code {
  font-size: 20px;
  font-weight: 700;
  color: #ff4000;
  margin-bottom: 8px;
}
.stock-modal-spinner {
  width: 40px;
  height: 40px;
  margin: 8px auto 8px;
  border: 4px solid #eee;
  border-top-color: #ff4000;
  border-radius: 50%;
  animation: stock-spin 0.8s linear infinite;
}
@keyframes stock-spin { to { transform: rotate(360deg); } }
.stock-modal-text { color: #555; margin-bottom: 20px; }
.stock-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.stock-modal .stock-modal-btn.stock-modal-btn,
.stock-modal .stock-modal-btn.stock-modal-btn:link,
.stock-modal .stock-modal-btn.stock-modal-btn:visited,
.stock-modal .stock-modal-btn.stock-modal-btn:hover,
.stock-modal .stock-modal-btn.stock-modal-btn:active {
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  border-bottom: none !important;
  display: inline-block;
}
.stock-modal .stock-modal-btn.stock-modal-req,
.stock-modal .stock-modal-btn.stock-modal-req:link,
.stock-modal .stock-modal-btn.stock-modal-req:visited,
.stock-modal .stock-modal-btn.stock-modal-req:hover,
.stock-modal .stock-modal-btn.stock-modal-req:active { background: #ff4000; color: #fff !important; }
.stock-modal .stock-modal-btn.stock-modal-req:hover { background: #e63900; }
.stock-modal-force { background: #f1f1f1; color: #333; }
.stock-modal-force:hover { background: #e0e0e0; }
@media (max-width: 600px) {
  .stock-modal { padding: 20px; }
  .stock-modal-img { max-height: 240px; }
  .stock-modal-actions { flex-direction: column; }
  .stock-modal-btn { width: 100%; }
}
