/*
 * Becoming Tile Catalog — WooCommerce loop styling
 * Tokens come from the Becoming Tile Modern theme (:root --ink, --teal, --sand, --line).
 * Fallbacks are included so the file also works standalone.
 * Selectors are scoped under body.bt-catalog and are specific enough to beat
 * WooCommerce's layout CSS and the theme's `.page-content a:not(.cta)` rule.
 */

body.bt-catalog {
	--bt-ink: var(--ink, #142d32);
	--bt-teal: var(--teal, #0d6767);
	--bt-sand: var(--sand, #f7f5f0);
	--bt-line: var(--line, #e0e2de);
	--bt-muted: #566667;
	--bt-gap: clamp(14px, 2vw, 28px);
}

/* ---- Page container ---------------------------------------------------- */
body.bt-catalog main.page-content {
	max-width: 1400px;
	padding: clamp(20px, 3vw, 40px) clamp(18px, 4vw, 48px) 90px;
	line-height: 1.5;
}

/* ---- Archive heading (h1 + description rendered as one sand panel) ------- */
body.bt-catalog .bt-eyebrow {
	margin: 0;
	padding: clamp(32px, 5vw, 72px) clamp(22px, 4vw, 64px) 0;
	background: var(--bt-sand);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .21em;
	text-transform: uppercase;
	color: var(--bt-teal);
}

body.bt-catalog main.page-content > h1.page-title {
	margin: 0;
	padding: 16px clamp(22px, 4vw, 64px) 0;
	background: var(--bt-sand);
	font: 400 clamp(40px, 5vw, 72px)/1.08 Georgia, serif;
	letter-spacing: -.03em;
	color: var(--bt-ink);
}

body.bt-catalog main.page-content > .term-description {
	margin: 0 0 clamp(28px, 4vw, 44px);
	padding: 18px clamp(22px, 4vw, 64px) clamp(32px, 5vw, 64px);
	background: var(--bt-sand);
	font-size: 18px;
	line-height: 1.65;
	color: #4c6162;
}
body.bt-catalog main.page-content > .term-description p {
	margin: 0;
	max-width: 560px;
}
/* No description: close the panel under the title. */
body.bt-catalog main.page-content > h1.page-title:not(:has(+ .term-description)) {
	padding-bottom: clamp(32px, 5vw, 64px);
	margin-bottom: clamp(28px, 4vw, 44px);
}

/* ---- Sub-category chips --------------------------------------------------- */
body.bt-catalog .bt-chips ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
}
body.bt-catalog .bt-chips a {
	display: inline-block;
	padding: 10px 16px;
	border: 1px solid var(--bt-line);
	background: #fff;
	color: var(--bt-ink);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background .15s, color .15s, border-color .15s;
}
body.bt-catalog .bt-chips a:hover {
	border-color: var(--bt-ink);
}
body.bt-catalog .bt-chips a[aria-current="page"] {
	background: var(--bt-ink);
	border-color: var(--bt-ink);
	color: #fff;
}

/* ---- Toolbar: result count + sorting --------------------------------------- */
body.bt-catalog .bt-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin: 0 0 26px;
	padding: 14px 0;
	border-top: 1px solid var(--bt-line);
	border-bottom: 1px solid var(--bt-line);
}
body.bt-catalog .woocommerce-result-count {
	float: none;
	margin: 0;
	font-size: 13px;
	letter-spacing: .03em;
	color: var(--bt-muted);
}
body.bt-catalog .woocommerce-ordering {
	float: none;
	margin: 0;
}
body.bt-catalog .woocommerce-ordering select {
	appearance: none;
	-webkit-appearance: none;
	min-width: 220px;
	padding: 11px 40px 11px 14px;
	border: 1px solid var(--bt-ink);
	border-radius: 0;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23142d32' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
	color: var(--bt-ink);
	font: 700 12px Arial, Helvetica, sans-serif;
	letter-spacing: .07em;
	text-transform: uppercase;
	cursor: pointer;
}

/* ---- Grid ------------------------------------------------------------------ */
body.woocommerce.bt-catalog ul.products,
body.woocommerce.bt-catalog ul.products[class*="columns-"] {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(26px, 3vw, 44px) var(--bt-gap);
	margin: 0 0 56px;
	padding: 0;
	list-style: none;
}
/* WooCommerce clearfix pseudo-elements would otherwise become grid cells. */
body.woocommerce.bt-catalog ul.products::before,
body.woocommerce.bt-catalog ul.products::after {
	display: none;
	content: none;
}
/* Beats ".woocommerce ul.products[class*=columns-] li.product" (float + width). */
body.woocommerce.bt-catalog ul.products[class*="columns-"] li.product {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	text-align: left;
}

/* ---- Card ------------------------------------------------------------------ */
body.bt-catalog ul.products li.product a.woocommerce-LoopProduct-link {
	display: block;
	color: var(--bt-ink);
	text-decoration: none;
}

/* Image frame: same square for every product. */
body.bt-catalog ul.products li.product .bt-frame {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--bt-line);
	transition: border-color .2s;
}
body.bt-catalog ul.products li.product .bt-frame img {
	display: block;
	margin: 0;
	transition: transform .5s ease;
}
/* Square panels fill the frame. */
body.bt-catalog ul.products li.product.bt-shape-square .bt-frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
/* Wide backsplash strips keep their full silhouette, centered with air around them. */
body.bt-catalog ul.products li.product.bt-shape-wide .bt-frame img {
	width: 84%;
	height: auto;
}
body.bt-catalog ul.products li.product.bt-shape-tall .bt-frame img {
	width: auto;
	height: 84%;
}
body.bt-catalog ul.products li.product:hover .bt-frame {
	border-color: var(--bt-ink);
}
body.bt-catalog ul.products li.product:hover .bt-frame img {
	transform: scale(1.035);
}

/* Text */
body.bt-catalog ul.products li.product .woocommerce-loop-product__title {
	margin: 16px 0 4px;
	padding: 0;
	font: 400 21px/1.25 Georgia, serif;
	letter-spacing: -.005em;
	color: var(--bt-ink);
}
body.bt-catalog ul.products li.product a.woocommerce-LoopProduct-link:hover .woocommerce-loop-product__title {
	color: var(--bt-teal);
}
body.bt-catalog ul.products li.product .bt-meta {
	display: block;
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--bt-teal);
}
body.bt-catalog ul.products li.product .price {
	display: block;
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 700;
	color: var(--bt-ink);
}
body.bt-catalog ul.products li.product .price del {
	font-weight: 400;
	opacity: .55;
}
body.bt-catalog ul.products li.product .price ins {
	text-decoration: none;
}

/* Button: outline, matches the theme's .outline / .cta controls. */
body.bt-catalog ul.products li.product .button {
	display: block;
	margin: auto 0 0;
	padding: 14px 16px;
	border: 1px solid var(--bt-ink);
	border-radius: 0;
	background: transparent;
	color: var(--bt-ink);
	font: 700 12px Arial, Helvetica, sans-serif;
	letter-spacing: .07em;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	transition: background .15s, color .15s;
}
body.bt-catalog ul.products li.product .button:hover,
body.bt-catalog ul.products li.product .button:focus-visible {
	background: var(--bt-ink);
	color: #fff;
}
body.bt-catalog ul.products li.product .added_to_cart {
	display: block;
	margin-top: 10px;
	font-size: 12px;
	color: var(--bt-teal);
}
body.bt-catalog ul.products li.product .onsale {
	top: 12px;
	left: 12px;
	right: auto;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 6px 10px;
	border-radius: 0;
	background: var(--bt-ink);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	line-height: 1;
	text-transform: uppercase;
}

/* ---- Pagination ------------------------------------------------------------ */
body.bt-catalog .woocommerce-pagination {
	margin: 0 0 64px;
	text-align: center;
}
body.bt-catalog .woocommerce-pagination ul.page-numbers {
	display: inline-flex;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
}
body.bt-catalog .woocommerce-pagination ul.page-numbers li {
	margin: 0;
	border: 0;
	float: none;
}
body.bt-catalog .woocommerce-pagination .page-numbers {
	display: block;
	min-width: 44px;
	padding: 12px 14px;
	border: 1px solid var(--bt-line);
	background: #fff;
	color: var(--bt-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	text-decoration: none;
}
body.bt-catalog .woocommerce-pagination a.page-numbers:hover {
	border-color: var(--bt-ink);
	background: #fff;
	color: var(--bt-ink);
}
body.bt-catalog .woocommerce-pagination .page-numbers.current {
	border-color: var(--bt-ink);
	background: var(--bt-ink);
	color: #fff;
}

/* ---- Design-wizard banner -------------------------------------------------- */
body.bt-catalog .bt-wizard {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	flex-wrap: wrap;
	padding: clamp(28px, 4vw, 52px) clamp(22px, 4vw, 64px);
	background: var(--bt-sand);
}
body.bt-catalog .bt-wizard h2 {
	margin: 0 0 10px;
	font: 400 clamp(26px, 3vw, 38px)/1.15 Georgia, serif;
	color: var(--bt-ink);
}
body.bt-catalog .bt-wizard p {
	margin: 0;
	max-width: 560px;
	font-size: 16px;
	line-height: 1.6;
	color: #4c6162;
}
body.bt-catalog .bt-wizard .cta {
	color: #fff;
	text-decoration: none;
}

/* ---- Focus ------------------------------------------------------------------ */
body.bt-catalog ul.products li.product a:focus-visible,
body.bt-catalog .bt-chips a:focus-visible,
body.bt-catalog .woocommerce-ordering select:focus-visible {
	outline: 3px solid #177f81;
	outline-offset: 3px;
}

/* ---- Responsive ------------------------------------------------------------ */
@media (max-width: 1100px) {
	body.woocommerce.bt-catalog ul.products,
	body.woocommerce.bt-catalog ul.products[class*="columns-"] {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (max-width: 760px) {
	body.woocommerce.bt-catalog ul.products,
	body.woocommerce.bt-catalog ul.products[class*="columns-"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	body.bt-catalog ul.products li.product .woocommerce-loop-product__title {
		font-size: 17px;
	}
	body.bt-catalog ul.products li.product .button {
		padding: 12px 8px;
		font-size: 11px;
	}
	body.bt-catalog .bt-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	body.bt-catalog .woocommerce-ordering select {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.bt-catalog ul.products li.product .bt-frame img {
		transition: none;
	}
	body.bt-catalog ul.products li.product:hover .bt-frame img {
		transform: none;
	}
}
