/* Default grid view */
.list-only {
	display: none !important;
}
body.wc-list-view .product-cart a.add_to_cart_button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;

	width: 40px !important;
	height: 40px !important;
	padding: 0 !important;

	font-size: 0 !important;
	line-height: 0 !important;

	border-radius: 50%;
}

 
body.wc-list-view .product-cart a.add_to_cart_button::before {
	content: "";
	display: block;
	width: 18px;
	height: 18px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='%23003560'%3E%3Ccircle cx='12.667' cy='24.667' r='2'/%3E%3Ccircle cx='23.333' cy='24.667' r='2'/%3E%3Cpath d='M9.285 10.036a1 1 0 0 1 .776-.37h15.272a1 1 0 0 1 .99 1.142l-1.333 9.333A1 1 0 0 1 24 21H12a1 1 0 0 1-.98-.797L9.083 10.87a1 1 0 0 1 .203-.834m2.005 1.63L12.814 19h10.319l1.047-7.333z'/%3E%3Cpath d='M5.667 6.667a1 1 0 0 1 1-1h2.666a1 1 0 0 1 .984.82l.727 4a1 1 0 1 1-1.967.359l-.578-3.18H6.667a1 1 0 0 1-1-1'/%3E%3C/svg%3E");

}



/* List view */
.wc-list-view .grid-only {
	display: none !important;
}

.wc-list-view .list-only {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
}

/* ======================================================
   DEFAULT GRID VIEW 
   ====================================================== */
ul.products.columns-4,
ul.products.columns-3,
ul.products.columns-2,
ul.products.columns-1 {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 24px;
}

ul.products li.product {
	width: 100% !important;
	float: none !important;
	clear: none !important;
}

ul.products {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

ul.products li.product {
	width: 100%;
	float: none !important;
}

ul.products li.product img {
	width: 100%;
	height: auto;
}


/* Restore card styling explicitly */
.card {
	border: 1px solid rgba(0,0,0,.125);
	background: #fff;
	box-shadow: none;
}


/* ======================================================
   LIST VIEW ONLY (TABLE MODE)
   Activated by body.wc-list-view
   ====================================================== */

body.wc-list-view ul.products {
	display: block !important;
}

body.wc-list-view ul.products li.product {
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
	border-bottom: 1px solid #e3e3e3;
	float: none !important;
}


/* Convert product layout into row */
body.wc-list-view li.product > .card,
body.wc-list-view .product-inner,
body.wc-list-view .product-table-row {
	display: grid !important;
	grid-template-columns: 70px 1fr 160px 60px;
	align-items: center;
	gap: 18px;
	padding: 6px;

	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
}


/* Smaller image only in list */
body.wc-list-view li.product img {
	width: 55px !important;
	height: auto;
}


/* Product text */
body.wc-list-view .woocommerce-loop-product__title,
body.wc-list-view .product-title {
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 2px;
}

body.wc-list-view .product-excerpt {
	font-size: .85rem;
	color: #6b7280;
	margin: 0;
}


/* Price column */
body.wc-list-view .price,
body.wc-list-view .col-price {
	text-align: center;
	font-weight: 600;
}
.product-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* Tight title + price */
.product-info {
	margin-bottom: 0.15rem;
}

.product-price {
	margin-bottom: 0;
}

.product-cart {
	margin-top: auto;
	padding-top: 0.75rem;
}
body.wc-list-view .product-cart {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Cart button */
body.wc-list-view .btn-cart-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 6px;
	background: #ffc107;
	color: #000;
}


/* ======================================================
   TABLE HEADER
   ====================================================== */

.wc-list-header {
	display: none;
}

body.wc-list-view .wc-list-header {
	display: grid;
	grid-template-columns: 70px 1fr 160px 60px;
	font-weight: 700;
	border-bottom: 2px solid #ccc;
	padding-bottom: 8px;
	margin-bottom: 12px;
}
.product-thumb {
	overflow: hidden;
}

.product-thumb a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.product-thumb img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}
.woocommerce ul.products[class*=columns-] li.product, .woocommerce-page ul.products[class*=columns-] li.product {
	margin: 0 !important;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */

@media (max-width: 992px) {

	ul.products {
		grid-template-columns: repeat(2, 1fr);
	}

	body.wc-list-view li.product > .card {
		grid-template-columns: 60px 1fr;
		row-gap: 8px;
	}

	body.wc-list-view .price {
		text-align: left;
	}
	.woocommerce ul.products li.product a {
		font-size: 0.85rem;
		padding: 10px;
	} 
	body.wc-list-view li.product > .card, body.wc-list-view .product-inner, body.wc-list-view .product-table-row {
		grid-template-columns: repeat(4, 1fr);
	}
}
@media (max-width: 320px) {
		ul.products {
		grid-template-columns: 1fr;
	}
}

