/* Combined Best Sellers – frontend. Theme-agnostic grid/carousel built on WooCommerce's own product loop. */
.swenggco-cbs { --sbs-gap: 20px; --sbs-d: 4; --sbs-n: var(--sbs-d); position: relative; margin: 0 0 1.5em; }
.swenggco-cbs.sbs-n-1 { --sbs-d: 1; } .swenggco-cbs.sbs-n-2 { --sbs-d: 2; } .swenggco-cbs.sbs-n-3 { --sbs-d: 3; }
.swenggco-cbs.sbs-n-4 { --sbs-d: 4; } .swenggco-cbs.sbs-n-5 { --sbs-d: 5; } .swenggco-cbs.sbs-n-6 { --sbs-d: 6; }
.swenggco-cbs.sbs-n-7 { --sbs-d: 7; } .swenggco-cbs.sbs-n-8 { --sbs-d: 8; }

.swenggco-cbs-title { margin: 0 0 .75em; }

.swenggco-cbs ul.products { list-style: none; margin: 0; padding: 0; }
.swenggco-cbs ul.products::before,
.swenggco-cbs ul.products::after { display: none !important; content: none !important; }
.swenggco-cbs ul.products li.product { float: none !important; margin: 0 !important; clear: none !important; }

/* Grid */
.swenggco-cbs-grid ul.products { display: grid; gap: var(--sbs-gap); grid-template-columns: repeat(var(--sbs-n), minmax(0, 1fr)); }
.swenggco-cbs-grid ul.products li.product { width: auto !important; }

/* Carousel */
.swenggco-cbs-carousel ul.products {
	display: flex; gap: var(--sbs-gap); overflow-x: auto; scroll-snap-type: x mandatory;
	scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
}
.swenggco-cbs-carousel ul.products::-webkit-scrollbar { display: none; }
.swenggco-cbs-carousel ul.products li.product {
	flex: 0 0 calc((100% - (var(--sbs-n) - 1) * var(--sbs-gap)) / var(--sbs-n));
	width: auto !important; max-width: none; scroll-snap-align: start; box-sizing: border-box;
}

@media (max-width: 900px) { .swenggco-cbs { --sbs-n: min(var(--sbs-d), 3); } }
@media (max-width: 680px) { .swenggco-cbs { --sbs-n: min(var(--sbs-d), 2); --sbs-gap: 12px; } }
@media (max-width: 400px) { .swenggco-cbs-carousel { --sbs-n: 1; } }

/* Arrows + dots */
.swenggco-cbs-arrow {
	position: absolute; top: 40%; z-index: 2; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(0, 0, 0, .65); color: #fff; font-size: 20px; line-height: 38px; cursor: pointer; transition: opacity .2s;
}
.swenggco-cbs-arrow:hover, .swenggco-cbs-arrow:focus { background: #000; }
.swenggco-cbs-arrow[disabled] { opacity: .25; cursor: default; }
.swenggco-cbs-prev { left: -8px; } .swenggco-cbs-next { right: -8px; }
.swenggco-cbs-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.swenggco-cbs-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: #c3c4c7; cursor: pointer; }
.swenggco-cbs-dot.is-active { background: #1d2327; }

.swenggco-cbs-pagination { margin-top: 1.5em; text-align: center; }
.swenggco-cbs-pagination .page-numbers { display: inline-block; margin: 0 3px; padding: 6px 12px; border: 1px solid #dcdcde; border-radius: 3px; text-decoration: none; }
.swenggco-cbs-pagination .page-numbers.current { background: #1d2327; border-color: #1d2327; color: #fff; }

/* Best Seller badge */
.swenggco-cbs-badge-wrap:empty { display: none; }
.swenggco-cbs-badge-wrap { margin: 0 0 .6em; }
.swenggco-cbs-badge {
	display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 999px;
	background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; font-size: 13px; font-weight: 700;
	line-height: 1.4; letter-spacing: .02em; text-transform: uppercase; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.swenggco-cbs-badge--loop { position: absolute; top: 10px; left: 10px; z-index: 5; font-size: 11px; padding: 3px 9px; }
li.product:has(.swenggco-cbs-badge--loop) { position: relative; }
