/**
 * Shop archive — self-contained layout + product cards
 */

.ms-shop {
	background: var(--ms-color-bg);
	min-height: 60vh;
}

/* ── Header ── */
.ms-shop-head {
	padding: 1rem 0 0.85rem;
	background: var(--ms-color-surface);
	border-bottom: 1px solid var(--ms-color-border);
}

.ms-shop-head__crumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 0.65rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--ms-color-text-muted);
}

.ms-shop-head__crumb a {
	color: var(--ms-color-navy);
	text-decoration: none;
}

.ms-shop-head__row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.75rem;
}

.ms-shop-head__title {
	margin: 0;
	font-size: clamp(1.35rem, 4vw, 1.85rem);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.03em;
	color: var(--ms-color-navy);
}

.ms-shop-head__desc {
	margin: 0.2rem 0 0;
	font-size: 0.8rem;
	color: var(--ms-color-text-muted);
}

.ms-shop-head__stats {
	display: flex;
	gap: 0.45rem;
	margin: 0;
	padding: 0;
	list-style: none;
	flex-shrink: 0;
}

.ms-shop-head__stats li {
	padding: 0.35rem 0.55rem;
	border-radius: 10px;
	background: var(--ms-color-bg);
	border: 1px solid var(--ms-color-border);
	font-size: 0.68rem;
	font-weight: 600;
	color: var(--ms-color-text-muted);
	white-space: nowrap;
}

.ms-shop-head__stats strong {
	color: var(--ms-color-primary);
	font-weight: 800;
}

/* ── Body ── */
.ms-shop-body {
	padding: 0.85rem 0 2rem;
}

/* ── Filter bar ── */
.ms-shop-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.55rem;
	position: sticky;
	top: calc(var(--ms-header-height, 64px) + 0.25rem);
	z-index: 30;
	padding: 0.45rem 0;
	background: color-mix(in srgb, var(--ms-color-bg) 92%, transparent);
	backdrop-filter: blur(8px);
}

.ms-shop-bar__filters,
.ms-shop-brands {
	display: flex;
	gap: 0.35rem;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	flex: 1;
	min-width: 0;
}

.ms-shop-bar__filters::-webkit-scrollbar,
.ms-shop-brands::-webkit-scrollbar {
	display: none;
}

.ms-shop-brands {
	margin-bottom: 0.55rem;
}

.ms-shop-pill {
	flex-shrink: 0;
	padding: 0.38rem 0.72rem;
	border: 1px solid var(--ms-color-border);
	border-radius: 999px;
	background: var(--ms-color-surface);
	color: var(--ms-color-text);
	font-size: 0.72rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ms-shop-pill.is-active {
	background: var(--ms-color-navy);
	border-color: var(--ms-color-navy);
	color: #fff;
}

.ms-shop-bar__sort {
	flex-shrink: 0;
	max-width: 7.5rem;
	padding: 0.38rem 0.55rem;
	border: 1px solid var(--ms-color-border);
	border-radius: 10px;
	background: var(--ms-color-surface);
	font-size: 0.72rem;
	font-weight: 600;
	font-family: inherit;
	color: var(--ms-color-text);
}

.ms-shop-count {
	margin: 0 0 0.65rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--ms-color-text-muted);
}

/* ── Product grid (self-contained) ── */
.ms-shop-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.6rem;
}

@media (min-width: 640px) {
	.ms-shop-grid {
		gap: 0.85rem;
	}
}

@media (min-width: 900px) {
	.ms-shop-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1200px) {
	.ms-shop-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Cards inside shop grid */
.ms-shop-grid .ms-product-card {
	min-width: 0;
	height: 100%;
}

.ms-shop-grid .ms-product-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	background: var(--ms-color-surface);
	border: 1px solid var(--ms-color-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 8px rgba(27, 43, 75, 0.05);
}

.ms-shop-grid .ms-product-card__link:active {
	transform: scale(0.98);
}

.ms-shop-grid .ms-product-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	width: 100%;
	flex-shrink: 0;
	background: #eef2f8;
	overflow: hidden;
	isolation: isolate;
}

.ms-shop-grid .ms-product-card__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	object-fit: cover;
	object-position: center center;
}

.ms-shop-grid .ms-product-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--ms-color-text-muted);
	opacity: 0.4;
}

.ms-shop-grid .ms-product-card__placeholder svg {
	width: 2rem;
	height: 2rem;
}

.ms-shop-grid .ms-product-card__sold {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	padding: 0.5rem;
	text-align: center;
	background: rgba(15, 23, 42, 0.55);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 800;
	line-height: 1.45;
}

.ms-shop-grid .ms-product-card__badge {
	position: absolute;
	top: 0.45rem;
	inset-inline-start: 0.45rem;
	z-index: 2;
	padding: 0.15rem 0.45rem;
	border-radius: 6px;
	background: var(--ms-color-navy);
	color: #fff;
	font-size: 0.62rem;
	font-weight: 800;
}

.ms-shop-grid .ms-product-card__badge--sale {
	background: #dc2626;
}

.ms-shop-grid .ms-product-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 0.2rem;
	padding: 0.55rem 0.6rem 0.65rem;
}

.ms-shop-grid .ms-product-card__brand {
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--ms-color-primary);
}

.ms-shop-grid .ms-product-card__title {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 800;
	line-height: 1.4;
	color: var(--ms-color-navy);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ms-shop-grid .ms-product-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem;
	font-size: 0.65rem;
	color: var(--ms-color-text-muted);
}

.ms-shop-grid .ms-product-card__meta span {
	padding: 0.1rem 0.35rem;
	border-radius: 4px;
	background: var(--ms-color-bg);
}

.ms-shop-grid .ms-product-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem;
	margin-top: auto;
	padding-top: 0.25rem;
}

.ms-shop-grid .ms-product-card__price {
	font-size: 0.82rem;
	font-weight: 900;
	color: var(--ms-color-primary);
	white-space: nowrap;
}

.ms-shop-grid .ms-product-card__cta {
	font-size: 0.65rem;
	font-weight: 700;
	color: var(--ms-color-navy);
	opacity: 0.55;
}

/* Sold state */
.ms-shop-grid .ms-product-card--sold .ms-product-card__media img {
	filter: grayscale(0.4);
	opacity: 0.7;
}

.ms-shop-grid .ms-product-card--sold .ms-product-card__price,
.ms-shop-grid .ms-product-card--sold .ms-product-card__title {
	opacity: 0.55;
}

.ms-shop-grid .ms-product-card--sold .ms-product-card__cta {
	color: #991b1b;
	opacity: 1;
	font-weight: 800;
}

/* ── Testing card — image overlay timer (self-contained) ── */
.ms-shop-grid .ms-product-card--testing .ms-product-card__link {
	border-color: rgba(249, 115, 22, 0.35);
	box-shadow: 0 2px 14px rgba(249, 115, 22, 0.12);
}

.ms-shop-grid .ms-product-card__badge--testing {
	top: 0.45rem;
	inset-inline-start: 0.45rem;
	padding: 0.2rem 0.5rem;
	font-size: 0.56rem;
	font-weight: 800;
	border-radius: 6px;
	background: linear-gradient(135deg, #f97316, #ea580c);
	color: #fff;
	box-shadow: 0 2px 8px rgba(234, 88, 12, 0.45);
	z-index: 4;
}

.ms-shop-grid .ms-card-timer {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	padding: 0.4rem 0.45rem 0.35rem;
	background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.88) 35%, rgba(15, 23, 42, 0.96) 100%);
}

.ms-shop-grid .ms-card-timer__row {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem;
}

.ms-shop-grid .ms-card-timer__label {
	flex-shrink: 0;
	font-size: 0.52rem;
	font-weight: 800;
	color: #fdba74;
	line-height: 1.2;
	white-space: nowrap;
}

.ms-shop-grid .ms-card-timer__clock {
	display: inline-flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.1rem;
	direction: ltr;
	unicode-bidi: isolate;
}

.ms-shop-grid .ms-card-timer__clock b {
	display: inline-block;
	min-width: 1.4rem;
	padding: 0.14rem 0.18rem;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(249, 115, 22, 0.45);
	font-size: 0.72rem;
	font-weight: 900;
	font-style: normal;
	font-variant-numeric: tabular-nums;
	color: #fff;
	text-align: center;
	line-height: 1.15;
	text-shadow: 0 0 10px rgba(249, 115, 22, 0.45);
}

.ms-shop-grid .ms-card-timer__clock i {
	display: inline-block;
	font-style: normal;
	font-size: 0.68rem;
	font-weight: 900;
	color: #f97316;
	line-height: 1;
	padding: 0 0.02rem;
}

.ms-shop-grid .ms-card-timer__bar {
	display: block;
	height: 2px;
	margin-top: 0.3rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
	overflow: hidden;
}

.ms-shop-grid .ms-card-timer__bar-fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #fb923c, #f97316);
	transition: width 1s linear;
}

.ms-shop-grid .ms-product-card--testing .ms-product-card__cta {
	color: #ea580c;
	font-weight: 800;
}

.ms-shop-grid .ms-product-card.is-hidden {
	display: none;
}

/* ── Empty / no results ── */
.ms-shop-empty,
.ms-shop-no-results {
	padding: 2.5rem 1rem;
	text-align: center;
}

.ms-shop-empty__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 0.85rem;
	border-radius: 14px;
	background: var(--ms-color-orange-tint);
	color: var(--ms-color-primary);
}

.ms-shop-empty__icon svg {
	width: 28px;
	height: 28px;
}

.ms-shop-empty h2 {
	margin: 0 0 0.35rem;
	font-size: 1.1rem;
	font-weight: 800;
}

.ms-shop-empty p {
	margin: 0 0 1rem;
	font-size: 0.85rem;
	color: var(--ms-color-text-muted);
}

.ms-shop-no-results {
	background: var(--ms-color-surface);
	border: 1px dashed var(--ms-color-border);
	border-radius: 14px;
}

.ms-shop-no-results p {
	margin: 0 0 0.75rem;
	color: var(--ms-color-text-muted);
	font-size: 0.85rem;
}

/* ── CTA ── */
.ms-shop-cta .ms-btn--primary {
	background: #fff;
	color: var(--ms-color-navy);
	border: none;
	font-weight: 800;
}

.ms-shop-cta .ms-btn--primary:hover {
	background: var(--ms-color-orange-tint);
	color: var(--ms-color-primary);
}

/* ── Desktop polish ── */
@media (min-width: 900px) {
	.ms-shop-head {
		padding: 1.35rem 0 1rem;
	}

	.ms-shop-body {
		padding: 1.25rem 0 2.5rem;
	}

	.ms-shop-bar {
		position: static;
		background: transparent;
		backdrop-filter: none;
		padding: 0;
		margin-bottom: 0.75rem;
	}

	.ms-shop-bar__filters,
	.ms-shop-brands {
		flex-wrap: wrap;
		overflow: visible;
	}

	.ms-shop-bar__sort {
		max-width: 10rem;
	}
}
