/**
 * MR Stiff Product Shop — MrStiff Archive front-end styles.
 */

.msps-archive {
	--msps-cols: 3;
	--msps-gap: 24px;
	--msps-card-bg: #ececec;
	--msps-accent: #00b67a;
	--msps-sale: #eaff00;
	--msps-ink: #3b3933;
	--msps-muted: #3b3933;
	--msps-line: #e6e6e6;
	position: relative;
	width: 100%;
	color: var(--msps-ink);
	box-sizing: border-box;
}

.msps-archive *,
.msps-archive *::before,
.msps-archive *::after {
	box-sizing: border-box;
}

/* ---------- Toolbar ---------- */
.msps-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 0 26px;
	flex-wrap: wrap;
}

.msps-toolbar-left {
	display: flex;
	align-items: center;
	gap: 28px;
}

.msps-filter-toggle, .msps-sort {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-weight: 600;
	color: var(--msps-ink);
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
}

.msps-sort {
	font-weight: 600;
}

.msps-sort-select {
	border: 0;
	background: none;
	font: inherit;
	font-weight: 400;
	color: var(--msps-muted);
	cursor: pointer;
	padding: 2px 4px;
}

.msps-ico {
	width: 27px;
	height: 27px;
	display: inline-block;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.msps-ico-filter {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='4' y1='7' x2='20' y2='7'/%3E%3Cline x1='7' y1='12' x2='17' y2='12'/%3E%3Cline x1='10' y1='17' x2='14' y2='17'/%3E%3C/svg%3E");
}

.msps-ico-sort {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4v16M7 4l-3 3M7 4l3 3M17 20V4M17 20l-3-3M17 20l3-3'/%3E%3C/svg%3E");
}

/* Layout switcher */
.msps-layout-switch {
	display: inline-flex;
	align-items: center;
	gap: 14px;
}

.msps-layout-btn {
	background: none;
	border: 0;
	padding: 4px;
	cursor: pointer;
	opacity: 0.4;
	transition: opacity 0.15s ease;
}

.msps-layout-btn.is-active,
.msps-layout-btn:hover {
	opacity: 1;
}

.msps-layout-ico {
	display: inline-flex;
	gap: 2px;
	align-items: stretch;
	height: 16px;
}

.msps-layout-ico i {
	display: block;
	width: 3px;
	height: 13px;
	background: #3b3933;
	border-radius: 1px;
}
.msps-count {
	display: none;
}
/* ---------- Body / drawer layout ---------- */
.msps-body {
	display: flex;
	align-items: flex-start;
	gap: 0;
	position: relative;
}

.msps-results {
	flex: 1 1 auto;
	min-width: 0;
}

.msps-drawer {
	flex: 0 0 0;
	width: 0;
	height: 0;
	overflow: hidden;
	opacity: 0;
	transition: width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.msps-body.is-open .msps-drawer {
	flex-basis: 300px;
	width: 300px;
	height: auto;
	opacity: 1;
	margin-right: var(--msps-gap);
}

.msps-drawer-inner {
	width: 300px;
	max-width: 100%;
	padding: 4px 24px 24px 0;
}

.msps-drawer-overlay {
	display: none;
}

/* ---------- Filters ---------- */
.msps-filter {
	padding: 22px 0;
	border-bottom: 1px solid var(--msps-line);
}

.msps-filter:first-child {
	padding-top: 6px;
}

.msps-filter-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 14px;
}

.msps-filter-options {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.msps-option {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 15px;
	color: var(--msps-ink);
}

.msps-option-count {
	color: var(--msps-muted);
	font-size: 13px;
}

.msps-filter-input,
.msps-stock-input {
	accent-color: var(--msps-ink);
}

/* Stock switch */
.msps-switch-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
}

.msps-filter-stock .msps-filter-title {
	margin-bottom: 0;
}

.msps-switch {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	flex: 0 0 auto;
}

.msps-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.msps-switch-track {
	position: absolute;
	inset: 0;
	background: #d8d8d8;
	border-radius: 999px;
	transition: background 0.2s ease;
}

.msps-switch-track::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.msps-switch input:checked + .msps-switch-track {
	background: var(--msps-accent);
}

.msps-switch input:checked + .msps-switch-track::before {
	transform: translateX(18px);
}

/* Price slider */
.msps-price-note {
	color: var(--msps-muted);
	font-size: 14px;
	margin-bottom: 18px;
}

.msps-price-slider {
	position: relative;
	height: 24px;
	margin-bottom: 18px;
}

.msps-price-track {
	position: absolute;
	top: 50%;
	left: 8px;
	right: 8px;
	height: 4px;
	transform: translateY(-50%);
	background: #dcdcdc;
	border-radius: 4px;
}

.msps-price-range {
	position: absolute;
	top: 0;
	bottom: 0;
	background: var(--msps-ink);
	border-radius: 4px;
}

.msps-price-slider input[type="range"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 24px;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.msps-price-slider input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--msps-ink);
	cursor: pointer;
	pointer-events: auto;
	border: 3px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.msps-price-slider input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--msps-ink);
	cursor: pointer;
	pointer-events: auto;
	border: 3px solid #fff;
}

.msps-price-inputs {
	display: flex;
	align-items: center;
	gap: 10px;
}

.msps-price-field {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #f4f2ef;
	border-radius: 8px;
	padding: 8px 12px;
	flex: 1;
}

.msps-price-field input {
	border: 0;
	background: none;
	width: 100%;
	font: inherit;
	outline: none;
	color: var(--msps-ink);
}

.msps-price-symbol {
	color: var(--msps-muted);
}

.msps-price-dash {
	color: var(--msps-muted);
}

/* Clear-all bar — top of the drawer, only shown while filters are active. */
.msps-drawer-top {
	padding: 0 0 16px;
	margin-bottom: 4px;
	border-bottom: 1px solid var(--msps-line);
}

.msps-drawer-top[hidden] {
	display: none;
}

/* Keep the first visible filter tight to the top, whether the bar shows or not. */
.msps-drawer-top + .msps-filter {
	padding-top: 6px;
}

.msps-drawer-actions {
	padding-top: 18px;
}

.msps-clear-filters {
	background: none;
	border: 0;
	padding: 0;
	color: var(--msps-muted);
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
}

/* ---------- Count ---------- */
.msps-count {
	color: var(--msps-muted);
	font-size: 14px;
	margin-bottom: 16px;
}

/* ---------- Grid ---------- */
.msps-grid-wrap {
	position: relative;
	min-height: 120px;
}

.msps-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(var(--msps-cols), minmax(0, 1fr));
	gap: var(--msps-gap);
}

.msps-cols-2 {
	--msps-cols: 2;
}

.msps-cols-3 {
	--msps-cols: 3;
}

.msps-cols-4 {
	--msps-cols: 4;
}

.msps-card {
	position: relative;
	margin: 0;
	list-style: none;
}

.msps-card-media {
	position: relative;
	background: var(--msps-card-bg);
	border-radius: 10px;
	overflow: hidden;
	aspect-ratio: 1 / 1;
}

.msps-card-link {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
}

.msps-card-image {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.35s ease;
}

.msps-card-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.msps-card-image-hover {
	opacity: 0;
}

.msps-card:hover .msps-card-image-hover {
	opacity: 1;
}

.msps-card:hover .msps-card-image-main {
	opacity: 0;
}

/* Only fade the main image out when a hover image exists. */
.msps-card:hover .msps-card-image-main:only-child,
.msps-card:hover .msps-card-image-main:last-child {
	opacity: 1;
}

.msps-card-media:not(:has(.msps-card-image-hover)) .msps-card-image-main {
	opacity: 1 !important;
}

/* Badges */
.msps-badges {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	display: flex;
	gap: 8px;
}

.msps-badge {
	display: inline-block;
	padding: 9px 12px;
	font-size: 14px;
	font-weight: 500;
	border-radius: 6px;
	line-height: 1.2;
}

.msps-badge-sale {
	background: var(--msps-sale);
	color: #1a1a1a;
}

.msps-badge-bestseller {
	background: #3a3a3a;
	color: #fff;
}

/* Hover add-to-cart */
.msps-card-cart {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 3;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.msps-card:hover .msps-card-cart {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.msps-card-cart .button, .msps-card-cart .msps-add-to-cart {
	display: block;
	width: 100%;
	text-align: center;
	background: var(--msps-accent) !important;
	color: #fff !important;
	border: 0;
	border-radius: 8px !important;
	padding: 14px 16px !important;
	font-weight: 600;
	font-size: 15px !important;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease;
	border: 0px !important;
	letter-spacing: 0px !important;
}

.msps-card-cart .button:hover {
	background: #12a76c;
}

.msps-card-cart .added {
	display: none;
}

/* Card body */
.msps-card-body {
	text-align: center;
	padding: 18px 8px 4px;
}

.msps-card-title {
	font-size: 15px !important;
	font-weight: 500;
	margin: 0 0 8px;
	line-height: 1.35;
	color: #3b3933 !important;
}

.msps-card-title a {
	color: inherit;
	text-decoration: none;
}

.msps-card-price {
	font-size: 15px;
	color: var(--msps-ink);
}

.msps-card-price del {
	color: var(--msps-muted);
	margin-left: 6px;
	font-weight: 400;
}

.msps-card-price ins {
	text-decoration: none;
	color: var(--msps-accent);
	font-weight: 600;
}

.msps-card.sale .msps-card-price ins, .msps-card-price .amount {
	color: #3b3933 !important;
	font-weight: 500;
}

/* No results */
.msps-no-results {
	padding: 60px 20px;
	text-align: center;
	color: var(--msps-muted);
	font-size: 16px;
}

/* ---------- Loading ---------- */
.msps-loading {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding-top: 60px;
	background: rgba(255, 255, 255, 0.7);
}

.msps-grid-wrap.is-loading .msps-loading {
	display: flex;
}

.msps-grid-wrap.is-loading .msps-grid {
	opacity: 0.4;
	pointer-events: none;
}

.msps-spinner {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: var(--msps-ink);
	animation: msps-spin 0.7s linear infinite;
}

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

/* ---------- Pagination ---------- */
.msps-pagination-wrap {
	margin-top: 36px;
}

.msps-pagination ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 8px;
	justify-content: center;
	align-items: center;
}

.msps-pagination a,
.msps-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--msps-ink);
	border: 1px solid var(--msps-line);
	font-weight: 500;
}

.msps-pagination .current {
	background: var(--msps-ink);
	color: #fff;
	border-color: var(--msps-ink);
}

.msps-pagination a:hover {
	border-color: var(--msps-ink);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.msps-cols-4 {
		--msps-cols: 3;
	}
}

@media (max-width: 782px) {
	.msps-cols-3,
	.msps-cols-4 {
		--msps-cols: 2;
	}

	/* On mobile the drawer becomes an off-canvas overlay. */
	.msps-drawer {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 84vw;
		height: auto;
		max-width: 340px;
		z-index: 9999;
		background: #fff;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
		opacity: 1;
		flex-basis: auto;
		overflow-y: auto;
		box-shadow: 2px 0 24px rgba(0, 0, 0, 0.15);
	}

	.msps-drawer-inner {
		width: 100%;
	}

	.msps-body.is-open .msps-drawer {
		width: 84vw;
		transform: translateX(0);
		margin-right: 0;
	}

	.msps-drawer-inner {
		padding: 24px;
	}

	.msps-drawer-overlay {
		display: none;
		position: fixed;
		inset: 0;
		z-index: 9998;
		background: rgba(0, 0, 0, 0.4);
	}

	.msps-body.is-open .msps-drawer-overlay {
		display: block;
	}
.msps-toolbar {
	justify-content: center;

}
}

@media (max-width: 480px) {
	.msps-cols-2,
	.msps-cols-3,
	.msps-cols-4 {
		--msps-cols: 1;
	}

	.msps-toolbar-left {
		gap: 18px;
	}
}
