/* ---------------------------------------------------------------------------
   Shop / category archive / product search.
   Layout from the source archive template (post-5574): 33/66 split, rail hidden
   below 768px, 3-up grid, toolbar above, numbered pagination below.
   --------------------------------------------------------------------------- */

.nx-shop { padding-block: 36px 60px; }

.nx-shop__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: 30px var(--nx-widget-gap);
	align-items: start;
}

/* --- Rail ---------------------------------------------------------------- */

/* Measured: the rail headings are accent purple, not ink. The colour has to sit
   on the heading itself as well as the link — the diff reads the h3. */
.nx-shop__rail-title {
	margin: 0 0 12px;
	padding-top: 6px;
	font-size: 22px;
	line-height: 32px;
	color: var(--nx-purple);
}
.nx-shop__rail-title a { color: inherit; }
.nx-shop__rail-title a:hover { color: var(--nx-purple-deep); }

.nx-shop__rail .nx-titlelist { margin-bottom: 26px; }

/* Measured: the archive rail runs 16px/32px; the homepage list is 15px/25px. */
.nx-shop__rail .nx-titlelist a { font-size: 16px; line-height: 32px; }

/* --- Main ---------------------------------------------------------------- */

/* Measured: 28px in the accent purple, not the 38px navy h2 scale. */
.nx-shop__title {
	margin: 0 0 14px;
	font-size: 28px;
	color: var(--nx-purple);
}

.nx-shop__intro {
	margin-bottom: 20px;
	font-size: 15px;
	line-height: 1.8;
}

/* --- Toolbar ------------------------------------------------------------- */

.nx-shop__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 12px 0 18px;
	margin-bottom: 6px;
	border-bottom: 1px solid var(--nx-rule);
}

.nx-shop__toolbar-left,
.nx-shop__toolbar-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

.nx-shop__toolbar .woocommerce-result-count {
	margin: 0;
	font-size: 14px;
	color: var(--nx-muted);
}

.nx-shop__toolbar .woocommerce-ordering { margin: 0; }
.nx-shop__toolbar .woocommerce-ordering select {
	width: auto;
	min-width: 220px;
	padding-block: 9px;
	font-size: 14px;
}

.nx-viewtoggle {
	display: inline-flex;
	border: 1px solid var(--nx-rule);
	border-radius: var(--nx-radius);
	overflow: hidden;
}

.nx-viewtoggle__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 0;
	background: var(--nx-white);
	color: var(--nx-muted);
	cursor: pointer;
	transition: background var(--nx-transition), color var(--nx-transition);
}
.nx-viewtoggle__btn svg { fill: currentColor; }
.nx-viewtoggle__btn + .nx-viewtoggle__btn { border-left: 1px solid var(--nx-rule); }
.nx-viewtoggle__btn:hover { color: var(--nx-purple); }
.nx-viewtoggle__btn.is-active { background: var(--nx-purple); color: var(--nx-white); }

/* List view — one column, image beside the summary. */
.nx-products.is-list { --nx-cols: 1; gap: 20px; }
.nx-products.is-list .nx-card {
	display: grid;
	grid-template-columns: 160px minmax(0, 1fr);
	gap: 20px;
	align-items: center;
	text-align: left;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--nx-rule);
}
.nx-products.is-list .nx-card__body { padding-top: 0; }
.nx-products.is-list .nx-card__title { font-size: 18px; }

/* --- Empty state --------------------------------------------------------- */

.nx-shop__empty {
	padding: 50px 20px;
	text-align: center;
	border: 1px dashed var(--nx-rule);
	border-radius: var(--nx-radius-lg);
}
.nx-shop__empty p { margin-bottom: 18px; font-size: 16px; }

/* --- Pagination ---------------------------------------------------------- */

.woocommerce-pagination { margin-top: 36px; }

.woocommerce-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 0;
}

.woocommerce-pagination ul.page-numbers li { border: 0; margin: 0; }

.woocommerce-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--nx-rule);
	border-radius: var(--nx-radius);
	background: var(--nx-white);
	color: var(--nx-ink);
	font-size: 14px;
	font-weight: 600;
	transition: background var(--nx-transition), border-color var(--nx-transition), color var(--nx-transition);
}

.woocommerce-pagination .page-numbers:hover,
.woocommerce-pagination .page-numbers.current {
	background: var(--nx-purple);
	border-color: var(--nx-purple);
	color: var(--nx-white);
}

/* --- Breakpoints --------------------------------------------------------- */

@media (max-width: 1024px) {
	.nx-shop__grid { grid-template-columns: minmax(0, 1fr); }
	.nx-shop__rail { display: none; }
}

@media (max-width: 767px) {
	.nx-shop__toolbar { flex-direction: column; align-items: stretch; }
	.nx-shop__toolbar-right { justify-content: space-between; }
	.nx-shop__toolbar .woocommerce-ordering { flex: 1 1 auto; }
	.nx-shop__toolbar .woocommerce-ordering select { width: 100%; min-width: 0; }
	.nx-products.is-list .nx-card { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
}
