/* static/css/catalog.css */
/* Общие стили каталога: переопределения + модалка подкатегорий */

/* ── Catalog page-specific overrides ── */
.sidebar-back {
  padding: 0.3rem 0.75rem;
}
/* Active tag in filter bar */
.tag-link--active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
/* No top margin when filtered */
.product-listing--filtered {
  margin-top: 1.5rem;
}
/* Reset filter button */
.listing-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-decoration: none;
  padding: .3rem .7rem;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  background: var(--color-bg);
  transition: all .2s;
  white-space: nowrap;
}
.listing-reset-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ── Subcategory modal ── */
.subcat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: subcatFadeIn 0.2s ease;
}
@keyframes subcatFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.subcat-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: subcatSlideUp 0.25s ease;
}
@keyframes subcatSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.subcat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #f0f2f5;
}
.subcat-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text, #1a1a2e);
}
.subcat-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 8px;
  color: #9ca3af;
  transition: background 0.15s, color 0.15s;
}
.subcat-modal-close:hover {
  background: #f0f2f5;
  color: #374151;
}
.subcat-modal-body {
  padding: 0.5rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.subcat-modal-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f7f8fa;
  text-decoration: none;
  color: var(--color-text, #1a1a2e);
  transition: color 0.15s;
}
.subcat-modal-item:last-child {
  border-bottom: none;
}
.subcat-modal-item:hover {
  color: var(--color-accent, #2563eb);
}
.subcat-modal-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: #f7f8fa;
  flex-shrink: 0;
}
.subcat-modal-item-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.subcat-modal-item-name {
  font-size: 0.95rem;
  flex: 1;
  min-width: 0;
}
.subcat-modal-item-count {
  font-size: 0.8rem;
  color: #9ca3af;
  background: #f0f2f5;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.subcat-modal-footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid #f0f2f5;
  text-align: center;
}
.subcat-modal-all-btn {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent, #2563eb);
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  border-radius: 10px;
  transition: background 0.15s;
}
.subcat-modal-all-btn:hover {
  background: #eff6ff;
}

/* ── Mobile: модалка как bottom-sheet ── */
@media (max-width: 767px) {
  .subcat-modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
    margin-top: auto;
  }
  .subcat-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
}
