/* ==========================================================================
   Catalog surface. Loaded only on WooCommerce views.

   V6
   --
   V5 styled a catalog that had no templates behind it, so product archives
   rendered in WooCommerce's own markup and looked like a different website.
   The frame is now supplied by hooks in inc/woocommerce.php - page hero,
   container, toolbar, empty state - and this file styles the result.

   Approach: work WITH WooCommerce's classes rather than replacing its
   templates, so a WooCommerce update cannot silently break the catalog.
   ========================================================================== */

/* -------------------------------------------- neutralise commerce surfaces */

/* Release 1 has no cart, no checkout, no reviews and no ratings. Anything
   WooCommerce still emits for those is removed here as a second line of
   defence behind the PHP filters. */
.woocommerce .add_to_cart_button,
.woocommerce .single_add_to_cart_button,
.woocommerce .cart,
.woocommerce-cart-form,
.woocommerce .woocommerce-message .button,
.woocommerce .product .stock,
.woocommerce .woocommerce-product-rating,
.woocommerce #reviews,
.woocommerce .star-rating,
.woocommerce-tabs .reviews_tab,
.woocommerce .quantity {
	display: none !important;
}

/* --------------------------------------------------------------- toolbar */

.wt-catalog-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wt-space-4);
	margin-bottom: var(--wt-space-6);
	padding: var(--wt-space-4) var(--wt-space-5);
	border: 1px solid var(--wt-border);
	border-radius: var(--wt-radius-xl);
	background:
		var(--wt-tread-light),
		linear-gradient(120deg, var(--wt-white), var(--wt-navy-50));
	box-shadow: var(--wt-shadow-sm);
}

.woocommerce .woocommerce-result-count {
	margin: 0;
	color: var(--wt-text-muted);
	font-size: var(--wt-text-sm);
}

.woocommerce .woocommerce-ordering {
	margin: 0;
}

.woocommerce .woocommerce-ordering select {
	min-height: 2.9rem;
	padding: 0.5rem 2.5rem 0.5rem 0.9rem;
	border: 2px solid var(--wt-border-strong);
	border-radius: var(--wt-radius-pill);
	background-color: var(--wt-white);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237D838A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	background-size: 1.05rem;
	appearance: none;
	color: var(--wt-navy);
	font: inherit;
	font-weight: var(--wt-weight-bold);
	font-size: var(--wt-text-sm);
	cursor: pointer;
}

.woocommerce .woocommerce-ordering select:focus {
	border-color: var(--wt-blue-bright);
	box-shadow: 0 0 0 3px var(--wt-blue-100);
	outline: none;
}

/* ------------------------------------------------------------ product grid */

.woocommerce ul.products {
	display: grid;
	gap: var(--wt-space-5);
	grid-template-columns: 1fr;
	margin: 0 0 var(--wt-space-7);
	padding: 0;
	list-style: none;
}

@media (min-width: 620px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1040px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* WooCommerce ships float-based column classes; the grid above owns layout. */
.woocommerce ul.products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	width: auto !important;
	margin: 0 !important;
	float: none !important;
	padding: 0;
	border: 1px solid var(--wt-border);
	border-radius: var(--wt-radius-xl);
	background: var(--wt-white);
	box-shadow: var(--wt-shadow-sm);
	overflow: hidden;
	transition: transform var(--wt-duration) var(--wt-ease),
	            border-color var(--wt-duration) var(--wt-ease),
	            box-shadow var(--wt-duration) var(--wt-ease);
}

.woocommerce ul.products li.product:hover {
	transform: translateY(-5px);
	border-color: var(--wt-blue-bright);
	box-shadow: var(--wt-shadow-float);
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
	gap: var(--wt-space-2);
	padding: 0 var(--wt-space-5) var(--wt-space-2);
	text-decoration: none;
}

.woocommerce ul.products li.product img {
	width: 100%;
	aspect-ratio: 1 / 1;
	margin: 0 0 var(--wt-space-4);
	object-fit: cover;
	background: var(--wt-steel-100);
	border-radius: 0;
	box-shadow: none;
	transition: transform var(--wt-duration-slow) var(--wt-ease);
}

/* The image sits full-bleed at the top of the card. */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
	margin-inline: calc(var(--wt-space-5) * -1);
	padding-inline: var(--wt-space-5);
}

.woocommerce ul.products li.product:hover img {
	transform: scale(1.04);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	margin: 0;
	padding: 0;
	color: var(--wt-navy);
	font-family: var(--wt-font-display);
	font-size: var(--wt-text-lg);
	font-weight: var(--wt-weight-bold);
	letter-spacing: -0.01em;
}

.wt-catalog-card__badges {
	position: absolute;
	inset-inline-start: var(--wt-space-4);
	inset-block-start: var(--wt-space-4);
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	gap: var(--wt-space-2);
}

.wt-catalog-card__size {
	margin: 0;
	padding-inline: var(--wt-space-5);
	color: var(--wt-text-muted);
	font-size: var(--wt-text-sm);
	font-variant-numeric: tabular-nums;
}

.woocommerce ul.products li.product .price {
	display: block;
	margin: 0;
	padding: var(--wt-space-2) var(--wt-space-5) 0;
	color: var(--wt-navy);
	font-family: var(--wt-font-price);
	font-size: var(--wt-text-lg);
	font-weight: var(--wt-weight-bold);
	font-variant-numeric: tabular-nums;
}

.woocommerce ul.products li.product .price del {
	color: var(--wt-text-muted);
	font-weight: var(--wt-weight-regular);
	font-size: var(--wt-text-sm);
}

.wt-catalog-card__action {
	margin: auto var(--wt-space-5) var(--wt-space-5);
}

/* --------------------------------------------------------- single product */

.woocommerce div.product {
	display: grid;
	gap: clamp(1.5rem, 4vw, 3.5rem);
	grid-template-columns: 1fr;
}

@media (min-width: 900px) {
	.woocommerce div.product {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: start;
	}
}

.woocommerce div.product div.images {
	width: auto !important;
	float: none !important;
	margin: 0 !important;
	border-radius: var(--wt-radius-xl);
	overflow: hidden;
	box-shadow: var(--wt-shadow-lg);
}

.woocommerce div.product div.summary {
	width: auto !important;
	float: none !important;
	margin: 0 !important;
}

.woocommerce div.product .product_title {
	margin-bottom: var(--wt-space-3);
	font-size: clamp(1.9rem, 3.4vw, 2.9rem);
	letter-spacing: -0.02em;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
	display: block;
	margin-bottom: var(--wt-space-5);
	color: var(--wt-navy);
	font-family: var(--wt-font-price);
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	font-weight: var(--wt-weight-bold);
	font-variant-numeric: tabular-nums;
}

.woocommerce div.product .woocommerce-product-details__short-description {
	margin-bottom: var(--wt-space-5);
	color: var(--wt-text);
}

.woocommerce div.product .product_meta {
	margin-top: var(--wt-space-5);
	padding-top: var(--wt-space-4);
	border-top: 1px solid var(--wt-border);
	font-size: var(--wt-text-sm);
	color: var(--wt-text-muted);
}

.woocommerce div.product .product_meta a {
	color: var(--wt-navy);
}

/* Product tabs, minus the disabled reviews tab. */
.woocommerce div.product .woocommerce-tabs {
	grid-column: 1 / -1;
	margin-top: var(--wt-space-7);
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wt-space-2);
	margin: 0 0 var(--wt-space-5);
	padding: 0;
	border: 0;
	list-style: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
	display: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	border-radius: var(--wt-radius-pill);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	display: inline-block;
	padding: 0.6rem 1.25rem;
	border: 1px solid var(--wt-border);
	border-radius: var(--wt-radius-pill);
	background: var(--wt-white);
	color: var(--wt-navy);
	font-weight: var(--wt-weight-bold);
	font-size: var(--wt-text-sm);
	text-decoration: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
	border-color: var(--wt-orange);
	background: var(--wt-orange);
	color: var(--wt-accent-label);
}

/* ------------------------------------------------------------- pagination */

.woocommerce nav.woocommerce-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--wt-space-2);
	border: 0;
}

.woocommerce nav.woocommerce-pagination ul li {
	border: 0;
	overflow: visible;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.9rem;
	min-height: 2.9rem;
	padding: 0 0.75rem;
	border: 1px solid var(--wt-border);
	border-radius: var(--wt-radius);
	background: var(--wt-white);
	color: var(--wt-navy);
	font-weight: var(--wt-weight-bold);
}

.woocommerce nav.woocommerce-pagination ul li span.current {
	background: linear-gradient(135deg, var(--wt-orange), var(--wt-orange-bright));
	border-color: var(--wt-orange-bright);
	color: var(--wt-accent-label);
}

/* ---------------------------------------------------------------- notices */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	display: flex;
	align-items: center;
	gap: var(--wt-space-3);
	margin-bottom: var(--wt-space-6);
	padding: var(--wt-space-4) var(--wt-space-5);
	border: 1px solid var(--wt-border);
	border-inline-start: 0.28rem solid var(--wt-navy);
	border-radius: 0 var(--wt-radius-lg) var(--wt-radius-lg) 0;
	background: var(--wt-white);
	color: var(--wt-text);
	font-size: var(--wt-text-sm);
	list-style: none;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
	display: none;
}

.woocommerce-error {
	border-inline-start-color: var(--wt-alert);
}

/* ----------------------------------------------------------------- mobile */

@media (max-width: 767px) {
	.wt-catalog-toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: var(--wt-space-3);
		padding: var(--wt-space-4);
		border-radius: var(--wt-radius-lg);
		text-align: center;
	}

	.woocommerce .woocommerce-ordering select {
		width: 100%;
	}

	.woocommerce ul.products li.product {
		border-radius: var(--wt-radius-lg);
	}

	.woocommerce div.product .product_title {
		font-size: 1.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.woocommerce ul.products li.product,
	.woocommerce ul.products li.product img {
		transition: none !important;
		transform: none !important;
	}
}
