/*
 * NEXMART design layer (theme 0.3): header, mobile bar, page banners, home sections,
 * footer columns, cart and product polish. Colours and sizes come from the tokens in
 * base.css (--nx-*), so every preset and dark mode keeps working.
 */

/* ---------- Header ---------- */

.nx-header {
	background: var(--nx-base);
	border-bottom: 1px solid var(--nx-border);
}

.nx-header--sticky {
	box-shadow: 0 1px 0 var(--nx-border);
}

.nx-header__device .nx-header__row--top {
	background: var(--nx-surface);
	font-size: 0.8125rem;
	color: var(--nx-muted);
}

.nx-header__row--main {
	align-items: center;
	padding-block: 0.875rem;
}

.nx-header__logo {
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--nx-text);
	text-decoration: none;
}

.nx-header__search input[type="search"] {
	border-radius: 999px;
	padding-inline: 1rem;
	background: var(--nx-surface);
	border-color: transparent;
}

.nx-header__search input[type="search"]:focus {
	border-color: var(--nx-accent);
	background: var(--nx-base);
	outline: none;
}

.nx-header__cart,
.nx-header__account {
	font-weight: 600;
	text-decoration: none;
}

.nx-header__count {
	display: inline-grid;
	place-items: center;
	min-width: 1.25rem;
	height: 1.25rem;
	padding-inline: 0.3rem;
	margin-left: 0.25rem;
	font-size: 0.75rem;
	color: var(--nx-base);
	background: var(--nx-accent);
	border-radius: 999px;
}

.nx-header__menu-list > li > a {
	font-weight: 600;
	padding-block: 0.25rem;
	text-decoration: none;
}

/* ---------- Mobile bar (phones only) ---------- */

.nx-mobile-bar {
	display: none;
}

@media (max-width: 959px) {
	.nx-mobile-bar {
		position: fixed;
		inset: auto 0 0 0;
		z-index: 200;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
		background: var(--nx-base);
		border-top: 1px solid var(--nx-border);
		box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
	}

	.nx-mobile-bar__item {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 3.5rem;
		padding-inline: 0.25rem;
		font-size: 0.8125rem;
		font-weight: 600;
		color: var(--nx-text);
		text-decoration: none;
		text-align: center;
	}

	/* Keep page content clear of the fixed bar. */
	body {
		padding-bottom: 3.5rem;
	}
}

/* ---------- Page banner (title block with a photo or a tint) ---------- */

.nx-banner {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 180px;
	padding: 2.5rem 1rem;
	text-align: center;
	color: var(--nx-text);
	background: var(--nx-surface);
	border-bottom: 1px solid var(--nx-border);
}

.nx-banner h1 {
	margin: 0;
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	letter-spacing: -0.02em;
}

.nx-banner__crumbs {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--nx-muted);
}

/* ---------- Home sections ---------- */

.nx-section {
	margin-block: 3rem;
}

.nx-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.nx-section__title {
	margin: 0;
	font-size: 1.5rem;
	letter-spacing: -0.01em;
}

.nx-section__more {
	font-weight: 600;
	color: var(--nx-accent);
	text-decoration: none;
}

.nx-hero {
	display: grid;
	gap: 1.5rem;
	align-items: center;
	padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem);
	background: var(--nx-surface);
	border-radius: calc(var(--nx-radius) * 2);
}

@media (min-width: 760px) {
	.nx-hero {
		grid-template-columns: 1.2fr 1fr;
	}
}

.nx-hero__kicker {
	margin: 0 0 0.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--nx-accent);
}

.nx-hero__title {
	margin: 0 0 1rem;
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	line-height: 1.1;
	letter-spacing: -0.03em;
	color: var(--nx-text);
}

.nx-hero__text {
	margin: 0 0 1.5rem;
	max-width: 36ch;
	color: var(--nx-muted);
}

.nx-btn--ghost {
	background: transparent;
	color: var(--nx-text);
	border: 1px solid var(--nx-border);
}

.nx-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nx-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 1rem;
	text-align: center;
	color: var(--nx-text);
	text-decoration: none;
	background: var(--nx-base);
	border: 1px solid var(--nx-border);
	border-radius: var(--nx-radius);
}

.nx-tile:hover,
.nx-tile:focus-visible {
	border-color: var(--nx-accent);
}

.nx-tile__count {
	font-size: 0.8125rem;
	color: var(--nx-muted);
}

.nx-brands {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem 2rem;
	padding: 1.5rem 0;
	margin-block: 2rem;
	border-block: 1px solid var(--nx-border);
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--nx-muted);
	list-style: none;
}

/* ---------- Shop layout: filter sidebar, toolbar, grid ---------- */

.nx-catalog__layout {
	display: grid;
	gap: 2rem;
	align-items: start;
}

.nx-catalog__side-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 2.75rem;
	padding: 0.5rem 1rem;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
	border: 1px solid var(--nx-border);
	border-radius: var(--nx-radius);
	background: var(--nx-base);
}

.nx-catalog__side-toggle::-webkit-details-marker {
	display: none;
}

.nx-catalog__side-toggle::after {
	content: "+";
	font-size: 1.25rem;
	line-height: 1;
}

.nx-catalog__side[open] > .nx-catalog__side-toggle::after {
	content: "−";
}

@media (min-width: 900px) {
	.nx-catalog__layout {
		grid-template-columns: 260px minmax(0, 1fr);
	}

	/* Wide screens keep the filters open and visible; the toggle is not needed. */
	.nx-catalog__side-toggle {
		display: none;
	}

	.nx-catalog__side {
		position: sticky;
		top: 6rem;
	}
}

.nx-catalog__side .nx-catalog__filters {
	display: grid;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
}

.nx-catalog__side .nx-catalog__field,
.nx-catalog__side .nx-catalog__price {
	width: 100%;
}

.nx-catalog__side .nx-catalog__price input[type="number"] {
	width: 45%;
}

.nx-catalog__side .nx-catalog__actions {
	display: flex;
	gap: 0.75rem;
	align-items: center;
}

.nx-catalog__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding-bottom: 1rem;
	margin-bottom: 1.25rem;
	border-bottom: 1px solid var(--nx-border);
}

.nx-catalog__toolbar .nx-catalog__count {
	margin: 0;
}

.nx-catalog__sort {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nx-catalog__sort label {
	font-size: 0.875rem;
	color: var(--nx-muted);
}

/* ---------- Shop polish ---------- */

.nx-card__price del {
	color: var(--nx-muted);
	font-weight: 400;
	margin-right: 0.35rem;
}

.nx-card__price ins {
	text-decoration: none;
	color: var(--nx-text);
}

.nx-badge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	padding: 0.2rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--nx-base);
	background: var(--nx-accent);
	border-radius: 999px;
}

.nx-card__media {
	position: relative;
}

.nx-card__title {
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
}

/* ---------- Cart and checkout ---------- */

.nx-cart .wc-block-cart,
.nx-checkout .wc-block-checkout {
	max-width: 100%;
}

/* ---------- Footer columns ---------- */

.nx-footer-cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 2rem;
	padding-block: 3rem;
	border-top: 1px solid var(--nx-border);
}

.nx-footer-cols h2 {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--nx-muted);
}

.nx-footer-cols ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nx-footer-cols li {
	margin-block: 0.4rem;
}

.nx-footer-cols a {
	color: var(--nx-text);
	text-decoration: none;
}

.nx-footer-cols a:hover {
	color: var(--nx-accent);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.nx-tile {
		transition: none;
	}
}

/* ---------- Hero picture block ---------- */

.nx-hero__media {
	min-height: 280px;
	border-radius: var(--nx-radius);
	background:
		linear-gradient(135deg, color-mix(in srgb, var(--nx-accent) 35%, transparent), transparent 70%),
		var(--nx-base);
	border: 1px solid var(--nx-border);
}

@media (max-width: 759px) {
	.nx-hero__media {
		min-height: 180px;
	}
}

/* ---------- Blog list and single post ---------- */

.wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.5rem;
	list-style: none;
	padding: 0;
}

.wp-block-post-title a {
	color: var(--nx-text);
	text-decoration: none;
}

.wp-block-post-excerpt__excerpt {
	color: var(--nx-muted);
}

/* ---------- Product page title and spacing ---------- */

.nx-product .wp-block-post-title {
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	letter-spacing: -0.015em;
}

.nx-product .wp-block-woocommerce-product-price {
	font-size: 1.25rem;
	font-weight: 600;
}

/* ==========================================================================
   Design layer 0.4: paper and ink. One signal accent, a display face for
   headings, real product photos, hairlines instead of boxes. Weights stay at
   400 / 500 / 600; motion uses 150 to 300 ms and transform / opacity only.
   ========================================================================== */

:root {
	--nx-display: "Bricolage Grotesque", var(--nx-font);
}

h1,
h2,
h3,
.nx-hero__title,
.nx-section__title,
.nx-banner h1 {
	font-family: var(--nx-display);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

:where(a, button, input, select, summary):focus-visible {
	outline: 2px solid var(--nx-accent);
	outline-offset: 3px;
	border-radius: 2px;
}

/* Header: wordmark with a signal dot, underline on navigation hover. */
.nx-header__row--top {
	background: var(--nx-surface);
}

.nx-header__logo {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-family: var(--nx-display);
	font-size: 1.35rem;
	font-weight: 600;
	letter-spacing: -0.02em;
}

.nx-header__logo::before {
	content: "";
	width: 0.55rem;
	height: 0.55rem;
	border-radius: 50%;
	background: var(--nx-accent);
}

.nx-header__menu-list > li > a {
	position: relative;
}

.nx-header__menu-list > li > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -0.25rem;
	height: 2px;
	background: var(--nx-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 200ms ease-out;
}

.nx-header__menu-list > li > a:hover::after,
.nx-header__menu-list > li > a[aria-current="page"]::after {
	transform: scaleX(1);
}

/* Buttons: one solid accent, a ghost variant for secondary actions. */
.nx-btn,
.nx-card__cart.button,
.button.add_to_cart_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0 1.25rem;
	border: 0;
	border-radius: var(--nx-radius);
	background: var(--nx-accent);
	color: var(--nx-base);
	font-weight: 600;
	text-decoration: none;
	transition: filter 150ms ease-out;
}

.nx-btn:hover {
	filter: brightness(0.92);
}

.nx-btn--ghost {
	background: transparent;
	color: var(--nx-text);
	border: 1px solid var(--nx-border);
}

.nx-btn--ghost:hover {
	filter: none;
	border-color: var(--nx-text);
}

/* Home hero: text on the left, a real product photo on a paper tile on the right. */
.nx-hero {
	background: transparent;
	border-radius: 0;
	border-bottom: 1px solid var(--nx-border);
	padding: clamp(2rem, 5vw, 4.5rem) 0;
	gap: clamp(1.5rem, 4vw, 4rem);
}

.nx-hero__kicker {
	color: var(--nx-accent);
	font-weight: 600;
}

.nx-hero__title {
	font-size: clamp(2.5rem, 5.2vw, 4.5rem);
	line-height: 1.02;
	letter-spacing: -0.035em;
}

.nx-hero__text {
	max-width: 42ch;
	font-size: 1.125rem;
}

.nx-hero__media {
	margin: 0;
	display: grid;
	place-items: center;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--nx-surface);
	border: 0;
	border-radius: calc(var(--nx-radius) * 2);
}

.nx-hero__media a {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
}

.nx-hero__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 8%;
}

/* Sections: a hairline above each heading instead of stacked boxes. */
.nx-section {
	margin-block: 3.5rem;
}

.nx-section__head {
	border-top: 1px solid var(--nx-border);
	padding-top: 1.25rem;
}

.nx-section__more {
	font-weight: 600;
}

/* Product cards: photo on a paper tile, title, price, options hint. */
.nx-card__media {
	aspect-ratio: 1 / 1;
	border: 0;
	border-radius: var(--nx-radius);
	background: var(--nx-surface);
}

.nx-card__media img {
	object-fit: contain;
	padding: 10%;
	transition: transform 200ms ease-out;
}

.nx-card:hover .nx-card__media img {
	transform: scale(1.03);
}

.nx-card__title {
	font-family: var(--nx-display);
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.nx-card__price {
	font-size: 1rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.nx-card__cart {
	color: var(--nx-accent);
	font-weight: 600;
	text-decoration: none;
}

.nx-card__cart:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Catalog: the filter panel is a bordered surface; the empty state keeps the page frame. */
.nx-catalog__side .nx-catalog__filters {
	background: var(--nx-surface);
	border: 1px solid var(--nx-border);
	border-radius: var(--nx-radius);
	padding: 1.25rem;
}

.nx-catalog__empty {
	display: grid;
	justify-items: center;
	gap: 0.75rem;
	padding: 2.5rem 1.5rem;
	text-align: center;
	background: var(--nx-surface);
	border: 1px dashed var(--nx-border);
	border-radius: var(--nx-radius);
}

.nx-catalog__empty-title {
	margin: 0;
	font-family: var(--nx-display);
	font-size: 1.25rem;
	font-weight: 600;
}

.nx-catalog__empty p {
	margin: 0;
	color: var(--nx-muted);
}

/* Footer: a single hairline and the four columns. */
.nx-site-footer {
	border-top: 1px solid var(--nx-border);
}

/* One orchestrated moment on load: the hero rises in once. */
@keyframes nx-rise {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.nx-hero__title,
.nx-hero__media {
	animation: nx-rise 300ms ease-out both;
}

@media (prefers-reduced-motion: reduce) {
	.nx-hero__title,
	.nx-hero__media,
	.nx-card:hover .nx-card__media img,
	.nx-header__menu-list > li > a::after,
	.nx-btn {
		animation: none;
		transition: none;
		transform: none;
	}
}
