/* ════════════════════════════════════════
   Products List Page
   Стили специфичные для страницы Товари
   ════════════════════════════════════════ */

.page-products {
  padding: 16px;
}

/* HEADER */
.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.products-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 3px 0;
}
.products-counter {
  color: var(--text-secondary, #8B98A8);
  font-size: 12px;
  margin: 0;
}
.products-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* FILTERS */
.products-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.filters-search-row, .filters-chips-row, .filters-dropdowns-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 36px 8px 32px;
  background: var(--bg-elevated, #161C26);
  border: 1px solid var(--border-default, #2A3140);
  border-radius: 8px;
  color: var(--text-primary, #F2F4F7);
  font-size: 13px;
}
.search-input:focus {
  border-color: var(--accent, #10E089);
  outline: none;
}
.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
}

.filter-chip {
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text-primary);
}
.filter-chip:hover { background: var(--bg-hover, #1B2230); }
.filter-chip.active {
  background: var(--accent-dim, rgba(16, 224, 137, 0.15));
  border-color: var(--accent, #10E089);
  color: var(--accent);
  font-weight: 600;
}

.filter-select {
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}

/* TABLE */
.products-table-wrap {
  overflow-x: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  margin-bottom: 16px;
}
.products-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}
.products-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-base, #07090C);
  border-bottom: 1px solid var(--border-default);
}
.products-table td {
  padding: 7px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-subtle, #1B2230);
}
.product-row { cursor: pointer; transition: background 0.1s; }
.product-row:hover { background: var(--bg-hover, #1B2230); }

.product-photo {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background-color: var(--bg-base);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.product-photo.no-photo { color: var(--text-muted); }
.product-photo:not(.no-photo) { cursor: zoom-in; }

.type-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.mono { font-family: 'JetBrains Mono', monospace; }
.article-text { color: var(--accent); font-size: 12px; }

.name-cell { max-width: 220px; }
.product-name-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.rubric-tag {
  font-size: 10px;
  color: #A78BFA;
  cursor: pointer;
  margin-top: 2px;
}
.rubric-tag:hover { text-decoration: underline; }
.condition-note-tag {
  font-size: 10px;
  color: #F59E0B;
  background: #F59E0B15;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 3px;
  border-left: 2px solid #F59E0B;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.manual-check-tag {
  font-size: 10px;
  color: #EF4444;
  background: #EF444415;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

.location-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}
.pallet-badge {
  display: inline-block;
  padding: 2px 6px;
  background: var(--accent-dim, rgba(16, 224, 137, 0.15));
  color: var(--accent);
  border-radius: 4px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.dim-cell { color: var(--text-muted); font-size: 11px; }
.qty-cell { font-weight: 600; }
.qty-multi { color: #F59E0B; }

.price-cell { font-size: 11px; font-weight: 600; }
.price-prom { color: #FF6B35; }
.price-rozetka { color: #00A046; }
.price-empty { color: var(--text-muted); }

.status-tag { font-size: 12px; }

.row-actions { padding: 7px 8px; }
.action-buttons { display: flex; gap: 4px; }

/* LOADING + EMPTY */
.loading-cell { text-align: center; padding: 30px; }
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-cell { padding: 0; }
.empty-state-rich {
  max-width: 600px;
  margin: 60px auto;
  text-align: center;
  padding: 32px;
}
.empty-icon { font-size: 64px; opacity: 0.4; margin-bottom: 16px; }
.empty-title { font-size: 22px; margin-bottom: 8px; color: var(--text-primary); }
.empty-description { color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }
.empty-tips {
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 16px;
  text-align: left;
  font-size: 13px;
}
.empty-tips p { margin: 0 0 8px 0; }
.empty-tips ul { margin: 0; padding-left: 20px; color: var(--text-secondary); }
.empty-tips li { margin-bottom: 4px; }
.empty-tips a { color: var(--accent); text-decoration: none; }
.empty-tips a:hover { text-decoration: underline; }

/* PAGINATION */
.products-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  padding: 12px 4px;
}
.pagination-info { color: var(--text-secondary); font-size: 12px; margin-right: 6px; }
.pagination-page {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.pagination-page.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* SAVED VIEWS DROPDOWN */
.saved-views-dropdown {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  min-width: 260px;
  padding: 8px;
  z-index: 9999;
}
.sv-header { font-size: 11px; color: var(--text-muted); padding: 4px 8px; }
.sv-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; gap: 8px;
}
.sv-item:hover { background: var(--bg-hover); }
.sv-name { flex: 1; font-size: 13px; }
.sv-delete {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px 6px; font-size: 14px;
}
.sv-delete:hover { color: var(--rd, #EF4444); }
.sv-empty { padding: 12px; text-align: center; color: var(--text-muted); font-size: 12px; }
.sv-divider { border: none; border-top: 1px solid var(--border-default); margin: 6px 0; }
.sv-save-btn {
  width: 100%; padding: 10px;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 6px;
  font-size: 13px; cursor: pointer;
}
