/**
 * Phase 5.4 â€” dense bookstore homepage.
 * Loaded on front page only.
 */

.nds-home--bookstore {
	--nds-home-cream: #f7f3ea;
	--nds-home-mist: #eef5f7;
	background:
		radial-gradient(ellipse 80% 40% at 10% 0%, rgba(196, 180, 230, 0.22), transparent 55%),
		radial-gradient(ellipse 60% 35% at 90% 5%, rgba(180, 220, 210, 0.28), transparent 50%),
		linear-gradient(180deg, var(--nds-home-cream) 0%, #fff 18%, var(--nds-home-mist) 55%, #fff 100%);
	padding-bottom: 3rem;
}

.nds-home--bookstore .nds-container {
	max-width: min(92rem, calc(100% - 2rem));
}

/* â€”â€” Category rail â€”â€” */
.nds-cat-rail {
	padding: 1rem 0 0.35rem;
}

.nds-cat-rail__track {
	display: flex;
	gap: 0.85rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: 0.35rem 0.15rem 0.85rem;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.nds-cat-tile {
	flex: 0 0 auto;
	width: 5.5rem;
	scroll-snap-align: start;
	text-align: center;
	text-decoration: none;
	color: var(--nds-color-ink);
	transition: transform var(--nds-dur) var(--nds-ease);
}

.nds-cat-tile:hover,
.nds-cat-tile:focus-visible {
	transform: translateY(-3px);
}

.nds-cat-tile__disc {
	display: grid;
	place-items: center;
	width: 4.35rem;
	height: 4.35rem;
	margin: 0 auto 0.45rem;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 8px 18px rgba(10, 31, 40, 0.1);
	color: #fff;
	background: var(--nds-color-teal);
}

.nds-cat-tile--fundamentals .nds-cat-tile__disc { background: linear-gradient(145deg, #0f6b75, #148a7a); }
.nds-cat-tile--medsurg .nds-cat-tile__disc { background: linear-gradient(145deg, #1e587a, #2a7aad); }
.nds-cat-tile--pharm .nds-cat-tile__disc { background: linear-gradient(145deg, #5c4c82, #7a6ab0); }
.nds-cat-tile--pediatrics .nds-cat-tile__disc { background: linear-gradient(145deg, #8a5c2e, #c4894a); }
.nds-cat-tile--maternity .nds-cat-tile__disc { background: linear-gradient(145deg, #96506a, #c47a96); }
.nds-cat-tile--mental .nds-cat-tile__disc { background: linear-gradient(145deg, #466496, #6a8ec0); }
.nds-cat-tile--critical .nds-cat-tile__disc { background: linear-gradient(145deg, #14466e, #c85a28); }
.nds-cat-tile--dosage .nds-cat-tile__disc { background: linear-gradient(145deg, #3c7846, #6aaa6e); }

.nds-cat-tile__label {
	display: block;
	font-size: 0.72rem;
	font-weight: 650;
	line-height: 1.25;
}

/* â€”â€” Hero merchandising grid â€”â€” */
.nds-hero-store {
	padding: 0.75rem 0 1.25rem;
}

.nds-hero-store__grid {
	display: grid;
	grid-template-columns: 1.55fr 1fr;
	grid-template-rows: auto auto;
	gap: 0.85rem;
}

.nds-promo {
	position: relative;
	overflow: hidden;
	border-radius: 1rem;
	padding: 1.35rem 1.4rem;
	border: 1px solid rgba(10, 31, 40, 0.06);
	box-shadow: 0 10px 28px rgba(10, 31, 40, 0.06);
}

.nds-promo--hero {
	grid-row: span 2;
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 1rem;
	align-items: center;
	min-height: 22rem;
	background:
		linear-gradient(135deg, #fff 0%, #eef7f5 45%, #e4f0fb 100%);
}

.nds-promo__eyebrow {
	margin: 0 0 0.4rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--nds-color-teal-deep);
}

.nds-promo h1,
.nds-promo h2 {
	margin: 0 0 0.55rem;
	font-family: var(--nds-font-display);
	line-height: 1.15;
	color: var(--nds-color-ink);
}

.nds-promo h1 {
	font-size: clamp(1.7rem, 2.6vw, 2.55rem);
	font-weight: 750;
}

.nds-promo h2 {
	font-size: 1.15rem;
	font-weight: 700;
}

.nds-promo p {
	margin: 0 0 1rem;
	color: var(--nds-color-muted);
	max-width: 38ch;
}

.nds-promo__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
}

.nds-promo__covers {
	position: relative;
	min-height: 16rem;
}

.nds-promo__cover {
	position: absolute;
	width: 42%;
	border-radius: 0.45rem;
	overflow: hidden;
	box-shadow: 0 14px 30px rgba(10, 31, 40, 0.22);
	transform-origin: center bottom;
}

.nds-promo__cover img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

.nds-promo__cover--1 { left: 8%; top: 8%; z-index: 3; transform: rotate(-6deg); }
.nds-promo__cover--2 { left: 34%; top: 0; z-index: 4; transform: rotate(2deg); }
.nds-promo__cover--3 { left: 58%; top: 14%; z-index: 2; transform: rotate(8deg); }
.nds-promo__cover--4 { left: 22%; top: 42%; z-index: 5; width: 38%; transform: rotate(-2deg); }
.nds-promo__cover--5 { left: 52%; top: 48%; z-index: 1; width: 34%; transform: rotate(5deg); }

.nds-promo--side {
	min-height: 10.5rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.nds-promo--practice { background: linear-gradient(145deg, #efe8fb, #f8f5ff); }
.nds-promo--bundles { background: linear-gradient(145deg, #e5f3ef, #f3faf7); }
.nds-promo--samples { background: linear-gradient(145deg, #fff4e8, #fffaf3); }
.nds-promo--updated { background: linear-gradient(145deg, #e7f0fa, #f4f8fc); }

.nds-hero-store__grid > .nds-promo--side:nth-of-type(2) { grid-column: 2; grid-row: 1; }
.nds-hero-store__grid > .nds-promo--side:nth-of-type(3) { grid-column: 2; grid-row: 2; }

/* Extra side promos under hero on wide screens */
.nds-hero-store__grid {
	grid-template-columns: 1.45fr 1fr 1fr;
}

.nds-promo--hero {
	grid-column: 1;
	grid-row: 1 / span 2;
}

.nds-hero-store__grid > .nds-promo--practice { grid-column: 2; grid-row: 1; }
.nds-hero-store__grid > .nds-promo--bundles { grid-column: 3; grid-row: 1; }
.nds-hero-store__grid > .nds-promo--samples { grid-column: 2; grid-row: 2; }
.nds-hero-store__grid > .nds-promo--updated { grid-column: 3; grid-row: 2; }

/* â€”â€” Trust strip â€”â€” */
.nds-trust-strip {
	padding: 0.35rem 0 1.1rem;
}

.nds-trust-strip__grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.65rem;
	padding: 0.85rem 1rem;
	border-radius: 0.9rem;
	background: #fff;
	border: 1px solid rgba(10, 31, 40, 0.07);
	box-shadow: var(--nds-shadow-sm);
}

.nds-trust-strip__item {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
}

.nds-trust-strip__icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 2.35rem;
	height: 2.35rem;
	border-radius: 0.65rem;
	background: var(--nds-color-teal-soft);
	color: var(--nds-color-teal-deep);
}

.nds-trust-strip__item:nth-child(2) .nds-trust-strip__icon { background: #e8eefb; color: #1e587a; }
.nds-trust-strip__item:nth-child(3) .nds-trust-strip__icon { background: #efe8fb; color: #5c4c82; }
.nds-trust-strip__item:nth-child(4) .nds-trust-strip__icon { background: #fff0e0; color: #b85a28; }
.nds-trust-strip__item:nth-child(5) .nds-trust-strip__icon { background: #e8f6ec; color: #1a6b42; }

.nds-trust-strip__item p {
	margin: 0;
	font-size: 0.82rem;
	font-weight: 650;
	line-height: 1.3;
	color: var(--nds-color-ink);
}

.nds-trust-strip__item a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* â€”â€” Shelves â€”â€” */
.nds-shelf {
	padding: 1.35rem 0 0.5rem;
}

.nds-shelf__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.85rem;
}

.nds-shelf__title {
	margin: 0;
	font-size: clamp(1.2rem, 1.8vw, 1.55rem);
	font-weight: 750;
	color: var(--nds-color-ink);
}

.nds-shelf__desc {
	margin: 0.25rem 0 0;
	color: var(--nds-color-muted);
	font-size: 0.92rem;
}

.nds-shelf__all {
	flex: 0 0 auto;
	font-weight: 700;
	font-size: 0.9rem;
	color: var(--nds-color-teal-deep);
	text-decoration: none;
	white-space: nowrap;
}

.nds-shelf__all:hover,
.nds-shelf__all:focus-visible {
	text-decoration: underline;
}

.nds-shelf__rail {
	display: flex;
	gap: 0.9rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: 0.2rem 0.1rem 0.85rem;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.nds-shelf__item {
	flex: 0 0 auto;
	width: min(11.5rem, 42vw);
	scroll-snap-align: start;
}

.nds-shelf__item .nds-product-card {
	height: 100%;
	margin: 0;
	background: #fff;
	border: 1px solid rgba(10, 31, 40, 0.07);
	border-radius: 0.75rem;
	overflow: hidden;
	box-shadow: 0 6px 16px rgba(10, 31, 40, 0.05);
	transition: transform var(--nds-dur) var(--nds-ease), box-shadow var(--nds-dur) var(--nds-ease);
}

.nds-shelf__item .nds-product-card:hover,
.nds-shelf__item .nds-product-card:focus-within {
	transform: translateY(-3px);
	box-shadow: 0 14px 28px rgba(10, 31, 40, 0.1);
}

.nds-product-card--shelf .nds-product-card__media {
	display: block;
	aspect-ratio: 3 / 4;
	background: #e8eef0;
}

.nds-product-card--shelf .nds-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nds-product-card--shelf .nds-product-card__body {
	padding: 0.7rem 0.75rem 0.85rem;
}

.nds-product-card--shelf .nds-product-card__title {
	font-size: 0.92rem;
	line-height: 1.3;
	margin: 0 0 0.35rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.4em;
}

.nds-product-card--shelf .nds-product-card__meta {
	font-size: 0.75rem;
	margin: 0 0 0.35rem;
}

.nds-product-card--shelf .nds-product-card__meta span + span::before {
	content: " Â· ";
}

.nds-product-card--shelf .nds-product-card__price {
	font-size: 0.95rem;
	font-weight: 750;
	margin-bottom: 0.55rem;
}

.nds-product-card--shelf .nds-product-card__actions {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.nds-product-card--shelf .nds-btn {
	width: 100%;
	justify-content: center;
	font-size: 0.8rem;
	padding: 0.45rem 0.55rem;
	min-height: 2.35rem;
}

.nds-product-card--shelf .nds-product-card__badges {
	margin: 0 0 0.35rem;
}

.nds-product-card--shelf .nds-product-card__more,
.nds-product-card--shelf .nds-product-card__actions .nds-btn--ghost,
.nds-product-card--shelf .nds-product-card__actions .nds-btn--secondary {
	display: none;
}

.nds-product-card--shelf.nds-product-card--free .nds-product-card__actions .nds-btn--primary {
	display: inline-flex;
}

/* â€”â€” Popular subjects â€”â€” */
.nds-popular-subjects {
	padding: 1.5rem 0 0.75rem;
}

.nds-subject-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.85rem;
}

.nds-subject-card {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.85rem;
	align-items: center;
	min-height: 7.5rem;
	padding: 1rem;
	border-radius: 0.9rem;
	text-decoration: none;
	color: var(--nds-color-ink);
	border: 1px solid rgba(10, 31, 40, 0.06);
	background: #fff;
	box-shadow: var(--nds-shadow-sm);
	transition: transform var(--nds-dur) var(--nds-ease), box-shadow var(--nds-dur) var(--nds-ease);
}

.nds-subject-card:hover,
.nds-subject-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: var(--nds-shadow-md);
}

.nds-subject-card__art {
	display: grid;
	place-items: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 0.85rem;
	color: #fff;
	background: var(--nds-color-teal);
}

.nds-subject-card--fundamentals .nds-subject-card__art { background: #0f6b75; }
.nds-subject-card--medical-surgical .nds-subject-card__art { background: #1e587a; }
.nds-subject-card--pharmacology .nds-subject-card__art { background: #5c4c82; }
.nds-subject-card--pediatrics .nds-subject-card__art { background: #8a5c2e; }
.nds-subject-card--maternity .nds-subject-card__art { background: #96506a; }
.nds-subject-card--mental-health .nds-subject-card__art { background: #466496; }
.nds-subject-card--critical-care .nds-subject-card__art { background: #14466e; }
.nds-subject-card--dosage-calculations .nds-subject-card__art { background: #3c7846; }

.nds-subject-card__label {
	display: block;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--nds-color-muted);
}

.nds-subject-card__title {
	display: block;
	font-size: 1.05rem;
	font-weight: 750;
	margin: 0.15rem 0;
}

.nds-subject-card__count {
	display: block;
	font-size: 0.78rem;
	font-weight: 650;
	color: var(--nds-color-teal-deep);
	margin-bottom: 0.2rem;
}

.nds-subject-card__blurb {
	display: block;
	font-size: 0.8rem;
	color: var(--nds-color-muted);
	line-height: 1.35;
}

/* â€”â€” Mid promos â€”â€” */
.nds-mid-promo {
	padding: 1.1rem 0;
}

.nds-mid-promo__inner {
	display: grid;
	grid-template-columns: 1.2fr 0.8fr;
	gap: 1rem;
	align-items: center;
	min-height: 11rem;
	padding: 1.5rem 1.6rem;
	border-radius: 1rem;
	overflow: hidden;
	border: 1px solid rgba(10, 31, 40, 0.05);
}

.nds-mid-promo--practice .nds-mid-promo__inner {
	background: linear-gradient(120deg, #efe8fb 0%, #f7f4ff 55%, #fff 100%);
}

.nds-mid-promo--bundle .nds-mid-promo__inner {
	background: linear-gradient(120deg, #e5f3ef 0%, #f2faf7 55%, #fff 100%);
}

.nds-mid-promo--samples .nds-mid-promo__inner {
	background: linear-gradient(120deg, #fff0e0 0%, #fff8ef 55%, #fff 100%);
}

.nds-mid-promo__copy h2 {
	margin: 0 0 0.5rem;
	font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.nds-mid-promo__copy p {
	margin: 0 0 1rem;
	color: var(--nds-color-muted);
	max-width: 46ch;
}

.nds-mid-promo__visual {
	min-height: 8rem;
	border-radius: 0.85rem;
	background:
		radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), transparent 50%),
		linear-gradient(145deg, rgba(15, 107, 117, 0.35), rgba(92, 76, 130, 0.35));
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.nds-mid-promo--bundle .nds-mid-promo__visual {
	background:
		radial-gradient(circle at 70% 40%, rgba(255, 255, 255, 0.8), transparent 45%),
		linear-gradient(145deg, rgba(20, 138, 110, 0.4), rgba(184, 90, 40, 0.28));
}

.nds-mid-promo--samples .nds-mid-promo__visual {
	background:
		radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.85), transparent 50%),
		linear-gradient(145deg, rgba(196, 140, 60, 0.4), rgba(150, 80, 106, 0.28));
}

/* â€”â€” Delivery / story / FAQ â€”â€” */
.nds-delivery,
.nds-story,
.nds-faq {
	padding: 1.75rem 0 0.75rem;
}

.nds-delivery__steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.85rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nds-delivery__step {
	background: #fff;
	border: 1px solid rgba(10, 31, 40, 0.07);
	border-radius: 0.9rem;
	padding: 1.1rem 1rem 1.2rem;
	box-shadow: var(--nds-shadow-sm);
}

.nds-delivery__num {
	display: inline-grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	margin-bottom: 0.65rem;
	border-radius: 999px;
	background: var(--nds-color-teal);
	color: #fff;
	font-weight: 750;
}

.nds-delivery__step h3 {
	margin: 0 0 0.4rem;
	font-size: 1rem;
}

.nds-delivery__step p {
	margin: 0;
	font-size: 0.88rem;
	color: var(--nds-color-muted);
}

.nds-delivery__cta {
	margin: 1.1rem 0 0;
}

.nds-story__grid {
	display: grid;
	grid-template-columns: 1.4fr 0.8fr;
	gap: 1.25rem;
	align-items: stretch;
	padding: 1.5rem;
	border-radius: 1rem;
	background: linear-gradient(135deg, #0f3d4a 0%, #1a5c6b 45%, #2a6f8a 100%);
	color: #f4f8f9;
}

.nds-story__copy .nds-promo__eyebrow {
	color: #b8e0e4;
}

.nds-story__copy h2 {
	margin: 0 0 0.75rem;
	font-size: clamp(1.3rem, 2vw, 1.8rem);
	color: #fff;
}

.nds-story__copy p {
	margin: 0 0 0.75rem;
	color: rgba(244, 248, 249, 0.88);
	max-width: 58ch;
}

.nds-story__panel {
	display: grid;
	place-content: center;
	text-align: center;
	border-radius: 0.85rem;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.14);
	padding: 1.5rem;
}

.nds-story__mark {
	font-family: var(--nds-font-brand);
	font-size: 2.4rem;
	font-weight: 700;
}

.nds-story__name {
	margin-top: 0.35rem;
	font-weight: 650;
	opacity: 0.92;
}

.nds-faq__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
}

.nds-faq__item {
	background: #fff;
	border: 1px solid rgba(10, 31, 40, 0.08);
	border-radius: 0.75rem;
	padding: 0.85rem 1rem;
}

.nds-faq__item summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--nds-color-ink);
}

.nds-faq__item p {
	margin: 0.65rem 0 0;
	color: var(--nds-color-muted);
	font-size: 0.92rem;
}

/* â€”â€” Responsive â€”â€” */
@media (max-width: 1200px) {
	.nds-hero-store__grid {
		grid-template-columns: 1.3fr 1fr;
	}

	.nds-promo--hero {
		grid-column: 1 / -1;
		grid-row: auto;
	}

	.nds-hero-store__grid > .nds-promo--practice,
	.nds-hero-store__grid > .nds-promo--bundles,
	.nds-hero-store__grid > .nds-promo--samples,
	.nds-hero-store__grid > .nds-promo--updated {
		grid-column: auto;
		grid-row: auto;
	}

	.nds-subject-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.nds-trust-strip__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.nds-promo--hero {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.nds-promo__covers {
		min-height: 12rem;
		max-width: 18rem;
		margin: 0 auto;
	}

	.nds-delivery__steps,
	.nds-faq__list,
	.nds-story__grid,
	.nds-mid-promo__inner {
		grid-template-columns: 1fr;
	}

	.nds-trust-strip__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.nds-home--bookstore .nds-container {
		max-width: calc(100% - 1.1rem);
	}

	.nds-hero-store__grid {
		grid-template-columns: 1fr;
	}

	.nds-subject-cards {
		grid-template-columns: 1fr;
	}

	.nds-shelf__item {
		width: min(10.5rem, 68vw);
	}

	.nds-trust-strip__grid {
		grid-template-columns: 1fr;
	}

	.nds-promo {
		padding: 1.1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nds-cat-tile,
	.nds-shelf__item .nds-product-card,
	.nds-subject-card {
		transition: none;
	}
}

/* —— Phase 5.4.1 visual rhythm —— */
.nds-home--bookstore .nds-shelf:nth-of-type(even) {
	background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(247,243,234,0.65));
	padding-top: 1.6rem;
	padding-bottom: 1rem;
	margin-top: 0.35rem;
}

.nds-promo--hero {
	box-shadow: 0 18px 40px rgba(11, 31, 51, 0.1);
}

.nds-promo__cover {
	filter: drop-shadow(0 18px 24px rgba(11, 31, 51, 0.28));
}

.nds-shelf__title {
	letter-spacing: -0.02em;
}

.nds-product-card--shelf {
	border-radius: 0.85rem;
}
