/* Layout: sidebar + products */
.np-shop-layout__inner {
  max-width: var(--np-max);
  margin: 0 auto;
  padding: 18px 16px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: start;

  /* Anchor: Grid placement */
  grid-auto-flow: row;
}

/* Shop titlebar – centered across sidebar + products
   Anchor: Shop Title Centered */
.np-shop-layout__titlebar {
  grid-column: 1 / -1;
  margin-bottom: 14px;
  text-align: center;
}

.np-shop-layout__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

/* Anchor: Force sidebar + main into the correct columns */
.np-sidebar {
  grid-column: 1;
}

.np-shop {
  grid-column: 2;
  min-width: 0; /* prevents overflow issues in grids */
}

/* Toolbar stays inside main column */
.np-shop__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* Woo loop UL is usually .products */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
}

/* IMPORTANT:
   Prevent Woo/Theme clearfix pseudo-elements from becoming grid items.
   This fixes the "empty first slot" in a CSS grid layout. */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
  content: none !important;
  display: none !important;
}

/* Remove default floats/margins that some themes add */
.woocommerce ul.products li.product {
  list-style: none;
  margin: 0 !important;
  width: auto !important;
  float: none !important;
}

/* Responsive */
@media (max-width: 1000px) {
  .np-shop-layout__inner { grid-template-columns: 1fr; }
  .np-shop-layout__titlebar { margin-bottom: 10px; }

  /* Anchor: Stack sidebar above products on small screens */
  .np-sidebar { grid-column: 1; }
  .np-shop { grid-column: 1; }

  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .woocommerce ul.products { grid-template-columns: 1fr; }
}
