/* Nexsaver Catalog Layout */
:root {
	--nx-ink: #0d2647;
	--nx-text: #5b6b7f;
	--nx-blue: #1f63ad;
	--nx-tile: #eaf2fb;
	--nx-line: #e2e9f1;
	--nx-bg: #f4f7fb;
	--nx-radius: 14px;
}

/* ---------- All-categories grid ---------- */
.nx-cat-grid {
	display: grid;
	grid-template-columns: repeat(var(--nx-cols, 4), minmax(0, 1fr));
	gap: 24px;
	margin: 24px 0;
}
.nx-cat-card {
	display: flex;
	flex-direction: column;
	min-height: 260px;
	padding: 30px;
	background: #fff;
	border: 1px solid var(--nx-line);
	border-radius: 16px;
	text-decoration: none !important;
	color: inherit;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.nx-cat-card:hover,
.nx-cat-card:focus-visible {
	transform: translateY(-3px);
	border-color: #c9d9ec;
	box-shadow: 0 12px 30px -14px rgba(13, 38, 71, .25);
}
.nx-cat-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 14px;
	background: var(--nx-tile);
	color: var(--nx-blue);
	margin-bottom: 22px;
	overflow: hidden;
	flex: none;
}
.nx-cat-ico .nx-ico { width: 32px; height: 32px; }
.nx-cat-ico .nx-ico-img { width: 100%; height: 100%; object-fit: cover; }
.nx-cat-title {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--nx-ink);
	margin-bottom: 8px;
}
.nx-cat-desc {
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--nx-text);
}
.nx-cat-foot {
	margin-top: auto;
	padding-top: 22px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.nx-cat-link { color: var(--nx-blue); font-size: 15px; font-weight: 500; }
.nx-cat-card:hover .nx-cat-link { text-decoration: underline; }
.nx-cat-count { font-size: 12.5px; color: #8a98a8; }

@media (max-width: 1024px) {
	.nx-cat-grid { grid-template-columns: repeat(min(var(--nx-cols, 4), 3), minmax(0, 1fr)); }
}
@media (max-width: 768px) {
	.nx-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
	.nx-cat-card { padding: 18px; min-height: 0; }
	.nx-cat-ico { width: 48px; height: 48px; margin-bottom: 14px; border-radius: 12px; }
	.nx-cat-ico .nx-ico { width: 24px; height: 24px; }
	.nx-cat-title { font-size: 16px; }
	.nx-cat-desc { font-size: 13px; }
	.nx-cat-foot { padding-top: 12px; }
	.nx-cat-count { display: none; }
}

/* ---------- Catalog layout: sidebar + products ---------- */
.nx-shop-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
	width: 100%;
	clear: both;
}
.nx-shop-layout.nx-no-sidebar { grid-template-columns: minmax(0, 1fr); }
.nx-shop-main { min-width: 0; }
.nx-shop-main .woocommerce-result-count { margin: 0 0 16px; font-size: 14px; color: var(--nx-text); }
.nx-shop-main .woocommerce-ordering { margin: 0 0 16px; }

/* Theme sidebars would squeeze us; give the content full width on catalog pages. */
body.nx-has-filters.nx-compact #secondary,
body.nx-has-filters.nx-compact .widget-area.secondary { display: none !important; }
body.nx-has-filters.nx-compact #primary { width: 100% !important; max-width: 100% !important; }

/* Sidebar */
.nx-filters {
	position: sticky;
	top: 24px;
	background: #fff;
	border: 1px solid var(--nx-line);
	border-radius: var(--nx-radius);
	font-size: 14px;
	color: var(--nx-ink);
}
.admin-bar .nx-filters { top: 56px; }
.nx-filters-toggle { display: none; }
.nx-filters-body { padding: 6px 18px 18px; max-height: calc(100vh - 80px); overflow-y: auto; }
.nx-fblock { padding: 16px 0; border-bottom: 1px solid var(--nx-line); }
.nx-fblock:last-of-type { border-bottom: 0; }
.nx-flabel {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #7a889a;
	margin-bottom: 10px;
}
.nx-filters .nx-search { display: flex; border: 1px solid #cfdbe8; border-radius: 10px; overflow: hidden; background: #fff; }
.nx-filters .nx-search:focus-within { border-color: var(--nx-blue); box-shadow: 0 0 0 3px rgba(31, 99, 173, .12); }
.nx-filters .nx-search input {
	flex: 1; min-width: 0; border: 0 !important; outline: 0; box-shadow: none !important;
	padding: 9px 12px !important; font-size: 14px; background: transparent; margin: 0;
}
.nx-filters .nx-search button {
	border: 0; background: var(--nx-tile); color: var(--nx-blue); width: 40px; padding: 0;
	cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.nx-filters .nx-search button svg { width: 18px; height: 18px; }
/* 1.4.1: the header search form shares the class name; its AJAX results list must not be clipped. */
form.nx-search[data-nst-search] { overflow: visible; }

.nx-catlist, .nx-checklist { list-style: none; margin: 0; padding: 0; }
.nx-catlist li a {
	display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px;
	border-radius: 8px; color: var(--nx-ink); text-decoration: none; line-height: 1.3;
}
.nx-catlist li a:hover { background: var(--nx-bg); }
.nx-catlist li.is-current a { background: var(--nx-tile); color: var(--nx-blue); font-weight: 600; }
.nx-catlist li.nx-back a { color: var(--nx-blue); font-size: 13px; }
.nx-mini-ico {
	flex: none; width: 28px; height: 28px; border-radius: 7px; background: var(--nx-tile);
	color: var(--nx-blue); display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
}
.nx-mini-ico .nx-ico { width: 16px; height: 16px; }
.nx-mini-ico .nx-ico-img { width: 100%; height: 100%; object-fit: cover; }
.nx-cname { flex: 1; min-width: 0; }
.nx-count { margin-left: auto; font-size: 12px; color: #8a98a8; font-weight: 400; }

.nx-checklist { max-height: 260px; overflow-y: auto; }
.nx-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-weight: 400; margin: 0; }
.nx-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--nx-blue); flex: none; }
.nx-check > span:not(.nx-count):not(.nx-blogo) { flex: 1; }
.nx-list-filter {
	width: 100%; margin: 0 0 8px; padding: 7px 10px !important; font-size: 13px;
	border: 1px solid #cfdbe8; border-radius: 8px;
}
.nx-price { display: flex; align-items: center; gap: 8px; }
.nx-price input {
	width: 100%; min-width: 0; padding: 8px 10px !important; font-size: 14px;
	border: 1px solid #cfdbe8; border-radius: 8px; margin: 0;
}
.nx-factions { display: flex; align-items: center; gap: 12px; padding-top: 14px; }
.nx-apply {
	flex: 1; background: var(--nx-blue) !important; color: #fff !important; border: 0;
	border-radius: 10px; padding: 10px 14px !important; font-size: 14px; font-weight: 600; cursor: pointer;
}
.nx-apply:hover { background: #174f8c !important; }
.nx-clear { color: var(--nx-text); font-size: 13px; text-decoration: underline; }
.nx-dot { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; margin-left: 4px; }

/* ---------- Compact product cards ---------- */
body.nx-compact .nx-shop-main ul.products {
	display: grid !important;
	grid-template-columns: repeat(var(--nx-pcols, 4), minmax(0, 1fr)) !important;
	gap: 16px !important;
	margin: 0 0 24px !important;
	padding: 0 !important;
}
body.nx-compact.nx-cols-3 { --nx-pcols: 3; }
body.nx-compact.nx-cols-4 { --nx-pcols: 4; }
body.nx-compact.nx-cols-5 { --nx-pcols: 5; }
body.nx-compact.nx-cols-6 { --nx-pcols: 6; }
body.nx-compact .nx-shop-main ul.products::before,
body.nx-compact .nx-shop-main ul.products::after { display: none !important; content: none !important; }

body.nx-compact .nx-shop-main ul.products li.product {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	float: none !important;
	clear: none !important;
	padding: 12px !important;
	background: #fff;
	border: 1px solid var(--nx-line);
	border-radius: 12px;
	display: flex !important;
	flex-direction: column;
	transition: box-shadow .15s ease, border-color .15s ease;
	position: relative;
}
body.nx-compact .nx-shop-main ul.products li.product:hover {
	border-color: #c9d9ec;
	box-shadow: 0 8px 22px -12px rgba(13, 38, 71, .25);
}

/* Image: fixed square, product fully visible, smaller */
body.nx-compact .nx-shop-main ul.products li.product img {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	object-fit: contain !important;
	padding: 8px;
	margin: 0 0 10px !important;
	background: #fff;
	border-radius: 8px;
}
body.nx-compact .nx-shop-main ul.products li.product .astra-shop-thumbnail-wrap,
body.nx-compact .nx-shop-main ul.products li.product .astra-shop-summary-wrap { padding: 0 !important; }

/* Out-of-stock badge: small pill instead of a big banner */
body.nx-compact .nx-shop-main ul.products li.product .ast-shop-product-out-of-stock,
body.nx-compact .nx-shop-main ul.products li.product .out-of-stock-badge,
body.nx-compact .nx-shop-main ul.products li.product .soldout,
body.nx-compact .nx-shop-main ul.products li.product .outofstock-badge {
	position: absolute !important;
	top: 10px !important; left: 10px !important; right: auto !important; bottom: auto !important;
	width: auto !important; transform: none !important;
	padding: 3px 8px !important;
	font-size: 10.5px !important; line-height: 1.4 !important; font-weight: 700 !important; letter-spacing: .03em;
	background: #fff4f4 !important; color: #c53030 !important;
	border: 1px solid #f6caca; border-radius: 999px !important;
	z-index: 2;
}
body.nx-compact .nx-shop-main ul.products li.product .onsale {
	top: 10px !important; right: 10px !important; left: auto !important;
	min-height: 0 !important; min-width: 0 !important; line-height: 1.4 !important;
	padding: 3px 8px !important; font-size: 10.5px !important; border-radius: 999px !important;
}

/* Category label above title */
body.nx-compact .nx-shop-main ul.products li.product .ast-woo-product-category,
body.nx-compact .nx-shop-main ul.products li.product .product-category-label {
	font-size: 11px !important; color: #8a98a8 !important; margin: 0 0 4px !important;
	text-transform: none; letter-spacing: 0;
}

/* Title: 3 lines max */
body.nx-compact .nx-shop-main ul.products li.product .woocommerce-loop-product__title {
	font-size: 13.5px !important;
	line-height: 1.4 !important;
	font-weight: 600 !important;
	color: var(--nx-ink) !important;
	margin: 0 0 8px !important;
	padding: 0 !important;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: calc(1.4em * 3);
}
body.nx-compact .nx-shop-main ul.products li.product .price {
	font-size: 15px !important;
	font-weight: 700;
	color: var(--nx-ink) !important;
	margin: auto 0 8px !important;
}
body.nx-compact .nx-shop-main ul.products li.product .price del { font-size: 12px; opacity: .6; font-weight: 400; }
body.nx-compact .nx-shop-main ul.products li.product .star-rating { font-size: 11px; margin: 0 0 6px; }
body.nx-compact .nx-shop-main ul.products li.product .button,
body.nx-compact .nx-shop-main ul.products li.product .added_to_cart {
	margin: 0 !important;
	padding: 8px 10px !important;
	font-size: 12.5px !important;
	line-height: 1.2 !important;
	border-radius: 8px !important;
	width: 100%;
	text-align: center;
}
body.nx-compact .nx-shop-main ul.products li.product .ast-woo-shop-product-description { display: none; }

body.nx-compact .nx-shop-main .woocommerce-pagination { margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
	body.nx-compact.nx-cols-5, body.nx-compact.nx-cols-6 { --nx-pcols: 4; }
}
@media (max-width: 1024px) {
	.nx-shop-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
	body.nx-compact { --nx-pcols: 3 !important; }
}
@media (max-width: 860px) {
	.nx-shop-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.nx-filters { position: static; }
	.nx-filters-toggle {
		display: flex; align-items: center; gap: 8px; width: 100%;
		padding: 12px 16px; background: #fff; border: 0; border-radius: var(--nx-radius);
		color: var(--nx-ink); font-size: 15px; font-weight: 600; cursor: pointer;
	}
	.nx-ico-sm { width: 18px; height: 18px; color: var(--nx-blue); }
	.nx-filters-body { display: none; max-height: none; border-top: 1px solid var(--nx-line); }
	.nx-filters.is-open .nx-filters-body { display: block; }
	body.nx-compact { --nx-pcols: 2 !important; }
	body.nx-compact .nx-shop-main ul.products { gap: 10px !important; }
	body.nx-compact .nx-shop-main ul.products li.product { padding: 10px !important; }
	body.nx-compact .nx-shop-main ul.products li.product .woocommerce-loop-product__title { font-size: 13px !important; }
}

/* Small brand logos inside the filter sidebar */
.nx-checklist .nx-blogo { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--nx-line); overflow: hidden; flex: none; display: inline-flex; align-items: center; justify-content: center; background: #fff; }
.nx-checklist .nx-blogo img { width: 14px !important; height: 14px !important; object-fit: contain; margin: 0 !important; }
.nx-checklist .nx-blogo .nxbd-mono { font-size: 8px; }
.nx-checklist .nx-blogo img.nxbd-img { width: 14px !important; height: 14px !important; }
.nx-checklist .nx-blogo .nxbd-mono { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: hsl(var(--h, 210) 60% 95%); color: hsl(var(--h, 210) 45% 32%); }
