/**
 * Wholesale Marketplace — front-end styles.
 *
 * Design direction, second pass: the first redesign was still reading
 * as a generic "web-app card" (colored price, resting shadow, rounded
 * bubble corners). This pass is modeled directly on Alibaba.com and
 * Made-in-China.com listing cards, both inspected live (computed
 * styles + DOM anatomy, not guessed): flat, chrome-free cards with NO
 * resting shadow and a near-flat radius — separation comes from grid
 * whitespace, not decoration; the price is large and bold but a
 * NEUTRAL ink color, never brand-colored, because on every real B2B
 * marketplace color is reserved for actions and badges, not data; a
 * compact icon+label meta row (SKU / lead time) stands in for the
 * "supplier trust row" those sites show; a small "Save up to X%"
 * badge sits on the image itself, safe to show even to a locked-out
 * visitor since it reveals a percentage, never a real price; and every
 * icon is a plain monochrome SVG (no emoji — 🔒 read as an AI-template
 * tell next to real marketplace UI). Exact price breaks stay behind a
 * native <details> disclosure so they never force a card taller.
 *
 * Every token below was pulled from the live site (university.
 * linkinsolution.com) rather than invented: EduBlink theme headings
 * run on the Google Font "Spartan", body copy on "Poppins"; the
 * primary brand color is the navy gradient used on "Enroll Now" and
 * "Add to Cart" (#144272 → #0D3B66); the site's own "Locked Research"
 * badge (amber #FFFBEB / #92400E / #FDE68A, full-pill, 900 weight) is
 * reused verbatim for this catalog's own "sign in for pricing" state
 * so the two features read as one product, not two bolted together;
 * --ls-accent (#1AB69D) is their teal, used here for the savings badge
 * and success accent; the page-title band's own background (#F5F9FA)
 * is matched for anything that needs a light neutral fill.
 */

.lwm-wrap {
	--lwm-navy: #0D3B66;
	--lwm-navy-2: #144272;
	--lwm-navy-gradient: linear-gradient(-90deg, var(--lwm-navy-2) 0%, var(--lwm-navy) 100%);
	--lwm-teal: #1AB69D;
	--lwm-teal-light: #E7F8F4;
	--lwm-amber-bg: #FFFBEB;
	--lwm-amber-text: #92400E;
	--lwm-amber-border: #FDE68A;
	--lwm-ink: #1E1E1E;
	--lwm-muted: #6B7280;
	--lwm-muted-2: #9CA3AF;
	--lwm-line: #E5E7EB;
	--lwm-band: #F5F9FA;
	--lwm-card-bg: #FFFFFF;
	--lwm-danger: #B3261E;
	--lwm-radius-btn: 5px;
	--lwm-radius-card: 8px;
	--lwm-radius-pill: 999px;
	--lwm-shadow-card-hover: 0 10px 24px rgba(13,59,102,.14);

	--lwm-font-display: 'Spartan', sans-serif;
	--lwm-font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	font-family: var(--lwm-font-body);
	color: var(--lwm-ink);
	background: transparent;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	font-size: 14px;
}

.lwm-wrap * {
	box-sizing: border-box;
}

/*
 * `.lwm-quote-form` toggles visibility via the plain `hidden` attribute
 * (see wholesale.js) — but `.lwm-form, .lwm-quote-form` below sets
 * `display: flex` unconditionally, which (being an author rule)
 * outranks the browser's own low-specificity `[hidden]{display:none}`
 * default. Without this rule a "hidden" form would still render and
 * take up layout space. Scoped to .lwm-wrap rather than a bare
 * [hidden] selector so it can never affect markup outside this
 * plugin's own templates.
 */
.lwm-wrap [hidden] {
	display: none !important;
}

.lwm-wrap a {
	color: var(--lwm-navy);
}

.lwm-eyebrow {
	font-family: var(--lwm-font-display);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--lwm-teal);
	margin: 0 0 4px;
}

.lwm-heading {
	font-family: var(--lwm-font-display);
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 6px;
	color: var(--lwm-ink);
	font-size: clamp(20px, 2.6vw, 28px);
}

/* ---------------------------------------------------------------
 * Banners
 * --------------------------------------------------------------- */
.lwm-banner {
	border: 1px solid var(--lwm-line);
	border-left: 3px solid var(--lwm-teal);
	background: var(--lwm-card-bg);
	padding: 11px 14px;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 13.5px;
}
.lwm-banner-error {
	border-left-color: var(--lwm-danger);
	color: var(--lwm-danger);
}

/* ---------------------------------------------------------------
 * Signup / activate gate — same navy gradient + Spartan type as the
 * site's own "Enroll Now" CTA and hero sections.
 * --------------------------------------------------------------- */
.lwm-gate {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 0;
	background: var(--lwm-navy-gradient);
	color: #fff;
	border-radius: var(--lwm-radius-card);
	overflow: hidden;
	margin-bottom: 28px;
	box-shadow: 0 4px 14px rgba(13,59,102,.12);
}

.lwm-gate-copy {
	padding: clamp(22px, 3.5vw, 40px);
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.lwm-gate-copy .lwm-eyebrow {
	color: #6FE3CB;
}
.lwm-gate-copy .lwm-heading {
	color: #fff;
	font-size: clamp(20px, 2.6vw, 28px);
}
.lwm-gate-copy p {
	color: rgba(255,255,255,.78);
	max-width: 46ch;
	font-size: 13.5px;
	margin: 0;
}
.lwm-gate-login {
	margin-top: 14px !important;
	font-size: 13.5px;
}
.lwm-gate-login a {
	color: #fff;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.lwm-gate-form {
	background: #fff;
	padding: clamp(20px, 3.5vw, 32px);
}

@media (max-width: 780px) {
	.lwm-gate {
		grid-template-columns: 1fr;
	}
}

/* ---------------------------------------------------------------
 * Forms (shared: registration + activation + quote request)
 * --------------------------------------------------------------- */
.lwm-form,
.lwm-quote-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lwm-label {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--lwm-muted);
}
.lwm-optional {
	font-weight: 400;
	color: var(--lwm-muted-2);
}

.lwm-input {
	font-family: var(--lwm-font-body);
	font-size: 14px;
	color: var(--lwm-ink);
	background: #fff;
	border: 1px solid var(--lwm-line);
	border-radius: 6px;
	padding: 9px 12px;
	min-height: 40px;
	width: 100%;
}
textarea.lwm-input {
	min-height: 56px;
	resize: vertical;
}
.lwm-input:focus-visible,
.lwm-btn:focus-visible,
.lwm-pill:focus-visible,
.lwm-qty-btn:focus-visible,
summary.lwm-tiers-toggle:focus-visible {
	outline: 2px solid var(--lwm-navy);
	outline-offset: 2px;
}

.lwm-btn {
	cursor: pointer;
	font-family: var(--lwm-font-display);
	font-weight: 600;
	font-size: 13.5px;
	border-radius: var(--lwm-radius-btn);
	border: 1px solid transparent;
	padding: 10px 18px;
	min-height: 40px;
	transition: box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}
.lwm-btn-primary {
	background: var(--lwm-navy-gradient);
	color: #fff;
}
.lwm-btn-primary:hover {
	box-shadow: 0 6px 16px rgba(13,59,102,.32);
}
.lwm-btn-amber {
	background: #fff;
	color: var(--lwm-navy);
	border-color: var(--lwm-navy);
}
.lwm-btn-amber:hover {
	background: var(--lwm-navy);
	color: #fff;
}
.lwm-btn:active {
	transform: translateY(1px);
}

.lwm-quote-note {
	font-size: 12px;
	color: var(--lwm-muted);
	margin: 0;
}

.lwm-already {
	font-size: 15px;
}

/* ---------------------------------------------------------------
 * Toolbar — filter pills + result count, the row real B2B listing
 * pages ("Showing 30,000+ products for X") open with instead of
 * dropping straight into the grid.
 * --------------------------------------------------------------- */
.lwm-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}
.lwm-results-count {
	margin: 0;
	font-size: 12.5px;
	color: var(--lwm-muted);
	white-space: nowrap;
}

.lwm-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-bottom: 0;
}
.lwm-pill {
	cursor: pointer;
	font-family: var(--lwm-font-body);
	font-size: 12.5px;
	font-weight: 500;
	background: #fff;
	border: 1px solid var(--lwm-line);
	color: var(--lwm-muted);
	border-radius: var(--lwm-radius-pill);
	padding: 7px 14px;
	min-height: 34px;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.lwm-pill:hover {
	border-color: var(--lwm-navy);
	color: var(--lwm-navy);
}
.lwm-pill.is-active {
	background: var(--lwm-navy);
	border-color: var(--lwm-navy);
	color: #fff;
}

.lwm-empty {
	color: var(--lwm-muted);
	font-size: 14px;
}

/* ---------------------------------------------------------------
 * Product grid + card — dense, small square photos, compact info.
 * --------------------------------------------------------------- */
.lwm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 16px;
}

/*
 * Flat, chrome-free card — this is the single biggest change from the
 * earlier "web-app card" look: real B2B listing pages (Alibaba,
 * Made-in-China — both inspected directly) render their cards with NO
 * resting shadow and almost no radius at all; cards are separated by
 * grid whitespace, not by decoration. A shadow only appears on hover,
 * as lift feedback, never at rest.
 */
.lwm-card {
	background: var(--lwm-card-bg);
	border: 1px solid var(--lwm-line);
	border-radius: var(--lwm-radius-card);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: none;
	transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.lwm-card:hover {
	box-shadow: var(--lwm-shadow-card-hover);
	transform: translateY(-2px);
	border-color: #D7E3EC;
}

.lwm-card-media {
	position: relative;
	aspect-ratio: 1 / 1;
	background: var(--lwm-band);
	overflow: hidden;
}

.lwm-save-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	background: var(--lwm-teal);
	color: #fff;
	font-family: var(--lwm-font-display);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.01em;
	padding: 4px 8px;
	border-radius: 4px;
	line-height: 1;
	box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.lwm-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.lwm-card-media-placeholder {
	width: 100%;
	height: 100%;
	background:
		repeating-linear-gradient(45deg, var(--lwm-line) 0 2px, transparent 2px 12px);
}

.lwm-card-body {
	padding: 11px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	flex: 1;
}

.lwm-card-title {
	font-family: var(--lwm-font-body);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.35;
	margin: 0;
	color: var(--lwm-ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.7em;
}

/* Meta row (SKU / lead time) — the stand-in for the "supplier" trust
   row every real B2B card shows; small icon + label pairs, not text
   alone, for the same reason: it reads as data, not decoration. */
.lwm-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 3px 10px;
	margin: 0;
}
.lwm-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 10.5px;
	color: var(--lwm-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}
.lwm-icon {
	flex-shrink: 0;
	color: var(--lwm-muted-2);
}

.lwm-price-row {
	display: flex;
	align-items: baseline;
	gap: 4px;
	margin-top: 2px;
}
.lwm-price-amount {
	font-family: var(--lwm-font-display);
	font-size: 17px;
	font-weight: 700;
	color: var(--lwm-ink);
	letter-spacing: -0.01em;
}
.lwm-price-unit {
	font-size: 11.5px;
	color: var(--lwm-muted-2);
}

.lwm-moq-line {
	font-size: 11.5px;
	color: var(--lwm-muted);
	margin: 0;
}
.lwm-moq-line strong {
	color: var(--lwm-ink);
	font-weight: 600;
}

/* Tier breakdown — collapsed by default (native <details>, no JS
   required to open/close), so a product with several price breaks
   doesn't force every card in the grid to be tall. */
.lwm-tiers-details {
	margin-top: 2px;
	border-top: 1px dashed var(--lwm-line);
	padding-top: 6px;
}
.lwm-tiers-toggle {
	cursor: pointer;
	list-style: none;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--lwm-navy);
	display: flex;
	align-items: center;
	gap: 4px;
	-webkit-tap-highlight-color: transparent;
}
.lwm-tiers-toggle::-webkit-details-marker {
	display: none;
}
.lwm-tiers-toggle::before {
	content: '▸';
	font-size: 9px;
	transition: transform 150ms ease;
	color: var(--lwm-muted-2);
}
.lwm-tiers-details[open] .lwm-tiers-toggle::before {
	transform: rotate(90deg);
}

.lwm-tier-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
	margin-top: 6px;
}
.lwm-tier-table th {
	text-align: left;
	font-size: 10px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--lwm-muted-2);
	font-weight: 600;
	padding: 0 0 4px;
	border-bottom: 1px solid var(--lwm-line);
}
.lwm-tier-table td {
	padding: 4px 0;
	border-bottom: 1px solid var(--lwm-line);
	color: var(--lwm-ink);
}
.lwm-tier-table tr:last-child td {
	border-bottom: none;
}
.lwm-tier-row-display.is-active td {
	color: var(--lwm-navy);
	font-weight: 700;
}

.lwm-locked-pricing {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--lwm-amber-bg);
	border: 0.8px solid var(--lwm-amber-border);
	color: var(--lwm-amber-text);
	border-radius: var(--lwm-radius-pill);
	padding: 5px 10px;
	font-size: 10.5px;
	font-weight: 700;
	margin-top: 4px;
	width: fit-content;
}
.lwm-locked-pricing .lwm-icon {
	color: inherit;
}

/* Order block — one compact qty+cart row instead of a stack of
   separate sections. */
.lwm-order-block {
	margin-top: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--lwm-line);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.lwm-order-row {
	display: flex;
	align-items: stretch;
	gap: 6px;
}

.lwm-qty-stepper {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--lwm-line);
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
}
.lwm-qty-btn {
	cursor: pointer;
	background: var(--lwm-band);
	border: none;
	width: 26px;
	font-size: 14px;
	font-weight: 700;
	color: var(--lwm-ink);
	transition: background-color 150ms ease;
}
.lwm-qty-btn:hover {
	background: var(--lwm-line);
}
.lwm-qty-input {
	font-family: var(--lwm-font-body);
	font-weight: 600;
	font-size: 12.5px;
	text-align: center;
	width: 44px;
	border: none;
	border-left: 1px solid var(--lwm-line);
	border-right: 1px solid var(--lwm-line);
	-moz-appearance: textfield;
}
.lwm-qty-input::-webkit-outer-spin-button,
.lwm-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.lwm-cart-form,
.lwm-quote-form {
	margin: 0;
	flex: 1;
}
.lwm-cart-form .lwm-btn {
	width: 100%;
	padding: 0 10px;
}
.lwm-quote-form {
	border-top: 1px solid var(--lwm-line);
	padding-top: 8px;
	gap: 6px;
}
.lwm-quote-form .lwm-btn {
	width: 100%;
}
.lwm-quote-form .lwm-input {
	min-height: 34px;
	padding: 7px 10px;
	font-size: 12.5px;
}

.lwm-line-total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin: 0;
	font-size: 11px;
	color: var(--lwm-muted);
}
.lwm-line-total-amount {
	font-family: var(--lwm-font-display);
	font-size: 13px;
	font-weight: 700;
	color: var(--lwm-ink);
}

@media (prefers-reduced-motion: reduce) {
	.lwm-card,
	.lwm-btn,
	.lwm-tiers-toggle::before {
		transition: none !important;
	}
}
