/**
 * Moneysworth Toolkit — catalogue presentation
 *
 * Rebuilds the category/shop grid: square product tiles instead of circular
 * crops, no hover zoom, equal-height cards, brand-consistent typography and
 * buttons.
 *
 * Loads after mt-core.css and the child theme, and leans on `body` prefixes
 * where those sheets use !important from a later position in the cascade.
 *
 * Rollback: remove the 'mt-shop' enqueue in core-init.php.
 *
 * Palette (from the logo and existing theme):
 *   navy    #15467b   primary actions, headings
 *   navy-dk #0f3560   hover
 *   blue    #0373ae   prices
 *   red     #cc2a2a   sale / urgency only
 *   teal    #2aa190   breadcrumb links (existing convention)
 *   tile    #f2f5f8   neutral ground behind product photography
 */


/* =========================================================================
 * Category header — title, description, then a tidy control bar
 * ====================================================================== */

.woocommerce .woocommerce-products-header,
.tax-product_cat .page-title,
.woocommerce-page h1.page-title {
	margin: 0 0 10px !important;
}

:is(body.woocommerce,body) .term-description,
body .tax-product_cat .term-description {
	max-width: 74ch;
	color: #4a5a6b;
	font-size: 15.5px;
	line-height: 1.6;
	margin: 0 0 22px;
}

:is(body.woocommerce,body) .term-description strong,
body .tax-product_cat .term-description strong {
	color: #1c2b3a;
}

/* Count + sort share one line, separated, with a rule under them. */
:is(body.woocommerce,body) .mt-shop-bar,
:is(body.tax-product_cat,body) .mt-shop-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 24px;
	padding: 0 0 14px;
	margin: 0 0 26px;
	border-bottom: 1px solid #e3e8ee;
}

/* Inside the bar the "Sort by" label sits beside the select, not above it. */
:is(body.woocommerce,body) .mt-shop-bar .woocommerce-ordering {
	display: flex !important;
	align-items: center;
	gap: 10px;
}

:is(body.woocommerce,body) .mt-shop-bar .woocommerce-ordering::before {
	display: inline-block !important;
	margin: 0 !important;
	white-space: nowrap;
}

:is(body.woocommerce,body) .mt-shop-bar .woocommerce-result-count {
	margin: 0 !important;
	font-size: 14.5px;
	color: #5a6672;
}

:is(body.woocommerce,body) .mt-shop-bar .woocommerce-ordering {
	margin: 0 !important;
}


/* =========================================================================
 * The grid
 *
 * Divi lays products out with floats and percentage widths, which is what
 * produces the ragged last row and the stepped buttons. Grid removes both.
 * ====================================================================== */

:is(body.woocommerce,body) ul.products,
:is(body.woocommerce-page,body) ul.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
	gap: 26px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

:is(body.woocommerce,body) ul.products::before,
:is(body.woocommerce,body) ul.products::after {
	content: none !important;
}

:is(body.woocommerce,body) ul.products li.product,
:is(body.woocommerce-page,body) ul.products li.product,
:is(body.woocommerce,body) ul.products li.product:nth-child(n),
:is(body.woocommerce-page,body) ul.products li.product:nth-child(n) {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	clear: none !important;
	display: flex !important;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e3e8ee;
	border-radius: 4px;
	overflow: hidden;
	text-align: left;
	transition: border-color .16s ease, box-shadow .16s ease;
	box-shadow: none;
}

/* No zoom, no lift — just a quiet edge. */
:is(body.woocommerce,body) ul.products li.product:hover,
:is(body.woocommerce-page,body) ul.products li.product:hover,
body .products .product:hover {
	transform: none !important;
	border-color: #15467b;
	box-shadow: 0 2px 10px rgba(21, 70, 123, .10) !important;
	background: #fff;
}

:is(body.woocommerce,body) ul.products li.product:focus-within {
	border-color: #15467b;
}


/* =========================================================================
 * Product tile — square, contained, on a neutral ground
 *
 * mt-core.css sets `border-radius:116px` and `object-fit:fill` on archive
 * product images, which crops the corners off equipment photos and stretches
 * anything that isn't square. Both go.
 * ====================================================================== */

:is(body.woocommerce,body) ul.products li.product a.woocommerce-loop-product__link,
:is(body.woocommerce,body) ul.products li.product a.woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	text-decoration: none !important;
	color: inherit;
}

:is(body.archive,body) ul.products li.product.type-product a img,
:is(body.woocommerce,body) ul.products li.product img,
:is(body.woocommerce-page,body) ul.products li.product img {
	display: block;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	object-fit: contain !important;
	background: #f2f5f8;
	padding: 16px;
	margin: 0 0 4px !important;
	border-radius: 0 !important;
	border-bottom: 1px solid #e9edf2;
	transition: none !important;
}

/* Divi's teal radial overlay with the magnifier fought the photography and
   only appeared on hover. The whole card is the link; it isn't needed. */
:is(body.woocommerce,body) ul.products li.product .et_overlay,
:is(body.woocommerce-page,body) ul.products li.product .et_overlay {
	display: none !important;
}


/* =========================================================================
 * Card text and actions
 * ====================================================================== */

:is(body.woocommerce,body) ul.products li.product .woocommerce-loop-product__title,
:is(body.woocommerce,body) ul.products li.product h2.woocommerce-loop-product__title,
:is(body.woocommerce-page,body) ul.products li.product h2 {
	font-size: 16.5px !important;
	line-height: 1.35;
	font-weight: 600;
	color: #1c2b3a !important;
	margin: 0 !important;
	padding: 16px 16px 0 !important;
	flex: 1 0 auto;
	text-align: left;
}

:is(body.woocommerce,body) ul.products li.product:hover .woocommerce-loop-product__title {
	color: #15467b !important;
}

:is(body.woocommerce,body) ul.products li.product .price,
:is(body.woocommerce-page,body) ul.products li.product .price {
	display: block;
	padding: 8px 16px 0 !important;
	margin: 0 !important;
	text-align: left;
	font-size: 15px;
	color: #5a6672 !important;
}

:is(body.woocommerce,body) ul.products li.product .price .woocommerce-Price-amount,
:is(body.woocommerce,body) ul.products li.product .price span.amount {
	font-size: 21px !important;
	font-weight: 700;
	color: #0373ae !important;
	font-variant-numeric: tabular-nums;
}

/* "from $85.00" prefix on variable products */
:is(body.woocommerce,body) ul.products li.product .price > span:first-child:not(.amount) {
	font-size: 13px;
	color: #7b8794;
}

/* The /week suffix — the rental term is the most important qualifier on the
   page, so it reads as a unit rather than fine print. */
:is(body.woocommerce,body) ul.products li.product .price small,
:is(body.woocommerce,body) ul.products li.product .price .woocommerce-price-suffix {
	display: inline;
	font-size: 13px !important;
	color: #5a6672 !important;
	font-weight: 600;
	margin-left: 2px;
}

:is(body.woocommerce,body) ul.products li.product .button,
:is(body.woocommerce-page,body) ul.products li.product .button,
:is(body.woocommerce,body) ul.products li.product a.add_to_cart_button {
	display: block !important;
	width: calc(100% - 32px) !important;
	max-width: none !important;
	float: none !important;
	margin: 16px 16px !important;
	padding: 12px 14px !important;
	min-height: 46px;
	background: #15467b !important;
	color: #fff !important;
	border: 1px solid #15467b !important;
	border-radius: 3px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	text-align: center;
	line-height: 1.4;
	text-decoration: none !important;
	transition: background-color .14s ease;
}

:is(body.woocommerce,body) ul.products li.product .button:hover,
:is(body.woocommerce-page,body) ul.products li.product .button:hover,
:is(body.woocommerce,body) ul.products li.product a.add_to_cart_button:hover {
	background: #0f3560 !important;
	border-color: #0f3560 !important;
	color: #fff !important;
	padding: 12px 14px !important;
	transform: none !important;
}

/* "Select options" reads as a different kind of action — make that legible
   rather than identical to Add to cart. */
:is(body.woocommerce,body) ul.products li.product a.product_type_variable {
	background: #fff !important;
	color: #15467b !important;
	border-color: #15467b !important;
}

:is(body.woocommerce,body) ul.products li.product a.product_type_variable:hover {
	background: #eef2f7 !important;
	color: #0f3560 !important;
	border-color: #0f3560 !important;
}

/* The post-add "View cart" link, sized to sit under the button. */
:is(body.woocommerce,body) ul.products li.product .added_to_cart {
	display: block;
	width: calc(100% - 32px);
	margin: -6px 16px 16px !important;
	padding: 9px 12px;
	text-align: center;
	font-size: 14px !important;
	white-space: nowrap;
}

:is(body.woocommerce,body) ul.products li.product span.onsale,
:is(body.woocommerce-page,body) ul.products li.product span.onsale {
	background: #cc2a2a !important;
	color: #fff !important;
	border-radius: 2px !important;
	font-size: 12px !important;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	padding: 5px 10px !important;
	top: 10px !important;
	left: 10px !important;
	right: auto !important;
	margin: 0 !important;
	line-height: 1.2 !important;
	min-height: 0 !important;
	min-width: 0 !important;
	position: absolute;
}

/* Ratings are not used on this store; when they are, keep them left-aligned
   with the rest of the card rather than centred against it. */
:is(body.woocommerce,body) ul.products li.product .star-rating {
	margin: 10px 16px 0 !important;
	font-size: 15px;
}


/* =========================================================================
 * Breadcrumb
 * ====================================================================== */

:is(body.woocommerce,body) .woocommerce-breadcrumb {
	font-size: 14px !important;
	font-weight: 400 !important;
	color: #7b8794 !important;
	margin: 0 0 14px !important;
}

:is(body.woocommerce,body) .woocommerce-breadcrumb a {
	color: #2aa190 !important;
	font-weight: 600;
}

:is(body.woocommerce,body) .woocommerce-breadcrumb a:hover {
	color: #15467b !important;
	text-decoration: underline;
}


/* =========================================================================
 * Sub-category tiles (when a category lists its children)
 * ====================================================================== */

:is(body.woocommerce,body) ul.products li.product-category a {
	display: block;
	text-decoration: none !important;
}

:is(body.woocommerce,body) ul.products li.product-category h2 {
	padding: 16px !important;
	margin: 0 !important;
	font-size: 16.5px !important;
	font-weight: 600;
	color: #15467b !important;
}

:is(body.woocommerce,body) ul.products li.product-category mark,
:is(body.woocommerce,body) ul.products li.product-category .count {
	background: none !important;
	color: #7b8794 !important;
	font-weight: 400;
	font-size: 14px;
}


/* =========================================================================
 * Empty state
 *
 * An Outer Banks visitor can land on a category with nothing in it. Silence
 * reads as breakage; say what happened.
 * ====================================================================== */

:is(body.woocommerce,body) .woocommerce-info.mt-empty-cat {
	background: #eef2f7 !important;
	border-color: #15467b !important;
	color: #1c2b3a !important;
}


/* =========================================================================
 * Responsive
 * ====================================================================== */

@media (max-width: 980px) {
	:is(body.woocommerce,body) ul.products,
	:is(body.woocommerce-page,body) ul.products {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 20px;
	}
}

@media (max-width: 620px) {
	:is(body.woocommerce,body) ul.products,
	:is(body.woocommerce-page,body) ul.products {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}

	:is(body.woocommerce,body) ul.products li.product .woocommerce-loop-product__title {
		font-size: 15px !important;
		padding: 12px 12px 0 !important;
	}

	:is(body.woocommerce,body) ul.products li.product .price {
		padding: 6px 12px 0 !important;
	}

	:is(body.woocommerce,body) ul.products li.product .price .woocommerce-Price-amount {
		font-size: 18px !important;
	}

	:is(body.woocommerce,body) ul.products li.product .button,
	:is(body.woocommerce,body) ul.products li.product .added_to_cart {
		width: calc(100% - 24px);
		margin-left: 12px !important;
		margin-right: 12px !important;
		font-size: 14px !important;
	}

	:is(body.woocommerce,body) ul.products li.product img {
		padding: 10px;
	}
}

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