/* Needlic product cards - shop, categories, homepage product sections,
   upsells and related products. Same design language as the product page
   buttons (brand blue var(--nd-primary), soft indigo secondary). */

.product-small.col {
	--ndl-ink: var(--nd-ink);
	--ndl-muted: var(--nd-muted);
	--ndl-line: var(--nd-line);
	--ndl-soft: var(--nd-soft);
}

/* Card shell */
.product-small.col > .col-inner {
	height: 100%;
	display: flex;
	flex-direction: column;
	background: transparent !important;
	box-shadow: none !important; /* Flatsome's card shadow; the card itself has its own */
}
.product-small.col .product-small.box {
	height: 100%;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--ndl-line);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
	transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.product-small.col .product-small.box:hover {
	transform: translateY(-3px);
	border-color: #d7dde8;
	box-shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 18px 36px -18px rgba(15, 23, 42, .28);
}
.product-small.col > .col-inner > .product-small.box { flex: 1; }

/* Image: same frame for every product */
.product-small.col .box-image {
	background: var(--ndl-soft);
	border-radius: 0;
}
.product-small.col .box-image img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	padding: 14px;
	transition: transform .35s ease;
}
.product-small.col .product-small.box:hover .box-image img { transform: scale(1.03); }

/* Text */
.product-small.col .box-text {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 16px !important;
	text-align: left;
}
.product-small.col .box-text .category {
	font-size: 11px;
	letter-spacing: .08em;
	color: var(--ndl-muted);
	opacity: 1;
	margin: 0 0 2px;
}
.product-small.col .box-text .product-title {
	font-size: 15px;
	line-height: 1.4;
	font-weight: 600;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.8em;
}
.product-small.col .box-text .product-title a { color: var(--ndl-ink); }
.product-small.col .box-text .product-title a:hover { color: var(--nd-primary-600); }
.product-small.col .box-text .price-wrapper { margin-top: 2px; }
.product-small.col .box-text .price {
	font-size: 18px;
	font-weight: 700;
	color: var(--ndl-ink);
}
.product-small.col .box-text .price del { font-size: .75em; color: var(--ndl-muted); font-weight: 500; }
.product-small.col .box-text .price ins { text-decoration: none; }
.product-small.col .box-text .price .amount { color: inherit; }
.product-small.col .box-text > * { margin-left: 0; margin-right: 0; }

/* Stars/review counts never show in cards */
.product-small.col .box-text .star-rating,
.product-small.col .box-text .review-count { display: none !important; }

/* ---------- Add to Cart (cards + related products) ---------- */

.ndl-cta { margin-top: auto; padding-top: 8px; width: 100%; align-self: stretch; }

.ndl-cta .ndl-atc,
.ndl-cta .button.ndl-atc {
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	height: 44px;
	margin: 0 !important;
	padding: 0 14px !important;
	border-radius: 11px !important;
	border: 1px solid var(--nd-primary-200) !important;
	background: var(--nd-primary-50) !important;
	color: var(--nd-primary-800) !important;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .01em;
	line-height: 1 !important;
	text-transform: none !important;
	box-shadow: none;
	overflow: hidden;
	transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.ndl-cta .ndl-atc::before {
	content: "";
	width: 17px;
	height: 17px;
	flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h14l-1.2 11.1a2 2 0 0 1-2 1.9H8.2a2 2 0 0 1-2-1.9Z'/%3E%3Cpath d='M9 8V6.5a3 3 0 0 1 6 0V8'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h14l-1.2 11.1a2 2 0 0 1-2 1.9H8.2a2 2 0 0 1-2-1.9Z'/%3E%3Cpath d='M9 8V6.5a3 3 0 0 1 6 0V8'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Hover: fills with the Buy Now gradient */
.ndl-cta .ndl-atc:hover,
.ndl-cta .ndl-atc:focus-visible {
	color: #fff !important;
	border-color: var(--nd-primary-700) !important;
	background: var(--nd-primary-600) linear-gradient(180deg, var(--nd-primary-400) 0%, var(--nd-primary) 45%, var(--nd-primary-600) 100%) !important;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 10px 20px -10px rgba(var(--nd-primary-rgb), .7);
}
.ndl-cta .ndl-atc:active { transform: scale(.98); }
.ndl-cta .ndl-atc:focus-visible { outline: 3px solid rgba(var(--nd-primary-rgb), .35); outline-offset: 2px; }

/* AJAX states */
.ndl-cta .ndl-atc.loading { opacity: .85; pointer-events: none; }
.ndl-cta .ndl-atc.loading::before {
	-webkit-mask: none;
	mask: none;
	background: none;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	width: 14px;
	height: 14px;
	animation: ndl-spin .7s linear infinite;
}
.ndl-cta .ndl-atc.loading::after { display: none !important; }
.ndl-cta .ndl-atc.added {
	color: #166534 !important;
	background: #f0fdf4 !important;
	border-color: #bbf7d0 !important;
}
.ndl-cta .ndl-atc.added::before {
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ndl-cta .ndl-atc.added::after { display: none !important; } /* Flatsome adds its own tick */
.ndl-cta .added_to_cart {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	color: var(--nd-primary-600);
}
@keyframes ndl-spin { to { transform: rotate(360deg); } }

/* Quick view link sits on the image; keep it tidy */
.product-small.col .grid-tools a { border-radius: 0 0 0 0; font-weight: 600; }

@media (max-width: 549px) {
	.product-small.col .product-small.box { border-radius: 14px; }
	.product-small.col .box-text { padding: 10px 10px 12px !important; gap: 4px; }
	.product-small.col .box-text .product-title { font-size: 13.5px; }
	.product-small.col .box-text .price { font-size: 16px; }
	.product-small.col .box-image img { padding: 8px; }
	.ndl-cta .ndl-atc, .ndl-cta .button.ndl-atc { height: 40px; min-height: 40px; font-size: 13px; padding: 0 8px !important; gap: 6px; }
	.ndl-cta .ndl-atc::before { width: 15px; height: 15px; }
}

/* ---------- Homepage: 7 category cards, centered rows ---------- */
.nlx .nlx-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px;
}
.nlx .nlx-grid > .nlx-card { flex: 0 0 calc((100% - 6 * 14px) / 7); min-width: 0; }
@media (max-width: 1099px) {
	.nlx .nlx-grid > .nlx-card { flex-basis: calc((100% - 3 * 14px) / 4); }
}
@media (max-width: 640px) {
	.nlx .nlx-grid { gap: 12px; }
	.nlx .nlx-grid > .nlx-card { flex-basis: calc((100% - 12px) / 2); }
}

/* Homepage product sections */
.ndl-home-products .section-title-container { margin-bottom: 14px; }
.ndl-home-products .section-title a { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) {
	.product-small.col .product-small.box,
	.product-small.col .box-image img,
	.ndl-cta .ndl-atc { transition: none; }
	.product-small.col .product-small.box:hover { transform: none; }
}
