/* Catalog page - bancafbll style */
.page-catalog .catalog-main {
  padding: 24px 0 48px;
}

.page-catalog .catalog-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}

.catalog-sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 16px;
}

.catalog-sidebar::-webkit-scrollbar {
  width: 6px;
}

.catalog-sidebar::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 4px;
}

.catalog-sidebar::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 4px;
}

.catalog-sidebar::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.sidebar-block {
  margin-bottom: 24px;
}

.sidebar-block h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.sidebar-block h3 .arrow {
  font-size: 10px;
  transition: transform 0.2s;
}

.sidebar-block.collapsed h3 .arrow {
  transform: rotate(-90deg);
}

.sidebar-block.collapsed .sidebar-links {
  display: none;
}

.sidebar-block a {
  display: block;
  font-size: 15px;
  color: var(--text-muted);
  padding: 6px 0;
  transition: color 0.2s;
  text-decoration: none;
}

.sidebar-block a:hover,
.sidebar-block a.active {
  color: var(--text);
  font-weight: 500;
}

.sidebar-links {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.sidebar-block a:hover {
  color: var(--blue);
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.catalog-toolbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--blue);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.results-count {
  font-size: 14px;
  color: var(--text-muted);
}

.sort-select {
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.view-switch {
  display: inline-flex;
  border: 1px solid var(--border);
}

.view-btn {
  border: none;
  background: #fff;
  color: var(--text-muted);
  padding: 8px 10px;
  cursor: pointer;
}

.view-btn.active {
  background: var(--blue);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

#catalog-grid.view-rows {
  grid-template-columns: 1fr;
}

#catalog-grid.view-rows .product-card {
  display: grid;
  grid-template-columns: 220px 1fr;
}

#catalog-grid.view-column {
  grid-template-columns: 1fr;
  max-width: 620px;
}

#catalog-grid.view-column .product-card {
  max-width: 620px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.3s ease;
}

.product-card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-6px);
}

.product-image {
  display: block;
  position: relative;
  aspect-ratio: 1;
}

.product-img-placeholder {
  width: 100%;
  height: 100%;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent);
  color: #000;
  border-radius: 4px;
}

.product-badge.sale {
  background: #e74c3c;
  color: #fff;
}

.product-badge.signed {
  background: #f0c674;
  color: #000;
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px;
}

.product-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.product-tag {
  display: inline-block;
  padding: 4px 10px;
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.2s;
}

.product-tag:hover {
  background: var(--blue);
  color: #fff;
  transform: translateY(-1px);
}

.product-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.product-info h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.product-info h3 a:hover {
  color: var(--blue);
}

.product-details {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-price strong {
  font-size: 1.1rem;
}

.price-old {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.catalog-empty {
  color: var(--text-muted);
  margin: 12px 0 0;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: all 0.2s;
}

.page-link:hover:not(.disabled) {
  color: var(--text);
  border-color: var(--blue);
}

.page-link.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.page-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

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

@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  #catalog-grid.view-rows .product-card {
    grid-template-columns: 1fr;
  }
}
