/* ----------------------------------------------------------- Header badge */

.nsd-badge {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border: 1.5px solid var(--nsd-fg);
	border-radius: var(--nsd-radius);
	color: var(--nsd-fg);
	font-family: var(--nsd-sans);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.3s, color 0.3s;
}

.nsd-badge:hover {
	background: var(--nsd-fg);
	color: var(--nsd-bg);
}

.nsd-badge__count {
	position: absolute;
	top: -8px;
	right: -8px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--nsd-accent);
	color: #fff;
	border-radius: 999px;
	font-size: 0.62rem;
	font-weight: 700;
	line-height: 1;
}

.nsd-badge__count[data-count="0"] {
	display: none;
}

/*
 * Card call to action. It lives inside the theme's product card, outside the
 * `.nsd` scope, so every declaration has to stand on its own.
 */
.nsd-loop-button {
	display: block;
	width: 100%;
	margin-top: 0.75rem;
	padding: 0.7rem 1rem !important;
	background-color: #85be14 !important;
	color: #fff !important;
	border: 1.5px solid #85be14 !important;
	border-radius: 2px !important;
	font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-size: 0.72rem;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.16s ease, border-color 0.16s ease;
}

.nsd-loop-button:hover,
.nsd-loop-button:focus-visible {
	background-color: #72a810 !important;
	border-color: #72a810 !important;
	color: #fff !important;
}

.nsd-loop-button::before,
.nsd-loop-button::after {
	display: none !important;
	content: none !important;
}

/* Secondary variant : the product exists but cannot be bought right now. */
.nsd-loop-button--ghost {
	background-color: transparent !important;
	border-color: #1a1c1e !important;
	color: #1a1c1e !important;
}

.nsd-loop-button--ghost:hover,
.nsd-loop-button--ghost:focus-visible {
	background-color: #1a1c1e !important;
	border-color: #1a1c1e !important;
	color: #fff !important;
}

/* ------------------------------------------------- Interaction refinements */

/*
 * `hidden` has to win against theme rules that force `display` on layout
 * containers, otherwise the empty state and the basket would stack.
 */
.nsd [hidden] {
	display: none !important;
}

/*
 * Selections must feel instantaneous. The previous 0.2s–0.3s curves read as lag
 * on a page where a visitor clicks a dozen options in a row.
 */
.nsd .nsd-option,
.nsd .nsd-extra,
.nsd .nsd-qty__btn,
.nsd .nsd-mini-qty button {
	transition-duration: 0.12s;
}

.nsd .nsd-btn {
	transition-duration: 0.16s;
}

.nsd .nsd-option:active,
.nsd .nsd-extra:active,
.nsd .nsd-swatch:active {
	transform: scale(0.97);
}

/* Visible keyboard focus everywhere, including inside themed buttons. */
.nsd :focus-visible {
	outline: 2px solid var(--nsd-primary);
	outline-offset: 2px;
}

/* Selected states deserve more than a colour change. */
.nsd .nsd-option.is-selected {
	box-shadow: 0 2px 8px color-mix(in srgb, var(--nsd-primary) 35%, transparent);
}

.nsd .nsd-extra.is-selected {
	box-shadow: inset 0 0 0 1px var(--nsd-primary);
}

/* Confirmation shown on the add button once the server has stored the line. */
.nsd .nsd-btn.is-added {
	background-color: var(--nsd-secondary);
	color: #fff;
}

/* A line being removed collapses instead of blinking out. */
.nsd .nsd-line {
	transition: opacity 0.16s ease, transform 0.16s ease;
}

.nsd .nsd-line.is-removing {
	opacity: 0.45;
	transform: scale(0.99);
	pointer-events: none;
}

/* Secondary, destructive-ish action : readable, never mistaken for a CTA. */
.nsd .nsd-linkbtn {
	align-self: center;
	padding: 0.4rem 0.5rem;
	border: 0 !important;
	background: none !important;
	color: var(--nsd-muted-fg) !important;
	font-family: var(--nsd-sans);
	font-size: 0.75rem;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.nsd .nsd-linkbtn:hover {
	color: #b3261e !important;
}

.nsd-basket__lead {
	margin: -0.75rem 0 1.75rem;
	max-width: 56ch;
	font-size: 0.92rem;
	color: var(--nsd-muted-fg);
}

.nsd-aside__note {
	margin: 0;
	text-align: center;
	font-size: 0.72rem;
	color: var(--nsd-muted-fg);
}

/* The summary is the decision aid : give it the weight of one. */
.nsd .nsd-summary {
	border-left: 3px solid var(--nsd-primary);
}

/* ------------------------------------------------------ Theme button reset */

/*
 * Woodmart repaints every `<button>` element on the page : grey background, no
 * border, no radius, its own typography. Our controls are buttons, so without
 * this block the swatches, the options, the extras and — worst of all — the
 * primary call to action all render as the same grey rectangle.
 *
 * The single-class rules above lose to the theme's own selectors, hence the
 * explicit overrides here. They are deliberately grouped in one place so the
 * cost of coexisting with the theme stays visible and easy to revisit.
 */
.nsd button {
	appearance: none;
	-webkit-appearance: none;
	font-family: var(--nsd-sans);
	line-height: 1.4;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	min-width: 0;
}

.nsd .nsd-option,
.nsd .nsd-extra,
.nsd .nsd-qty__btn,
.nsd .nsd-mini-qty button {
	background-color: var(--nsd-card) !important;
	color: var(--nsd-fg) !important;
	border: 1px solid var(--nsd-border) !important;
	border-radius: var(--nsd-radius) !important;
}

.nsd .nsd-extra {
	color: var(--nsd-muted-fg) !important;
}

.nsd .nsd-option:hover,
.nsd .nsd-extra:hover,
.nsd .nsd-qty__btn:hover,
.nsd .nsd-mini-qty button:hover {
	border-color: var(--nsd-primary) !important;
	color: var(--nsd-fg) !important;
}

.nsd .nsd-option.is-selected {
	background-color: var(--nsd-primary) !important;
	border-color: var(--nsd-primary) !important;
	color: #fff !important;
}

.nsd .nsd-extra.is-selected {
	background-color: color-mix(in srgb, var(--nsd-primary) 10%, var(--nsd-card)) !important;
	border-color: var(--nsd-primary) !important;
	color: var(--nsd-fg) !important;
}

/* The call to action must read as the call to action. */
.nsd button.nsd-btn--gold,
.nsd a.nsd-btn--gold {
	background-color: var(--nsd-primary) !important;
	border-color: var(--nsd-primary) !important;
	color: #fff !important;
	border-radius: var(--nsd-radius) !important;
	text-transform: uppercase;
	letter-spacing: 0.18em;
}

.nsd button.nsd-btn--gold:hover:not(:disabled),
.nsd a.nsd-btn--gold:hover {
	background-color: var(--nsd-primary-dark) !important;
}

.nsd button.nsd-btn--outline,
.nsd a.nsd-btn--outline {
	background-color: transparent !important;
	border: 1.5px solid var(--nsd-fg) !important;
	color: var(--nsd-fg) !important;
	border-radius: var(--nsd-radius) !important;
}

.nsd button.nsd-btn--outline:hover,
.nsd a.nsd-btn--outline:hover {
	background-color: var(--nsd-fg) !important;
	color: var(--nsd-bg) !important;
}

.nsd .nsd-btn.is-added {
	background-color: var(--nsd-secondary) !important;
	border-color: var(--nsd-secondary) !important;
	color: #fff !important;
}

/* -------------------------------------------------- Same-family navigation */

.nsd-siblings {
	margin: 3rem 0;
	padding: 2rem 0 0;
	border-top: 1px solid var(--nsd-border);
}

.nsd-siblings__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	margin-bottom: 1.5rem;
}

.nsd-siblings__title {
	margin: 0;
	font-family: var(--nsd-serif);
	font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
	font-weight: 600;
	line-height: 1.15;
}

.nsd-siblings__all {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--nsd-primary);
	text-decoration: none;
	white-space: nowrap;
	border-bottom: 1px solid transparent;
}

.nsd-siblings__all:hover {
	border-bottom-color: var(--nsd-primary);
	color: var(--nsd-primary-dark);
}

.nsd-siblings__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.nsd-siblings__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.nsd-siblings__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.nsd-sibling {
	margin: 0;
	list-style: none;
}

.nsd-sibling__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--nsd-card);
	border: 1px solid var(--nsd-border);
	border-radius: var(--nsd-radius);
	overflow: hidden;
	text-decoration: none;
	color: var(--nsd-fg);
	transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.nsd-sibling__link:hover {
	border-color: var(--nsd-primary);
	transform: translateY(-2px);
	box-shadow: var(--nsd-shadow);
	color: var(--nsd-fg);
}

.nsd-sibling__media {
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--nsd-muted);
	overflow: hidden;
}

.nsd-sibling__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nsd-sibling__name {
	display: -webkit-box;
	min-height: 3.25em;
	padding: 0.875rem 1rem 0.5rem;
	font-family: var(--nsd-serif);
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.25;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.nsd-sibling__cta {
	display: block;
	margin-top: auto;
	padding: 0 1rem 1rem;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--nsd-primary);
}

@media (prefers-reduced-motion: reduce) {
	.nsd *,
	.nsd *::before,
	.nsd *::after {
		transition: none !important;
		animation: none !important;
	}
}

