/* Carroll Arms - Product Grid 1.0.3.
   Storefront product loops match My Account Favorites cards:
   left-aligned 15px/700 uppercase titles, left price (struck regular +
   olive sale + MAP), stock matches the price size (15px / 700) at desktop
   and phone, uppercase green #58762ede,
   full-width 36px olive buttons,
   plain 1:1 image with object-fit:contain, no SALE badge.
   Does not change column count, the single-product main summary, or My Account.
   Olive #8C760E; no red. */

/* Card roots used on shop, category, search, homepage, related, upsells,
   cross-sells, and the All Products / product-collection blocks. */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product
){
	display:flex !important;
	flex-direction:column;
	align-items:stretch;
	align-self:stretch;
	text-align:left;
	min-width:0;
	height:auto;
	box-sizing:border-box;
}

/* Equal-height cards in a row so margin-top:auto on the PRICE can pin the
   price + MAP + stock + button group to the same baseline. Extra space from
   short titles sits between the title and the price, so prices, stock lines
   and buttons line up across a row. Do not change how many columns a template uses —
   existing 4 / 2 / 6-col templates stay. Classic ul.products is floats
   on desktop; flex-wrap keeps those item widths. Phone archive already
   uses display:grid !important (child.css), which wins over this flex. */
body:not(.ca-myaccount) :is(
	ul.products,
	ol.products
){
	display:flex;
	flex-wrap:wrap;
	align-items:stretch;
}
body:not(.ca-myaccount) :is(
	ul.products,
	ol.products
)::before,
body:not(.ca-myaccount) :is(
	ul.products,
	ol.products
)::after{
	content:none !important;
	display:none !important;
}
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product
){
	float:none;
}
body:not(.ca-myaccount) :is(
	.wc-block-grid__products,
	.wc-block-product-template,
	ul.products-block-post-template,
	.wp-block-woocommerce-product-collection
){
	align-items:stretch;
}

/* Search results use the block post-template grid. The theme sets
   --wp--style--block-gap to 0 and a generated container rule sets
   gap:0, so full-width buttons and titles run into the next card.
   A CSS column-gap of 3.8% (the category gutter) would shrink the
   auto-fill minmax(12rem) tracks from 6 columns to 5, so desktop
   horizontal gutters are applied as 20px item padding instead
   (about the same 40px between buttons as category's 39px). Row
   gap can match category's 2.992em without changing the count. */
body:not(.ca-myaccount) :is(
	ul.products-block-post-template.is-layout-grid,
	ul.products-block-post-template.wp-block-post-template,
	.wp-block-woocommerce-product-collection ul.wp-block-post-template.is-layout-grid
){
	column-gap:0 !important;
	row-gap:2.992em !important;
}
body:not(.ca-myaccount) :is(
	ul.products-block-post-template.is-layout-grid,
	ul.products-block-post-template.wp-block-post-template,
	.wp-block-woocommerce-product-collection ul.wp-block-post-template.is-layout-grid
)>li{
	padding-left:20px !important;
	padding-right:20px !important;
	box-sizing:border-box !important;
}

/* ---- Image: no box, Favorites crop (contain in a 1:1 frame) ---- */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product
) :is(
	.wc-block-components-product-image,
	.wc-block-grid__product-image,
	.wp-block-woocommerce-product-image,
	.wp-block-cart-cross-sells-product__product-image
){
	position:relative;
	width:100%;
	aspect-ratio:1/1;
	border:0 !important;
	background:transparent !important;
	margin:0 0 12px !important;
	overflow:hidden;
	box-sizing:border-box;
	box-shadow:none !important;
	border-radius:0 !important;
}

/* Classic loop: the link wraps the image; give the image a square frame. */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product
) :is(
	a.woocommerce-LoopProduct-link,
	a.wc-block-grid__product-link
){
	display:flex;
	flex-direction:column;
	align-items:stretch;
	flex:1 1 auto;
	min-height:0;
	width:100%;
	text-decoration:none !important;
	color:#000;
}

body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product
) img:not(.ca-bis-sheet-thumb):not(.ca-qa-thumb):not(.ca-cp-thumb):not(.ca-cp-rec-thumb){
	border:0 !important;
	background:transparent !important;
	box-shadow:none !important;
	border-radius:0 !important;
	object-fit:contain !important;
	object-position:center center !important;
}

body:not(.ca-myaccount) :is(
	.wc-block-components-product-image,
	.wc-block-grid__product-image,
	.wp-block-woocommerce-product-image,
	.wp-block-cart-cross-sells-product__product-image
) img{
	width:100% !important;
	height:100% !important;
	max-width:100% !important;
	max-height:100% !important;
	object-fit:contain !important;
}

/* Classic / All Products block: square the first product photo. */
body:not(.ca-myaccount) ul.products li.product > a > img,
body:not(.ca-myaccount) ul.products li.product a.woocommerce-LoopProduct-link > img,
body:not(.ca-myaccount) .wc-block-grid__product a.wc-block-grid__product-link > img,
body:not(.ca-myaccount) .wc-block-grid__product .wc-block-grid__product-image img{
	width:100% !important;
	height:auto !important;
	aspect-ratio:1/1;
	object-fit:contain !important;
	margin:0 0 12px !important;
	display:block;
}

/* Hide SALE badges in every storefront loop (shop already hid the block badge). */
body:not(.ca-myaccount) :is(
	.wp-block-woocommerce-product-sale-badge,
	.wc-block-components-product-sale-badge,
	.wc-block-grid__product-onsale,
	ul.products li.product .onsale,
	ol.products li.product .onsale,
	span.onsale
){
	display:none !important;
}

/* ---- Title: 15px / 700 / uppercase / left (14px on phones) ---- */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product
) :is(
	.woocommerce-loop-product__title,
	.wp-block-post-title,
	.wp-block-post-title a,
	.wc-block-grid__product-title,
	.wc-block-components-product-title,
	.wc-block-components-product-title a,
	.wp-block-cart-cross-sells-product__product-title,
	.wp-block-cart-cross-sells-product__product-title a
){
	display:block !important;
	font-weight:700 !important;
	text-transform:uppercase !important;
	font-size:15px !important;
	line-height:1.3 !important;
	color:#000 !important;
	text-align:left !important;
	text-decoration:none !important;
	margin:0 0 8px !important;
	padding:0 !important;
	word-wrap:break-word;
	overflow-wrap:anywhere;
	height:auto !important;
	min-height:0 !important;
	max-height:none !important;
}

body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product
) :is(.wp-block-post-title, .woocommerce-loop-product__title, .wc-block-grid__product-title, .wc-block-components-product-title) a:hover{
	color:#000 !important;
	text-decoration:none !important;
}

/* ---- Price + MAP: left, 15px/700, struck #777, sale olive, MAP #735d0b ---- */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product
) :is(
	.price,
	.wc-block-components-product-price,
	.wp-block-woocommerce-product-price,
	.wc-block-grid__product-price
){
	font-size:15px !important;
	font-weight:700 !important;
	color:#000 !important;
	text-align:left !important;
	margin:0 0 6px !important;
	margin-top:auto !important;
	padding:0 !important;
	line-height:1.3 !important;
	width:100%;
}


/* Nested price wrappers (search / product collection) should not add a
   second auto margin or an extra 6px under the price. */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product
) :is(
	.wp-block-woocommerce-product-price,
	.price,
	.wc-block-grid__product-price,
	.wc-block-components-product-price
) :is(
	.price,
	.wc-block-components-product-price,
	.wc-block-grid__product-price
){
	margin:0 !important;
}

body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product
) :is(.price, .wc-block-components-product-price, .wc-block-grid__product-price) .woocommerce-Price-amount{
	color:#000;
}

body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product
) :is(.price, .wc-block-components-product-price, .wc-block-grid__product-price) :is(del, del .woocommerce-Price-amount){
	color:#777 !important;
	font-weight:400 !important;
}

body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product
) :is(.price, .wc-block-components-product-price, .wc-block-grid__product-price) :is(ins, ins .woocommerce-Price-amount){
	text-decoration:none !important;
	color:#8C760E !important;
	font-weight:700 !important;
}

body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product
) :is(.price, .wc-block-components-product-price, .wc-block-grid__product-price):has(>.ca-map-note){
	display:flex !important;
	flex-direction:column;
	align-items:flex-start !important;
	gap:0;
	text-align:left !important;
}

body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product
) .ca-map-note{
	display:block !important;
	margin:3px 0 0 !important;
	padding:0 !important;
	line-height:1.2 !important;
	font-weight:500 !important;
	color:#735d0b !important;
	font-size:.88em !important;
	text-align:left !important;
}

/* ---- Stock: same font-size as the price (15px at desktop and phone),
   still the old shop listing look otherwise: 700 / uppercase / #58762ede
   (same green for IN STOCK and OUT OF STOCK; no red), left-aligned.
   Gap to the button stays 8px. ---- */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product,
	.ca-bis-listing-cta
) :is(.ca-bis-stock-line--listing, .stock.ca-bis-stock-line, .stock.ca-bis-stock-line.in-stock, .stock.ca-bis-stock-line.out-of-stock),
body.home:not(.ca-myaccount) :is(
	ul.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.ca-bis-listing-cta
) :is(.ca-bis-stock-line--listing, .ca-bis-stock-line, .ca-bis-stock-line--listing.out-of-stock, .stock.ca-bis-stock-line.in-stock, .stock.ca-bis-stock-line.out-of-stock){
	margin:0 0 8px !important;
	padding:0 !important;
	font-size:15px !important;
	font-weight:700 !important;
	color:#58762ede !important;
	text-align:left !important;
	text-transform:uppercase !important;
	line-height:1.3 !important;
	width:100%;
	white-space:normal !important;
	background:transparent !important;
	text-decoration:none !important;
	letter-spacing:normal;
}

/* The IN STOCK <p> wraps a shipping-policy <a>. That link must not add
   its own 8px bottom margin (or display:block height), or In-stock cards
   would sit 8px taller than Out-of-stock cards and prices would not line up. */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.ca-bis-listing-cta
) :is(.ca-bis-stock-line--listing, .stock.ca-bis-stock-line, .ca-bis-stock-line) a,
body.home:not(.ca-myaccount) :is(
	ul.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.ca-bis-listing-cta
) :is(.ca-bis-stock-line--listing, .ca-bis-stock-line, .stock.ca-bis-stock-line) a{
	display:inline !important;
	width:auto;
	margin:0 !important;
	padding:0 !important;
	font-size:15px !important;
	font-weight:700 !important;
	line-height:1.3 !important;
	color:#58762ede !important;
	text-decoration:none !important;
	text-transform:uppercase !important;
	background:transparent !important;
}

/* ---- CTA column: full card width. Do not use margin-top:auto here — that
   would leave a hole between the price and the stock line. The price
   (above) is what pins the whole group to the card bottom. ---- */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product
) :is(
	.ca-bis-listing-cta,
	.wp-block-button,
	.wc-block-components-product-button,
	.wc-block-grid__product-add-to-cart,
	.wp-block-woocommerce-product-button
){
	width:100% !important;
	max-width:100% !important;
	margin-left:0 !important;
	margin-right:0 !important;
	margin-top:0 !important;
	margin-bottom:0 !important;
	padding-bottom:0 !important;
	flex:0 0 auto;
	display:flex !important;
	flex-direction:column;
	align-items:stretch !important;
	text-align:left;
	box-sizing:border-box;
}

/* Nested CTA wrappers should not add a top margin either. */
body:not(.ca-myaccount) :is(.ca-bis-listing-cta, .wc-block-grid__product-add-to-cart) :is(.wp-block-button, .wc-block-components-product-button, .ca-bis-listing-cta){
	margin-top:0 !important;
}

/* ---- Buttons: full card width, 36px, olive, Favorites type ---- */
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product,
	.ca-bis-listing-cta
) :is(
	a.add_to_cart_button,
	a.button,
	a.wp-element-button,
	a.wp-block-button__link,
	button.add_to_cart_button,
	button.wp-element-button,
	button.wp-block-button__link,
	button.ca-bis-notify-btn,
	a.ca-bis-notify-btn
){
	display:flex !important;
	align-items:center !important;
	justify-content:center !important;
	width:100% !important;
	max-width:100% !important;
	min-width:0 !important;
	box-sizing:border-box !important;
	text-align:center !important;
	background:#8C760E !important;
	background-color:#8C760E !important;
	color:#000 !important;
	border:1px solid #8C760E !important;
	border-radius:0 !important;
	font-weight:700 !important;
	text-transform:uppercase !important;
	letter-spacing:.04em !important;
	padding:0 12px !important;
	height:36px !important;
	min-height:36px !important;
	font-size:13px !important;
	line-height:1 !important;
	text-decoration:none !important;
	margin:0 !important;
	white-space:nowrap;
	box-shadow:none !important;
	float:none !important;
}

body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product,
	.ca-bis-listing-cta
) :is(
	a.add_to_cart_button,
	a.button,
	a.wp-element-button,
	a.wp-block-button__link,
	button.add_to_cart_button,
	button.wp-element-button,
	button.wp-block-button__link,
	button.ca-bis-notify-btn,
	a.ca-bis-notify-btn
):hover,
body:not(.ca-myaccount) :is(
	ul.products li.product,
	ol.products li.product,
	.wc-block-grid__product,
	li.wc-block-product,
	li.wp-block-post.product,
	.cross-sells-product,
	.wp-block-cart-cross-sells-product,
	.ca-bis-listing-cta
) :is(
	a.add_to_cart_button,
	a.button,
	a.wp-element-button,
	a.wp-block-button__link,
	button.add_to_cart_button,
	button.wp-element-button,
	button.wp-block-button__link,
	button.ca-bis-notify-btn,
	a.ca-bis-notify-btn
):focus-visible{
	background:#000 !important;
	background-color:#000 !important;
	border-color:#000 !important;
	color:#fdfbfb !important;
}

/* Phones: Favorites uses 14px titles and 12px / 36px buttons. */
@media (max-width:782px){
	body:not(.ca-myaccount) :is(
		ul.products-block-post-template.is-layout-grid,
		ul.products-block-post-template.wp-block-post-template,
		.wp-block-woocommerce-product-collection ul.wp-block-post-template.is-layout-grid
	){
		gap:20px 12px !important;
		column-gap:12px !important;
		row-gap:20px !important;
	}
	body:not(.ca-myaccount) :is(
		ul.products-block-post-template.is-layout-grid,
		ul.products-block-post-template.wp-block-post-template,
		.wp-block-woocommerce-product-collection ul.wp-block-post-template.is-layout-grid
	)>li{
		padding-left:0 !important;
		padding-right:0 !important;
	}

	body:not(.ca-myaccount) :is(
		ul.products li.product,
		ol.products li.product,
		.wc-block-grid__product,
		li.wc-block-product,
		li.wp-block-post.product,
		.cross-sells-product,
		.wp-block-cart-cross-sells-product
	) :is(
		.woocommerce-loop-product__title,
		.wp-block-post-title,
		.wp-block-post-title a,
		.wc-block-grid__product-title,
		.wc-block-components-product-title,
		.wc-block-components-product-title a,
		.wp-block-cart-cross-sells-product__product-title,
		.wp-block-cart-cross-sells-product__product-title a
	){
		font-size:14px !important;
	}

	body:not(.ca-myaccount) :is(
		ul.products li.product,
		ol.products li.product,
		.wc-block-grid__product,
		li.wc-block-product,
		li.wp-block-post.product,
		.cross-sells-product,
		.wp-block-cart-cross-sells-product,
		.ca-bis-listing-cta
	) :is(
		.ca-bis-stock-line--listing,
		.stock.ca-bis-stock-line,
		.stock.ca-bis-stock-line.in-stock,
		.stock.ca-bis-stock-line.out-of-stock,
		.ca-bis-stock-line--listing.in-stock,
		.ca-bis-stock-line--listing.out-of-stock,
		.ca-bis-stock-line,
		.ca-bis-stock-line a
	),
	body.home:not(.ca-myaccount) :is(
		ul.products li.product,
		.wc-block-grid__product,
		li.wc-block-product,
		li.wp-block-post.product,
		.ca-bis-listing-cta
	) :is(
		.ca-bis-stock-line--listing,
		.ca-bis-stock-line,
		.ca-bis-stock-line a,
		.ca-bis-stock-line--listing.out-of-stock,
		.ca-bis-stock-line--listing.in-stock,
		.stock.ca-bis-stock-line.in-stock,
		.stock.ca-bis-stock-line.out-of-stock
	){
		font-size:15px !important;
		line-height:1.3 !important;
	}

	body:not(.ca-myaccount) :is(
		ul.products li.product,
		ol.products li.product,
		.wc-block-grid__product,
		li.wc-block-product,
		li.wp-block-post.product,
		.cross-sells-product,
		.wp-block-cart-cross-sells-product,
		.ca-bis-listing-cta
	) :is(
		a.add_to_cart_button,
		a.button,
		a.wp-element-button,
		a.wp-block-button__link,
		button.add_to_cart_button,
		button.wp-element-button,
		button.wp-block-button__link,
		button.ca-bis-notify-btn,
		a.ca-bis-notify-btn
	){
		padding:0 8px !important;
		font-size:12px !important;
		height:36px !important;
		min-height:36px !important;
	}
}
