/* ==================================================================
 * Shop, category and single-product layout.
 *
 * Written against WooCommerce's own markup, since that is what renders
 * the imported catalogue. High specificity and a late enqueue, because
 * the captured Flatsome stylesheet styles the same elements and would
 * otherwise win.
 * ================================================================ */


/* ---- wrapper from woocommerce.php -------------------------------- */

.je-shop {
	max-width: 1220px;
	margin: 0 auto;
	padding: 28px 20px 70px;
}

.je-shop::after {
	content: "";
	display: table;
	clear: both;
}

/* The old templates wrapped the grid in Flatsome's .row/.col, which the
   captured stylesheet sizes down to a narrow column. Those templates are
   gone; this neutralises the classes in case any imported page still
   carries them. */
.je-shop .row,
.je-shop .col,
.je-shop .shop-container {
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
	display: block;
	float: none;
}

/* ---- page frame -------------------------------------------------- */

.woocommerce main#main,
body.woocommerce-page main#main {
	max-width: none;
	margin: 0;
	padding: 0;
}

body.woocommerce .woocommerce-products-header,
body.woocommerce-page .woocommerce-products-header {
	padding: 0 0 6px;
}

body.woocommerce h1.page-title,
body.woocommerce-page h1.page-title,
body.woocommerce .woocommerce-products-header__title {
	font-size: 30px;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0 0 4px;
	color: var(--je-ink, #1a1a1a);
}

body.woocommerce .woocommerce-result-count,
body.woocommerce-page .woocommerce-result-count {
	color: #6b7280;
	font-size: 14px;
	margin: 0 0 18px;
	float: none;
}

body.woocommerce .woocommerce-ordering,
body.woocommerce-page .woocommerce-ordering {
	float: none;
	margin: 0 0 22px;
}

body.woocommerce .woocommerce-ordering select {
	height: 42px;
	border: 1px solid #d9dde3;
	border-radius: 5px;
	padding: 0 12px;
	background: #fff;
	font-size: 14px;
	max-width: 260px;
}

/* result count + ordering on one line */
body.woocommerce .woocommerce-notices-wrapper + .woocommerce-result-count,
body.woocommerce-page .woocommerce-result-count {
	display: inline-block;
}

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

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

body.woocommerce ul.products::before,
body.woocommerce ul.products::after {
	content: none;
}

body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product,
.woocommerce ul.products li.product {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	clear: none !important;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e6e9ee;
	border-radius: 10px;
	overflow: hidden;
	transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
	position: relative;
}

body.woocommerce ul.products li.product:hover {
	box-shadow: 0 10px 26px rgba(17, 24, 39, 0.1);
	border-color: #d7dde6;
	transform: translateY(-2px);
}

/* image: uniform box, never distorted */

body.woocommerce ul.products li.product > a:first-of-type,
body.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

body.woocommerce ul.products li.product img,
.woocommerce ul.products li.product img {
	width: 100%;
	height: 230px;
	object-fit: contain;
	object-position: center;
	background: #f7f8fa;
	margin: 0;
	padding: 14px;
	display: block;
	box-shadow: none;
	border-radius: 0;
	box-sizing: border-box;
}

/* text block */

body.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--je-ink, #1a1a1a);
	margin: 0;
	padding: 14px 16px 0;
	/* keep cards even when titles differ in length */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 3.9em;
}

body.woocommerce ul.products li.product a:hover .woocommerce-loop-product__title {
	color: var(--je-accent, #1c6fc4);
}

/* the category label WooCommerce prints above the title */
body.woocommerce ul.products li.product .product-category,
body.woocommerce ul.products li.product .posted_in {
	padding: 12px 16px 0;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #98a1ad;
	margin: 0;
}

body.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .price {
	padding: 8px 16px 0;
	margin: 0;
	color: var(--je-ink, #1a1a1a);
	font-size: 17px;
	font-weight: 800;
	line-height: 1.35;
}

body.woocommerce ul.products li.product .price del {
	color: #9aa3ae;
	font-weight: 500;
	font-size: 14px;
	opacity: 1;
}

body.woocommerce ul.products li.product .price ins {
	text-decoration: none;
	color: var(--je-accent, #1c6fc4);
}

body.woocommerce ul.products li.product .star-rating {
	margin: 10px 16px 0;
	font-size: 13px;
}

/* button: pinned to the bottom so every card lines up */

body.woocommerce ul.products li.product .button,
body.woocommerce ul.products li.product a.add_to_cart_button,
.woocommerce ul.products li.product .button {
	margin: auto 16px 16px;
	margin-top: auto;
	display: block;
	text-align: center;
	background: var(--je-accent, #1c6fc4);
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 12px 14px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s;
}

body.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .button:hover {
	background: var(--je-accent-dark, #14559b);
	color: #fff;
}

body.woocommerce ul.products li.product .added_to_cart {
	margin: 0 16px 16px;
	font-size: 12.5px;
	color: var(--je-accent, #1c6fc4);
	text-align: center;
	display: block;
}

/* sale flash */

body.woocommerce ul.products li.product .onsale,
.woocommerce span.onsale {
	position: absolute;
	top: 12px;
	left: 12px;
	right: auto;
	margin: 0;
	background: var(--je-accent, #1c6fc4);
	color: #fff;
	border-radius: 4px;
	padding: 5px 11px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	min-height: 0;
	line-height: 1.3;
	z-index: 2;
}

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

body.woocommerce nav.woocommerce-pagination {
	margin: 38px 0 0;
	text-align: center;
}

body.woocommerce nav.woocommerce-pagination ul {
	display: inline-flex;
	gap: 6px;
	border: 0;
	padding: 0;
	margin: 0;
}

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

body.woocommerce nav.woocommerce-pagination ul li a,
body.woocommerce nav.woocommerce-pagination ul li span {
	display: block;
	min-width: 42px;
	padding: 10px 12px;
	border: 1px solid #e2e6ec;
	border-radius: 6px;
	color: var(--je-ink, #1a1a1a);
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
}

body.woocommerce nav.woocommerce-pagination ul li span.current,
body.woocommerce nav.woocommerce-pagination ul li a:hover {
	background: var(--je-accent, #1c6fc4);
	border-color: var(--je-accent, #1c6fc4);
	color: #fff;
}

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

body.single-product div.product {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 46px;
	align-items: start;
}

body.single-product div.product > .woocommerce-breadcrumb,
body.single-product div.product > .woocommerce-tabs,
body.single-product div.product > .related,
body.single-product div.product > .upsells,
body.single-product div.product > .woocommerce-product-gallery ~ .woocommerce-tabs {
	grid-column: 1 / -1;
}

body.single-product div.product .woocommerce-product-gallery {
	width: 100% !important;
	float: none !important;
	margin: 0 !important;
}

body.single-product div.product .woocommerce-product-gallery img {
	border-radius: 10px;
	border: 1px solid #e9edf2;
	background: #fafbfc;
}

body.single-product div.product .summary {
	width: 100% !important;
	float: none !important;
	margin: 0 !important;
}

body.single-product div.product .product_title {
	font-size: 28px;
	font-weight: 800;
	line-height: 1.25;
	margin: 0 0 12px;
}

body.single-product div.product p.price,
body.single-product div.product span.price {
	font-size: 26px;
	font-weight: 800;
	color: var(--je-accent, #1c6fc4);
	margin: 0 0 16px;
}

body.single-product div.product .single_add_to_cart_button,
body.woocommerce button.button.alt,
body.woocommerce a.button.alt,
body.woocommerce input.button.alt {
	background: var(--je-accent, #1c6fc4);
	color: #fff;
	border-radius: 6px;
	padding: 14px 30px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border: 0;
}

body.single-product div.product .single_add_to_cart_button:hover,
body.woocommerce button.button.alt:hover,
body.woocommerce a.button.alt:hover {
	background: var(--je-accent-dark, #14559b);
	color: #fff;
}

body.single-product .woocommerce-tabs ul.tabs {
	padding: 0;
	margin: 0 0 20px;
	border-bottom: 2px solid #e8ecf1;
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}

body.single-product .woocommerce-tabs ul.tabs::before {
	border: 0;
}

body.single-product .woocommerce-tabs ul.tabs li {
	background: transparent;
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
}

body.single-product .woocommerce-tabs ul.tabs li::before,
body.single-product .woocommerce-tabs ul.tabs li::after {
	content: none;
	border: 0;
	box-shadow: none;
}

body.single-product .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 12px 18px;
	font-weight: 700;
	color: #55606e;
	text-transform: uppercase;
	font-size: 13px;
	letter-spacing: 0.04em;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
}

body.single-product .woocommerce-tabs ul.tabs li.active a {
	color: var(--je-accent, #1c6fc4);
	border-bottom-color: var(--je-accent, #1c6fc4);
}

body.single-product table.shop_attributes {
	width: 100%;
	border-collapse: collapse;
}

body.single-product table.shop_attributes th,
body.single-product table.shop_attributes td {
	border: 1px solid #e8ecf1;
	padding: 10px 14px;
	font-size: 14px;
	text-align: left;
}

body.single-product table.shop_attributes th {
	background: #f7f9fb;
	width: 220px;
	font-weight: 700;
}

body.single-product .related > h2,
body.single-product .upsells > h2 {
	font-size: 22px;
	font-weight: 800;
	margin: 46px 0 20px;
}

/* ---- cart / checkout tidy ---------------------------------------- */

/*
 * Deliberately NO max-width on #main here.
 *
 * This rule used to set `max-width: 1120px`, but the frame rule above it
 * sets `margin: 0` — so on any window wider than 1120px #main was pinned
 * hard left with a band of white down the right-hand side, while the
 * header and footer stayed full width. The page read as "one sided", and
 * the hero band stopped dead in the middle of the screen.
 *
 * Centring is the job of .je-checkout (max-width + margin-inline: auto),
 * which leaves #main full width so the hero band can span the window the
 * same way it does on every other page.
 */
body.woocommerce-cart main#main,
body.woocommerce-checkout main#main,
body.woocommerce-account main#main {
	max-width: none;
	margin-inline: auto;
}

body.woocommerce table.shop_table {
	border-radius: 8px;
	border-color: #e6e9ee;
}

body.woocommerce .woocommerce-message,
body.woocommerce .woocommerce-info {
	border-top-color: var(--je-accent, #1c6fc4);
}

body.woocommerce .woocommerce-message::before,
body.woocommerce .woocommerce-info::before {
	color: var(--je-accent, #1c6fc4);
}

/* ---- responsive -------------------------------------------------- */

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

@media (max-width: 880px) {
	body.woocommerce ul.products,
	.woocommerce ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}

	body.single-product div.product {
		grid-template-columns: minmax(0, 1fr);
		gap: 26px;
	}

	body.woocommerce ul.products li.product img {
		height: 190px;
	}
}

@media (max-width: 520px) {
	body.woocommerce ul.products li.product .woocommerce-loop-product__title {
		font-size: 14px;
		min-height: 3.6em;
	}

	body.woocommerce ul.products li.product img {
		height: 165px;
	}
}

/* ---- fixes found in render testing ------------------------------- */

/* The captured stylesheet leaves list markers on WooCommerce's lists,
   which showed as bullets between the pagination numbers. */
body.woocommerce ul.products,
body.woocommerce ul.products li,
body.woocommerce nav.woocommerce-pagination ul,
body.woocommerce nav.woocommerce-pagination ul li,
body.woocommerce ul.woocommerce-widget-layered-nav-list,
body.woocommerce ul.woocommerce-widget-layered-nav-list li,
.woocommerce ul.products,
.woocommerce ul.products li {
	list-style: none !important;
}

body.woocommerce nav.woocommerce-pagination ul li::marker,
body.woocommerce ul.products li::marker {
	content: "";
}

/* Result count and sorting share one line on desktop. */
.je-shop-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin: 0 0 22px;
}

body.woocommerce .je-shop-toolbar .woocommerce-result-count,
body.woocommerce .je-shop-toolbar .woocommerce-ordering {
	margin: 0;
}

@media (min-width: 881px) {
	body.woocommerce .woocommerce-result-count {
		float: left;
		margin-bottom: 0;
	}

	body.woocommerce .woocommerce-ordering {
		float: right;
		margin-bottom: 0;
	}

	body.woocommerce ul.products {
		margin-top: 22px;
	}
}

/* ==================================================================
 * PRODUCT GRID — size from the container, not the window  (v2.4.1)
 *
 * The column count above is driven by viewport media queries: 4 columns
 * on a wide window, 3, then 2, then 1. That is right for the shop page,
 * where the grid is the width of the screen, and wrong everywhere else.
 *
 * The home page puts a product widget inside a 50% Elementor column. On
 * a 1024px window the media query says "3 columns" while the container
 * is only 475px wide, so the cards come out 142px across — an image the
 * size of a postage stamp, a title cut off mid-word, and a button
 * wrapped onto two lines. That is the "packed" grid.
 *
 * auto-fill with a minimum track size fixes it without knowing anything
 * about the window: the grid fits as many >=210px cards as its own width
 * allows. The 475px column gets 2 cards of 225px; the full-width shop
 * grid gets 4 of 229px. Same card, both places.
 * ================================================================ */

.woocommerce ul.products,
body.woocommerce ul.products,
body.woocommerce-page ul.products,
.elementor-widget-container ul.products {
	grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)) !important;
	gap: 26px 22px !important;
	align-items: stretch;
}

/* The image box now scales with the card instead of being pinned to
   230px, so a narrow card gets a proportionate image rather than a tall
   letterbox with a tiny motor floating in it. */
.woocommerce ul.products li.product img,
body.woocommerce ul.products li.product img {
	height: auto !important;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	padding: 12px;
}

/* The category sat above the photo as a line of plain text, pushing the
   card taller and reading like a heading. As a badge on the image it
   costs no vertical space.
   
   Kept deliberately quiet — low contrast, no border. The category names
   in this catalogue are not all trustworthy (55 products sit in "Lower
   Unit Gear Lube" that are lower units, propellers and cowlings), and a
   loud badge would make the wrong label the first thing read on a card.
   It is supporting information, so it looks like supporting information. */
.woocommerce ul.products li.product .product-category {
	position: absolute;
	top: 9px;
	left: 9px;
	z-index: 2;
	margin: 0;
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.82);
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #98a1ad;
	max-width: calc(100% - 18px);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	line-height: 1.5;
}

/* Titles need room to breathe once the card is a sensible width. */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
	padding: 14px 15px 0 !important;
	min-height: 0;
}

.woocommerce ul.products li.product .price {
	padding: 8px 15px 0;
}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.add_to_cart_button {
	margin: 14px 15px 16px !important;
	white-space: normal;
	line-height: 1.25;
}

/* Give the widget itself some air — it was flush against the column. */
.elementor-widget-wc-archive-products .woocommerce,
.elementor-widget-woocommerce-products .woocommerce,
.elementor-widget-container > .woocommerce.columns-3,
.elementor-widget-container > .woocommerce.columns-4 {
	padding-block: 4px;
}

/* Phones: two across is the shop convention and beats one tall column,
   but the gap has to come down or the cards are all margin. */
@media (max-width: 600px) {
	.woocommerce ul.products,
	body.woocommerce ul.products,
	body.woocommerce-page ul.products,
	.elementor-widget-container ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 16px 12px !important;
	}

	.woocommerce ul.products li.product .woocommerce-loop-product__title,
	.woocommerce ul.products li.product h2 {
		font-size: 13.5px !important;
		padding: 11px 11px 0 !important;
	}

	.woocommerce ul.products li.product .price {
		padding: 6px 11px 0;
		font-size: 15px;
	}

	.woocommerce ul.products li.product .button,
	.woocommerce ul.products li.product a.add_to_cart_button {
		margin: 10px 11px 12px !important;
		font-size: 12.5px !important;
		padding: 9px 8px !important;
	}

	.woocommerce ul.products li.product .product-category {
		font-size: 9.5px;
		padding: 3px 7px;
	}
}

/* Very narrow phones cannot carry two cards and a readable price. */
@media (max-width: 360px) {
	.woocommerce ul.products,
	.elementor-widget-container ul.products {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}
