/* Product Listing: toolbar + filters + pagination. Tokens only. */
.bg-listing {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.bg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.bg-count {
  display:inline-flex;
  align-items:center;
  background: var(--bg-color-surface);
  border:1px solid var(--bg-color-surface-2);
  border-radius:8px;
  padding:8px 12px;
  font-family: var(--bg-font-product);
  font-size:13px;
  font-weight:600;
  color: var(--bg-color-text);
  letter-spacing:0.02em;
  margin: 10px 10px;
}
.bg-ordering { margin: 0; }
.bg-ordering select {
  background: var(--bg-color-surface);
  color: var(--bg-color-text);
  border: 1px solid var(--bg-color-surface-2);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--bg-font-heading);
  font-size: 14px;
}
.bg-filters {
  background: var(--bg-color-surface);
  border: 1px solid var(--bg-color-surface-2);
  border-radius: var(--bg-radius);
  padding: 16px;
  position: sticky;
  top: 90px;
}
.bg-filter-clear {
  color: var(--bg-color-accent);
  font-family: var(--bg-font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}
.bg-fgroup {
  border-top: 1px solid var(--bg-color-surface-2);
  padding: 10px 0;
}
.bg-fgroup summary {
  font-family: var(--bg-font-heading);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--bg-color-text);
  cursor: pointer;
  list-style: none;
}
.bg-fgroup summary::-webkit-details-marker { display: none; }
.bg-fgroup ul { list-style: none; margin: 8px 0 0; padding: 0; }
.bg-fgroup li a {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px;
  color: var(--bg-color-muted);
  font-family: var(--bg-font-body);
  font-size: 14px;
  text-decoration: none;
}
.bg-fgroup li a.on { color: var(--bg-color-accent); font-weight: 700; }
.bg-pagination { margin-top: 20px; text-align: center; }
.bg-pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 3px;
  border: 1px solid var(--bg-color-surface-2);
  border-radius: 8px;
  color: var(--bg-color-text);
  text-decoration: none;
  font-family: var(--bg-font-heading);
}
.bg-pagination .current { background: var(--bg-color-accent); color: var(--bg-color-accent-ink); border-color: var(--bg-color-accent); }
@media (max-width: 900px) {
  .bg-listing { grid-template-columns: 1fr; }
  .bg-filters { position: static; }
}

.bg-archive-desc{font-family:var(--bg-font-body);color:var(--bg-color-muted);max-width:70ch;margin:0 0 18px;line-height:1.65;}
.woocommerce-breadcrumb{font-family:var(--bg-font-heading);font-size:13px;color:var(--bg-color-muted);margin-bottom:12px;}
.woocommerce-breadcrumb a{color:var(--bg-color-text);text-decoration:none;}
.bg-empty{background:var(--bg-color-surface);border:1px solid var(--bg-color-surface-2);border-radius:var(--bg-radius);padding:40px 24px;text-align:center;}
.bg-empty-t{font-family:var(--bg-font-display);font-size:22px;color:var(--bg-color-text);margin:0 0 8px;}
.bg-empty p{color:var(--bg-color-muted);font-family:var(--bg-font-body);}
.bg-empty a{color:var(--bg-color-accent);}


/* FASE 11b: tienda y archives full-width. */
body.post-type-archive-product .bg-site-content>main.bg-container,body.tax-product_cat .bg-site-content>main.bg-container,body.tax-product_brand .bg-site-content>main.bg-container{max-width:none;padding-left:32px;padding-right:32px;box-sizing:border-box;}
@media (max-width:768px){body.post-type-archive-product .bg-site-content>main.bg-container,body.tax-product_cat .bg-site-content>main.bg-container,body.tax-product_brand .bg-site-content>main.bg-container{padding-left:16px;padding-right:16px;}}

/* FASE 11c: sin titulo shop + breadcrumb estilo single. */
body.post-type-archive-product,body.tax-product_cat,body.tax-product_brand{overflow-x:clip;}
body.post-type-archive-product main>.bg-section-title{display:none;}
main>.woocommerce-breadcrumb{margin:0 0 20px;padding:0;font-family:var(--bg-font-product);font-size:13px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;}
main>.woocommerce-breadcrumb a{color:var(--bg-color-accent);text-decoration:none;}
main>.woocommerce-breadcrumb a:hover{text-decoration:underline;}

/* FASE 11d: ocultar breadcrumb + titulo solo en shop. */


/* FASE 11e: label ordenar + Rajdhani. */
.bg-ordering{display:flex;align-items:center;gap:10px;}
.bg-order-label{font-family:var(--bg-font-product);font-size:14px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--bg-color-text);white-space:nowrap;}
.bg-ordering select{font-family:var(--bg-font-product);font-size:14px;font-weight:600;color:var(--bg-color-text);background:var(--bg-color-surface);border:1px solid var(--bg-color-surface-2);border-radius:8px;padding:9px 12px;}

/* Fix: toolbar count no fuera de pagina */
.bg-toolbar{position:relative;z-index:1;}
@media (max-width: 768px){
  .bg-toolbar{margin-left:0;margin-right:0;}
  .bg-count{font-size:12px;padding:7px 10px;}
}

/* Fix: evitar desborde toolbar y listing en mobile.
   OJO: se usa clip (no hidden) para no crear un scroll container:
   con overflow:hidden la sidebar sticky se desplomaba 90px y no quedaba
   alineada con la barra de ordenamiento. */
.bg-listing,
.bg-listing-main{
  max-width:100%;
  min-width:0;
  overflow:clip;
}
.bg-toolbar{
  max-width:100%;
  flex-wrap:wrap;
  box-sizing:border-box;
}
.bg-ordering,
.bg-ordering select{
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}
@media (max-width:768px){
  .bg-toolbar{
    gap:10px;
    flex-wrap:nowrap;
  }
  .bg-ordering{flex:0 1 auto;}
  .bg-ordering select{width:auto;max-width:52vw;}
  .bg-count{flex-shrink:0;white-space:nowrap;}
}

@media (max-width: 768px) {
    .bg-count {
        margin: 10px 10px 0px 0px;
    }
}
