/*
 * Layout for the wholesale blocks on themes other than Catalyst B2B.
 * Every rule is scoped to the plugin's own wrappers, or to pages that contain
 * the wholesale catalogue (body.ekmusta-page).
 */
.ekmusta-sku-importer-card [hidden],
.ekmusta-registration-showcase [hidden],
.ekmusta-catalog-portal-shell [hidden],
.ekmusta-account-portal [hidden],
.ekmusta-matrix-wrapper [hidden] {
	display: none !important;
}
body.ekmusta-page #secondary,
body.ekmusta-page aside.widget-area,
body.ekmusta-page .sidebar-width,
body.ekmusta-page .default-sidebar,
body.ekmusta-page .entry-header {
	display: none !important;
}
body.ekmusta-page .site-wrapper,
body.ekmusta-page #primary,
body.ekmusta-page .lay-width,
body.ekmusta-page .site-main,
body.ekmusta-page .content-area,
body.ekmusta-page .entry-content {
	width: 100% !important;
	max-width: 1280px !important;
	flex: 0 0 100% !important;
	float: none !important;
	margin-left: auto !important;
	margin-right: auto !important;
}
.ekmusta-sku-importer-card *,
.ekmusta-registration-showcase *,
.ekmusta-catalog-portal-shell *,
.ekmusta-account-portal *,
.ekmusta-matrix-wrapper * {
	box-sizing: border-box;
}
/* Keep wide Ekmusta blocks inside a readable width with breathing room from the screen edge. */
.ekmusta-sku-importer-card,
.ekmusta-registration-showcase,
.ekmusta-catalog-portal-shell {
	width: auto !important;
	max-width: min(1180px, calc(100% - 32px)) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box !important;
}
.ekmusta-registration-showcase,
.ekmusta-catalog-portal-shell {
	padding-left: 0 !important;
	padding-right: 0 !important;
}
.ekmusta-sticky-order-bar {
	position: sticky;
	/* Themes with a sticky header can set --ekmusta-sticky-top to its height. */
	top: calc(var(--ekmusta-sticky-top, 32px) + var(--ekmusta-bar-gap, 0px));
	z-index: 45;
	display: flex !important;
	flex-wrap: wrap !important;
	justify-content: space-between !important;
	align-items: center !important;
	gap: 16px !important;
	/* Colours follow Settings → Appearance → Catalogue header (dark is the default). */
	background: var(--ekmusta-bar-bg, linear-gradient(135deg, #0f172a 0%, #1e293b 100%)) !important;
	color: var(--ekmusta-bar-ink, #ffffff) !important;
	border: 1px solid var(--ekmusta-bar-line, #334155) !important;
	border-radius: 16px !important;
	padding: 14px 20px !important;
	margin-bottom: 24px !important;
	box-shadow: 0 10px 28px -12px rgba(15, 23, 42, 0.1) !important;
}
.ekmusta-sticky-order-bar > .wp-block-group {
	display: flex !important;
	align-items: center !important;
	flex-wrap: wrap !important;
	gap: 14px !important;
	margin: 0 !important;
}
.ekmusta-sticky-order-bar h2 {
	color: var(--ekmusta-bar-ink, #ffffff) !important;
	margin: 0 !important;
	font-size: 1.15rem !important;
	font-weight: 750 !important;
	letter-spacing: -0.02em;
	white-space: nowrap;
}
.ekmusta-sticky-order-bar .wp-block-search {
	margin: 0 !important;
}
.ekmusta-sticky-order-bar .wp-block-search__inside-wrapper {
	display: flex !important;
	align-items: center !important;
	gap: 6px !important;
	background: var(--ekmusta-bar-field, #1e293b);
	border: 1px solid var(--ekmusta-bar-line, #334155);
	border-radius: 10px;
	padding: 2px 4px 2px 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ekmusta-sticky-order-bar .wp-block-search__inside-wrapper:focus-within {
	border-color: var(--ekmusta-brand, #2457e6);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ekmusta-brand, #2457e6) 18%, transparent);
}
.ekmusta-sticky-order-bar .wp-block-search__input {
	min-width: 210px;
	padding: 6px 4px !important;
	border: 0 !important;
	background: transparent !important;
	color: var(--ekmusta-bar-ink, #ffffff) !important;
	font-size: 0.86rem !important;
	outline: none !important;
}
.ekmusta-sticky-order-bar .wp-block-search__input::placeholder {
	color: var(--ekmusta-bar-muted, #94a3b8) !important;
}
.ekmusta-sticky-order-bar .wp-block-search__button {
	padding: 6px 10px !important;
	border-radius: 7px !important;
	background: transparent !important;
	color: var(--ekmusta-bar-ink, #ffffff) !important;
	border: 1px solid var(--ekmusta-bar-line, #475569) !important;
	cursor: pointer;
	margin: 0 !important;
	transition: background 0.15s ease, color 0.15s ease;
}
.ekmusta-sticky-order-bar .wp-block-search__button:hover {
	background: var(--ekmusta-bar-field, #334155) !important;
	border-color: var(--ekmusta-bar-line, #475569) !important;
}
.ekmusta-live-Order-metrics {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 0.88rem;
	background: var(--ekmusta-bar-field, rgba(255, 255, 255, 0.08));
	border: 1px solid var(--ekmusta-bar-line, rgba(255, 255, 255, 0.12));
	padding: 8px 14px;
	border-radius: 10px;
	color: var(--ekmusta-bar-muted, #cbd5e1);
	white-space: nowrap;
}
.ekmusta-live-Order-metrics strong {
	color: var(--ekmusta-bar-value, #38bdf8);
	font-weight: 750;
	font-variant-numeric: tabular-nums;
}
.ekmusta-metric-divider {
	color: var(--ekmusta-bar-line, rgba(255, 255, 255, 0.25));
}
.ekmusta-catalog-portal-shell > .wp-block-columns {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: flex-start !important;
	gap: 24px !important;
	width: 100% !important;
	max-width: 1280px !important;
}
.ekmusta-catalog-sidebar {
	flex: 0 0 240px !important;
	max-width: 240px !important;
	position: sticky;
	top: calc(var(--ekmusta-sticky-top, 32px) + var(--ekmusta-bar-gap, 0px) + var(--ekmusta-bar-h, 72px) + 16px);
	/* Line up with the first product: skip the List/Grid row above the results. */
	margin-top: 54px !important;
}
.ekmusta-catalog-sidebar > .wp-block-group {
	background: #ffffff;
	border: 1px solid #e2e8f0 !important;
	border-radius: 16px !important;
	padding: 20px !important;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 8px 20px -12px rgba(15, 23, 42, 0.06);
}
.ekmusta-catalog-sidebar h3 {
	margin: 0 0 14px !important;
	font-size: 0.75rem !important;
	font-weight: 800 !important;
	color: #64748b !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
}
.ekmusta-catalog-sidebar ul {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.ekmusta-catalog-sidebar li {
	margin: 0 !important;
	padding: 8px 12px;
	border-radius: 9px;
	background: #f8fafc;
	border: 1px solid transparent;
	font-size: 0.86rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.ekmusta-catalog-sidebar li a {
	text-decoration: none !important;
	color: #1e293b !important;
	font-weight: 600;
}
.ekmusta-catalog-sidebar li:hover {
	background: color-mix(in srgb, var(--ekmusta-brand, #2457e6) 8%, #ffffff);
	border-color: color-mix(in srgb, var(--ekmusta-brand, #2457e6) 28%, #ffffff);
	transform: translateX(2px);
}
.ekmusta-catalog-sidebar li:hover a {
	color: var(--ekmusta-brand, #2457e6) !important;
}

.ekmusta-catalog-list {
	list-style: none !important;
	padding-left: 0 !important;
	margin: 0 !important;
}
.ekmusta-catalog-list > li {
	margin: 0 0 16px !important;
}
.ekmusta-catalog-list > li:last-child {
	margin-bottom: 0 !important;
}

/* Unified Card Row (List View default) */
.ekmusta-catalog-row {
	display: flex !important;
	flex-wrap: nowrap !important;
	justify-content: space-between !important;
	align-items: flex-start !important;
	gap: 24px !important;
	background: #ffffff !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 16px !important;
	margin-bottom: 0 !important;
	padding: 20px 24px !important;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 10px 24px -14px rgba(15, 23, 42, 0.08) !important;
	transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.ekmusta-catalog-row:hover {
	background-color: #ffffff !important;
	border-color: #cbd5e1 !important;
	box-shadow: 0 14px 30px -16px rgba(36, 87, 230, 0.14) !important;
}
.ekmusta-catalog-row > .wp-block-group:first-child {
	display: flex !important;
	align-items: flex-start !important;
	gap: 16px !important;
	flex: 0 0 300px !important;
	min-width: 240px !important;
	max-width: 320px !important;
	padding-top: 2px;
}
.ekmusta-catalog-row > .wp-block-group:first-child > .wp-block-group {
	padding-top: 2px;
	min-width: 0;
}
.ekmusta-catalog-row > .ekmusta-matrix-wrapper {
	flex: 1 1 0% !important;
	min-width: 0 !important;
	max-width: none !important;
}
.ekmusta-catalog-row .wp-block-post-featured-image {
	flex: 0 0 84px !important;
	width: 84px !important;
	height: 84px !important;
	margin: 0 !important;
	border-radius: 12px !important;
	background: #f8fafc;
	border: 1px solid #eef2f6;
	overflow: hidden;
}
.ekmusta-catalog-row .wp-block-post-featured-image img {
	width: 84px !important;
	height: 84px !important;
	object-fit: cover !important;
	border-radius: 11px !important;
	display: block;
}
.ekmusta-catalog-row .wp-block-post-title {
	margin: 0 0 10px !important;
	font-size: 1.04rem !important;
	line-height: 1.35 !important;
	letter-spacing: -0.015em;
}
.ekmusta-catalog-row .wp-block-post-title a {
	text-decoration: none !important;
	color: #0f172a !important;
	font-weight: 700 !important;
	transition: color 0.15s ease;
}
.ekmusta-catalog-row .wp-block-post-title a:hover {
	color: var(--ekmusta-brand, #2457e6) !important;
}
.ekmusta-catalog-row .wp-block-group .wp-block-group {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 6px !important;
}
.ekmusta-catalog-row .wp-block-group .wp-block-group p {
	margin: 0 !important;
	padding: 3px 9px !important;
	border-radius: 999px !important;
	font-size: 0.72rem !important;
	font-weight: 650 !important;
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #d1fae5;
	white-space: nowrap;
}
.ekmusta-catalog-row .wp-block-group .wp-block-group p:first-child {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	background: #f1f5f9 !important;
	border: 1px solid #e2e8f0 !important;
	color: #475569 !important;
}
.ekmusta-catalog-row .wp-block-group .wp-block-group p.has-brand-color {
	background: color-mix(in srgb, var(--ekmusta-brand, #2457e6) 9%, #ffffff) !important;
	border: 1px solid color-mix(in srgb, var(--ekmusta-brand, #2457e6) 26%, #ffffff) !important;
	color: var(--ekmusta-brand, #2457e6) !important;
}
.ekmusta-catalog-row .wp-block-group .wp-block-group p:empty {
	display: none !important;
}

.ekmusta-catalog-portal-shell .wp-block-button__link.has-brand-background-color {
	background: var(--ekmusta-bar-button, var(--ekmusta-brand, #2457e6)) !important;
	color: var(--ekmusta-bar-button-ink, var(--ekmusta-brand-ink, #ffffff)) !important;
	font-weight: 650 !important;
	border-radius: 10px !important;
	text-decoration: none !important;
	white-space: nowrap;
	box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--ekmusta-bar-button, var(--ekmusta-brand, #2457e6)) 55%, transparent);
}

/* Inside catalogue rows the product details already show the minimum. */
.ekmusta-catalog-row .ekmusta-matrix-head {
	display: none !important;
}
.ekmusta-catalog-row .ekmusta-matrix-wrapper:not(.is-locked) {
	border-color: #eef2f6 !important;
	border-radius: 12px !important;
	background: #fbfcfe !important;
	box-shadow: none !important;
}

/* Grid view: balanced 2-column card layout */
.ekmusta-catalog-list.is-grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 20px !important;
}
.ekmusta-catalog-list.is-grid > li {
	margin: 0 !important;
	min-width: 0;
}
.ekmusta-catalog-list.is-grid > li > .ekmusta-catalog-row {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	grid-template-rows: auto 1fr !important;
	align-content: stretch !important;
	height: 100% !important;
	row-gap: 18px !important;
	padding: 22px !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 18px !important;
	background: #ffffff !important;
}
.ekmusta-catalog-list.is-grid > li > .ekmusta-catalog-row:hover {
	border-color: #93c5fd !important;
	transform: translateY(-2px);
	box-shadow: 0 16px 34px -18px rgba(36, 87, 230, 0.22) !important;
}
.ekmusta-catalog-list.is-grid > li > .ekmusta-catalog-row > .wp-block-group:first-child {
	width: 100% !important;
	max-width: none !important;
	flex: none !important;
	padding-bottom: 16px;
	border-bottom: 1px solid #f1f5f9;
}
.ekmusta-catalog-list.is-grid .ekmusta-matrix-wrapper:not(.is-locked) {
	align-self: end;
	width: 100%;
}
.ekmusta-catalog-list.is-grid .ekmusta-matrix-wrapper.is-locked {
	align-self: end;
	width: 100%;
}
.ekmusta-catalog-list.is-grid .ekmusta-guest-row {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 6px;
}

@media (max-width: 960px) {
	.ekmusta-catalog-portal-shell > .wp-block-columns {
		flex-wrap: wrap !important;
	}
	.ekmusta-catalog-sidebar {
		flex: 1 1 100% !important;
		max-width: 100% !important;
		position: static;
	}
	.ekmusta-catalog-row {
		flex-wrap: wrap !important;
	}
	.ekmusta-catalog-row > .wp-block-group:first-child,
	.ekmusta-catalog-row > .ekmusta-matrix-wrapper {
		flex: 1 1 100% !important;
		max-width: 100% !important;
		width: 100% !important;
	}
}
@media (max-width: 820px) {
	.ekmusta-catalog-list.is-grid {
		grid-template-columns: 1fr !important;
	}
}

.ekmusta-single-product-matrix {
	margin-top: 24px;
}
.ekmusta-wholesale-label {
	font-weight: 600;
	white-space: nowrap;
}
body.ekmusta-grid-replaces-cart form.cart:not(.ekmusta-keep) {
	display: none !important;
}

/* Stock tag colours: Ekmusta marks the stock line ekmusta-stock--in, --backorder or --out. */
.ekmusta-catalog-row .wp-block-group .wp-block-group p.ekmusta-stock--backorder {
	background: #fffbeb !important;
	border-color: #fde68a !important;
	color: #b45309 !important;
}
.ekmusta-catalog-row .wp-block-group .wp-block-group p.ekmusta-stock--out {
	background: #fef2f2 !important;
	border-color: #fecaca !important;
	color: #b91c1c !important;
}

/* Phones: the catalogue bar wraps to several lines, so it scrolls with the page instead of covering it. */
@media (max-width: 781px) {
	.ekmusta-sticky-order-bar { position: relative !important; top: auto !important; }
	.ekmusta-catalog-sidebar { position: static !important; }
}

/* Grid view: image across the top of the card (strong selectors so theme row styles do not win). */
html body .ekmusta-catalog-list.is-grid > li > .ekmusta-catalog-row > .wp-block-group:first-child {
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 12px !important;
	width: 100% !important;
	max-width: none !important;
	flex: none !important;
}
html body .ekmusta-catalog-list.is-grid > li > .ekmusta-catalog-row .wp-block-post-featured-image {
	width: 100% !important;
	height: 200px !important;
	flex: none !important;
}
html body .ekmusta-catalog-list.is-grid > li > .ekmusta-catalog-row .wp-block-post-featured-image img {
	width: 100% !important;
	height: 200px !important;
	object-fit: cover !important; object-position: center;
	background: #f8fafc;
}
html body .ekmusta-catalog-list.is-grid > li > .ekmusta-catalog-row {
	grid-template-rows: auto auto !important;
	align-content: start !important;
}
html body .ekmusta-catalog-list.is-grid > li > .ekmusta-catalog-row > .ekmusta-matrix-wrapper { align-self: start !important; }
html body .ekmusta-catalog-list.is-grid .ekmusta-matrix-wrapper.is-out-of-stock .ekmusta-matrix-footer { padding-top: 0 !important; padding-bottom: 12px !important; min-height: 0 !important; }

/* Catalogue search note */
.ekmusta-search-note { display: flex; align-items: center; gap: 12px; float: left; margin: 10px 0 0; font-size: .92rem; color: #334155; }
.ekmusta-search-note a { color: var(--ekmusta-brand, #2457e6) !important; font-weight: 600; }
.ekmusta-catalog-list > li[hidden] { display: none !important; }
.ekmusta-search-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 28px; border: 1px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; }
.ekmusta-search-empty strong { font-size: 1.05rem; color: #0f172a; }
.ekmusta-search-empty span { color: #64748b; }
.ekmusta-search-empty a { margin-top: 6px; font-weight: 650; color: var(--ekmusta-brand, #2457e6) !important; }
.ekmusta-live-hint { clear: both; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--ekmusta-brand, #2457e6) 7%, #fff); color: #334155; font-size: .9rem; }
.wp-block-query-pagination[hidden] { display: none !important; }

/* View toggle: its own row above the list in every theme (never floats beside the first product). */
.ekmusta-view-toggle { float: none !important; display: flex !important; width: max-content; height: 44px; box-sizing: border-box; margin: 0 0 10px auto !important; }

/* Catalogue pagination: Previous · numbers · Next as buttons, whatever the theme. */
.ekmusta-catalog-portal-shell .wp-block-query-pagination:not([hidden]),
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination:not([hidden]) {
	display: flex !important; align-items: center; justify-content: center !important; flex-wrap: wrap; gap: 8px !important;
	margin-top: 2rem !important; padding-top: 1.5rem; border-top: 1px solid #e2e8f0;
}
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination > * { margin: 0 !important; }
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-numbers { display: inline-flex; gap: 8px; order: 2; }
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-previous { order: 1; }
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-next { order: 3; }
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-numbers .page-numbers,
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-previous,
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-next {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 14px !important; box-sizing: border-box;
	border: 1px solid #e2e8f0 !important; border-radius: 10px;
	background: #fff; color: #0f172a !important;
	font-size: .95rem !important; font-weight: 650; line-height: 1; text-decoration: none !important;
	transition: border-color .15s, color .15s, box-shadow .15s;
}
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-numbers a.page-numbers:hover,
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-previous:hover,
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-next:hover {
	border-color: var(--ekmusta-brand, #4f46e5) !important; color: var(--ekmusta-brand, #4f46e5) !important;
}
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--ekmusta-brand, #4f46e5) !important; border-color: var(--ekmusta-brand, #4f46e5) !important; color: var(--ekmusta-brand-ink, #fff) !important;
}
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-numbers .page-numbers.dots { border-color: transparent !important; background: none; }
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-previous-arrow,
.wp-block-query:has(.ekmusta-catalog-list) .wp-block-query-pagination-next-arrow { margin: 0 !important; }

/* Search loading state: the results are swapped for skeleton rows, the search box is held. */
.wp-block-query.ekmusta-is-loading > .ekmusta-catalog-list,
.wp-block-query.ekmusta-is-loading > .ekmusta-live-hint,
.wp-block-query.ekmusta-is-loading > .ekmusta-search-note,
.wp-block-query.ekmusta-is-loading > .ekmusta-search-empty { display: none !important; }
.wp-block-query.ekmusta-is-loading > .wp-block-query-pagination { opacity: .35; pointer-events: none; }
form.is-busy input[name="q"] { cursor: progress; color: #64748b; }
form.is-busy button { pointer-events: none; }
form.is-busy button::after {
	content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 6px; vertical-align: middle; border-radius: 50%;
	border: 2px solid color-mix(in srgb, var(--ekmusta-brand, #4f46e5) 25%, transparent);
	border-top-color: var(--ekmusta-brand, #4f46e5); animation: ekmusta-spin .7s linear infinite;
}
form.is-busy button svg { display: none; }

.ekmusta-skeleton { display: grid; gap: 16px; }
.ekmusta-skeleton__row {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 24px; align-items: start;
	padding: 22px 24px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff;
}
.ekmusta-skeleton__info { display: flex; gap: 16px; }
.ekmusta-skeleton__lines { flex: 1; display: grid; gap: 10px; align-content: start; }
.ekmusta-skeleton__panel { display: grid; gap: 16px; padding: 18px; border-radius: 12px; background: #f8fafc; }
.ekmusta-skeleton__buy { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.ekmusta-sk {
	display: block; border-radius: 8px;
	background: linear-gradient(90deg, #eef2f6 0%, #f8fafc 45%, #eef2f6 90%) 0 0 / 220% 100%;
	animation: ekmusta-sheen 1.3s ease-in-out infinite;
}
.ekmusta-sk--img { flex: none; width: 84px; height: 84px; border-radius: 12px; }
.ekmusta-sk--title { width: 80%; height: 18px; }
.ekmusta-sk--chip { width: 45%; height: 22px; border-radius: 6px; }
.ekmusta-sk--short { width: 32%; }
.ekmusta-sk--bar { width: 70%; height: 26px; }
.ekmusta-sk--price { width: 34%; height: 22px; }
.ekmusta-sk--qty { width: 120px; height: 40px; border-radius: 10px; }
.ekmusta-sk--btn { width: 130px; height: 40px; border-radius: 10px; justify-self: end; }
.ekmusta-skeleton.is-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ekmusta-skeleton.is-grid .ekmusta-skeleton__row { grid-template-columns: 1fr; padding: 16px; }
.ekmusta-skeleton.is-grid .ekmusta-skeleton__info { flex-direction: column; }
.ekmusta-skeleton.is-grid .ekmusta-sk--img { width: 100%; height: 150px; }
@media (max-width: 700px) { .ekmusta-skeleton__row { grid-template-columns: 1fr; } }
@keyframes ekmusta-sheen { to { background-position: -120% 0; } }
@keyframes ekmusta-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ekmusta-sk, form.is-busy button::after { animation-duration: 3s; } }

/* Phones: categories sit above the results, so no offset. */
@media (max-width: 781px) { .ekmusta-catalog-sidebar { position: static; margin-top: 0 !important; } }

/* Quick order popup: opened from the catalogue bar. */
.ekmusta-quick-order-open {
	display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; margin-right: 10px;
	border: 1px solid var(--ekmusta-bar-line, rgba(255,255,255,.18)); border-radius: 10px;
	background: var(--ekmusta-bar-field, rgba(255,255,255,.08)); color: var(--ekmusta-bar-ink, #fff);
	font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; white-space: nowrap;
	transition: border-color .15s, color .15s;
}
.ekmusta-quick-order-open svg { width: 18px; height: 18px; flex: none; }
.ekmusta-quick-order-open:hover { border-color: var(--ekmusta-brand, #4f46e5); color: var(--ekmusta-brand, #4f46e5); }
.ekmusta-quick-order-dialog {
	width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0;
	border-radius: 18px; background: transparent; overflow: visible;
}
.ekmusta-quick-order-dialog[open] { animation: ekmusta-dialog-in .22s ease-out; }
.ekmusta-quick-order-dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.ekmusta-quick-order-dialog .ekmusta-sku-importer-card {
	margin: 0 !important; max-height: calc(100vh - 48px); overflow: auto; box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .5) !important;
}
.ekmusta-quick-order-close {
	position: absolute; z-index: 2; top: 14px; right: 14px; width: 36px; height: 36px; display: grid; place-items: center;
	border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #475569; cursor: pointer;
}
.ekmusta-quick-order-close svg { width: 18px; height: 18px; }
.ekmusta-quick-order-close:hover { color: #0f172a; border-color: #cbd5e1; }
@keyframes ekmusta-dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (max-width: 781px) { .ekmusta-quick-order-open span { display: none; } .ekmusta-quick-order-open { padding: 0 12px; } }
@media (prefers-reduced-motion: reduce) { .ekmusta-quick-order-dialog[open] { animation: none; } }
.ekmusta-quick-order-dialog .ekmusta-sku-importer-card { width: 100% !important; max-width: none !important; box-sizing: border-box; }
/* Leave room for the close button so it never covers the header actions. */
.ekmusta-quick-order-dialog .ekmusta-importer-header { padding-right: 52px; }
.ekmusta-quick-order-dialog .ekmusta-quick-order-close { top: 22px; right: 22px; }
/* With the quick order box in a popup, the catalogue starts at the top of the page. */
.ekmusta-has-quick-order .ekmusta-catalog-portal-shell { margin-top: 0 !important; }
.ekmusta-catalog-portal-shell > .wp-block-columns { margin-top: 14px !important; }

/* Catalogue search: one joined control, the button is a tinted segment on the right. */
html body .ekmusta-sticky-order-bar .wp-block-search__inside-wrapper {
	gap: 0 !important; padding: 0 !important; overflow: hidden; align-items: stretch !important; height: 44px; box-sizing: border-box;
}
html body .ekmusta-sticky-order-bar .wp-block-search__input { padding: 0 14px !important; height: auto !important; min-height: 0 !important; }
html body .ekmusta-sticky-order-bar .wp-block-search__button {
	display: inline-flex !important; align-items: center; justify-content: center;
	width: 46px; min-width: 46px; height: auto !important; padding: 0 !important; margin: 0 !important;
	border: 0 !important; border-left: 1px solid var(--ekmusta-bar-line, #475569) !important; border-radius: 0 !important;
	background: color-mix(in srgb, var(--ekmusta-brand, #4f46e5) 12%, var(--ekmusta-bar-field, #1e293b)) !important;
	color: var(--ekmusta-brand, #4f46e5) !important; box-shadow: none !important;
}
html body .ekmusta-sticky-order-bar .wp-block-search__button:hover {
	background: var(--ekmusta-brand, #4f46e5) !important; color: var(--ekmusta-brand-ink, #fff) !important;
}
html body .ekmusta-sticky-order-bar .wp-block-search__button svg { width: 20px; height: 20px; fill: currentColor; }

/* Catalogue bar items switched off in Settings → Storefront. */
.ekmusta-bar-hide-title h2,
.ekmusta-bar-hide-search .wp-block-search,
.ekmusta-bar-hide-totals .ekmusta-live-Order-metrics,
.ekmusta-bar-hide-checkout .wp-block-buttons { display: none !important; }

/* List view: product info above the order grid up to 1024px, so neither gets squeezed. */
@media (max-width: 1024px) {
	html body .ekmusta-catalog-list:not(.is-grid) > li > .ekmusta-catalog-row { flex-wrap: wrap !important; grid-template-columns: minmax(0, 1fr) !important; row-gap: 16px !important; }
	html body .ekmusta-catalog-list:not(.is-grid) > li > .ekmusta-catalog-row > .wp-block-group:first-child,
	html body .ekmusta-catalog-list:not(.is-grid) > li > .ekmusta-catalog-row > .ekmusta-matrix-wrapper {
		flex: 1 1 100% !important; max-width: 100% !important; width: 100% !important;
	}
}
/* Categories above the list (narrow screens): no alignment offset. */
@media (max-width: 960px) { .ekmusta-catalog-sidebar { position: static; margin-top: 0 !important; } }
