/* ═══════════════════════════════════════
   SANCOMFORT — CATALOG PAGE (archive-product)
   Dvokolonkovyi layout: sidebar + product grid
   ═══════════════════════════════════════ */

/* -----------------------------------------------
   LAYOUT — sidebar 260px + content auto
   ----------------------------------------------- */
.sc-catalog-page {
  padding: 0 0 60px;
}

.sc-catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  column-gap: clamp(48px, 4vw, 64px);
  row-gap: 0;
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* -----------------------------------------------
   SIDEBAR — filtry
   ----------------------------------------------- */
.sc-catalog-sidebar {
  position: sticky;
  top: 20px;
  padding: 0 8px 0 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* Header sidebaru — na desktopi prykhovanyi */
.sidebar-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar-header h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text-heading);
  margin: 0;
}

.sidebar-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--r-sm);
  background: var(--bg-secondary);
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-close:hover {
  background: var(--urgency-soft);
  border-color: var(--urgency);
  color: var(--urgency);
}

/* Overlay — dlia mobilnoho off-canvas */
.sc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 35, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sc-sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Spysok filtriv v sidebari */
.filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.filter-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-body);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: all 0.2s;
}

.filter-list li a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.filter-list li a .count {
  font-size: 12px;
  color: var(--text-light);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 10px;
}

/* -----------------------------------------------
   CATALOG HEADER — zaholovok katehorii
   ----------------------------------------------- */
.catalog-header {
  margin-bottom: 20px;
}

.catalog-header h1 {
  font-family: var(--font-heading);
  font-size: 30px;
  color: var(--text-heading);
  margin: 0 0 8px;
}

.cat-description {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 100%;
}

/* -----------------------------------------------
   TOOLBAR — filtry, sortuvannia, kilkist
   ----------------------------------------------- */
.catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Knopka "Filtry" — na desktopi prykhavana */
.sc-btn-filters {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  cursor: pointer;
  transition: all 0.2s;
}

.sc-btn-filters:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.sc-btn-filters__icon {
  font-size: 16px;
}

/* Result count ta ordering — zvilniuiemo prostir */
.catalog-toolbar .woocommerce-result-count {
  margin: 0;
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

.catalog-toolbar .woocommerce-ordering {
  margin: 0;
}

.catalog-toolbar .woocommerce-ordering select {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-body);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.2s;
}

.catalog-toolbar .woocommerce-ordering select:focus {
  outline: none;
  border-color: var(--primary);
}

/* -----------------------------------------------
   NO PRODUCTS — zahlushka
   ----------------------------------------------- */
.sc-no-products {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--r-lg);
}

.sc-no-products__icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.sc-no-products h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--text-heading);
  margin: 0 0 8px;
}

.sc-no-products p {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.sc-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s var(--ease);
}

.sc-btn-back:hover {
  background: var(--accent);
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

/* -----------------------------------------------
   RESPONSIVE — tablet & mobile
   ----------------------------------------------- */

/* Tablet — sidebar vijizhdzhaie z liva */
@media (max-width: 1024px) {
  .sc-catalog-layout {
    grid-template-columns: 1fr;
  }

  .sc-btn-filters {
    display: flex;
  }

  .sc-catalog-sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    width: 300px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    z-index: 1000;
    padding: 20px;
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    transition: left 0.35s var(--ease);
    overflow-y: auto;
  }

  .sc-catalog-sidebar.open {
    left: 0;
  }

  .sidebar-header {
    display: flex;
  }

  /* Product grid — 3 na tablet */
  .sc-catalog-content ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Mobile — 2 kartky v riad */
@media (max-width: 768px) {
  .sc-catalog-content ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .catalog-header h1 {
    font-size: 24px;
  }

  .catalog-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* Dribni ekrany — 1 kartka */
@media (max-width: 480px) {
  .sc-catalog-content ul.products {
    grid-template-columns: 1fr !important;
  }
}

/* WP admin bar + sticky sidebar na desktop */
.admin-bar .sc-catalog-sidebar {
  top: 52px; /* 32px admin bar + 20px vidstup */
}

/* Na planseti i mobilnomu — fixed sidebar z povnoiu vysotoiu */
@media (max-width: 1024px) {
  .admin-bar .sc-catalog-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);
  }
}

@media screen and (max-width: 782px) {
  .admin-bar .sc-catalog-sidebar {
    top: 46px;
    height: calc(100vh - 46px);
    max-height: calc(100vh - 46px);
  }
}
