/* ================================================================ */
/* result-stage2.css — Стили для макета экрана результатов KITONE   */
/* Версия: v2.1-demo                                                */
/* Дата: 2026-07-28                                                 */
/* ⚠ Визуальный CSS. Не содержит data-role-зависимостей для JS.     */
/* ================================================================ */

/* --- Базовые стили --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Убираем дефолтные браузерные стили кнопок */
.stage3-ui button {
  min-height: 44px;
  line-height: 1.4;
  border: none;
  font: inherit;
  background: none;
}

.stage3-ui {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f6fa;
  color: #2d3436;
  line-height: 1.5;
  min-height: 100vh;
}

.stage3-ui.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 120px;
}

/* ================================================================ */
/* PERSISTENT SEARCH                                                 */
/* ================================================================ */
.stage3-ui .persistent-search {
  padding: 16px 0 8px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 16px;
}

.stage3-ui .search-row {
  display: flex;
  gap: 8px;
}

.stage3-ui .search-input {
  flex: 1;
  padding: 10px 16px;
  font-size: 16px;
  border: 2px solid #dfe6e9;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.stage3-ui .search-input:focus {
  border-color: #6c5ce7;
}

.stage3-ui .search-button {
  padding: 14px 24px;
  background: #6c5ce7;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, opacity 0.2s;
}

.stage3-ui .search-button:hover { background: #5a4bcf; }
.stage3-ui .search-button:active { background: #4a3bb5; }
.stage3-ui .search-button.disabled
.stage3-ui .search-button:disabled {
  background: #b2bec3;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ================================================================ */
/* ХЛЕБНЫЕ КРОШКИ (вторичные)                                       */
/* ================================================================ */
.stage3-ui .breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 13px;
  color: #636e72;
  margin-bottom: 16px;
  min-height: 20px;
}

.stage3-ui .crumb-sep { color: #b2bec3; }

.stage3-ui .crumb-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #dfe6e9;
  border-radius: 12px;
  font-size: 12px;
  color: #2d3436;
}

.stage3-ui .crumb-x {
  cursor: pointer;
  color: #636e72;
  font-weight: 700;
  font-size: 14px;
}
.stage3-ui .crumb-x:hover { color: #e94560; }

.stage3-ui .crumb-sort {
  color: #6c5ce7;
  font-weight: 500;
}

/* ================================================================ */
/* КАРТОЧКА ДЕТАЛИ                                                   */
/* ================================================================ */
.stage3-ui .product-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
  align-items: flex-start;
}

.stage3-ui .card-photo {
  flex-shrink: 0;
}

.stage3-ui .photo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #dfe6e9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #b2bec3;
}

.stage3-ui .card-info {
  flex: 1;
  min-width: 0;
}

.stage3-ui .card-title {
  font-size: 18px;
  font-weight: 700;
  color: #2d3436;
  margin-bottom: 4px;
}

.stage3-ui .card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #636e72;
  margin-bottom: 4px;
}

.stage3-ui .card-brand {
  font-weight: 600;
  color: #6c5ce7;
}

.stage3-ui .card-category {
  color: #b2bec3;
}

.stage3-ui .card-count {
  font-size: 13px;
  color: #00b894;
  font-weight: 500;
  margin-bottom: 6px;
}

.stage3-ui .card-trust {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stage3-ui .trust-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.stage3-ui .trust-ok {
  background: #e8f8f5;
  color: #00b894;
}

.stage3-ui .trust-warn {
  background: #fef9e7;
  color: #f39c12;
}

/* ================================================================ */
/* РЕКОМЕНДАЦИЯ KITONE (data-role="best-price")                      */
/* ================================================================ */
.stage3-ui .recommendation {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stage3-ui .recommendation:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.stage3-ui .rec-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.9;
}

.stage3-ui .rec-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.stage3-ui .rec-price {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stage3-ui .rec-supplier {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 14px;
}

.stage3-ui .supplier-icon { font-size: 16px; }

.stage3-ui .rec-delivery {
  font-size: 13px;
  opacity: 0.85;
}

.stage3-ui .rec-reasons {
  width: 100%;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.stage3-ui .reason {
  font-size: 12px;
  padding: 2px 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

.stage3-ui .rec-hint {
  width: 100%;
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
}

/* ================================================================ */
/* ТАБЛИЦА ПОСТАВЩИКОВ                                               */
/* ================================================================ */
.stage3-ui .suppliers-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 16px;
}

.stage3-ui .section-header {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.stage3-ui .section-title {
  font-size: 16px;
  font-weight: 700;
  color: #2d3436;
}

.stage3-ui .offers-count {
  font-size: 13px;
  color: #b2bec3;
  background: #f0f0f0;
  padding: 2px 10px;
  border-radius: 10px;
}

.stage3-ui .filters-row {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.stage3-ui .filter-select {
  padding: 4px 10px;
  border: 1px solid #dfe6e9;
  border-radius: 6px;
  font-size: 12px;
  color: #636e72;
  background: #fff;
  cursor: pointer;
}

/* Сетка таблицы */
.stage3-ui .suppliers-grid {
  display: flex;
  flex-direction: column;
}

.stage3-ui .grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 80px 60px;
  padding: 10px 16px;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  border-bottom: 1px solid #f5f6fa;
  transition: background 0.15s;
}

.stage3-ui .grid-row:hover {
  background: #f8f9ff;
}

.stage3-ui .grid-header {
  background: #f8f9fa;
  font-weight: 600;
  color: #636e72;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #dfe6e9;
}

.stage3-ui .row-highlight {
  background: #f0fff4 !important;
  border-left: 3px solid #00b894;
}

.stage3-ui .col-price { text-align: right; font-weight: 600; }
.stage3-ui .col-delivery { text-align: center; }
.stage3-ui .col-stock { text-align: center; }

/* Разделитель групп */
.stage3-ui .grid-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f0f0f0;
  font-size: 12px;
  color: #636e72;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stage3-ui .divider-count {
  background: #dfe6e9;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
}

/* ================================================================ */
/* OEM КАРТОЧКИ (сворачиваемые)                                      */
/* ================================================================ */
.stage3-ui .oem-cards {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
  overflow: hidden;
}

.stage3-ui .oem-summary {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #2d3436;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.stage3-ui .oem-summary::-webkit-details-marker { display: none; }
.stage3-ui .oem-summary::before { content: '▾ '; color: #6c5ce7; }
.stage3-ui details[open] .oem-summary::before { content: '▴ '; }

.stage3-ui .oem-count, .stage3-ui .analog-count {
  font-size: 12px;
  color: #b2bec3;
  background: #f0f0f0;
  padding: 1px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.stage3-ui .oem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.stage3-ui .oem-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  background: #f8f9ff;
  border-radius: 10px;
  transition: background 0.15s;
  cursor: pointer;
}

.stage3-ui .oem-card:hover {
  background: #eff0ff;
}

.stage3-ui .oem-icon { font-size: 24px; margin-bottom: 4px; }
.stage3-ui .oem-name { font-weight: 600; font-size: 14px; text-align: center; }
.stage3-ui .oem-price { color: #6c5ce7; font-weight: 700; font-size: 16px; margin-top: 4px; }
.stage3-ui .oem-delivery { font-size: 12px; color: #636e72; }

/* Прочие аналоги — аккордеон */
.stage3-ui .analog-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
  overflow: hidden;
}

.stage3-ui .analog-summary {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #636e72;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.stage3-ui .analog-summary::-webkit-details-marker { display: none; }
.stage3-ui .analog-summary::before { content: '▸ '; color: #b2bec3; }
.stage3-ui details[open] .analog-summary::before { content: '▾ '; color: #6c5ce7; }

/* ================================================================ */
/* ПУСТОЙ РЕЗУЛЬТАТ                                                  */
/* ================================================================ */
.stage3-ui .empty-state {
  text-align: center;
  padding: 60px 20px;
}

.stage3-ui .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.stage3-ui .empty-title {
  font-size: 20px;
  font-weight: 700;
  color: #2d3436;
  margin-bottom: 8px;
}

.stage3-ui .empty-article {
  font-size: 14px;
  color: #636e72;
  font-family: monospace;
  background: #f0f0f0;
  padding: 4px 12px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 16px;
}

.stage3-ui .empty-hint {
  font-size: 14px;
  color: #b2bec3;
  margin-bottom: 20px;
}

.stage3-ui .empty-btn {
  padding: 14px 24px;
  background: #6c5ce7;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.stage3-ui .empty-btn:hover { background: #5a4bcf; }

/* ================================================================ */
/* ОШИБКА                                                            */
/* ================================================================ */
.stage3-ui .error-state {
  text-align: center;
  padding: 60px 20px;
}

.stage3-ui .error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.stage3-ui .error-title {
  font-size: 20px;
  font-weight: 700;
  color: #e94560;
  margin-bottom: 8px;
}

.stage3-ui .error-hint {
  font-size: 14px;
  color: #636e72;
  margin-bottom: 20px;
}

.stage3-ui .error-btn {
  padding: 14px 24px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.stage3-ui .error-btn:hover { background: #d33654; }

/* ================================================================ */
/* СКЕЛЕТОНЫ (loading)                                               */
/* ================================================================ */
.stage3-ui .skeleton {
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.stage3-ui .skeleton-photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
}

.stage3-ui .skeleton-title {
  width: 280px;
  height: 20px;
  margin-bottom: 8px;
}

.stage3-ui .skeleton-meta {
  width: 180px;
  height: 14px;
  margin-bottom: 8px;
}

.stage3-ui .skeleton-trust {
  width: 200px;
  height: 14px;
}

.stage3-ui .skeleton-rec-title {
  width: 180px;
  height: 16px;
  margin-bottom: 12px;
}

.stage3-ui .skeleton-rec-body {
  width: 100%;
  height: 20px;
  margin-bottom: 8px;
}

.stage3-ui .skeleton-rec-body.short {
  width: 60%;
}

.stage3-ui .skeleton-section-title {
  width: 160px;
  height: 18px;
}

.stage3-ui .skeleton-row {
  width: 100%;
  height: 36px;
  margin: 0 16px 8px;
}

.stage3-ui .skeleton-row.short {
  width: 60%;
}

/* ================================================================ */
/* TABLET (768px)                                                    */
/* ================================================================ */
@media (max-width: 768px) {
.stage3-ui.app { padding: 0 12px 120px; }

.stage3-ui .rec-body {
    flex-direction: column;
    align-items: flex-start;
  }

.stage3-ui .grid-row {
    grid-template-columns: 1fr 1fr 70px 70px 50px;
    font-size: 13px;
    padding: 8px 12px;
  }

.stage3-ui .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

.stage3-ui .filters-row {
    margin-left: 0;
    width: 100%;
  }

.stage3-ui .filter-select {
    flex: 1;
  }

.stage3-ui .oem-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================================================================ */
/* MOBILE (480px)                                                    */
/* ================================================================ */
@media (max-width: 480px) {
.stage3-ui.app { padding: 0 8px 120px; }

.stage3-ui .search-button {
    padding: 10px 16px;
    font-size: 13px;
  }

.stage3-ui .product-card {
    flex-direction: column;
    gap: 12px;
  }

.stage3-ui .card-photo {
    align-self: center;
  }

.stage3-ui .card-title {
    font-size: 16px;
    text-align: center;
  }

.stage3-ui .card-meta {
    justify-content: center;
  }

.stage3-ui .card-trust {
    justify-content: center;
  }

.stage3-ui .rec-price {
    font-size: 28px;
  }

.stage3-ui .grid-row {
    grid-template-columns: 1fr 70px 50px;
    font-size: 12px;
    padding: 8px;
  }

.stage3-ui .grid-row .col-delivery
.stage3-ui .grid-row .col-stock {
    display: none;
  }

.stage3-ui .grid-header .col-delivery
.stage3-ui .grid-header .col-stock {
    display: none;
  }

  /* Карточки вместо таблицы на mobile */
.stage3-ui .suppliers-grid .grid-row[data-group] {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 4px;
    padding: 10px;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
  }

.stage3-ui .suppliers-grid .grid-row[data-group] .col-supplier { grid-column: 1; grid-row: 1; }
.stage3-ui .suppliers-grid .grid-row[data-group] .col-article { grid-column: 1; grid-row: 2; font-size: 11px; color: #b2bec3; }
.stage3-ui .suppliers-grid .grid-row[data-group] .col-price { grid-column: 2; grid-row: 1; text-align: right; }
.stage3-ui .suppliers-grid .grid-row[data-group] .col-delivery { display: block !important; grid-column: 2; grid-row: 2; text-align: right; font-size: 11px; color: #636e72; }
.stage3-ui .suppliers-grid .grid-row[data-group] .col-stock { display: block !important; grid-column: 2; grid-row: 3; text-align: right; font-size: 11px; }
.stage3-ui .suppliers-grid .grid-header { display: none; }

.stage3-ui .oem-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

.stage3-ui .oem-card {
    padding: 10px 6px;
  }
}

/* ================================================================ */
/* VISIBLE FOCUS — keyboad navigation                               */
/* ================================================================ */
.stage3-ui button:focus-visible,
.stage3-ui input:focus-visible,
.stage3-ui select:focus-visible,
.stage3-ui summary:focus-visible {
  outline: 3px solid #6c5ce7;
  outline-offset: 2px;
}

/* ================================================================ */
/* КОНТРАКТ: CSS-классы, которые НЕ ИСПОЛЬЗУЮТСЯ В JS               */
/* ================================================================ */
/*
 * Следующие классы используются только для визуального оформления:
 * .persistent-search, .search-row, .search-input, .search-button
 * .breadcrumbs, .crumb-*, .product-card, .card-*, .photo-placeholder
 * .recommendation, .rec-*, .suppliers-section, .section-header
 * .suppliers-grid, .grid-row, .grid-header, .grid-divider, .col-*
 * .oem-cards, .oem-summary, .oem-grid, .oem-card
 * .analog-section, .analog-summary
 * .empty-state, .error-state
 * .skeleton, .skeleton-*
 * .demo-footer, .demo-badge, .state-toggler
 *
 * JS (pricing-v7.js) зависит ТОЛЬКО от data-role:
 * search-input, search-button, part-article, part-brand
 * offers-count, best-price, suppliers-grid, suppliers-header
 * filters, loading-state, error-state
 */