/* ================================================================
   CATALOG STYLES - Стили для страницы каталога
   Современный минимальный дизайн с чистыми линиями
   ================================================================ */

/* Карточка категорий - магазинный сайдбар */
.catalog-sidebar .card {
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.06);
}

.catalog-sidebar .card-header {
  border-bottom: 1px solid #e6e9ef;
  background: #fff;
  padding: 14px 16px;
}

.catalog-sidebar .card-body {
  padding: 10px 8px 12px;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f5f6f8;
}

.catalog-sidebar .card-body::-webkit-scrollbar {
  width: 6px;
}

.catalog-sidebar .card-body::-webkit-scrollbar-track {
  background: #f5f6f8;
}

.catalog-sidebar .card-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

/* Древовидное меню - магазинный стиль */
.catalog-tree,
.catalog-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.catalog-tree .category-item {
  display: block;
}

.catalog-tree .category-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.catalog-tree .toggle,
.catalog-tree .toggle-placeholder {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  color: #6b7280;
  font-size: 11px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.catalog-tree .toggle::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.15s ease;
}

.catalog-tree .category-item.open > .category-row > .toggle::before {
  transform: rotate(90deg);
}

.catalog-tree .toggle:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #1d4ed8;
}

.catalog-tree .category-item > .category-row > a.catalog-category-link {
  display: block;
  width: 100%;
  padding: 8px 10px;
  color: #111827;
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.catalog-tree .category-item.root > .category-row > a.catalog-category-link {
  font-weight: 600;
}

.catalog-tree .category-item > .category-row > a.catalog-category-link:hover {
  background: #f8fafc;
  color: #0f172a;
}

.catalog-tree .category-item > .category-row > a.catalog-category-link.active {
  background: #eff6ff;
  color: #1d4ed8;
  position: relative;
  font-weight: 600;
}

.catalog-tree .category-item > .category-row > a.catalog-category-link.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: #2563eb;
  border-radius: 2px;
}

.catalog-tree .children {
  margin: 2px 0 6px 16px;
  padding-left: 10px;
  border-left: 1px dashed #e5e7eb;
}

.catalog-tree .children[hidden] {
  display: none !important;
}

/* Фильтр производителей - современный стиль */
.catalog-vendors .card {
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.06);
}

.catalog-vendors .card-header {
  background: #fff;
  color: #333;
  border-bottom: 1px solid #e6e9ef;
  border-radius: 8px 8px 0 0;
  padding: 14px 16px;
}

.catalog-vendors .card-body {
  padding: 12px 16px;
  border-radius: 0 0 8px 8px;
}

.catalog-vendors .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 6px;
  transition: all 0.15s ease;
  margin-right: 6px;
  margin-bottom: 8px;
}

.catalog-vendors .btn-primary {
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #fff;
}

.catalog-vendors .btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.catalog-vendors .btn-outline-secondary {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
}

.catalog-vendors .btn-outline-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
}

/* Таблица товаров - современный стиль */
.catalog-table {
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.06);
}

.table-responsive {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.06);
}

.table-responsive .catalog-table {
  box-shadow: none;
}

.catalog-table thead {
  background: #f8fafc;
  color: #1e293b;
}

.catalog-table thead th {
  border-bottom: 1px solid #e6e9ef;
  font-weight: 600;
  padding: 14px 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.catalog-table tbody tr {
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #e6e9ef;
}

.catalog-table tbody tr:last-child {
  border-bottom: none;
}

.catalog-table tbody tr:hover {
  background-color: #f8fafc;
}

.catalog-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.catalog-table td a {
  font-weight: 500;
  color: #2563eb;
  transition: color 0.15s ease;
  text-decoration: none;
}

.catalog-table td a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Значки наличия - современный стиль */
.badge-success {
  background: #10b981;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.badge-secondary {
  background: #64748b;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

/* Детальная карточка товара - современный стиль */
.product-details {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

.product-details h1 {
  font-size: 28px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 20px;
  line-height: 1.3;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

/* Блок с изображением */
.product-image {
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.06);
}

.product-image > div {
  width: 100% !important;
  height: 400px;
  background: #f8fafc !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 14px;
  border: 2px dashed #e2e8f0;
}

/* Блок с информацией о товаре */
.product-info {
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.06);
}

.product-table {
  width: 100%;
  border-collapse: collapse;
}

.product-table tr {
  border-bottom: 1px solid #e6e9ef;
  transition: background-color 0.15s ease;
}

.product-table tr:last-child {
  border-bottom: none;
}

.product-table tr:hover {
  background-color: #f8fafc;
}

.product-table th,
.product-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

.product-table th {
  width: 180px;
  color: #64748b;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-table td {
  color: #1e293b;
  font-size: 15px;
}

.product-table td strong {
  font-size: 20px;
  color: #2563eb;
  font-weight: 600;
}

/* Блок описания товара */
.product-description {
  margin-top: 24px;
  padding: 24px;
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.06);
}

.product-description h3 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e6e9ef;
}

.product-description > div {
  color: #475569;
  line-height: 1.7;
  font-size: 15px;
}

/* Кнопка "Назад" */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #fff;
  color: #475569;
  text-decoration: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-back:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Вспомогательные классы */
.product-back-btn {
  margin-bottom: 20px;
}

.product-not-found {
  text-align: center;
}

.catalog-row-clickable {
  cursor: pointer;
}

/* Responsive */
@media (max-width: 991px) {
  .catalog-sidebar {
    margin-bottom: 20px;
    padding-top: 0;
  }

  .catalog-sidebar .card-body {
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}
