/* NPD product cards — 2-row flex wrap:
 * Row 1: image (107px) + title/price (flex)
 * Row 2: Choose Options CTA (full width)
 */

.npd-card-wrapper,
.products .product.npd-product-card-item,
.npd-fct__item .npd-card-wrapper {
	color: inherit;
	height: 100%;
	position: relative;
	text-decoration: none;
	font-family: 'Outfit', sans-serif;
}

.npd-card {
	--npd-card-radius: 12px;
	--npd-card-fg: #121212;
	--npd-card-bg: #ffffff;
	--npd-card-accent: #459bff;
	--npd-card-image-size: 107px;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	height: 100%;
	position: relative;
	box-sizing: border-box;
	border-radius: var(--npd-card-radius);
	background: var(--npd-card-bg);
	border: 1px solid rgba(18, 18, 18, 0.08);
	box-shadow: 0 2px 8px rgba(18, 18, 18, 0.04);
	overflow: hidden;
	text-align: left;
	color: var(--npd-card-fg);
	padding: 0.75rem 0.75rem 0;
	gap: 0;
}

/* —— Part 1: image —— */
.npd-card__media {
	position: relative;
	flex: 0 0 var(--npd-card-image-size);
	width: var(--npd-card-image-size);
	max-width: var(--npd-card-image-size);
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 8px;
	align-self: flex-start;
}

.npd-card__badge {
	position: absolute;
	z-index: 2;
	left: 0.35rem;
	bottom: 0.35rem;
	top: auto;
	pointer-events: none;
	max-width: calc(100% - 0.5rem);
}

.npd-card__badge-label {
	display: inline-block;
	padding: 0.2rem 0.4rem;
	border-radius: 4px;
	background: #121212;
	color: #fff;
	font-size: 0.55rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.npd-card__media-link {
	display: block;
	height: 100%;
	width: 100%;
}

.npd-card__media-frame {
	display: block;
	position: relative;
	height: 100%;
	width: 100%;
	overflow: hidden;
}

.npd-card__image,
.npd-card__media-frame img,
.npd-card__media-frame .woocommerce-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.25s ease;
}

.npd-card__image--secondary {
	opacity: 0;
}

.npd-card-wrapper:hover .npd-card__media-frame--has-secondary .npd-card__image--primary,
.npd-card-wrapper:focus-within .npd-card__media-frame--has-secondary .npd-card__image--primary {
	opacity: 0;
}

.npd-card-wrapper:hover .npd-card__media-frame--has-secondary .npd-card__image--secondary,
.npd-card-wrapper:focus-within .npd-card__media-frame--has-secondary .npd-card__image--secondary {
	opacity: 1;
}

/* —— Part 2: title + price —— */
.npd-card__information {
	flex: 1 1 calc(100% - var(--npd-card-image-size));
	min-width: 0;
	max-width: calc(100% - var(--npd-card-image-size));
	padding: 0.15rem 0 0.5rem 0.75rem;
	box-sizing: border-box;
	align-self: center;
}

.npd-card__heading {
	margin: 0 0 0.35rem;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.3;
}

.npd-card__title-link {
	color: inherit;
	text-decoration: none;
}

.npd-card__title-link:hover,
.npd-card__title-link:focus-visible {
	text-decoration: underline;
}

.npd-card__price {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--npd-card-fg);
}

.npd-card__price del {
	opacity: 0.55;
	margin-right: 0.35rem;
}

.npd-card__price ins {
	text-decoration: none;
	font-weight: 700;
}

.npd-card .npd-rating {
	margin-top: 0.3rem;
}

.npd-card .npd-rating:empty {
	display: none;
}

/* —— Part 3: Choose Options CTA (full second row) —— */
.npd-card__quick-add {
	flex: 1 1 100%;
	width: calc(100% + 1.5rem);
	max-width: calc(100% + 1.5rem);
	margin: 0.5rem -0.75rem 0;
}

.npd-card__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	width: 100%;
	min-height: 3rem;
	padding: 0.8rem;
	box-sizing: border-box;
	border: 0;
	border-radius: 0 0 var(--npd-card-radius) var(--npd-card-radius);
	background: #00b57a;
	color: #ffffff;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.npd-card__cta:hover,
.npd-card__cta:focus-visible {
	background: #00b57a;
	color: #ffffff;
	text-decoration: none;
	outline: none;
}

.npd-card__cta:focus-visible {
	box-shadow: inset 0 0 0 2px #ffffff, inset 0 0 0 4px #00b57a;
}

.npd-card__cta--sold-out {
	background: #555555;
	color: #ffffff;
	cursor: not-allowed;
	pointer-events: none;
}

.npd-card__cta-label {
	display: inline-block;
}

.npd-card__cta-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 0;
}

.npd-card__cta-icon svg {
	width: 25px;
	height: 25px;
	display: block;
}

/* Shop loop */
.products .product.npd-product-card-item {
	display: flex;
	flex-direction: column;
	list-style: none;
	min-width: 0;
}

.products .product.npd-product-card-item > .npd-card-wrapper {
	width: 100%;
}

/*
 * Category / brand / shop archives:
 * auto-fit columns (max 4), never below 240px.
 * Floor uses max(240px, ~25% of row) so wide screens stay at 4 cols.
 */
.woocommerce [data-products],
[data-products].products,
ul.products[data-products] {
	--npd-shop-card-min: 240px;
	--npd-shop-cols-max: 4;
	--npd-shop-col-floor: min(
		100%,
		max(
			var(--npd-shop-card-min),
			calc((100% - (var(--npd-shop-cols-max) - 1) * var(--grid-columns-gap, 30px)) / var(--npd-shop-cols-max))
		)
	);
	--shop-columns: repeat(auto-fit, minmax(var(--npd-shop-col-floor), 1fr)) !important;
	grid-template-columns: repeat(auto-fit, minmax(var(--npd-shop-col-floor), 1fr)) !important;
}

/* FCT / FC grid items */
.npd-fc__item,
.npd-fct__item {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
}

.npd-fc__item > .npd-card-wrapper,
.npd-fct__item > .npd-card-wrapper {
	width: 100%;
}
