/* ══════════════════════════════════════════
   CARD (search result)
   ══════════════════════════════════════════ */
.card {
  background: #252525;
  border: 1px solid #333;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.card:hover { border-color: #FFD100; transform: translateY(-2px); }
.card-body { padding: 14px 16px; }
.article {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFD100;
  letter-spacing: 0.5px;
}
.description { font-size: 0.95rem; margin: 6px 0 4px; line-height: 1.4; }
.section-name { font-size: 0.78rem; color: #aaa; margin-bottom: 4px; }
.meta { font-size: 0.78rem; color: #999; display: flex; gap: 12px; }
.info-tag {
  font-size: 0.75rem; color: #aaa; background: #333;
  padding: 2px 7px; border-radius: 4px; margin-top: 6px; display: inline-block;
}
.card-image {
  width: 100%; display: block;
  border-top: 1px solid #333;
  max-height: 220px; object-fit: cover; object-position: top; background: #111;
}

/* ══════════════════════════════════════════
   AI BANNER
   ══════════════════════════════════════════ */
#ai-banner {
  display: none;
  max-width: 1100px;
  margin: 0 auto 6px;
  padding: 0 24px;
}
.ai-box {
  background: linear-gradient(135deg, #141100 0%, #0e0d00 100%);
  border: 1px solid #3d3000;
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
}
.ai-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.ai-interp { color: #FFD100; font-weight: 600; margin-bottom: 4px; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.ai-tag {
  background: #181500; border: 1px solid #3d3000;
  border-radius: 4px; padding: 1px 8px; font-size: 0.75rem; color: #c8a800;
}
.ai-tag.section { border-color: #FFD100; color: #FFD100; }

/* ══════════════════════════════════════════
   PARTS MODAL
   ══════════════════════════════════════════ */
#modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#modal.open { display: flex; }

#modal-inner {
  max-width: 900px;
  width: 100%;
  background: #1e1e1e;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

#modal-header {
  padding: 16px 20px;
  background: #252525;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
#modal-article {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFD100;
}
#modal-desc { font-size: 1rem; margin-top: 4px; }
#modal-section { font-size: 0.8rem; color: #888; margin-top: 3px; }

#modal-close {
  background: #444; border: none; color: white;
  font-size: 1.2rem; width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer; flex-shrink: 0;
  padding: 0; line-height: 44px; text-align: center;
}
#modal-close:hover { background: #555; }

#copy-btn {
  background: #FFD100; border: none; color: #111; font-weight: 700;
  font-size: 0.8rem; padding: 5px 12px; border-radius: 6px;
  cursor: pointer; margin-top: 6px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background 0.2s;
}
#copy-btn:hover { background: #e6bc00; }
#copy-btn.copied { background: #555; }

.modal-tabs {
  display: flex; background: #1e1e1e; border-bottom: 1px solid #333;
}
.modal-tab {
  padding: 10px 20px; font-size: 0.9rem; font-weight: 600; color: #888;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s; user-select: none;
}
.modal-tab:hover { color: #ccc; }
.modal-tab.active { color: #FFD100; border-bottom-color: #FFD100; }
.modal-tab.disabled { opacity: 0.3; cursor: default; }

.modal-pane { display: none; overflow-y: auto; padding: 16px; text-align: center; flex: 1; }
.modal-pane.active { display: block; }
.modal-pane img { max-width: 100%; border-radius: 6px; }

/* ══════════════════════════════════════════
   PARTS TABLE
   ══════════════════════════════════════════ */
.parts-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.88rem; text-align: left;
}
.parts-table th {
  background: #2a2a2a; color: #888; padding: 8px 10px;
  font-weight: 600; border-bottom: 2px solid #333;
  position: sticky; top: 0;
}
.parts-table td {
  padding: 8px 10px; border-bottom: 1px solid #2a2a2a; vertical-align: middle;
}
.parts-table tr:hover td { background: #2a2a2a; }

.art-cell {
  font-family: "SF Mono", "Fira Code", monospace;
  color: #FFD100; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
.art-cell:hover { color: #ffe066; text-decoration: underline; }
.art-cell:active { opacity: 0.6; }
.art-cell.in-cart {
  background: transparent;
  cursor: default;
  padding: 0;
}
.art-cell.in-cart:hover { text-decoration: none; }

/* Inline qty controls */
.iqty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFD100;
  border-radius: 6px;
  padding: 2px 6px;
}
.iqty-btn {
  background: rgba(0,0,0,0.15);
  border: none;
  color: #111;
  width: 22px; height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
  user-select: none; touch-action: manipulation;
  transition: background 0.15s;
  position: relative;
}
.iqty-btn::before {
  content: '';
  position: absolute;
  inset: -11px;
}
.iqty-btn:hover { background: rgba(0,0,0,0.28); }
.iqty-btn:active { background: rgba(0,0,0,0.4); }
.iqty-label {
  color: #111;
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.iqty-count {
  background: rgba(0,0,0,0.2);
  color: #111;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0 5px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
  line-height: 18px;
  height: 18px;
}

/* ══════════════════════════════════════════
   ORDER PREVIEW MODAL
   ══════════════════════════════════════════ */
#order-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#order-modal.open { display: flex; }

#order-modal-inner {
  max-width: 760px;
  width: 100%;
  background: #1e1e1e;
  border-radius: 14px;
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

#order-modal-header {
  padding: 16px 20px;
  background: #252525;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
#order-modal-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #e8e8e8;
}
.order-modal-close {
  background: #444; border: none; color: white;
  width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; font-size: 1rem; display: flex;
  align-items: center; justify-content: center; padding: 0;
}
.order-modal-close:hover { background: #555; }

#order-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.order-doc-header {
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid #333;
}
.order-doc-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.order-doc-meta {
  font-size: 0.78rem;
  color: #aaa;
  line-height: 1.6;
}

.order-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
.order-table th {
  background: #2a2a2a; color: #888; padding: 7px 8px;
  font-weight: 600; border-bottom: 2px solid #333; text-align: left;
}
.order-table td {
  padding: 7px 8px; border-bottom: 1px solid #2a2a2a; vertical-align: middle;
}
.order-table .art-col {
  font-family: "SF Mono", "Fira Code", monospace;
  color: #FFD100; font-weight: 700; white-space: nowrap;
}

.qty-control {
  display: flex; align-items: center; gap: 4px;
}
.qty-btn {
  background: #333; border: none; color: #e8e8e8;
  width: 24px; height: 24px; border-radius: 5px;
  cursor: pointer; font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
  transition: background 0.15s;
  position: relative;
}
.qty-btn::before {
  content: '';
  position: absolute;
  inset: -10px;
}
.qty-btn:hover { background: #444; }
.qty-val {
  min-width: 28px; text-align: center;
  font-weight: 700; font-size: 0.9rem;
}
.del-btn {
  background: none; border: none; color: #555;
  cursor: pointer; font-size: 1rem; padding: 2px 4px;
  border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.del-btn:hover { color: #e57373; background: #3a1a1a; }

.order-empty {
  text-align: center; padding: 40px 20px; color: #999;
  font-size: 0.95rem;
}

#order-modal-footer {
  padding: 14px 20px;
  background: #252525;
  border-top: 1px solid #333;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.btn-pdf {
  flex: 1; padding: 11px; font-size: 0.9rem; font-weight: 700;
  background: #FFD100; color: #111; border: none; border-radius: 9px;
  cursor: pointer; transition: background 0.2s;
}
.btn-pdf:hover { background: #e6bc00; }
.btn-close-order {
  padding: 11px 20px; font-size: 0.9rem; font-weight: 600;
  background: #2a2a2a; color: #ccc; border: none; border-radius: 9px;
  cursor: pointer; transition: background 0.2s;
}
.btn-close-order:hover { background: #333; }

/* ══════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════ */
.copy-toast {
  position: fixed;
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 16px));
  left: 50%;
  transform: translateX(-50%);
  background: #FFD100; color: #111; font-weight: 700;
  padding: 10px 20px; border-radius: 8px;
  font-size: 0.88rem; z-index: 9999;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none; white-space: normal;
  max-width: 85vw; text-align: center;
}
.copy-toast.show { opacity: 1; }

/* Плейсхолдеры полей регистрации (физлицо) — серее */
#reg-p-position::placeholder,
#reg-p-last::placeholder,
#reg-p-first::placeholder,
#reg-p-middle::placeholder,
#reg-p-contact::placeholder { color: #aaa; }

/* Плейсхолдер основного поиска — повышенный контраст под механика
   в полевых условиях (грязный экран, яркое солнце). #555 на белом =
   контраст 7.46:1 — WCAG AAA. Дефолт браузера ~#757575 = 4.54:1,
   на грани AA. */
#query::placeholder { color: #555; }

/* ── Футер сайта ─────────────────────────────────────────── */
footer { border-top: 1px solid #222; color: #777; font-size: 0.8rem; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: #999; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
