/*
 * Sturlaugur Marás – WooCommerce listings, product cards, filters, notices.
 * Loaded on every page (cards and notices appear outside the shop too).
 */

/* ======================================================= Shared shop atoms */
.ms-price-block {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ms-price-block .ms-price {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 6px;
	color: var(--ms-color-ink);
	font-weight: var(--ms-fw-black);
	line-height: 1.2;
	white-space: normal;
}

.ms-price-block .ms-price .woocommerce-Price-currencySymbol {
	font-weight: inherit;
}

.ms-price-block .ms-price__vat {
	margin-left: 0;
	color: var(--ms-color-text-muted);
	font-size: .72em;
	font-weight: var(--ms-fw-medium);
	white-space: nowrap;
}

.ms-price-block .ms-price__from {
	color: var(--ms-color-text-muted);
	font-size: .75em;
	font-weight: var(--ms-fw-medium);
}

.ms-price-block .ms-price del {
	margin-right: 0;
	color: var(--ms-color-text-muted);
	font-size: .78em;
	font-weight: var(--ms-fw-medium);
}

.ms-price-block .ms-price ins {
	color: var(--ms-color-danger);
	text-decoration: none;
}

/* Second amount on the product page: „m/VSK …“ under an án VSK price (or „án VSK …“ under one incl. VAT). */
.ms-price-block__alt,
.ms-price-block__excl {
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-sm);
	font-variant-numeric: tabular-nums;
}

.ms-price--hidden {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ms-color-link);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
	line-height: 1.3;
	text-decoration: none;
	position: relative;
	z-index: 2;
}

.ms-price--hidden:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ms-price--hidden .ms-icon {
	flex: none;
	width: 16px;
	height: 16px;
}

.ms-price--request {
	color: var(--ms-color-ink);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
}

.ms-brand-logo {
	display: block;
	max-width: 100%;
	height: auto;
	object-fit: contain;
}

/* SKU as a real button inside cards / summaries */
button.ms-sku {
	font: inherit;
	font-size: var(--ms-fs-xs);
}

.ms-sku__label {
	color: var(--ms-color-text-muted);
}

.ms-sku__value {
	color: var(--ms-color-text);
	font-weight: var(--ms-fw-medium);
	letter-spacing: .01em;
}

/* ============================================================ Product grid */
.ms-product-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--ms-grid-gap-tight);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.ms-product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ms-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}
}

@media (min-width: 1551px) {
	.ms-product-grid {
		gap: 20px;
	}
}

/* ============================================================ Product card */
/* Brand 2026 mockup („Nýtt“ cards): photo on white · name · quiet part number + stock line ·
   „Verð frá“ (ranges) + bold price · stepper (− 1 +) and navy „Í körfu“. */
.ms-product-card {
	--ms-card-px: clamp(14px, 1.2vw, 18px);
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: var(--ms-card-px);
	border: 1px solid var(--ms-color-hairline);
	border-radius: var(--ms-radius-lg);
	background: var(--ms-color-surface);
	box-shadow: 0 1px 3px rgba(4, 40, 77, .04);
	transition: box-shadow var(--ms-t-base) var(--ms-ease), border-color var(--ms-t-base) var(--ms-ease), transform var(--ms-t-base) var(--ms-ease);
}

@media (hover: hover) {
	.ms-product-card:hover {
		transform: translateY(-2px);
		border-color: var(--ms-color-rule-strong);
		box-shadow: var(--ms-shadow-card-hover);
	}
}

.ms-product-card:has(.ms-product-card__link:focus-visible) {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: 3px;
}

/* Photo on white: a wide, calm frame (the mockup's photos sit in a ~16:10 box). */
.ms-product-card__media {
	position: relative;
	display: grid;
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	place-items: center;
	aspect-ratio: 16 / 11;
	min-width: 0;
	min-height: 0; /* the frame keeps its ratio: tall photos scale down instead of stretching it */
	overflow: hidden;
	background: var(--ms-color-surface);
}

.ms-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform var(--ms-t-slow) var(--ms-ease-out);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.ms-product-card:hover .ms-product-card__media img {
		transform: scale(1.035);
	}
}

/* Placeholder: hatched sheet with a picture glyph. */
.ms-product-placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border-radius: var(--ms-radius-md);
	background:
		repeating-linear-gradient(-45deg, var(--ms-color-border) 0 1px, transparent 1px 12px),
		var(--ms-color-surface-alt);
	color: var(--ms-color-steel);
}

.ms-product-card__badges {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-product-card__title {
	display: -webkit-box;
	margin: 14px 0 0;
	overflow: hidden;
	overflow: clip; /* not a scroll container: focusing the link must not scroll the clamped lines */
	color: var(--ms-color-ink);
	font-size: clamp(.875rem, .84rem + .12vw, .9375rem);
	font-weight: var(--ms-fw-bold);
	line-height: 1.35;
	letter-spacing: -.005em;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.ms-product-card__link {
	color: inherit;
	text-decoration: none;
}

.ms-product-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}

.ms-product-card__link:focus-visible {
	outline: none;
}

@media (hover: hover) {
	.ms-product-card:hover .ms-product-card__link {
		text-decoration: underline;
		text-decoration-thickness: 1.5px;
		text-underline-offset: 3px;
	}
}

/* Part number + stock: one quiet line (wraps to two on narrow cards). B2B buyers need both. */
.ms-product-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 12px;
	margin: 6px 0 0;
	color: var(--ms-color-text-muted);
	font-size: .75rem;
	line-height: 1.4;
}

.ms-product-card__sku {
	position: relative;
	z-index: 2;
	align-items: baseline; /* a long part number wraps under its own first line, the label stays on it */
	gap: 4px;
	max-width: calc(100% + 8px);
	min-height: 24px; /* WCAG 2.5.8 target size */
	margin: 0 0 0 -4px;
	padding: 0 4px;
	border-radius: var(--ms-radius-sm);
	font-size: .75rem;
	text-align: left;
}

.ms-product-card__sku:hover .ms-sku__value {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ms-product-card__sku .ms-sku__value {
	overflow-wrap: anywhere;
	color: var(--ms-color-text-muted);
	font-weight: var(--ms-fw-medium);
}

/* Key attributes as chips (product page / search; cards no longer show them). */
.ms-attr-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.ms-attr-chip {
	padding: 4px 9px;
	border-radius: var(--ms-radius-sm);
	background: var(--ms-color-bg);
	color: var(--ms-color-text-muted);
	font-size: .75rem;
	line-height: 1.35;
}

/* Stock signal: icon + text, never colour alone. */
.ms-stock {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	color: var(--ms-color-text);
	font-size: .8125rem;
	font-weight: var(--ms-fw-medium);
	line-height: 1.35;
}

.ms-stock .ms-icon {
	flex: none;
	margin-top: 1px;
	color: var(--ms-color-text-muted);
}

.ms-stock--instock .ms-icon {
	color: var(--ms-color-success);
}

.ms-stock--onbackorder .ms-icon {
	color: var(--ms-color-warning);
}

.ms-stock--outofstock .ms-icon {
	color: var(--ms-color-danger);
}

.ms-product-card__stock {
	align-items: center;
	gap: 5px;
	min-height: 24px;
	color: var(--ms-color-text-muted);
	font-size: .75rem;
	font-weight: 400;
}

.ms-product-card__stock .ms-icon {
	width: 14px;
	height: 14px;
	margin-top: 0;
}

/* Price and buy row sit at the foot so cards in a row line up. */
.ms-product-card__buy {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: auto 0 0;
	padding-top: 12px;
	container-type: inline-size;
}

.ms-product-card__buy .ms-price-block {
	min-width: 0;
}

.ms-price-block__from {
	color: var(--ms-color-ink);
	font-size: .75rem;
	font-weight: 400;
	line-height: 1.4;
}

.ms-product-card__buy .ms-price {
	color: var(--ms-color-ink);
	font-size: clamp(1rem, 8cqi, 1.125rem);
	font-weight: var(--ms-fw-bold);
	letter-spacing: -.01em;
	line-height: 1.2;
}

.ms-product-card__buy .ms-price .woocommerce-Price-currencySymbol {
	font-size: 1em;
	font-weight: inherit;
}

.ms-product-card__buy .ms-price__vat {
	font-size: .6875rem;
	font-weight: 400;
	letter-spacing: 0;
}

/* Stepper (− 1 +) and „Í körfu“: side by side; stacked full width on narrow cards. */
.ms-product-card__form {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0;
}

.ms-qty--card {
	flex: none;
	height: 40px;
	border-color: var(--ms-color-field-border);
	border-radius: var(--ms-radius-md);
}

.ms-qty--card .ms-qty__btn {
	width: 34px;
	height: 38px;
	border-radius: var(--ms-radius-md);
}

.ms-qty--card .ms-qty__btn .ms-icon {
	width: 16px;
	height: 16px;
	stroke-width: 2.2;
}

.ms-qty--card .ms-qty__input {
	width: 32px;
	height: 38px;
	font-size: .875rem;
	font-weight: var(--ms-fw-bold);
}

.ms-qty--card .ms-qty__btn:focus-visible {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: -2px;
}

.no-js .ms-qty--card .ms-qty__btn {
	display: none;
}

.no-js .ms-qty--card .ms-qty__input {
	width: 56px;
}

.ms-product-card__add {
	flex: none;
	min-height: 40px;
	padding: 8px 16px;
	font-size: .875rem;
}

.ms-product-card__add.is-added {
	--ms-btn-bg: var(--ms-color-success);
	--ms-btn-border: var(--ms-color-success);
}

.ms-product-card__add:focus-visible,
.ms-product-card__quote:focus-visible,
.ms-product-card__sku:focus-visible {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: 2px;
}

@container (max-width: 188px) {
	.ms-product-card__form {
		flex-wrap: wrap;
	}

	.ms-qty--card {
		flex: 1 1 100%;
		justify-content: space-between;
	}

	.ms-qty--card .ms-qty__input {
		flex: 1;
	}

	.ms-product-card__add {
		flex: 1 1 100%;
	}
}

/* Variants / out of stock: a secondary button look – the stretched title link takes the click. */
.ms-product-card__view {
	align-self: stretch;
	min-height: 40px;
	padding: 8px 14px;
	font-size: .875rem;
}

@media (hover: hover) {
	.ms-product-card:hover .ms-product-card__view {
		--ms-btn-bg: var(--ms-color-info-tint);
	}
}

/* Price on request (BC unitPrice 0): the label above a real „Óska eftir tilboði“ link. */
.ms-product-card__quote {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 6px 12px;
	border: 1.5px solid var(--ms-color-ink);
	border-radius: var(--ms-radius-md);
	background: var(--ms-color-surface);
	color: var(--ms-color-ink);
	font-size: .875rem;
	font-weight: var(--ms-fw-bold);
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color var(--ms-t-fast) var(--ms-ease), color var(--ms-t-fast) var(--ms-ease);
}

.ms-product-card__quote:hover {
	background: var(--ms-color-ink);
	color: var(--ms-color-on-brand);
}

.ms-product-card__quote .ms-icon {
	flex: none;
	width: 18px;
	height: 18px;
}

/* Price on request / hidden prices read as notes, not as prices; a customer price is not a sale. */
.ms-product-card__buy .ms-price.ms-price--request {
	font-size: .9375rem;
	font-weight: var(--ms-fw-bold);
	letter-spacing: 0;
}

.ms-product-card__buy .ms-price.ms-price--hidden {
	flex-wrap: nowrap;
	align-items: center;
	gap: 6px;
	color: var(--ms-color-link);
	font-size: .8125rem;
	font-weight: var(--ms-fw-bold);
	letter-spacing: 0;
	line-height: 1.3;
}

.ms-product-card:has(.ms-product-badge--customer) .ms-price ins {
	color: var(--ms-color-ink);
}

/* Badges over the photo. */
.ms-product-badge {
	display: inline-flex;
	align-items: center;
	min-height: 22px;
	padding: 3px 8px 2px;
	border-radius: var(--ms-radius-sm);
	background: var(--ms-color-ink);
	color: #FFFFFF;
	font-size: var(--ms-fs-label);
	font-weight: var(--ms-fw-bold);
	letter-spacing: .08em;
	line-height: 1.1;
	text-transform: uppercase;
	font-variant-numeric: var(--ms-num);
}

.ms-product-badge--sale {
	background: var(--ms-color-danger);
}

/* „Nýtt“: turquoise flag with navy text (9.0:1) – turquoise is a surface here, never text on white. */
.ms-product-badge--new {
	background: var(--ms-color-accent);
	color: var(--ms-color-on-accent);
}

.ms-product-badge--customer {
	background: var(--ms-color-brand);
	color: var(--ms-color-on-brand);
}

@keyframes ms-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
	.ms-product-card {
		--ms-card-px: 12px;
	}

	.ms-product-card__media {
		aspect-ratio: 1;
	}

	.ms-product-card__title {
		margin-top: 10px;
		font-size: .875rem;
	}

	.ms-product-card__sku .ms-sku__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.ms-product-card__buy {
		gap: 10px;
		padding-top: 10px;
	}

	.ms-product-card__quote {
		padding-inline: 8px;
		font-size: .8125rem;
	}

	.ms-product-card__quote .ms-icon {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ms-product-card,
	.ms-product-card__media img {
		transition: none;
	}
}

/* Skeleton cards while results load. */
.ms-product-card--skeleton {
	pointer-events: none;
	box-shadow: none;
}

.ms-product-card--skeleton::before {
	display: none;
}

.ms-product-card--skeleton .ms-skeleton--text {
	margin: 4px 0;
}

/* ================================================================ Listing */
.ms-shop {
	padding-block: clamp(24px, 3.5vw, 44px) var(--ms-section-gap);
}

.ms-shop__layout {
	display: grid;
	grid-template-columns: clamp(250px, 23%, 300px) minmax(0, 1fr);
	gap: clamp(24px, 2.6vw, 40px);
	align-items: start;
}

.ms-shop__layout--no-filters {
	grid-template-columns: minmax(0, 1fr);
}

.ms-shop__main {
	min-width: 0;
}

.ms-shop__results {
	position: relative;
	scroll-margin-top: calc(var(--ms-header-h) + 32px);
}

.ms-shop__results[aria-busy="true"] .ms-shop-pagination {
	visibility: hidden;
}

.ms-shop__notices:empty {
	display: none;
}

.ms-shop__notices {
	margin-bottom: 16px;
}

/* ------------------------------------------------------------ Category chips */
/* One row of text chips above the listing (name + muted count): top categories on /vorur/,
   sub-categories on a category, „Allt í …" + siblings on a leaf category. Scroll rail on phones. */
.ms-cat-chips {
	margin-bottom: var(--ms-space-6);
}

.ms-cat-chips__list {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-cat-chips .ms-chip {
	gap: 6px;
	min-height: 40px;
	padding-inline: 12px;
}

.ms-cat-chips .ms-chip__count {
	color: var(--ms-color-text-muted);
}

.ms-cat-chips__parent .ms-icon {
	width: 16px;
	height: 16px;
	color: var(--ms-color-ink);
}

.ms-cat-chips__more {
	font: inherit;
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
	cursor: pointer;
}

.ms-cat-chips__more:focus-visible {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: 3px;
}

html:not(.js) .ms-cat-chips__more-item,
.ms-cat-chips__more[aria-expanded="true"] .ms-chip__count {
	display: none;
}

@media (min-width: 768px) {
	.js .ms-cat-chips:not(.is-expanded) .is-extra {
		display: none;
	}
}

@media (max-width: 767px) {
	.ms-cat-chips {
		margin-bottom: var(--ms-space-3);
	}

	.ms-cat-chips__list {
		flex-wrap: nowrap;
		margin-inline: calc(var(--ms-gutter) * -1);
		padding: 2px var(--ms-gutter) 6px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x proximity;
		scroll-padding-inline: var(--ms-gutter);
		scrollbar-width: none;
	}

	.ms-cat-chips__list::-webkit-scrollbar {
		display: none;
	}

	.ms-cat-chips__list > li {
		flex: none;
		scroll-snap-align: start;
	}

	.ms-cat-chips__more-item {
		display: none;
	}
}

/* ----------------------------------------------------------------- Toolbar */
/* Count · filter button (≤1024px) · sort; active filter chips below. */
.ms-shop-toolbar {
	margin-bottom: 18px;
}

.ms-shop-toolbar__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	min-height: 48px;
	padding-bottom: 10px;
}

.ms-shop-toolbar__count {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin: 0 auto 0 0;
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-sm);
	font-variant-numeric: var(--ms-num);
}

.ms-shop-toolbar__num {
	color: var(--ms-color-ink);
	font-size: 1rem;
	font-weight: var(--ms-fw-bold);
}

.ms-shop-toolbar__filter {
	display: none;
}

.ms-sort {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 0 auto;
}

.ms-sort__label {
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-sm);
	white-space: nowrap;
}

.ms-sort__select {
	min-width: 190px;
	height: 40px;
	min-height: 40px;
	padding-block: 0;
	background-color: var(--ms-color-surface);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-medium);
}

/* No results and nothing to remove: the empty sheet speaks for itself (no lonely „0 vörur" ruler). */
.ms-shop-toolbar:not(:has(*)) {
	display: none;
}

.ms-active-filters {
	margin: 2px 0 12px;
}

.ms-active-filters__list {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-active-filters__label {
	margin-right: 2px;
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-label);
	font-weight: var(--ms-fw-bold);
	letter-spacing: var(--ms-track-label);
	text-transform: uppercase;
}

.ms-chip--filter {
	position: relative;
	gap: 7px;
	min-height: 36px;
	padding: 4px 5px 4px 12px;
	border-color: var(--ms-color-ink);
}

.ms-chip--filter:hover {
	background: var(--ms-color-neutral-tint);
}

.ms-chip--filter:focus-visible {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: 3px;
}

.ms-chip__group {
	color: var(--ms-color-text-muted);
	font-size: .6875rem;
	font-weight: var(--ms-fw-bold);
	letter-spacing: .08em;
	text-transform: uppercase;
}

.ms-chip__value {
	font-weight: var(--ms-fw-bold);
}

.ms-chip__remove {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--ms-color-neutral-tint);
	color: var(--ms-color-ink);
	transition: background-color var(--ms-t-fast) var(--ms-ease), color var(--ms-t-fast) var(--ms-ease);
}

.ms-chip--filter:hover .ms-chip__remove,
.ms-chip--filter:focus-visible .ms-chip__remove {
	background: var(--ms-color-ink);
	color: #FFFFFF;
}

.ms-chip--filter .ms-chip__remove .ms-icon {
	width: 14px;
	height: 14px;
	color: inherit;
}

.ms-active-filters__clear {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 6px;
	color: var(--ms-color-link);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ Filters */
/* Plain groups separated by thin rules (no cards): group head, checkbox rows (box · name ·
   muted count), „Aðeins vörur á lager" switch, price range slider and low-coverage facets folded
   under „Fleiri eiginleikar". Sidebar ≥1025px, modal drawer below. */
.ms-filters__head {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	margin-bottom: 10px;
}

.ms-filters__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 auto 0 0;
	color: var(--ms-color-ink);
	font-size: var(--ms-fs-h4);
	font-weight: var(--ms-fw-black);
	letter-spacing: var(--ms-track-h3);
}

.ms-filters__clear {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	color: var(--ms-color-link);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ms-filters__close,
.ms-filters__foot {
	display: none;
}

.ms-filters__body {
	display: grid;
	border-bottom: 1px solid var(--ms-color-rule);
}

.ms-filter {
	min-width: 0;
	border-top: 1px solid var(--ms-color-rule);
}

/* Á lager: label · count · switch. */
.ms-filter--toggle {
	padding: 4px 0;
}

.ms-switch {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 6px 0;
	color: var(--ms-color-ink);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
	text-decoration: none;
}

.ms-switch:hover .ms-switch__label {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ms-switch:focus-visible {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: -2px;
}

.ms-switch__label {
	flex: 1;
	min-width: 0;
}

.ms-switch__track {
	position: relative;
	flex: none;
	width: 38px;
	height: 22px;
	border-radius: var(--ms-radius-pill);
	background: var(--ms-color-field-border);
	transition: background-color var(--ms-t-base) var(--ms-ease);
}

.ms-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #FFFFFF;
	box-shadow: 0 1px 3px rgba(4, 40, 77, .25);
	transition: transform var(--ms-t-base) var(--ms-ease);
}

.ms-switch.is-active .ms-switch__track {
	background: var(--ms-color-ink);
}

.ms-switch.is-active .ms-switch__thumb {
	transform: translateX(16px);
}

/* Group head. */
.ms-filter__summary {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 0;
	color: var(--ms-color-ink);
	list-style: none;
	cursor: pointer;
	user-select: none;
}

.ms-filter__summary::-webkit-details-marker {
	display: none;
}

.ms-filter__summary:focus-visible {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: -3px;
	border-radius: var(--ms-radius-md);
}

.ms-filter__label {
	flex: 1;
	min-width: 0;
	font-size: 1rem;
	font-weight: var(--ms-fw-bold);
	letter-spacing: var(--ms-track-h3);
}

.ms-filter__summary:hover .ms-filter__chevron {
	color: var(--ms-color-ink);
}

.ms-filter__active-count {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: var(--ms-radius-pill);
	background: var(--ms-color-ink);
	color: #FFFFFF;
	font-size: .6875rem;
	font-weight: var(--ms-fw-black);
	font-variant-numeric: var(--ms-num);
}

.ms-filter__chevron {
	flex: none;
	width: 16px;
	height: 16px;
	color: var(--ms-color-text-muted);
	transition: transform var(--ms-t-base) var(--ms-ease);
}

details[open] > summary .ms-filter__chevron {
	transform: rotate(180deg);
}

.ms-filter__panel {
	padding: 0 0 14px;
}

/* Options: box · name ···· count. */
.ms-filter__list {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
}

.js .ms-filter__list:not(.is-expanded) > .is-extra {
	display: none;
}

.ms-filter__item[hidden] {
	display: none;
}

.ms-filter__option {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 36px;
	padding: 5px 6px;
	border-radius: var(--ms-radius-sm);
	color: var(--ms-color-text);
	font-size: var(--ms-fs-sm);
	line-height: 1.3;
	text-decoration: none;
	font-variant-numeric: var(--ms-num);
	transition: background-color var(--ms-t-fast) var(--ms-ease);
}

.ms-filter__option:hover {
	background: var(--ms-color-surface-alt);
	color: var(--ms-color-ink);
}

.ms-filter__option:hover .ms-filter__box {
	border-color: var(--ms-color-ink);
}

.ms-filter__option:focus-visible {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: -2px;
}

.ms-filter__box {
	display: grid;
	flex: none;
	place-items: center;
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--ms-color-field-border);
	border-radius: 3px;
	background: var(--ms-color-surface);
	color: transparent;
	transition: background-color var(--ms-t-fast) var(--ms-ease), border-color var(--ms-t-fast) var(--ms-ease);
}

/* Check mark as a CSS mask (no inline SVG per option); visible when the box colour is set. */
.ms-filter__box::after {
	content: "";
	width: 12px;
	height: 12px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.8 12.6 4.6 4.6L19.2 7.4'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.8 12.6 4.6 4.6L19.2 7.4'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
}

@media (forced-colors: active) {
	.ms-filter__option.is-active .ms-filter__box::after {
		forced-color-adjust: none;
		background-color: CanvasText;
	}
}

.ms-filter__option.is-active {
	color: var(--ms-color-ink);
	font-weight: var(--ms-fw-bold);
}

.ms-filter__option.is-active .ms-filter__box {
	border-color: var(--ms-color-ink);
	background: var(--ms-color-ink);
	color: #FFFFFF;
}

.ms-filter__name {
	display: flex;
	flex: 1;
	align-items: baseline;
	min-width: 0;
}

.ms-filter__text {
	min-width: 0;
	overflow-wrap: anywhere;
}

.ms-filter__count {
	flex: none;
	color: var(--ms-color-text-muted);
	font-size: .8125rem;
	font-weight: 400;
	font-variant-numeric: var(--ms-num);
}

.ms-filter__option.is-active .ms-filter__count {
	color: var(--ms-color-ink);
	font-weight: var(--ms-fw-bold);
}

.ms-switch .ms-filter__count {
	margin-right: 2px;
}

.ms-filter__search {
	position: relative;
	margin: 0 0 6px;
}

.ms-filter__search .ms-icon {
	position: absolute;
	top: 50%;
	left: 11px;
	width: 16px;
	height: 16px;
	color: var(--ms-color-text-muted);
	transform: translateY(-50%);
	pointer-events: none;
}

.ms-filter__search-input {
	width: 100%;
	height: 38px;
	padding: 0 12px 0 34px;
	border: 1px solid var(--ms-color-field-border);
	border-radius: var(--ms-radius-md);
	background: var(--ms-color-surface);
	color: var(--ms-color-text);
	font: inherit;
	font-size: var(--ms-fs-sm);
}

.ms-filter__search-input:focus {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: 1px;
}

.ms-filter__empty {
	margin: 4px 8px;
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-sm);
}

.ms-filter__more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 32px;
	margin: 4px 0 0 4px;
	padding: 4px;
	border: 0;
	background: none;
	color: var(--ms-color-link);
	font: inherit;
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
	cursor: pointer;
}

.ms-filter__more .ms-icon {
	width: 16px;
	height: 16px;
	transition: transform var(--ms-t-base) var(--ms-ease);
}

.ms-filter__more[aria-expanded="true"] .ms-icon {
	transform: rotate(180deg);
}

.ms-filter__more:hover span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* „Fleiri eiginleikar": facets that describe few of the listed products. */
.ms-filters__more {
	border-top: 1px solid var(--ms-color-rule);
}

.ms-filters__more-summary {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 56px;
	padding: 12px 0;
	color: var(--ms-color-ink);
	list-style: none;
	cursor: pointer;
}

.ms-filters__more-summary::-webkit-details-marker {
	display: none;
}

.ms-filters__more-summary:focus-visible {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: -3px;
	border-radius: var(--ms-radius-md);
}

.ms-filters__more-text {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ms-filters__more-title {
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
}

.ms-filters__more-hint {
	color: var(--ms-color-text-muted);
	font-size: .75rem;
}

.ms-filters__more-count {
	color: var(--ms-color-text-muted);
	font-size: .8125rem;
	font-variant-numeric: var(--ms-num);
}

/* Price: a ruler slider (tick scale, cursor thumbs) above tabular inputs. */
.ms-price-range {
	display: grid;
	gap: 12px;
	padding: 0 0 16px;
}

.ms-price-range__slider {
	position: relative;
	height: 34px;
	margin: 0 7px;
}

.ms-price-range__scale {
	display: none;
}

.ms-price-range__track {
	position: absolute;
	top: 11px;
	right: 0;
	left: 0;
	height: 4px;
	border-radius: 2px;
	background: var(--ms-color-border);
}

.ms-price-range__fill {
	position: absolute;
	top: 0;
	bottom: 0;
	background: var(--ms-color-accent);
}

.ms-price-range__slider input[type="range"] {
	position: absolute;
	top: 0;
	left: -7px;
	width: calc(100% + 14px);
	height: 26px;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.ms-price-range__slider input[type="range"]::-webkit-slider-thumb {
	width: 20px;
	height: 20px;
	border: 0;
	border-radius: 50%;
	background: var(--ms-color-ink); /* the handles must read on white (1.4.11); the turquoise fill is decoration */
	box-shadow: 0 0 0 2px #FFFFFF, 0 1px 4px rgba(4, 40, 77, .3);
	cursor: ew-resize;
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
}

.ms-price-range__slider input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border: 0;
	border-radius: 50%;
	background: var(--ms-color-ink);
	box-shadow: 0 0 0 2px #FFFFFF, 0 1px 4px rgba(4, 40, 77, .3);
	cursor: ew-resize;
	pointer-events: auto;
}

.ms-price-range__slider input[type="range"]:focus-visible::-webkit-slider-thumb {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: 3px;
}

.ms-price-range__slider input[type="range"]:focus-visible::-moz-range-thumb {
	outline: 2px solid var(--ms-color-focus);
	outline-offset: 3px;
}

.ms-price-range__inputs {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: end;
	gap: 8px;
}

.ms-price-range__inputs .ms-field {
	gap: 4px;
	margin: 0;
}

.ms-price-range__inputs .ms-label {
	margin: 0;
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-medium);
}

.ms-price-range__inputs .ms-input {
	height: 40px;
	min-height: 40px;
	padding: 0 10px;
	font-size: var(--ms-fs-sm);
	font-variant-numeric: var(--ms-num);
	-moz-appearance: textfield;
}

.ms-price-range__inputs .ms-input::-webkit-inner-spin-button,
.ms-price-range__inputs .ms-input::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.ms-price-range__sep {
	padding-bottom: 10px;
	color: var(--ms-color-text-muted);
}

.ms-price-range__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
}

.js .ms-price-range__actions .ms-btn {
	display: none;
}

.ms-price-range__reset {
	color: var(--ms-color-link);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
}

/* Desktop: sticky sidebar */
@media (min-width: 1025px) {
	.ms-shop__sidebar {
		position: sticky;
		top: calc(var(--ms-header-h) + 26px);
		max-height: calc(100vh - var(--ms-header-h) - 40px);
		margin: -6px -8px 0 -6px;
		padding: 6px 8px 12px 6px;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		scrollbar-color: var(--ms-color-rule-strong) transparent;
	}
}

/* Tablet & mobile: off-canvas filter drawer + sticky toolbar */
@media (max-width: 1024px) {
	.ms-shop__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.ms-shop-toolbar {
		position: sticky;
		top: calc(var(--ms-header-h) + 16px);
		z-index: 20;
		margin-inline: calc(var(--ms-gutter) * -1);
		padding: 8px var(--ms-gutter) 0;
		background: color-mix(in srgb, var(--ms-color-surface) 94%, transparent);
		-webkit-backdrop-filter: blur(8px);
		backdrop-filter: blur(8px);
	}

	.ms-shop-toolbar__row {
		min-height: 44px;
	}

	.ms-shop-toolbar__filter {
		display: inline-flex;
		height: 40px;
		min-height: 40px;
	}

	.ms-sort__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.ms-sort__select {
		min-width: 0;
		max-width: 52vw;
	}

	.js .ms-shop__sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: var(--ms-z-drawer);
		display: flex;
		width: min(420px, 100vw);
		background: var(--ms-color-surface);
		box-shadow: var(--ms-shadow-float);
		visibility: hidden;
		transform: translateX(-102%);
		transition: transform var(--ms-t-slow) var(--ms-ease-out), visibility 0s linear var(--ms-t-slow);
	}

	.js .ms-shop__sidebar.is-open {
		visibility: visible;
		transform: none;
		transition: transform var(--ms-t-slow) var(--ms-ease-out), visibility 0s;
	}

	.js .ms-filters {
		display: flex;
		flex-direction: column;
		width: 100%;
		min-height: 0;
	}

	.js .ms-filters__head {
		flex: none;
		margin: 0;
		padding: 10px 12px 10px 20px;
		border-bottom: 1px solid var(--ms-color-rule-strong);
		background: var(--ms-color-surface);
	}

	.js .ms-filters__close {
		display: grid;
		place-items: center;
		width: 44px;
		height: 44px;
		border: 0;
		border-radius: 50%;
		background: none;
		color: var(--ms-color-ink);
		cursor: pointer;
	}

	.js .ms-filters__close:hover {
		background: var(--ms-color-neutral-tint);
	}

	.js .ms-filters__close:focus-visible {
		outline: 2px solid var(--ms-color-focus);
		outline-offset: 2px;
	}

	.js .ms-filters__body {
		flex: 1;
		align-content: start;
		min-height: 0;
		padding: 0 20px;
		overflow-y: auto;
		overscroll-behavior: contain;
		border: 0;
	}

	.js .ms-filters__body > :first-child {
		border-top: 0;
	}

	.js .ms-filters__foot {
		display: grid;
		flex: none;
		grid-template-columns: auto 1fr;
		gap: 10px;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--ms-color-rule-strong);
		background: var(--ms-color-surface);
	}

	.js .ms-filters__foot [aria-disabled="true"] {
		opacity: .5;
		pointer-events: none;
	}

	.no-js .ms-shop__sidebar {
		margin-bottom: 8px;
	}

	.ms-shop__overlay {
		position: fixed;
		inset: 0;
		z-index: calc(var(--ms-z-drawer) - 1);
		background: var(--ms-color-overlay);
		opacity: 0;
		transition: opacity var(--ms-t-slow) var(--ms-ease);
	}

	.ms-shop__overlay.is-visible {
		opacity: 1;
	}
}

@media (max-width: 767px) {
	.ms-shop-toolbar__row {
		gap: 8px;
		padding-bottom: 8px;
	}

	/* Line 1: Sía + sort; line 2: count + view toggle (bases add up past 100 % to force the wrap). */
	.ms-shop-toolbar__filter {
		flex: 1 1 40%;
		justify-content: center;
	}

	.ms-sort {
		flex: 1 1 40%;
		min-width: 0;
	}

	.ms-sort__control {
		display: block;
		width: 100%;
	}

	.ms-sort__select {
		width: 100%;
		min-width: 0;
		max-width: none;
	}

	.ms-shop-toolbar__count {
		order: 3;
		flex: 1 1 60%;
		margin: 0;
	}

	.ms-active-filters__list {
		flex-wrap: nowrap;
		margin-inline: calc(var(--ms-gutter) * -1);
		padding: 2px var(--ms-gutter) 4px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.ms-active-filters__list li {
		flex: none;
	}

	.ms-active-filters__label {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.js .ms-shop__sidebar,
	.ms-shop__overlay,
	.ms-switch__thumb,
	.ms-switch__track {
		transition: none;
	}
}

/* -------------------------------------------------------------- Pagination */
/* „Hlaða fleiri vörum" (outline) and one small muted line under it: „24 af 220 vörum" + page numbers
   (the no-JS fallback stays visible, but quiet). */
.ms-shop-pagination {
	display: grid;
	justify-items: center;
	gap: var(--ms-space-4);
	margin-top: var(--ms-space-7);
}

.ms-load-more__btn {
	min-width: 240px;
}

.ms-load-more__btn.is-loading .ms-icon {
	animation: ms-spin .8s linear infinite;
}

.ms-shop-pagination__line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--ms-space-2) var(--ms-space-4);
}

.ms-load-more__meta {
	margin: 0;
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-sm);
	font-variant-numeric: var(--ms-num);
}

.ms-shop-pagination .ms-pagination,
.js .ms-shop-pagination .ms-pagination {
	margin-top: 0;
}

.ms-shop-pagination .nav-links {
	gap: 2px;
}

.ms-shop-pagination .page-numbers {
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	border-radius: var(--ms-radius-sm);
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-medium);
	font-variant-numeric: var(--ms-num);
}

.ms-shop-pagination a.page-numbers:hover {
	background: var(--ms-color-neutral-tint);
	color: var(--ms-color-ink);
}

.ms-shop-pagination .page-numbers.current {
	background: transparent;
	color: var(--ms-color-ink);
	font-weight: var(--ms-fw-black);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
}

.ms-shop-pagination .page-numbers .ms-icon {
	width: 16px;
	height: 16px;
}

/* ------------------------------------------------------------- Empty states */
/* No icon, no card: (title), a new search or „Hreinsa allar síur", one text link, one muted line. */
.ms-shop-empty {
	display: grid;
	justify-items: center;
	gap: var(--ms-space-4);
	max-width: 560px;
	margin: var(--ms-space-5) auto 0;
	text-align: center;
}

.ms-shop-empty__title {
	margin: 0;
	color: var(--ms-color-ink);
	font-size: var(--ms-fs-h3);
	font-weight: var(--ms-fw-bold);
	letter-spacing: var(--ms-track-h3);
	text-wrap: balance;
}

.ms-shop-empty__text {
	margin: 0;
	color: var(--ms-color-text-muted);
}

.ms-shop-empty__search {
	width: 100%;
	text-align: left;
}

.ms-shop-empty .ms-muted-note {
	margin: 0;
}

/* ============================================================ Page band */
.ms-shop-band .ms-page-band__intro {
	max-width: 62ch;
}

/* Brand archives: the (white booth) logo small beside the title – no plate. */
.ms-shop-band--brand .ms-page-band__inner {
	align-items: center;
}

.ms-shop-band--brand .ms-shop-band__logo {
	display: block;
	width: auto;
	max-width: 160px;
	height: auto;
	max-height: 48px;
	object-fit: contain;
}

/* Desktop: the logo sits flush with the right edge of the band, not adrift mid-page. */
@media (min-width: 1025px) {
	.ms-shop-band--brand .ms-page-band__aside {
		display: flex;
		justify-content: flex-end;
	}
}

/* ------------------------------------------------------------- Search note */
.ms-shop-note {
	margin: 0 0 var(--ms-space-4);
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-sm);
}

/* --------------------------------------------- Site search → product results */
/* One line: „6 vörur fundust fyrir „yanmar"." + text link. */
.ms-search-products {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--ms-space-1) var(--ms-space-3);
	margin: 0 0 var(--ms-space-6);
	padding-bottom: var(--ms-space-5);
	border-bottom: 1px solid var(--ms-color-rule);
	color: var(--ms-color-ink);
	font-weight: var(--ms-fw-bold);
}

/* ============================================================== Notices */
.ms-notices {
	display: grid;
	gap: 10px;
	margin: 0 0 20px;
}

.ms-notices .ms-alert {
	margin: 0;
}

.ms-alert .ms-alert__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-alert .ms-alert__list li + li {
	margin-top: 4px;
}

.ms-alert__content {
	flex: 1;
	min-width: 0;
}

/* .ms-alert prefix outranks WooCommerce-compat ".woocommerce a.button" (0,2,1). */
.ms-alert .ms-alert__content .ms-btn,
.ms-alert .ms-alert__content .button {
	float: right;
	margin: -4px 0 4px 16px;
}

.ms-alert__content::after {
	content: "";
	display: table;
	clear: both;
}

@media (max-width: 767px) {
	.ms-alert .ms-alert__content .ms-btn,
	.ms-alert .ms-alert__content .button {
		float: none;
		display: flex;
		width: fit-content;
		margin: 0 0 10px;
	}
}

/* Fallback for notices printed by plugins without the theme templates. */
.woocommerce-message:not(.ms-alert),
.woocommerce-error:not(.ms-alert),
.woocommerce-info:not(.ms-alert),
.woocommerce-notice:not(.ms-alert) {
	margin: 0 0 20px;
	padding: 14px 18px;
	border-left: 4px solid var(--ms-color-info);
	border-radius: var(--ms-radius-lg);
	background: var(--ms-color-info-tint);
	color: var(--ms-color-info-text);
	font-size: var(--ms-fs-sm);
	list-style: none;
}

.woocommerce-message:not(.ms-alert) {
	border-left-color: var(--ms-color-success);
	background: var(--ms-color-success-tint);
	color: #0B5A37;
}

.woocommerce-error:not(.ms-alert) {
	border-left-color: var(--ms-color-danger);
	background: var(--ms-color-danger-tint);
	color: #8E1C1C;
}

.woocommerce-message a:not(.ms-btn, .button),
.woocommerce-error a:not(.ms-btn, .button),
.woocommerce-info a:not(.ms-btn, .button) {
	color: inherit;
	font-weight: var(--ms-fw-bold);
}

/* Generic WooCommerce buttons that may appear in plugin output */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce-page a.button,
.woocommerce-page button.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 20px;
	border: 1px solid transparent;
	border-radius: var(--ms-radius-lg);
	background: var(--ms-color-brand);
	color: var(--ms-color-on-brand);
	font: inherit;
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-bold);
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--ms-t-fast) var(--ms-ease);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce-page a.button:hover,
.woocommerce-page button.button:hover {
	background: var(--ms-color-brand-strong);
}

.woocommerce a.button.alt,
.woocommerce button.button.alt {
	background: var(--ms-color-brand);
	color: var(--ms-color-on-brand);
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
	background: var(--ms-color-brand-strong);
	color: var(--ms-color-on-brand);
}

/* ============================================================ Carousels */
.ms-product-rail {
	position: relative;
}

.ms-product-rail__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-bottom: 16px;
}

.ms-product-rail__title {
	margin: 0;
	color: var(--ms-color-ink);
	font-size: var(--ms-fs-h3);
	font-weight: var(--ms-fw-black);
}

.ms-product-rail__nav {
	display: flex;
	gap: 8px;
}

.ms-product-rail__btn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--ms-color-border);
	border-radius: 50%;
	background: var(--ms-color-surface);
	color: var(--ms-color-ink);
	cursor: pointer;
	transition: background-color var(--ms-t-fast) var(--ms-ease), border-color var(--ms-t-fast) var(--ms-ease), opacity var(--ms-t-fast) var(--ms-ease);
}

.ms-product-rail__btn:hover:not(:disabled) {
	border-color: var(--ms-color-accent);
	background: var(--ms-color-accent-tint);
}

.ms-product-rail__btn:disabled {
	opacity: .4;
	cursor: default;
}

.ms-product-rail__btn:focus-visible {
	outline: 3px solid var(--ms-color-focus);
	outline-offset: 2px;
}

.ms-product-rail__viewport {
	margin: -8px -8px 0;
	padding: 8px 8px 12px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 8px;
	scrollbar-width: none;
}

.ms-product-rail__viewport::-webkit-scrollbar {
	display: none;
}

.ms-product-rail__viewport:focus-visible {
	outline: 3px solid var(--ms-color-focus);
	outline-offset: -3px;
	border-radius: var(--ms-radius-2xl);
}

.ms-product-rail .ms-product-grid {
	display: flex;
	gap: var(--ms-grid-gap-tight);
}

.ms-product-rail .ms-product-card {
	flex: 0 0 calc((100% - 3 * var(--ms-grid-gap-tight)) / 4);
	scroll-snap-align: start;
}

@media (max-width: 1024px) {
	.ms-product-rail .ms-product-card {
		flex-basis: calc((100% - 2 * var(--ms-grid-gap-tight)) / 3);
	}
}

@media (max-width: 767px) {
	.ms-product-rail .ms-product-grid {
		gap: 12px;
	}

	.ms-product-rail .ms-product-card {
		flex-basis: 62%;
	}

	.ms-product-rail__viewport {
		margin-inline: calc(var(--ms-gutter) * -1);
		padding-inline: var(--ms-gutter);
		scroll-padding-inline: var(--ms-gutter);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ms-product-rail__viewport {
		scroll-behavior: auto;
	}
}

/* ================================================== Order details (shared) */
/* Order details printed by WooCommerce (order-received & view-order): on the page, no cards;
   a plain table with thin rules and the addresses as plain text blocks side by side. */
.woocommerce-order-details,
.woocommerce-customer-details {
	padding: 0;
	background: none;
	box-shadow: none;
}

.woocommerce-order-details__title,
.woocommerce-column__title,
.woocommerce-customer-details h2 {
	margin: 0 0 12px;
	color: var(--ms-color-ink);
	font-size: var(--ms-fs-h3);
	font-weight: var(--ms-fw-bold);
}

.woocommerce-table--order-details {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--ms-fs-sm);
	font-variant-numeric: tabular-nums;
}

.woocommerce-table--order-details th,
.woocommerce-table--order-details td {
	padding: 12px 0;
	border-bottom: 1px solid var(--ms-color-rule);
	text-align: left;
	vertical-align: top;
}

.woocommerce-table--order-details :is(th, td) + :is(th, td) {
	padding-left: 16px;
}

.woocommerce-table--order-details thead th {
	background: none;
	color: var(--ms-color-text-muted);
	font-size: .8125rem;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

.woocommerce-table--order-details td:last-child,
.woocommerce-table--order-details th:last-child {
	min-width: 9em; /* „Reikningsviðskipti" stays one word on phones */
	text-align: right;
}

.woocommerce-table--order-details tfoot th {
	color: var(--ms-color-text-muted);
	font-weight: var(--ms-fw-medium);
}

.woocommerce-table--order-details tfoot td {
	color: var(--ms-color-ink);
}

.woocommerce-table--order-details .product-name a {
	color: var(--ms-color-ink);
	font-weight: var(--ms-fw-bold);
	text-decoration: none;
}

.woocommerce-table--order-details .product-quantity {
	color: var(--ms-color-text-muted);
	font-weight: var(--ms-fw-bold);
}

.woocommerce-table--order-details .wc-item-meta {
	margin: 4px 0 0;
	padding: 0;
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-xs);
	list-style: none;
}

.woocommerce-table--order-details .wc-item-meta p {
	display: inline;
}

.woocommerce-customer-details .woocommerce-columns {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--ms-space-5);
}

.woocommerce-customer-details address {
	padding: 0;
	border: 0;
	background: none;
	color: var(--ms-color-text);
	font-style: normal;
	line-height: 1.7;
}

.woocommerce-customer-details--phone,
.woocommerce-customer-details--email {
	margin: 0;
}

/* „Viðbótarupplýsingar" (checkout block fields, e.g. Kennitala): a plain line under the addresses. */
.woocommerce-customer-details .wc-block-order-confirmation-additional-fields-wrapper {
	margin-top: var(--ms-space-5);
}

.woocommerce-customer-details .wc-block-order-confirmation-additional-fields-wrapper h2 {
	margin: 0 0 8px;
	color: var(--ms-color-ink);
	font-size: var(--ms-fs-h3);
	font-weight: var(--ms-fw-bold);
}

.woocommerce-customer-details .wc-block-components-additional-fields-list {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 4px 16px;
	margin: 0;
}

.woocommerce-customer-details .wc-block-components-additional-fields-list dt {
	color: var(--ms-color-text-muted);
	font-weight: 400;
}

.woocommerce-customer-details .wc-block-components-additional-fields-list dd {
	margin: 0;
	color: var(--ms-color-text);
}

.order-again .button {
	margin-top: 12px;
}

/* Order details totals: WooCommerce does not keep the total as the last row (payment method and the
   "Aðgerðir" actions row can follow it), so only a total row with a VAT note is emphasised. */
.woocommerce-table--order-details tfoot tr:has(.includes_tax) :is(th, td) {
	border-bottom: 0;
	color: var(--ms-color-ink);
	font-size: 1.0625rem;
	font-weight: var(--ms-fw-black);
}

.woocommerce-table--order-details tfoot tr:has(.includes_tax) + tr :is(th, td),
.woocommerce-table--order-details tfoot tr:has(> .order-actions--heading) :is(th, td) {
	border-top: 1px solid var(--ms-color-rule);
}

.woocommerce-table--order-details tfoot tr:has(> .order-actions--heading) :is(th, td) {
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-sm);
	font-weight: var(--ms-fw-medium);
	vertical-align: middle;
}

.woocommerce-table--order-details .order-actions-button + .order-actions-button {
	margin-left: 8px;
}

.woocommerce-table--order-details .order-actions-button.cancel {
	border: 1px solid var(--ms-color-border);
	background: transparent;
	color: var(--ms-color-ink);
}

.woocommerce-table--order-details .order-actions-button.cancel:hover {
	border-color: var(--ms-color-danger);
	background: var(--ms-color-danger-tint);
	color: var(--ms-color-danger);
}

/* Order totals: "(þar af … VSK 24%)" on its own quiet line instead of wrapping the amount over three lines. */
.woocommerce-table--order-details .includes_tax {
	display: block;
	margin-top: 2px;
	color: var(--ms-color-text-muted);
	font-size: var(--ms-fs-xs);
	font-weight: var(--ms-fw-medium);
	white-space: normal;
}

/* "Panta aftur" gets room before the addresses heading (view order and confirmation pages). */
.order-again {
	margin: 4px 0 clamp(28px, 4vw, 40px);
}

/* Order details table on phones: long Icelandic compounds ("Reikningsviðskipti",
   "loftinntakshljóðdeyfi") set the table's minimum width and pushed the page 21px wide at 390px. */
.woocommerce-table--order-details :is(th, td),
.woocommerce-table--order-details .product-name a {
	overflow-wrap: anywhere;
}

/* iOS Safari zooms the page into any focused field under 16px. On phones the shop's small
   fields (filter search, sort, price range, card quantity) use 16px; desktop is unchanged. */
@media (max-width: 767px) {
	.ms-filter__search-input,
	.ms-sort__select,
	.ms-price-range__inputs .ms-input,
	.ms-qty--card .ms-qty__input {
		font-size: 16px;
	}
}
