/* Equal catalog tiles: theme material style uses max-width:none, so mixed ratios break the grid. */
.woocommerce ul.products li.product .product-wrap > a:first-of-type {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #fff;
}

.woocommerce ul.products li.product.material .product-wrap > a:first-of-type img,
.woocommerce ul.products li.product .product-wrap > a:first-of-type img {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: contain !important;
	object-position: center center;
	margin: 0 !important;
	pointer-events: none;
}

.woocommerce ul.products li.product.material .product-wrap {
	display: flex;
	flex-direction: column;
}

.woocommerce ul.products li.product.material .product-meta {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.woocommerce ul.products li.product.material .product-add-to-cart {
	margin-top: auto;
}

/* Product photos are on white; gray page bg made a white frame around them. */
.woocommerce .container-wrap,
.woocommerce-page .container-wrap,
.tax-product_cat .container-wrap,
.post-type-archive-product .container-wrap {
	background-color: #fff !important;
}

.woocommerce ul.products li.product.material,
.woocommerce ul.products li.product .product-wrap {
	background-color: #fff;
}

/* Single product: keep the preview in frame; click opens the lightbox. */
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image a,
.single-product .woocommerce-product-gallery .easyzoom > a {
	cursor: zoom-in;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 320px;
	background: #fff;
}

.single-product .woocommerce-product-gallery img.wp-post-image,
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
	max-width: 100% !important;
	max-height: min(70vh, 560px) !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain !important;
	margin: 0 auto !important;
	cursor: zoom-in;
}

.sft-crm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.88);
	cursor: zoom-out;
}

.sft-crm-lightbox img {
	max-width: 96vw;
	max-height: 96vh;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.sft-crm-lightbox-close {
	position: absolute;
	top: 16px;
	right: 20px;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
}

#header-outer .nectar-woo-cart .cart-contents {
	display: flex !important;
	align-items: center;
	gap: 8px;
}

/*
 * Header: logo | menu | shop/portal.
 * Salient mobile breakpoint is 1220px — do not force the desktop menu below that,
 * or CLIENT PORTAL is clipped (especially on shop, where the cart also sits in .buttons).
 */
@media only screen and (min-width: 1000px) {
	#header-outer[data-format="centered-menu"] #top,
	#header-outer[data-format="centered-menu"] #top > .container,
	#header-outer[data-format="centered-menu"] #top > .container > .row,
	#header-outer[data-format="centered-menu"] #top .span_9,
	#header-outer[data-format="centered-menu"] #top .span_9 nav {
		overflow: visible !important;
	}

	#header-outer[data-format="centered-menu"] #top nav >.buttons,
	#header-outer[data-format="centered-menu"] #top nav > ul.buttons {
		position: relative !important;
		right: auto !important;
		left: auto !important;
		top: auto !important;
		bottom: auto !important;
		height: auto !important;
		display: flex !important;
		flex: 0 0 auto;
		flex-wrap: nowrap !important;
		align-items: center;
		margin-left: 8px !important;
		min-width: max-content;
		z-index: 2;
		overflow: visible !important;
	}

	#header-outer[data-format="centered-menu"] #top nav > ul.buttons > li {
		flex: 0 0 auto;
		float: none;
	}

	#header-outer[data-format="centered-menu"] #top nav > ul > li[class*="button_solid_color"] > a {
		padding-left: 10px !important;
		padding-right: 10px !important;
		margin-left: 4px !important;
		margin-right: 4px !important;
	}

	#header-outer[data-format="centered-menu"] #top .nectar-woo-cart,
	#header-outer[data-format="centered-menu"] #top .cart-outer,
	#header-outer[data-format="centered-menu"] #top .cart-menu-wrap,
	#header-outer[data-format="centered-menu"] #top .cart-menu {
		position: relative !important;
		right: auto !important;
		top: auto !important;
		height: auto !important;
		width: auto !important;
	}

	#header-outer .sft-cart-total {
		display: none !important;
	}
}

@media only screen and (min-width: 1221px) {
	#header-outer[data-format="centered-menu"] #top > .container > .row {
		display: flex !important;
		align-items: center;
		flex-wrap: nowrap;
	}

	#header-outer[data-format="centered-menu"] #top .span_3 {
		position: relative !important;
		left: auto !important;
		flex: 0 0 auto;
		width: auto !important;
		margin-right: 16px !important;
		z-index: 5;
	}

	#header-outer[data-format="centered-menu"] #top .span_3 #logo {
		display: block;
		width: max-content;
	}

	#header-outer[data-format="centered-menu"] #top .span_9 {
		position: relative !important;
		left: auto !important;
		flex: 1 1 auto;
		width: auto !important;
		min-width: 0;
	}

	#header-outer[data-format="centered-menu"] #top .span_9 nav {
		display: flex !important;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		width: 100%;
	}

	#header-outer[data-format="centered-menu"] #top .span_9 .sf-menu:not(.buttons) {
		display: flex !important;
		flex: 1 1 0%;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: flex-start;
		width: auto !important;
		min-width: 0;
		text-align: left;
		position: relative;
		z-index: 1;
	}

	#header-outer[data-format="centered-menu"] #top .span_9 .sf-menu:not(.buttons) > li {
		flex: 0 1 auto;
	}

	#header-outer[data-format="centered-menu"] #top nav > .sf-menu:not(.buttons) > li > a {
		padding-left: 4px !important;
		padding-right: 4px !important;
	}

	#header-outer[data-format="centered-menu"] #top .logo-spacing {
		display: none !important;
	}
}

@media only screen and (max-width: 999px) {
	#mobile-cart-link {
		display: flex !important;
		align-items: center;
		gap: 8px;
	}
}

/* Header cart is a link to /cart/; hide Salient mini-cart / hover preview. */
.nectar-slide-in-cart,
.nectar-slide-in-cart-bg,
#header-outer .widget_shopping_cart,
#header-outer .cart-notification {
	display: none !important;
}

#header-outer .sft-cart-total,
#mobile-cart-link .sft-cart-total {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

#header-outer .sft-cart-total .woocommerce-Price-amount,
#mobile-cart-link .sft-cart-total .woocommerce-Price-amount {
	font-size: inherit;
}

.sft-cart-toast {
	position: fixed;
	top: 24px;
	right: 24px;
	z-index: 1000000;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	max-width: min(420px, calc(100vw - 32px));
	padding: 14px 18px;
	background: #111;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.sft-cart-toast.is-visible {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.sft-cart-toast a {
	color: #fff;
	font-weight: 600;
	text-decoration: underline;
}

.nectar-shop-header .sft-product-search {
	clear: both;
	margin: 0 0 28px;
}

.nectar-shop-header-bottom {
	display: flex;
	align-items: center;
	gap: 16px 24px;
	flex-wrap: wrap;
}

.nectar-shop-header-bottom .left-side {
	display: flex;
	align-items: center;
	gap: 16px;
	flex: 1 1 280px;
	min-width: 0;
}

.nectar-shop-header-bottom .sft-product-search {
	flex: 1 1 220px;
	max-width: 420px;
	margin: 0;
}

.nectar-shop-header-bottom .sft-product-search input[type="search"],
.nectar-shop-header-bottom .sft-product-search button {
	height: 40px;
}

.nectar-shop-header-bottom .sft-product-search input[type="search"] {
	line-height: 40px;
}

.sft-product-search {
	display: flex;
	align-items: stretch;
	gap: 8px;
	max-width: 560px;
	width: 100%;
}

.sft-product-search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	font-size: 15px;
	line-height: 46px;
	box-shadow: none;
}

.sft-product-search input[type="search"]:focus {
	border-color: #111;
	outline: none;
}

.sft-product-search button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	height: 46px;
	margin: 0;
	padding: 0 18px;
	border: 0;
	border-radius: 4px;
	background: #111;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.02em;
	cursor: pointer;
}

.sft-product-search button:hover {
	background: #333;
}

@media only screen and (max-width: 690px) {
	.sft-product-search {
		max-width: none;
	}

	.nectar-shop-header-bottom .left-side {
		flex-wrap: wrap;
		width: 100%;
	}

	.nectar-shop-header-bottom .sft-product-search {
		max-width: none;
		flex-basis: 100%;
	}
}

.woocommerce ul.products li.product .sft-stock {
	margin: 4px 0 0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.3;
}

.woocommerce div.product .stock.sft-stock--in_stock,
.woocommerce ul.products li.product .sft-stock--in_stock {
	color: #1a7f37;
}

.woocommerce div.product .stock.sft-stock--limited,
.woocommerce ul.products li.product .sft-stock--limited {
	color: #b45309;
}

.woocommerce div.product .stock.sft-stock--out_of_stock,
.woocommerce ul.products li.product .sft-stock--out_of_stock {
	color: #b42318;
}
