/**
 * Phase 5.7 — world-class marketplace homepage UI.
 * CSS-only polish. Loaded on the front page.
 */

.nds-home--marketplace {
	--nds-market-ink: #07131f;
	--nds-market-teal: #0b5f69;
	--nds-market-deep: #06343a;
	background:
		radial-gradient(ellipse 80% 45% at 50% -8%, rgba(11, 95, 105, 0.11), transparent 58%),
		linear-gradient(180deg, #e8eef1 0%, #ffffff 16%, #f4f7f8 52%, #ffffff 100%);
	padding-bottom: 3rem;
	color: var(--nds-market-ink);
}

.nds-home--marketplace .nds-container {
	max-width: min(94rem, calc(100% - 2rem));
}

/* —— Category rail —— */
.nds-cat-rail--market {
	padding: 0.85rem 0 0.15rem;
}

.nds-cat-rail--market .nds-cat-tile__disc {
	width: 3.85rem;
	height: 3.85rem;
	box-shadow: 0 10px 22px rgba(7, 19, 31, 0.14);
}

/* —— Full-bleed marketplace hero —— */
.nds-market-hero {
	position: relative;
	isolation: isolate;
	min-height: clamp(28rem, 72vh, 40rem);
	width: 100%;
	max-width: 100%;
	margin: 0.35rem 0 1.25rem;
	overflow: hidden;
	border-radius: 0;
	color: #fff;
	background: #062a30;
}

.nds-market-hero__stage {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.nds-market-hero__cover {
	position: absolute;
	margin: 0;
	overflow: hidden;
	border-radius: 0.55rem;
	box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.18);
	transform-origin: center bottom;
	transition: transform 0.55s var(--nds-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.nds-market-hero__cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: 3 / 4;
}

.nds-market-hero__cover--1 { width: min(15rem, 28vw); right: 38%; top: 12%; transform: rotate(-8deg); z-index: 3; }
.nds-market-hero__cover--2 { width: min(17rem, 32vw); right: 18%; top: 6%; transform: rotate(3deg); z-index: 5; }
.nds-market-hero__cover--3 { width: min(14rem, 26vw); right: 4%; top: 18%; transform: rotate(10deg); z-index: 2; }
.nds-market-hero__cover--4 { width: min(12.5rem, 22vw); right: 30%; top: 48%; transform: rotate(-3deg); z-index: 4; }
.nds-market-hero__cover--5 { width: min(11.5rem, 20vw); right: 10%; top: 52%; transform: rotate(7deg); z-index: 1; }
.nds-market-hero__cover--6 { width: min(10.5rem, 18vw); right: 44%; top: 56%; transform: rotate(-11deg); z-index: 2; opacity: 0.92; }

.nds-market-hero__veil {
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(105deg, rgba(4, 24, 28, 0.94) 0%, rgba(4, 24, 28, 0.82) 38%, rgba(4, 24, 28, 0.35) 62%, rgba(4, 24, 28, 0.55) 100%),
		radial-gradient(ellipse 50% 70% at 75% 40%, rgba(11, 95, 105, 0.35), transparent 70%);
	pointer-events: none;
}

.nds-market-hero__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: inherit;
	padding: 4.5rem 0 4rem;
	max-width: min(40rem, calc(100% - 2rem));
	margin-left: max(1rem, calc((100% - 94rem) / 2 + 1rem));
}

.nds-market-hero__brand {
	margin: 0 0 0.85rem;
	font-family: var(--nds-font-brand);
	font-size: clamp(1.15rem, 2.2vw, 1.65rem);
	font-weight: 750;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #9fd4d8;
}

.nds-market-hero h1 {
	margin: 0 0 1rem;
	max-width: 12ch;
	font-family: var(--nds-font-display);
	font-size: clamp(2.4rem, 5.4vw, 4.2rem);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -0.035em;
	color: #fff;
}

.nds-market-hero__lede {
	margin: 0 0 1.75rem;
	max-width: 34ch;
	font-size: clamp(1rem, 1.5vw, 1.15rem);
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.82);
}

.nds-market-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
	align-items: center;
}

.nds-btn--hero {
	min-height: 3.25rem;
	padding-inline: 1.55rem;
	font-size: 0.98rem;
	border-radius: 0.75rem;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.nds-btn--ghost-light {
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.35);
	min-height: 3.25rem;
	padding-inline: 1.2rem;
}

.nds-btn--ghost-light:hover,
.nds-btn--ghost-light:focus-visible {
	background: rgba(255, 255, 255, 0.1);
	border-color: #fff;
	color: #fff;
	transform: translateY(-1px);
}

@media (prefers-reduced-motion: no-preference) {
	.nds-market-hero:hover .nds-market-hero__cover--2 {
		transform: rotate(1deg) translateY(-10px);
	}
	.nds-market-hero:hover .nds-market-hero__cover--1 {
		transform: rotate(-10deg) translateY(-6px);
	}
	.nds-market-hero:hover .nds-market-hero__cover--3 {
		transform: rotate(12deg) translateY(-4px);
	}
}

/* —— Trust / lanes —— */
.nds-trust-strip--market {
	margin-top: -1.5rem;
	position: relative;
	z-index: 3;
	padding-bottom: 0.35rem;
}

.nds-trust-strip--market .nds-trust-strip__grid {
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: blur(12px);
	box-shadow: var(--nds-shadow-md);
	border-radius: 1rem;
}

.nds-quick-lanes {
	padding: 1.35rem 0 0.5rem;
}

.nds-quick-lanes__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.85rem;
}

.nds-lane {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1.15rem 1.2rem;
	border-radius: 1rem;
	text-decoration: none;
	color: inherit;
	border: 1px solid rgba(7, 19, 31, 0.06);
	box-shadow: var(--nds-shadow-sm);
	transition: transform var(--nds-dur) var(--nds-ease), box-shadow var(--nds-dur) var(--nds-ease);
}

.nds-lane:hover,
.nds-lane:focus-visible {
	transform: translateY(-3px);
	box-shadow: var(--nds-shadow-lift);
}

.nds-lane__eyebrow {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.72;
}

.nds-lane__title {
	font-family: var(--nds-font-body);
	font-size: 1.05rem;
	font-weight: 750;
	letter-spacing: -0.02em;
}

.nds-lane--practice { background: linear-gradient(145deg, #efe8fb, #faf7ff); }
.nds-lane--bundles { background: linear-gradient(145deg, #e4f4ef, #f4fbf8); }
.nds-lane--free { background: linear-gradient(145deg, #fff1e4, #fffaf4); }
.nds-lane--new { background: linear-gradient(145deg, #e5f0f9, #f5f9fc); }

/* —— Shelf personalities —— */
.nds-shelf__eyebrow {
	margin: 0 0 0.35rem;
	font-size: 0.72rem;
	font-weight: 750;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--nds-market-teal);
}

.nds-home--marketplace .nds-shelf {
	padding: 1.55rem 0 0.65rem;
}

.nds-home--marketplace .nds-shelf__title {
	font-size: clamp(1.35rem, 2.1vw, 1.85rem);
}

.nds-shelf--featured {
	padding: 2rem 0 1.1rem !important;
	margin: 0.75rem 0;
	background:
		linear-gradient(180deg, rgba(11, 95, 105, 0.07), rgba(11, 95, 105, 0.015) 55%, transparent);
	border-block: 1px solid rgba(11, 95, 105, 0.1);
}

.nds-shelf--featured .nds-shelf__item {
	width: min(14rem, 48vw);
}

.nds-shelf--bestsellers {
	padding: 1.85rem 0 0.9rem !important;
	background: linear-gradient(90deg, rgba(184, 122, 50, 0.08), transparent 55%);
}

.nds-shelf--bestsellers .nds-shelf__eyebrow {
	color: #9a6520;
}

.nds-shelf--bestsellers .nds-product-card {
	border-color: rgba(184, 122, 50, 0.18);
}

.nds-shelf--new {
	padding: 1.7rem 0 0.75rem !important;
}

.nds-shelf--new .nds-shelf__head {
	padding-bottom: 0.75rem;
	border-bottom: 1px solid rgba(7, 19, 31, 0.08);
	margin-bottom: 1rem;
}

.nds-shelf--bundles {
	padding: 2rem 0 1rem !important;
	margin: 0.65rem 0;
	background: linear-gradient(160deg, #eef7f5 0%, #ffffff 55%);
	border-radius: 1.25rem;
}

.nds-shelf--bundles .nds-shelf__item {
	width: min(13.25rem, 46vw);
}

.nds-shelf--free {
	padding: 1.7rem 0 0.8rem !important;
	background: linear-gradient(180deg, rgba(42, 111, 74, 0.06), transparent 70%);
}

.nds-shelf--free .nds-shelf__eyebrow {
	color: var(--nds-color-success);
}

.nds-shelf--updated {
	padding: 1.65rem 0 0.7rem !important;
}

.nds-shelf--updated .nds-shelf__rail {
	gap: 1.05rem;
}

.nds-shelf--subject {
	margin: 0.55rem 0;
	padding: 1.55rem 0 0.85rem !important;
	background: linear-gradient(100deg, rgba(26, 82, 116, 0.05), transparent 60%);
	border-radius: 1.1rem;
}

.nds-shelf--compact .nds-shelf__item {
	width: min(10.5rem, 40vw);
}

.nds-shelf--tint {
	background: linear-gradient(90deg, rgba(13, 101, 112, 0.04), transparent);
	border-radius: 1.1rem;
	padding: 1.45rem 0 0.75rem !important;
}

.nds-shelf--alt .nds-shelf__head {
	margin-bottom: 1rem;
	padding-bottom: 0.7rem;
	border-bottom: 1px solid rgba(7, 19, 31, 0.07);
}

/* —— Marketplace product cards —— */
.nds-home--marketplace .nds-product-card,
.nds-product-card {
	border: 0;
	border-radius: 1rem;
	background: #fff;
	box-shadow:
		0 1px 2px rgba(7, 19, 31, 0.04),
		0 10px 28px rgba(7, 19, 31, 0.07);
	overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
	.nds-home--marketplace .nds-product-card:hover,
	.nds-home--marketplace .nds-product-card:focus-within,
	.nds-product-card:hover,
	.nds-product-card:focus-within {
		transform: translateY(-7px);
		box-shadow:
			0 18px 42px rgba(7, 19, 31, 0.14),
			0 6px 14px rgba(11, 95, 105, 0.08);
	}

	.nds-home--marketplace .nds-product-card:hover .nds-product-card__media img,
	.nds-product-card:hover .nds-product-card__media img {
		transform: scale(1.06);
	}
}

.nds-product-card__media {
	background: linear-gradient(160deg, #dfe8ec, #cfdbe2);
}

.nds-product-card__media::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 28%;
	background: linear-gradient(180deg, transparent, rgba(7, 19, 31, 0.18));
	pointer-events: none;
	opacity: 0;
	transition: opacity var(--nds-dur) var(--nds-ease);
}

.nds-product-card:hover .nds-product-card__media::after,
.nds-product-card:focus-within .nds-product-card__media::after {
	opacity: 1;
}

.nds-product-card__body {
	padding: 0.95rem 1rem 1.05rem;
	gap: 0.55rem;
}

.nds-badge {
	border-radius: 999px;
	font-size: 0.66rem;
	letter-spacing: 0.05em;
}

.nds-product-card__title {
	font-size: 0.98rem;
	font-weight: 750;
	line-height: 1.28;
	letter-spacing: -0.02em;
}

.nds-product-card__price {
	font-size: 1.18rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	color: var(--nds-market-ink);
}

.nds-product-card__price .woocommerce-Price-amount {
	font-weight: 800;
}

.nds-product-card__actions .nds-btn--primary {
	border-radius: 0.7rem;
	box-shadow: 0 8px 18px rgba(11, 95, 105, 0.2);
}

.nds-product-card--shelf .nds-product-card__actions .nds-btn--secondary {
	display: none;
}

.nds-shelf--featured .nds-product-card--shelf .nds-product-card__actions .nds-btn--secondary,
.nds-shelf--bundles .nds-product-card--shelf .nds-product-card__actions .nds-btn--secondary {
	display: inline-flex;
}

/* —— Editorial interstitials —— */
.nds-editorial {
	margin: 1.75rem 0;
	padding: 0;
}

.nds-editorial__inner {
	display: grid;
	gap: 1.5rem;
	align-items: center;
	padding: 2.25rem 1.75rem;
	border-radius: 1.35rem;
	overflow: hidden;
	position: relative;
}

.nds-editorial__eyebrow {
	margin: 0 0 0.55rem;
	font-size: 0.74rem;
	font-weight: 750;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.nds-editorial h2 {
	margin: 0 0 0.75rem;
	max-width: 16ch;
	font-size: clamp(1.55rem, 2.6vw, 2.35rem);
}

.nds-editorial p {
	margin: 0 0 1.25rem;
	max-width: 42ch;
	color: var(--nds-color-muted);
}

.nds-editorial--subject .nds-editorial__inner {
	grid-template-columns: 1.2fr 0.8fr;
	background:
		radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.45), transparent 40%),
		linear-gradient(125deg, #0b5f69 0%, #1a5274 55%, #3d5678 100%);
	color: #fff;
	min-height: 16rem;
}

.nds-editorial--subject .nds-editorial__eyebrow,
.nds-editorial--subject p,
.nds-editorial--subject h2 {
	color: #fff;
}

.nds-editorial--subject p {
	opacity: 0.88;
}

.nds-editorial--subject .nds-editorial__visual {
	min-height: 12rem;
	border-radius: 1rem;
	overflow: hidden;
	display: grid;
	place-items: center;
	background:
		radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.25), transparent 55%),
		linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
	border: 1px solid rgba(255, 255, 255, 0.18);
	padding: 1.25rem;
}

.nds-editorial--subject .nds-editorial__visual img {
	width: min(11rem, 70%);
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: 0.65rem;
	box-shadow: 0 22px 44px rgba(0, 0, 0, 0.35);
	transform: rotate(6deg);
}

.nds-editorial--bundle .nds-editorial__inner {
	grid-template-columns: auto 1fr;
	gap: 2rem;
	background: linear-gradient(135deg, #f7fbfa 0%, #eef4f8 100%);
	border: 1px solid rgba(7, 19, 31, 0.06);
	box-shadow: var(--nds-shadow-md);
}

.nds-editorial__cover {
	margin: 0;
	width: min(11rem, 34vw);
	border-radius: 0.85rem;
	overflow: hidden;
	box-shadow: var(--nds-shadow-lift);
	transform: rotate(-4deg);
}

.nds-editorial__cover img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

.nds-editorial--success .nds-editorial__inner {
	background:
		radial-gradient(ellipse at 10% 0%, rgba(11, 95, 105, 0.1), transparent 45%),
		linear-gradient(180deg, #ffffff, #f4f7f8);
	border: 1px solid rgba(11, 95, 105, 0.12);
	text-align: center;
	justify-items: center;
}

.nds-editorial--success .nds-editorial__copy {
	max-width: 40rem;
}

.nds-editorial--success h2 {
	max-width: 18ch;
	margin-inline: auto;
}

.nds-editorial--success p {
	margin-inline: auto;
}

/* —— Subjects / delivery / story polish —— */
.nds-popular-subjects--market {
	margin: 1.5rem 0;
	padding: 2rem 0 1.25rem;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(232, 238, 241, 0.85));
	border-block: 1px solid rgba(7, 19, 31, 0.05);
}

.nds-home--marketplace .nds-subject-card {
	border: 0;
	box-shadow: var(--nds-shadow-md);
	border-radius: 1.05rem;
}

.nds-delivery--market,
.nds-faq--market {
	padding-top: 2rem;
}

.nds-story--market .nds-story__panel {
	box-shadow: var(--nds-shadow-lift);
}

/* —— Responsive —— */
@media (max-width: 1100px) {
	.nds-market-hero__cover--5,
	.nds-market-hero__cover--6 {
		display: none;
	}

	.nds-quick-lanes__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.nds-editorial--subject .nds-editorial__inner,
	.nds-editorial--bundle .nds-editorial__inner {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 760px) {
	.nds-market-hero {
		min-height: auto;
	}

	.nds-market-hero__content {
		padding: 2.75rem 0 12.5rem;
		max-width: calc(100% - 1.5rem);
		margin-left: 0.75rem;
	}

	.nds-market-hero__cover--1 { width: 7.5rem; right: 42%; top: auto; bottom: 1.25rem; }
	.nds-market-hero__cover--2 { width: 8.5rem; right: 18%; top: auto; bottom: 0.85rem; }
	.nds-market-hero__cover--3 { width: 7rem; right: 2%; top: auto; bottom: 1.6rem; }
	.nds-market-hero__cover--4 { display: none; }

	.nds-trust-strip--market {
		margin-top: 0.75rem;
	}

	.nds-quick-lanes__grid {
		grid-template-columns: 1fr 1fr;
	}

	.nds-shelf--featured .nds-shelf__item,
	.nds-shelf--bundles .nds-shelf__item {
		width: min(11rem, 68vw);
	}
}

@media (max-width: 480px) {
	.nds-quick-lanes__grid {
		grid-template-columns: 1fr;
	}

	.nds-market-hero h1 {
		max-width: 14ch;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nds-market-hero__cover,
	.nds-lane,
	.nds-editorial__cover {
		transition: none;
	}
}
