/* Shop-wide badges: Sale -XX% (Astra primary colour) and Out of stock (red). */
/* Badge palette: Sale = deep brand colour (Astra primary, darkened), Out of stock = red text on soft red */
:root{--alh-sale:color-mix(in srgb,var(--ast-global-color-0,var(--alh-accent,#16a34a)) 78%,#000);--alh-oos:#dc2626}

.woocommerce ul.products li.product,
.woocommerce div.product,
.wc-block-grid__product{position:relative}

/* Sale: corner tab, top-right */
.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale,
.woocommerce div.product span.onsale,
span.onsale.alh-sale{
	position:absolute;top:0;right:0;left:auto;z-index:5;margin:0;
	min-width:0;min-height:0;width:auto;height:auto;
	padding:6px 11px 6px 12px;border-radius:0 0 0 10px;
	background:var(--alh-sale);color:#fff;box-shadow:0 2px 6px rgba(0,0,0,.14);
	font-size:11.5px;font-weight:700;line-height:1.2;letter-spacing:.03em;text-transform:uppercase;text-align:center;
}
/* Out of stock: corner tab, top-left, red text */
.alh-oos{
	position:absolute;top:0;left:0;right:auto;z-index:5;margin:0;
	padding:6px 12px 6px 11px;border-radius:0 0 10px 0;
	background:#DC2626;color:#FFFFFF;box-shadow:0 2px 6px rgba(0,0,0,.14);
	font-size:11.5px;font-weight:700;line-height:1.2;letter-spacing:.03em;text-transform:uppercase;text-align:center;
}

/* Single product stock text in red */
.woocommerce div.product p.stock.out-of-stock,
.woocommerce div.product .stock.out-of-stock{color:var(--alh-oos);font-weight:700}

/* Hide the theme's own out-of-stock label to avoid a duplicate */
.ast-shop-product-out-of-stock{display:none!important}

/* Hide the theme's own "Sale!" bubble — only our "Sale -XX%" badge is shown */
.woocommerce span.onsale:not(.alh-sale),
.woocommerce ul.products li.product .onsale:not(.alh-sale),
.woocommerce div.product span.onsale:not(.alh-sale),
.ast-onsale-card:not(.alh-sale){display:none!important}

/* Shop buttons = same look as the home page buttons (Astra primary colour) */
:root{--alh-b:var(--ast-global-color-0,var(--alh-accent,#16a34a));--alh-b-dark:color-mix(in srgb,var(--alh-b) 78%,#000);--alh-b-soft:color-mix(in srgb,var(--alh-b) 11%,#fff)}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.button,
.woocommerce div.product form.cart .single_add_to_cart_button,
.woocommerce .related ul.products li.product .button,
.wc-block-grid__product .wp-block-button__link{
	display:inline-flex;align-items:center;justify-content:center;gap:8px;
	background:var(--alh-b)!important;color:#fff!important;
	border:2px solid var(--alh-b)!important;border-radius:10px!important;
	font-weight:600;font-size:14px;line-height:1;padding:11px 18px!important;
	box-shadow:none;transition:background .15s,color .15s,transform .15s;
}
.woocommerce ul.products li.product .button:hover,
.woocommerce div.product form.cart .single_add_to_cart_button:hover,
.wc-block-grid__product .wp-block-button__link:hover{
	background:var(--alh-b-dark)!important;border-color:var(--alh-b-dark)!important;color:#fff!important;
}
.woocommerce ul.products li.product .button:active,
.woocommerce div.product form.cart .single_add_to_cart_button:active{transform:scale(.97)}

/* "Read more" / "Select options" / "View product" = ghost (outlined) like home page */
.woocommerce ul.products li.product .button:not(.add_to_cart_button),
.woocommerce ul.products li.product .button.product_type_variable,
.woocommerce ul.products li.product .button.product_type_grouped,
.woocommerce ul.products li.product .button.product_type_external{
	background:#fff!important;color:var(--alh-b-dark)!important;
}
.woocommerce ul.products li.product .button:not(.add_to_cart_button):hover,
.woocommerce ul.products li.product .button.product_type_variable:hover,
.woocommerce ul.products li.product .button.product_type_grouped:hover{
	background:var(--alh-b-soft)!important;border-color:var(--alh-b)!important;color:var(--alh-b-dark)!important;
}
/* "View cart" link after add to cart */
.woocommerce ul.products li.product a.added_to_cart{color:var(--alh-b-dark);font-weight:600;font-size:14px}

/* =====================================================================
   Shop / category / search product cards = same design as the home page cards
   ===================================================================== */
:root{--alh-ink:var(--ast-global-color-2,#0b2b2a);--alh-mut:var(--ast-global-color-3,#5b6f6e);--alh-line:var(--ast-global-color-6,#e3ece7)}

body ul.products li.product{
	position:relative;display:flex!important;flex-direction:column;
	background:#fff!important;border:1px solid var(--alh-line)!important;border-radius:14px!important;
	overflow:hidden;padding:0!important;box-shadow:none;
	transition:box-shadow .2s,border-color .2s;
}
body ul.products li.product:hover{
	box-shadow:0 6px 22px rgba(0,0,0,.08);
	border-color:color-mix(in srgb,var(--alh-b) 40%,var(--alh-line))!important;
}

/* Image area: square, soft grey, product contained with padding (like home) */
body ul.products li.product .astra-shop-thumbnail-wrap{position:relative;display:block;margin:0!important;padding:0!important;overflow:hidden;background:#f4f7f5}
body ul.products li.product a.woocommerce-LoopProduct-link{display:block;margin:0}
body ul.products li.product img.attachment-woocommerce_thumbnail,
body ul.products li.product .woocommerce-LoopProduct-link>img{
	display:block;width:100%!important;height:auto;aspect-ratio:1;object-fit:contain;
	background:#f4f7f5;padding:10px;margin:0!important;box-sizing:border-box;border-radius:0;
}

/* Text area */
body ul.products li.product .astra-shop-summary-wrap{
	display:flex;flex-direction:column;gap:6px;flex:1;padding:12px 14px 14px!important;margin:0;text-align:left;
}
/* Themes without Astra's summary wrapper: give the text the same inner padding */
body ul.products li.product:not(:has(.astra-shop-summary-wrap)) :is(.woocommerce-loop-product__title,.price,.star-rating,.ast-woo-product-category,.woocommerce-loop-category__title){
	margin-left:14px;margin-right:14px;
}
body ul.products li.product:not(:has(.astra-shop-summary-wrap)) .woocommerce-loop-product__title{margin-top:12px}
body ul.products li.product:not(:has(.astra-shop-summary-wrap)) :is(a.button,a.added_to_cart){margin:6px 14px 14px;width:calc(100% - 28px)}

body ul.products li.product .ast-woo-product-category{font-size:12px;color:var(--alh-mut);margin:0;padding:0}
body ul.products li.product .woocommerce-loop-product__title{
	margin:0;padding:0;font-size:14.5px!important;line-height:1.35;font-weight:600;color:var(--alh-ink);min-height:2.7em;
	display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
body ul.products li.product .woocommerce-loop-product__title:hover{color:var(--alh-b-dark)}
body ul.products li.product .star-rating{margin:0;font-size:13px}
body ul.products li.product .star-rating span::before{color:#f5a623}
body ul.products li.product .price{
	margin:auto 0 0;padding:0;font-weight:800;font-size:16px;color:var(--alh-b-dark)!important;display:block;
}
body ul.products li.product .price del{color:var(--alh-mut);font-weight:500;font-size:13px;margin-right:4px;opacity:1}
body ul.products li.product .price ins{text-decoration:none;background:transparent;color:inherit}

/* Full-width button like home cards */
body ul.products li.product .button,
body ul.products li.product a.button{
	width:100%;margin-top:6px;padding:10px 12px!important;font-size:13.5px;text-align:center;
}
body ul.products li.product a.added_to_cart{display:block;text-align:center;margin-top:4px}

/* =====================================================================
   Search results page: tidy spacing around the content and the theme footer
   (footer always sits at the bottom of the screen on PC too; same white look as the shop page)
   ===================================================================== */
html:has(body.search),html:has(body.search-results){background:#fff;margin-bottom:0}
body.search,body.search-results{background:#fff!important;margin:0!important;padding-bottom:0!important}
body.search #page,body.search-results #page{display:flex;flex-direction:column;min-height:100vh;min-height:100dvh;margin:0;padding:0;background:#fff}
body.search #content,body.search-results #content{flex:1 0 auto;background:#fff;margin:0;padding:0}
body.search #colophon,body.search-results #colophon{margin-top:auto!important}
body.search #content>.ast-container,body.search-results #content>.ast-container{padding-top:0!important;padding-bottom:0!important}
body.search #primary,body.search-results #primary{margin:24px 0!important;padding:0!important;background:transparent}
body.search #colophon,body.search-results #colophon,
body.search .site-footer,body.search-results .site-footer{margin:0!important}
body.search #colophon~*:empty,body.search-results #colophon~*:empty{display:none!important}

/* =====================================================================
   Single product page: same look as the home cards
   ===================================================================== */
/* Any badge that is not inside the gallery or a product grid (theme position) is hidden on single pages */
body.single-product div.product span.onsale:not(ul.products span.onsale):not(.woocommerce-product-gallery span.onsale),
body.single-product div.product .ast-onsale-card:not(ul.products .ast-onsale-card),
body.single-product div.product .alh-oos:not(ul.products .alh-oos){display:none!important}

body.single-product div.product .woocommerce-product-gallery{
	position:relative;background:#f4f7f5;border:1px solid var(--alh-line);border-radius:14px;overflow:hidden;
}
body.single-product div.product .woocommerce-product-gallery__image{position:relative}
body.single-product div.product .woocommerce-product-gallery__image img{display:block;width:100%;height:auto;object-fit:contain}
/* magnifier moves below the badge */
body.single-product div.product .woocommerce-product-gallery__trigger{top:44px!important;right:10px!important}

.alh-gb{
	position:absolute;top:0;z-index:6;padding:6px 12px;font-size:11.5px;font-weight:700;line-height:1.2;
	letter-spacing:.03em;text-transform:uppercase;color:#fff;box-shadow:0 2px 6px rgba(0,0,0,.14);
}
.alh-gb--sale{right:0;background:var(--alh-sale);border-radius:0 0 0 10px}
.alh-gb--oos{left:0;background:#DC2626;color:#FFFFFF;border-radius:0 0 10px 0}

/* Summary text */
body.single-product div.product .summary .product_title{font-size:clamp(22px,3vw,30px);line-height:1.2;font-weight:800;color:var(--alh-ink);margin-bottom:10px}
body.single-product div.product .summary .price{font-size:26px;font-weight:800;color:var(--alh-b-dark)!important;margin:0 0 12px}
body.single-product div.product .summary .price del{color:var(--alh-mut);font-weight:500;font-size:17px;opacity:1;margin-right:6px}
body.single-product div.product .summary .price ins{text-decoration:none;background:transparent;color:inherit}
body.single-product div.product .summary .product_meta{border-top:1px solid var(--alh-line);padding-top:12px;font-size:13.5px;color:var(--alh-mut)}
body.single-product div.product .summary .single_add_to_cart_button{padding:13px 26px!important;font-size:15px;border-radius:12px!important}
