/* Shop, category and search results. */

.contener-shop { padding-block: var(--contener-section-y); }

.contener-shop__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0 clamp(24px, 3vw, 48px);
  align-items: start;
}

/* WooCommerce emits its breadcrumb, page header, toolbar, product list,
   pagination AND the sidebar as siblings, so every one of them becomes a grid
   item. Left to auto-placement they alternate across both columns and the
   product list ends up in a 280px track — cards one word wide. Everything is
   pinned to column 1; only the sidebar goes to column 2. */
.contener-shop__layout > * { grid-column: 1; min-width: 0; }

.contener-shop__layout > .contener-shop__sidebar {
  grid-column: 2;
  grid-row: 1 / span 100;
}

.woocommerce-breadcrumb {
  margin: 0 0 8px;
  color: var(--contener-text-muted);
  font-size: .875rem;
}
.woocommerce-breadcrumb a { color: inherit; }
.woocommerce-breadcrumb a:hover { color: var(--contener-brand); }

.woocommerce-products-header { margin-bottom: 4px; }
.woocommerce-products-header__title { margin: 0 0 8px; }

.contener-shop__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.contener-shop__toolbar .woocommerce-result-count { margin: 0; }
.contener-shop__toolbar .woocommerce-ordering { margin: 0; }

.woocommerce-pagination { margin-top: 32px; }
.woocommerce-pagination ul { display: flex; gap: 6px; justify-content: center; list-style: none; padding: 0; }

/* --- Sidebar ------------------------------------------------------------ */

.contener-shop__sidebar > * + * { margin-top: 28px; }
.contener-shop__widget-title {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--contener-border);
  font-size: 1.05rem;
}
.contener-shop__catlist { list-style: none; margin: 0; padding: 0; }
.contener-shop__catlist li { margin-bottom: 8px; }
.contener-shop__catlist a { text-decoration: none; }
.contener-shop__catlist a:hover { color: var(--contener-brand); }

.contener-shop__search { display: flex; gap: 8px; }
.contener-shop__search input[type="search"] { flex: 1 1 auto; min-width: 0; }

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

  /* Collapsing the template is not enough on its own. The sidebar carries an
     EXPLICIT placement — grid-column: 2 and grid-row: 1 / span 100 — and that
     placement survives the template change: `grid-column: 2` conjures an
     implicit second track, and `grid-row: 1` pulls the sidebar back up beside
     the breadcrumb, so it renders on top of the category copy while the main
     column is squeezed to a few characters wide. Both have to be handed back
     to auto-placement, which puts the sidebar after the products in source
     order. Reported from a phone on the live site, 2026-09-01. */
  .contener-shop__layout > .contener-shop__sidebar {
    grid-column: 1;
    grid-row: auto;
    margin-top: clamp(32px, 6vw, 56px);
  }
}
