/* =========================================================================
   MB Storefront UX: design tokens + components
   Built for WoodMart 8.x markup. Every rule is scoped to WoodMart's product
   classes (.wd-product ...) or the plugin's own .mb-* classes.
   ========================================================================= */

:root {
	/* Brand */
	--mb-red: var(--wd-primary-color, #ff2936);
	--mb-red-ink: #d81b2a;            /* hover / pressed */
	--mb-ink: #14171a;                 /* primary text, top bar */
	--mb-ink-2: #3d434a;               /* secondary text */
	--mb-muted: #6b7280;               /* meta, MRP */
	--mb-line: #e5e7eb;                /* borders */
	--mb-surface: #f5f6f7;             /* image wells, page bands */
	--mb-card: #ffffff;
	--mb-deal: #cc0c39;                /* % off, deal tags (Amazon-like deal red) */
	--mb-fit: #0a7a3b;                 /* "fits your bike" green */
	--mb-fit-bg: #e8f5ee;
	--mb-star: #f5a623;

	/* Shape + depth */
	--mb-r-sm: 6px;
	--mb-r: 10px;
	--mb-r-lg: 14px;
	--mb-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
	--mb-shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);

	/* Type (Rubik is already loaded by the theme) */
	--mb-font: Rubik, Arial, Helvetica, sans-serif;
	--mb-fs-xs: 12px;
	--mb-fs-sm: 13px;
	--mb-fs: 14px;
	--mb-fs-md: 16px;
	--mb-fs-lg: 20px;
	--mb-fs-xl: 24px;

	/* Spacing (4-pt) */
	--mb-1: 4px; --mb-2: 8px; --mb-3: 12px; --mb-4: 16px; --mb-5: 20px; --mb-6: 24px; --mb-8: 32px;
}

/* =========================================================================
   1. Unified product card (WoodMart .wd-product)
   ========================================================================= */

.wd-product .product-wrapper {
	height: 100%;
	display: flex;
	flex-direction: column;
	padding: var(--mb-2);
	border-radius: var(--mb-r);
	background: var(--mb-card);
	transition: box-shadow .2s ease;
}
.wd-product:hover .product-wrapper { box-shadow: var(--mb-shadow-lg); }

/* 1:1 image well on a light neutral, product centred, no cropping */
.wd-product .product-element-top {
	aspect-ratio: 1 / 1;
	border-radius: var(--mb-r-sm);
	background: var(--mb-surface);
	overflow: hidden;
	margin-bottom: var(--mb-3);
}
.wd-product .product-element-top .product-image-link,
.wd-product .product-element-top .product-image-link picture { display: block; width: 100%; height: 100%; }
.wd-product .product-element-top .product-image-link img,
.wd-product .product-element-top .wd-product-grid-slide {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	padding: 8%;
	mix-blend-mode: multiply; /* white product backgrounds melt into the grey well */
}
.wd-product .product-element-top .hover-img img { padding: 0; object-fit: cover; mix-blend-mode: normal; }

/* Discount tag: small, quiet, top-left */
.wd-product .product-labels { inset: var(--mb-2) auto auto var(--mb-2); }
.wd-product .product-labels .product-label {
	min-width: 0;
	min-height: 0;
	padding: 3px 7px;
	border-radius: 4px;
	font: 600 var(--mb-fs-xs)/1.2 var(--mb-font);
	letter-spacing: 0;
}
.wd-product .product-labels .onsale { background: var(--mb-deal); color: #fff; }

/* Card body order: brand > title > rating > price > button */
.wd-product .product-element-bottom {
	display: flex;
	flex-direction: column;
	gap: var(--mb-1);
	flex: 1 1 auto;
	text-align: left;
}
.wd-product .product-element-bottom .wrap-price { display: contents !important; } /* WoodMart sets it to flex */
.wd-product .mb-card__brand { order: -1; }
.wd-product .wd-product-header { order: 0; }
.wd-product .mb-card__rating { order: 1; }
.wd-product .product-element-bottom .price { order: 2; }
.wd-product .wd-product-footer,
.wd-product .product-element-bottom > .wd-add-btn { order: 3; margin-top: auto; } /* footer (hover layouts) or bare button ("Standard button" layout) */
.wd-product .product-element-bottom > .wd-add-btn { padding-top: var(--mb-2); }

/* Category line is replaced by the brand line */
.wd-product .wd-product-cats { display: none; }

.wd-product .mb-card__brand {
	color: var(--mb-muted);
	font: 600 var(--mb-fs-xs)/1.3 var(--mb-font);
	text-transform: uppercase;
	letter-spacing: .04em;
	text-decoration: none;
}
.wd-product .mb-card__brand:hover { color: var(--mb-ink); }

/* Title: 2 lines, fixed height so rows line up */
.wd-product .wd-entities-title {
	margin: 0;
	font: 500 var(--mb-fs)/1.4 var(--mb-font);
	min-height: calc(2 * 1.4em);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.wd-product .wd-entities-title a { color: var(--mb-ink); }
.wd-product .wd-entities-title a:hover { color: var(--mb-red); }

/* Rating (only printed when real reviews exist). Hide the theme's own loop stars so they never show twice. */
.wd-product .product-element-bottom .star-rating,
.wd-product .product-element-bottom .wd-star-rating { display: none; }
.mb-card__rating {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: var(--mb-muted);
	font-size: var(--mb-fs-xs);
}
.mb-stars {
	position: relative;
	display: inline-block;
	font-size: 13px;
	line-height: 1;
	letter-spacing: 1px;
}
.mb-stars::before { content: "★★★★★"; color: #d9dce1; }
.mb-stars__fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; }
.mb-stars__fill::before { content: "★★★★★"; color: var(--mb-star); }

/* =========================================================================
   2. Price block (from the plugin's price filter)
   ========================================================================= */

.mb-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 6px;
	row-gap: 0;
	line-height: 1.3;
	color: var(--mb-ink);
}
.mb-price__from { font-size: var(--mb-fs-xs); color: var(--mb-muted); }
.mb-price__now,
.mb-price__now .amount { font: 700 var(--mb-fs-md)/1.2 var(--mb-font); color: var(--mb-ink); }
.mb-price__mrp { color: var(--mb-muted); font-size: var(--mb-fs-xs); text-decoration: line-through; }
.mb-price__mrp .amount { color: inherit; font-weight: 400; }
.mb-price__mrp-label { text-decoration: none; display: inline-block; }
.mb-price__off { color: var(--mb-deal); font-weight: 600; font-size: var(--mb-fs-xs); }
.single-product .summary .mb-price__now,
.single-product .summary .mb-price__now .amount { font-size: 28px; }
.single-product .summary .mb-price__off,
.single-product .summary .mb-price__mrp { font-size: var(--mb-fs); }
.wd-product .price { margin: 0; }

/* =========================================================================
   3. Card button (WoodMart "Standard button" hover style recommended)
   ========================================================================= */

.wd-product .wd-add-btn > .button {
	width: 100%;
	min-height: 40px;
	border-radius: var(--mb-r-sm);
	background: var(--mb-red);
	color: #fff;
	font: 600 var(--mb-fs-sm)/1 var(--mb-font);
	text-transform: none;
	box-shadow: 0 1px 0 rgba(0, 0, 0, .08), inset 0 -2px 0 rgba(0, 0, 0, .12);
	transition: background .15s ease, transform .05s ease;
}
.wd-product .wd-add-btn > .button:hover { background: var(--mb-red-ink); color: #fff; }
.wd-product .wd-add-btn > .button:active { transform: translateY(1px); box-shadow: none; }
.wd-product .wd-add-btn > .button.product_type_variable { background: var(--mb-ink); }
.wd-product .wd-add-btn > .button.product_type_variable:hover { background: #000; }

/* =========================================================================
   4. My Garage card + chips
   ========================================================================= */

.mb-garage {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: minmax(220px, 300px) 1fr;
	align-items: center;
	gap: var(--mb-4) var(--mb-6);
	padding: var(--mb-5) var(--mb-6);
	border: 1px solid var(--mb-line);
	border-radius: var(--mb-r-lg);
	background: var(--mb-card);
	box-shadow: var(--mb-shadow-lg);
}
.mb-garage__head { display: flex; align-items: center; gap: var(--mb-3); }
.mb-garage__icon {
	flex: 0 0 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--mb-ink);
	color: #fff;
}
.mb-garage__title { margin: 0; font: 700 var(--mb-fs-lg)/1.2 var(--mb-font); color: var(--mb-ink); }
.mb-garage__sub { margin: 2px 0 0; font-size: var(--mb-fs-sm); color: var(--mb-muted); line-height: 1.4; }

.mb-garage__steps { display: none; } /* labels come from the select placeholders */

/* Restyle the YMM Search selector inside the card */
.mb-garage .ymm-selector { margin: 0; padding: 0; background: none; border: 0; }
.mb-garage .ymm-selector .ymm-title-right,
.mb-garage .ymm-selector > .ymm-clear { display: none; }
.mb-garage .ymm-selector .block-content {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
	gap: var(--mb-2);
	align-items: stretch;
}
.mb-garage .ymm-selector .block-content .ymm-clear { display: none; }
.mb-garage .ymm-selector .level { margin: 0; padding: 0; float: none; width: auto; }
.mb-garage .ymm-select {
	width: 100%;
	height: 48px;
	padding: 0 40px 0 14px;
	border: 1px solid #cfd4da;
	border-radius: var(--mb-r-sm);
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2314171a' stroke-width='1.8'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
	-webkit-appearance: none;
	appearance: none;
	font: 500 var(--mb-fs)/1 var(--mb-font);
	color: var(--mb-ink);
	cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.mb-garage .ymm-select:focus { outline: none; border-color: var(--mb-ink); box-shadow: 0 0 0 3px rgba(20, 23, 26, .12); }
.mb-garage .ymm-select.disabled,
.mb-garage .ymm-select:disabled { background-color: var(--mb-surface); color: #9aa1a9; cursor: not-allowed; }
.mb-garage .mb-garage__submit {
	height: 48px;
	padding: 0 22px;
	border: 0;
	border-radius: var(--mb-r-sm);
	background: var(--mb-red);
	color: #fff;
	font: 600 var(--mb-fs)/1 var(--mb-font);
	white-space: nowrap;
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.mb-garage .mb-garage__submit:hover { background: var(--mb-red-ink); }

/* Active (saved bike) state */
.mb-garage__active { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mb-3); }
.mb-garage__active[hidden], .mb-garage__body[hidden] { display: none; }
.mb-garage__chip {
	display: inline-flex;
	align-items: center;
	gap: var(--mb-2);
	min-height: 44px;
	padding: 0 var(--mb-4);
	border: 1px solid #b7dfc7;
	border-radius: 999px;
	background: var(--mb-fit-bg);
	color: var(--mb-fit);
	font: 600 var(--mb-fs)/1.2 var(--mb-font);
}
.mb-garage__tick {
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--mb-fit);
	color: #fff;
	font-size: 12px;
}
.mb-garage__bike { color: var(--mb-ink); }
.mb-garage__state { font-weight: 500; font-size: var(--mb-fs-xs); color: var(--mb-fit); }
.mb-garage__shop {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 var(--mb-4);
	border-radius: var(--mb-r-sm);
	background: var(--mb-red);
	color: #fff !important;
	font: 600 var(--mb-fs)/1 var(--mb-font);
	text-decoration: none;
}
.mb-garage__shop:hover { background: var(--mb-red-ink); }
.mb-garage__change {
	padding: 0;
	border: 0;
	background: none;
	color: var(--mb-ink-2);
	font: 500 var(--mb-fs-sm)/1 var(--mb-font);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

/* The empty Elementor widget that used to hold the selector */
.mb-is-moved { display: none !important; }

/* Header / sticky chip ("Deliver to" pattern) */
.mb-garage-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 220px;
	padding: 4px 10px 4px 6px;
	border: 1px solid transparent;
	border-radius: var(--mb-r-sm);
	color: inherit;
	text-decoration: none;
	line-height: 1.15;
}
.mb-garage-chip:hover { border-color: currentColor; }
.mb-garage-chip__icon { display: grid; place-items: center; }
.mb-garage-chip__text { display: flex; flex-direction: column; min-width: 0; }
.mb-garage-chip__label { font-size: 11px; opacity: .75; }
.mb-garage-chip__bike {
	font: 700 var(--mb-fs-sm)/1.2 var(--mb-font);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mb-garage-chip.is-set .mb-garage-chip__icon { color: var(--mb-fit); }

/* =========================================================================
   5. Category pills (swipeable)
   ========================================================================= */

.mb-pills { position: relative; margin: 0 0 var(--mb-4); }
.mb-pills__list {
	display: flex;
	gap: var(--mb-2);
	margin: 0;
	padding: 2px 0 6px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.mb-pills__list::-webkit-scrollbar { display: none; }
.mb-pills__list li { flex: 0 0 auto; scroll-snap-align: start; margin: 0; }
.mb-pill {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 0 var(--mb-4);
	border: 1px solid #cfd4da;
	border-radius: 999px;
	background: #fff;
	color: var(--mb-ink) !important;
	font: 500 var(--mb-fs-sm)/1 var(--mb-font);
	white-space: nowrap;
	text-decoration: none;
	box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
	transition: background .15s ease, border-color .15s ease;
}
.mb-pill:hover { border-color: var(--mb-ink); }
.mb-pill.is-active { background: var(--mb-ink); border-color: var(--mb-ink); color: #fff !important; }

/* =========================================================================
   6. 4-quadrant deal cards
   ========================================================================= */

.mb-deals {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--mb-4);
}
.mb-deal {
	display: flex;
	flex-direction: column;
	padding: var(--mb-4) var(--mb-4) var(--mb-3);
	border-radius: var(--mb-r);
	background: var(--mb-card);
	box-shadow: var(--mb-shadow);
}
.mb-deal__title { margin: 0 0 var(--mb-3); font: 700 var(--mb-fs-md)/1.25 var(--mb-font); color: var(--mb-ink); }
.mb-deal__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--mb-3) var(--mb-2);
	margin: 0;
	padding: 0;
	list-style: none;
}
.mb-deal__item { margin: 0; }
.mb-deal__item a { position: relative; display: block; color: var(--mb-ink-2); text-decoration: none; }
.mb-deal__img {
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: var(--mb-r-sm);
	background: var(--mb-surface);
	overflow: hidden;
}
.mb-deal__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 8%;
	mix-blend-mode: multiply;
	transition: transform .25s ease;
}
.mb-deal__item a:hover .mb-deal__img img { transform: scale(1.04); }
.mb-deal__badge {
	position: absolute;
	top: 6px;
	left: 6px;
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--mb-deal);
	color: #fff;
	font: 600 11px/1.2 var(--mb-font);
}
.mb-deal__name {
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 6px;
	font-size: var(--mb-fs-xs);
	line-height: 1.35;
}
.mb-deal__cta {
	margin-top: auto;
	padding-top: var(--mb-3);
	color: #007185 !important; /* marketplace link teal reads as "link" without competing with red CTAs */
	font: 500 var(--mb-fs-sm)/1.2 var(--mb-font);
	text-decoration: none;
}
.mb-deal__cta:hover { color: #c7511f !important; text-decoration: underline; }

/* =========================================================================
   7. Collapsible SEO text
   ========================================================================= */

.mb-clamp {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	max-width: 880px;
	margin-inline: auto;
}
.mb-clamp.is-open { display: block; -webkit-line-clamp: unset; }
.wd-tabs-desc.mb-clamp { max-width: none; margin-inline: 0; }
.wd-tabs-desc + .mb-clamp__toggle { margin: 4px 0 0; padding-left: 0; }
.mb-clamp__toggle {
	display: block;
	margin: 4px auto 0;
	padding: 4px 8px;
	border: 0;
	background: none;
	color: var(--mb-ink-2);
	font: 500 var(--mb-fs-sm)/1.2 var(--mb-font);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

/* =========================================================================
   8. Tablet + mobile
   ========================================================================= */

@media (max-width: 1024px) {
	.mb-deals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mb-garage { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
	/* 2-column product grids */
	.wd-products.wd-grid-g,
	.products.wd-grid-g { --wd-col-sm: 2; --wd-gap-sm: 10px; }

	.wd-product .product-wrapper { padding: 6px; }
	.wd-product .wd-entities-title { font-size: var(--mb-fs-sm); }
	.mb-price__now, .mb-price__now .amount { font-size: 15px; }
	.wd-product .wd-add-btn > .button { min-height: 38px; font-size: var(--mb-fs-xs); }

	/* Garage: stacked, thumb-friendly */
	.mb-garage { padding: var(--mb-4); gap: var(--mb-3); border-radius: var(--mb-r); }
	.mb-garage__icon { flex-basis: 36px; height: 36px; }
	.mb-garage__title { font-size: 18px; }
	.mb-garage .ymm-selector .block-content { grid-template-columns: 1fr; }
	.mb-garage .mb-garage__submit { width: 100%; }
	.mb-garage__active { gap: var(--mb-2); }
	.mb-garage__chip, .mb-garage__shop { width: 100%; justify-content: center; }
	.mb-garage__change { margin: 4px auto 0; }

	/* Deal cards become a swipeable row with the next card peeking */
	.mb-deals {
		display: flex;
		gap: var(--mb-3);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		padding-bottom: 4px;
	}
	.mb-deals::-webkit-scrollbar { display: none; }
	.mb-deal { flex: 0 0 82%; scroll-snap-align: start; }

	/* Pills: let the row bleed to the screen edge so the peek is obvious */
	.mb-pills { margin-right: -16px; }
	.mb-pills__list { padding-right: 16px; }

	.mb-garage-chip { max-width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
	.wd-product .product-wrapper, .mb-deal__img img, .mb-pill { transition: none; }
}
