/* APBCT - Basic styling for grid + pagination.
   Safe to override in your theme/Divi. */

/* Wrapper */
.apbct-wrapper{
	width:100%;
	position:relative;
}
.apbct-wrapper.is-loading{
	opacity:0.75;
	pointer-events:none;
}

/* Grid: responsive + keeps full width across column counts */
.apbct-product-grid{
	display:grid;
	gap:3em;
	width:100%;
	align-items:stretch;
}
@media (min-width: 600px) {
	.apbct-product-grid {
			gap: 2em !important;
		}
}
@media (max-width: 600px) {
	.apbct-product-grid {
			gap: 1em !important;
		}
}

/* Default responsive behavior:
   - On mobile: 1 column
   - Small tablets: 2 columns
   - Tablets: 3 columns
   - Desktop: use the shortcode "columns" value (capped by CSS below)
*/
.apbct-product-grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr));
    }
@media (min-width: 600px){
	.apbct-product-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 820px){
	.apbct-product-grid{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
}

/* Honor the shortcode column setting on larger screens */
@media (min-width: 1024px){
	.apbct-cols-1{ grid-template-columns:repeat(1, minmax(0, 1fr)); }
	.apbct-cols-2{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
	.apbct-cols-3{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
	.apbct-cols-4{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
	.apbct-cols-5{ grid-template-columns:repeat(5, minmax(0, 1fr)); }
	.apbct-cols-6{ grid-template-columns:repeat(6, minmax(0, 1fr)); }
}

/* product count */
.apbct-result-count {
	font-size: 1rem;
	font-weight: 800;
	color: #21a803 !important;
}

/* Product card */
.apbct-product-item{
	background: #191919;
	overflow:hidden;
	transition:transform 160ms ease, border 160ms ease;
	display:flex;
	flex-direction:column;
	min-height:100%;
}

.apbct-product-item:hover{
	transform:translateY(-2px);

}

.apbct-product-link {
	position: relative;
	display: block;
	text-decoration: none;
	color: inherit;
	overflow: hidden;
}

/* Overlay layer */
.apbct-product-link::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(25, 25, 25, 0.05);
	/* 5% of #191919 */
	opacity: 0;
	transition: opacity 160ms ease;
	pointer-events: none;
}

/* Show overlay on hover */
.apbct-product-item:hover .apbct-product-link::after {
	opacity: 1;
}

.apbct-product-item img{
	width:100%;
	height:auto;
	display:block;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

/* Title + price area */
.apbct-product-title{
	margin:20px 20px 1em;
	padding-bottom: 5px !important;
	font-size:1.25rem;
	font-weight:800;
	color: white !important;
	text-align: center !important;
}

@media (min-width: 600px) {
	.apbct-product-title {
			font-size: 0.9rem;
		}
	.apbct-price {
		font-size: 0.80rem;
	}
}
@media (max-width: 600px) {
	.apbct-product-title {
			font-size: 0.9rem;
		}
	.apbct-price {
		font-size: 0.8rem !important;
	}
}

.apbct-price{
	margin:auto 0 0;
	font-size:1rem;
	display:block;
	font-weight:600;
	color: #21a803 !important;
	text-align: center !important;
}

/* Category line added in loop (if you also use it there) */
.apbct-product-category{
	margin:12px 14px -6px;
    color: #21a803 !important;
}

/* Pagination */
.apbct-pagination{
	margin-top:22px;
	display:flex;
	justify-content:center; /* center pagination */
}

.apbct-page-list{
	list-style:none;
	padding: 1em 2em !important;
	margin:0;
	display:flex;
	gap:10px;
	flex-wrap:wrap;
	align-items:center;
	justify-content:center; /* center pagination */
	background-color: #191919;
}

.apbct-page-item.apbct-ellipsis{
  color: #21a803 !important;
  font-weight: 700;
}

.apbct-page-item a,
.apbct-page-item span{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	min-width:40px;
	height:40px;
	padding:0 12px;
	text-decoration:none;
	line-height:1;
	color: #21a803;
	background:#191919;
	transition:transform 120ms ease, box-shadow 120ms ease;
}

.apbct-page-item a:hover{
	transform:translateY(-1px);
	box-shadow:0 6px 16px rgba(0,0,0,0.08);
}

.apbct-page-item.is-current span{
	font-weight:800;
	border-color:rgba(0,0,0,0.22);
	box-shadow:0 6px 16px rgba(0,0,0,0.08);
}

/* HARD reset bullets/markers for this pagination only */
.apbct-pagination ul.apbct-page-list,
.apbct-pagination ul.apbct-page-list > li.apbct-page-item{
  list-style: none !important;
  list-style-type: none !important;
  list-style-image: none !important;
}

/* Some themes inject content via ::marker — force it empty */
.apbct-pagination ul.apbct-page-list > li.apbct-page-item::marker{
  content: "" !important;
}

/* Safety: some themes use ::before to fake markers */
.apbct-pagination ul.apbct-page-list > li.apbct-page-item::before{
  content: none !important;
}

/* Load more button (lazy_load="1") */
.apbct-load-more{
	padding:12px 18px;
	border:1px solid rgba(0,0,0,0.12);
	border-radius:999px;
	cursor:pointer;
	background:#fff;
	font-weight:700;
	transition:transform 120ms ease, box-shadow 120ms ease;
}

.apbct-load-more:hover{
	transform:translateY(-1px);
	box-shadow:0 6px 16px rgba(0,0,0,0.08);
}

.apbct-load-more[disabled]{
	opacity:0.6;
	cursor:not-allowed;
	box-shadow:none;
	transform:none;
}

/* Make sure buttons/links don't look weird inside Divi */
.apbct-wrapper a:focus,
.apbct-wrapper button:focus{
	outline:2px solid rgba(0,0,0,0.25);
	outline-offset:2px;
}


/* Result count */
.apbct-count-wrap{ width:100%; margin:0 0 14px; display:flex; justify-content:flex-start; }
.apbct-result-count{ font-weight:700; opacity:0.85; }




/* ============================================================
   DIVI WOOCOMMERCE PRODUCT CARDS
   
   DOM structure:
     <li class="product">                          ← black card
       <a class="woocommerce-LoopProduct-link">    ← image + title + price
       </a>
       <div class="apbct-add-to-cart apbct-woo-cart-wrap">
         <a class="apbct-cart-btn">Add To Cart</a> ← our button (sibling of <a>)
         <a class="wc-forward">View cart</a>        ← WC injects this after add
       </div>
     </li>
   ============================================================ */

/* <li> = the black card */
ul.products li.product {
    background: #191919 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transition: transform 160ms ease !important;
}

ul.products li.product:hover {
    transform: translateY(-2px) !important;
}

/* <a> card link: transparent, flex-col, grows to push button to bottom */
ul.products li.product a.woocommerce-LoopProduct-link {
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    height: auto !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    color: inherit !important;
    overflow: visible !important;
}

/* Image */
ul.products li.product a.woocommerce-LoopProduct-link .et_shop_image,
ul.products li.product a.woocommerce-LoopProduct-link img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    aspect-ratio: 4 / 5 !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

/* Title — flex-grow soaks up variable height so price+button always bottom-align */
ul.products li.product a.woocommerce-LoopProduct-link .woocommerce-loop-product__title {
    margin: 16px 16px 0 !important;
    padding: 0 0 8px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    flex-grow: 1 !important;
}

/* Price — sits directly above the button */
ul.products li.product a.woocommerce-LoopProduct-link .price,
ul.products li.product a.woocommerce-LoopProduct-link span.price {
    display: block !important;
    margin: 0 16px 12px !important;
    padding: 0 !important;
    color: #21a803 !important;
    font-weight: 600 !important;
    flex-shrink: 0 !important;
}

/* Button wrapper — flush to card edges, pushed to bottom by flex */
ul.products li.product .apbct-add-to-cart {
    margin-top: auto !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    flex-shrink: 0 !important;
}

/* ── ADD TO CART button ── */
ul.products li.product .apbct-add-to-cart a.apbct-cart-btn,
ul.products li.product .apbct-add-to-cart .apbct-cart-btn {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
    margin-top: auto !important;
    padding-top: 0.5em !important;
    padding-bottom: 0.5em !important;
    background: #21a803 !important;
    background-color: #21a803 !important;
    color: #ffffff !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer !important;
    transition: background-color 160ms ease !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
}

/* Hide after cart add (JS adds .apbct-btn-hidden) */
ul.products li.product .apbct-add-to-cart a.apbct-cart-btn.apbct-btn-hidden {
    display: none !important;
}

/* Kill Divi pseudo-element arrows */
ul.products li.product .apbct-add-to-cart a.apbct-cart-btn::after,
ul.products li.product .apbct-add-to-cart a.apbct-cart-btn::before {
    display: none !important;
    content: none !important;
}

ul.products li.product .apbct-add-to-cart a.apbct-cart-btn:hover {
    background: #1a8e02 !important;
    background-color: #1a8e02 !important;
    color: #ffffff !important;
}

/* ── VIEW CART link — WooCommerce injects .wc-forward after add ── */
ul.products li.product .apbct-add-to-cart a.wc-forward, .apbct-add-to-cart .added_to_cart {
    display: inline-block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding-top: 0.5em !important;
    padding-bottom: 0.5em !important;
    background-color: #808080 !important;
    color: #ffffff !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
}

ul.products li.product .apbct-add-to-cart a.wc-forward::after,
ul.products li.product .apbct-add-to-cart a.wc-forward::before,
ul.products li.product .apbct-add-to-cart .added_to_cart::after,
ul.products li.product .apbct-add-to-cart .added_to_cart::before {
    display: none !important;
    content: none !important;
}

ul.products li.product .apbct-add-to-cart a.wc-forward:hover,
ul.products li.product .apbct-add-to-cart .added_to_cart:hover {
    background-color: #696969 !important;
    color: #ffffff !important;
}

/* ── CUSTOM APBCT SHORTCODE GRID (identical styling) ── */
.apbct-product-item {
    display: flex !important;
    flex-direction: column !important;
}

.apbct-price {
    margin-top: auto !important;
    margin-bottom: 0 !important;
    padding-bottom: 12px !important;
}

.apbct-product-item .apbct-add-to-cart {
    margin-top: auto !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.apbct-product-item .apbct-add-to-cart a.apbct-cart-btn,
.apbct-product-item .apbct-add-to-cart .apbct-cart-btn {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
    margin-top: auto !important;
    padding-top: 0.5em !important;
    padding-bottom: 0.5em !important;
    background: #21a803 !important;
    background-color: #21a803 !important;
    color: #ffffff !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: background-color 160ms ease !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
}

.apbct-product-item .apbct-add-to-cart a.apbct-cart-btn.apbct-btn-hidden {
    display: none !important;
}

.apbct-product-item .apbct-add-to-cart a.apbct-cart-btn::after,
.apbct-product-item .apbct-add-to-cart a.apbct-cart-btn::before {
    display: none !important;
    content: none !important;
}

.apbct-product-item .apbct-add-to-cart a.apbct-cart-btn:hover {
    background: #1a8e02 !important;
    background-color: #1a8e02 !important;
    color: #ffffff !important;
}

.apbct-product-item .apbct-add-to-cart a.wc-forward,
.apbct-product-item .apbct-add-to-cart .added_to_cart {
    display: inline-block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding-top: 0.5em !important;
    padding-bottom: 0.5em !important;
    background-color: #808080 !important;
    color: #ffffff !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
}

.apbct-product-item .apbct-add-to-cart a.wc-forward::after,
.apbct-product-item .apbct-add-to-cart a.wc-forward::before,
.apbct-product-item .apbct-add-to-cart .added_to_cart::after,
.apbct-product-item .apbct-add-to-cart .added_to_cart::before {
    display: none !important;
    content: none !important;
}

.apbct-product-item .apbct-add-to-cart a.wc-forward:hover,
.apbct-product-item .apbct-add-to-cart .added_to_cart:hover {
    background-color: #696969 !important;
    color: #ffffff !important;
}
