/**
 * Woo Category Layout
 * Modern product-grid styling for shop / category archives.
 * Scoped under body.wcl-archive so it does not leak elsewhere
 * and is specific enough to beat most themes (incl. Divi).
 */

:root {
	--wcl-accent: #2271b1;
	--wcl-accent-dark: #135e96;
	--wcl-border: #e4e7ec;
	--wcl-text: #1d2327;
	--wcl-muted: #667085;
	--wcl-card-bg: #ffffff;
	--wcl-radius: 10px;
}

/* ---- Page container ---- */
body.wcl-archive .woocommerce,
body.wcl-archive .woocommerce-page {
	color: var(--wcl-text);
}

/* ---- Top toolbar: result count + ordering + view toggle ---- */
body.wcl-archive .woocommerce-result-count {
	margin: 0;
	color: var(--wcl-muted);
	font-size: 14px;
	line-height: 40px;
}

body.wcl-archive .woocommerce-ordering {
	margin: 0;
}

body.wcl-archive .woocommerce-ordering select,
body.wcl-archive select.orderby {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	border: 1px solid var(--wcl-border);
	border-radius: 8px;
	padding: 9px 38px 9px 14px;
	font-size: 14px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	color: var(--wcl-text);
	cursor: pointer;
	min-height: 0;
	line-height: 1.4;
}

body.wcl-archive .wcl-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}

body.wcl-archive .wcl-toolbar-right {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* View (grid/list) toggle */
body.wcl-archive .wcl-view-toggle {
	display: inline-flex;
	border: 1px solid var(--wcl-border);
	border-radius: 8px;
	overflow: hidden;
}

body.wcl-archive .wcl-view-toggle button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	background: #fff;
	color: var(--wcl-muted);
	cursor: pointer;
	padding: 0;
}

body.wcl-archive .wcl-view-toggle button + button {
	border-left: 1px solid var(--wcl-border);
}

body.wcl-archive .wcl-view-toggle button.is-active {
	background: var(--wcl-accent);
	color: #fff;
}

body.wcl-archive .wcl-view-toggle svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* ---- Product grid ---- */
body.wcl-archive ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr);
	gap: 22px;
	margin: 0 0 32px !important;
	padding: 0 !important;
	list-style: none;
}

body.wcl-archive ul.products::before,
body.wcl-archive ul.products::after {
	content: none !important;
	display: none !important;
}

body.wcl-archive ul.products li.product {
	width: auto !important;
	margin: 0 !important;
	padding: 18px !important;
	float: none !important;
	clear: none !important;
	display: flex;
	flex-direction: column;
	background: var(--wcl-card-bg);
	border: 1px solid var(--wcl-border);
	border-radius: var(--wcl-radius);
	transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
	text-align: left;
}

body.wcl-archive ul.products li.product:hover {
	box-shadow: 0 8px 24px rgba(16, 24, 40, .08);
	border-color: #d0d5dd;
	transform: translateY(-2px);
}

/* Remove theme link underlines inside the card. */
body.wcl-archive ul.products li.product a,
body.wcl-archive ul.products li.product a:hover,
body.wcl-archive ul.products li.product .wcl-cat-label {
	text-decoration: none !important;
}

/* Product image */
body.wcl-archive ul.products li.product a img,
body.wcl-archive ul.products li.product img {
	width: 100%;
	height: 170px;
	object-fit: contain;
	margin: 0 0 14px !important;
	border-radius: 6px;
	background: #fafafa;
}

/* Category label */
body.wcl-archive .wcl-cat-label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--wcl-accent) !important;
	text-decoration: none;
	margin-bottom: 6px;
}

/* Title */
body.wcl-archive ul.products li.product .woocommerce-loop-product__title,
body.wcl-archive ul.products li.product h2,
body.wcl-archive ul.products li.product h3 {
	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 1.35 !important;
	color: var(--wcl-text) !important;
	margin: 0 0 8px !important;
	padding: 0 !important;
}

/* Price */
body.wcl-archive ul.products li.product .price {
	color: var(--wcl-accent) !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	margin: 0 0 14px !important;
}

body.wcl-archive ul.products li.product .price del {
	color: var(--wcl-muted) !important;
	font-weight: 400 !important;
	opacity: .8;
}

body.wcl-archive ul.products li.product .price ins {
	text-decoration: none;
}

/* Rating (if shown) */
body.wcl-archive ul.products li.product .star-rating {
	margin: 0 0 10px !important;
	font-size: 14px;
}

/* Push the action row to the bottom of equal-height cards */
body.wcl-archive ul.products li.product .wcl-actions {
	margin-top: auto;
	display: flex;
	align-items: stretch;
	gap: 8px;
}

/* Add to cart button */
body.wcl-archive ul.products li.product .wcl-actions .button,
body.wcl-archive ul.products li.product .add_to_cart_button,
body.wcl-archive ul.products li.product .button.product_type_simple,
body.wcl-archive ul.products li.product a.button {
	flex: 1 1 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 !important;
	padding: 10px 14px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: var(--wcl-text) !important;
	background: #fff !important;
	border: 1px solid var(--wcl-border) !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

/* Cart icon on the add-to-cart button (inherits text color via mask). */
body.wcl-archive ul.products li.product .wcl-actions .add_to_cart_button::before,
body.wcl-archive ul.products li.product a.button.add_to_cart_button::before {
	content: "";
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'%3E%3C/circle%3E%3Ccircle cx='20' cy='21' r='1'%3E%3C/circle%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'%3E%3C/path%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'%3E%3C/circle%3E%3Ccircle cx='20' cy='21' r='1'%3E%3C/circle%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'%3E%3C/path%3E%3C/svg%3E") no-repeat center / contain;
}

body.wcl-archive ul.products li.product .wcl-actions .button:hover,
body.wcl-archive ul.products li.product a.button:hover {
	background: var(--wcl-accent) !important;
	border-color: var(--wcl-accent) !important;
	color: #fff !important;
}

body.wcl-archive ul.products li.product .button.added::after {
	margin-left: 6px;
}

/* ---- Pagination ---- */
body.wcl-archive .woocommerce-pagination ul.page-numbers {
	display: flex;
	justify-content: center;
	gap: 8px;
	border: 0 !important;
	margin-top: 8px;
	padding: 0 !important;
	list-style: none !important;
}

body.wcl-archive .woocommerce-pagination ul.page-numbers li {
	border: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

body.wcl-archive .woocommerce-pagination ul.page-numbers li::before,
body.wcl-archive .woocommerce-pagination ul.page-numbers li::marker {
	content: none !important;
}

body.wcl-archive .woocommerce-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--wcl-border) !important;
	border-radius: 8px;
	background: #fff;
	color: var(--wcl-text) !important;
	font-size: 14px;
	text-decoration: none;
}

body.wcl-archive .woocommerce-pagination .page-numbers.current {
	background: var(--wcl-accent) !important;
	border-color: var(--wcl-accent) !important;
	color: #fff !important;
}

body.wcl-archive .woocommerce-pagination a.page-numbers:hover {
	border-color: var(--wcl-accent) !important;
	color: var(--wcl-accent) !important;
}

/* ---- List view ---- */
body.wcl-archive.wcl-view-list ul.products {
	grid-template-columns: 1fr;
}

body.wcl-archive.wcl-view-list ul.products li.product {
	flex-direction: row;
	align-items: center;
	gap: 20px;
}

body.wcl-archive.wcl-view-list ul.products li.product a img,
body.wcl-archive.wcl-view-list ul.products li.product img {
	width: 140px;
	height: 120px;
	margin: 0 !important;
	flex: 0 0 auto;
}

body.wcl-archive.wcl-view-list ul.products li.product > a:not(.button) {
	display: flex;
	align-items: center;
	gap: 20px;
	flex: 1 1 auto;
}

body.wcl-archive.wcl-view-list ul.products li.product .wcl-actions {
	margin-top: 0;
	flex: 0 0 auto;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
	body.wcl-archive ul.products {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	body.wcl-archive ul.products {
		grid-template-columns: repeat(2, 1fr);
	}
	body.wcl-archive .wcl-view-toggle {
		display: none;
	}
}

@media (max-width: 480px) {
	body.wcl-archive ul.products {
		grid-template-columns: 1fr;
	}
	body.wcl-archive.wcl-view-list ul.products li.product {
		flex-direction: column;
		align-items: stretch;
	}
}
