/* Modern, simple shop/category archive. */
body .site-main ul.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
	margin: 0 0 32px;
	padding: 0;
	list-style: none;
}
body .site-main ul.products::before,
body .site-main ul.products::after {
	display: none;
}
body .site-main ul.products li.product {
	float: none;
	width: auto !important;
	max-width: none !important;
	min-width: 0;
	flex: none !important;
	margin: 0 !important;
	padding: 0;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e8ebef;
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow .2s ease, transform .2s ease;
}
body .site-main ul.products li.product:hover {
	box-shadow: 0 8px 24px rgba(0, 40, 77, .08);
	transform: translateY(-2px);
}
body .site-main ul.products li.product .product-block {
	display: flex;
	flex: 1;
	flex-direction: column;
	height: auto;
	padding: 14px;
	border: 0;
	box-shadow: none;
	background: transparent;
}
body .site-main ul.products li.product .product-block .product-transition {
	display: block;
	width: 100%;
	margin-bottom: 0;
}
body .site-main ul.products li.product .product-block .product-img-wrap,
body .site-main ul.products li.product .product-block .product-img-wrap .inner {
	width: 100%;
	height: auto;
}
body .site-main ul.products li.product .product-block .product-image.second-image {
	height: 100%;
	top: 0;
	left: 0;
}

/* Images keep their natural aspect ratio inside a square frame. */
body .site-main ul.products li.product .product-transition,
body .site-main ul.products li.product .product-img-wrap,
body .site-main ul.products li.product .product-image {
	position: relative;
}
body .site-main ul.products li.product .product-image {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	background: #fff;
}
body .site-main ul.products li.product .product-image img {
	width: auto !important;
	height: auto !important;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain !important;
}
body .site-main ul.products li.product .woocommerce-loop-product__title {
	margin: 12px 0 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
}
body .site-main ul.products li.product .woocommerce-loop-product__title a {
	color: #14202e;
}
/* Show the full name, wrapping onto as many lines as it needs; min-height
   keeps short (1-line) names aligned with 2-line ones in the same row. */
body .site-main ul.products li.product .woocommerce-loop-product__title {
	overflow-wrap: break-word;
	min-height: 2.7em;
}
body .site-main ul.products li.product .freshio-loop-add-to-cart .quantity {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
body .site-main ul.products li.product .freshio-loop-add-to-cart .quantity::before {
	content: "Qty:";
	font-size: 13px;
	font-weight: 600;
	color: #5b6775;
}
body .site-main ul.products li.product .price {
	margin-bottom: 10px;
	font-weight: 700;
	text-align: center;
}
body .site-main ul.products li.product .price::after,
body .site-main ul.products li.product .price::before,
body .site-main ul.products li.product .product-block:hover .price::after {
	display: none !important;
	content: none !important;
}
body .site-main ul.products li.product .freshio-loop-add-to-cart,
body .site-main ul.products li.product > .product-block > .add_to_cart_button {
	margin-top: auto;
}

/* Subcategory tiles. */
body .site-main ul.products li.product-category {
	text-align: center;
}
body .site-main ul.products li.product-category > a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	height: 100%;
	padding: 20px 14px;
	color: #14202e;
}
body .site-main ul.products li.product-category img {
	width: 100% !important;
	height: auto !important;
	max-width: 140px;
	aspect-ratio: 1 / 1;
	object-fit: contain !important;
	margin: 0 auto;
}
body .site-main ul.products li.product-category .woocommerce-loop-category__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}
body .site-main ul.products li.product-category .count {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 8px;
	border-radius: 999px;
	background: #eef3f8;
	color: #003766;
	font-size: 12px;
	font-weight: 600;
	background-color: #eef3f8;
}

/* Sidebar category widget. */
.widget_product_categories ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.widget_product_categories ul li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	margin: 0;
	padding: 0;
}
.widget_product_categories ul li > a {
	flex: 1;
	padding: 8px 10px;
	border-radius: 8px;
	color: #14202e;
	font-size: 14px;
	transition: background-color .15s ease, color .15s ease;
}
.widget_product_categories ul li > a:hover,
.widget_product_categories ul li.current-cat > a {
	background: #eef3f8;
	color: #003766;
	font-weight: 600;
}
.widget_product_categories ul li .count {
	padding: 1px 8px;
	border-radius: 999px;
	background: #f2f4f7;
	color: #5b6775;
	font-size: 12px;
}
.widget_product_categories ul ul.children {
	flex-basis: 100%;
	padding-left: 14px;
}

/* Bottom bar: pagination + per-page selector. */
.freshio-shop-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-top: 8px;
}
.freshio-shop-footer .woocommerce-pagination {
	margin: 0;
}

/* Go-to-top button. */
.freshio-to-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #003766;
	color: #fff;
	box-shadow: 0 4px 14px rgba(0, 40, 77, .25);
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}
.freshio-to-top[hidden] {
	display: none;
}
.freshio-to-top:hover {
	background: #00284d;
	transform: translateY(-2px);
}

/* Toolbar. */
.freshio-sorting {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
}
.freshio-per-page {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 14px;
}
.freshio-per-page select {
	height: 38px;
	padding: 0 32px 0 12px;
	border: 1px solid #d9dee5;
	border-radius: 8px;
	background-color: #fff;
}

/* Use more of wide screens so extra columns fit. */
@media (min-width: 1600px) {
	.site-content > .col-full {
		max-width: 1920px;
	}
}
@media (max-width: 767px) {
	body .site-main ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}
	body .site-main ul.products li.product .product-block {
		padding: 10px;
	}
	body .site-main ul.products li.product .woocommerce-loop-product__title {
		font-size: 13px;
	}
	.freshio-sorting {
		gap: 8px;
	}
}

/* Let the quantity + button stack when the card is too narrow for both. */
body .site-main ul.products li.product .freshio-loop-add-to-cart {
	flex-wrap: wrap;
	justify-content: center;
}
body .site-main ul.products li.product .freshio-loop-add-to-cart .add_to_cart_button {
	flex: 1 1 100%;
	justify-content: center;
	min-width: 0;
	white-space: normal;
	height: auto;
	min-height: 34px;
	padding: 8px 10px;
}
@media (max-width: 400px) {
	body .site-main ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
}
