/**
 * Nexus — native WooCommerce shop sections & extras
 *
 * @package Nexus
 */

/* --------------------------------------------------------------------------
   Builder preview ribbon (canvas only)
   -------------------------------------------------------------------------- */

.nexus-wc-builder-preview {
	margin: 0 0 1rem;
	padding: 0.85rem 1rem;
	border: 1px dashed color-mix(in srgb, var(--nexus-primary, #0f766e) 35%, var(--nexus-border, #cbd5e1));
	border-radius: 12px;
	background: color-mix(in srgb, var(--nexus-primary, #0f766e) 5%, var(--nexus-surface, #fff));
}

.nexus-wc-builder-preview__summary,
.nexus-wc-builder-preview__count {
	margin: 0 0 0.45rem;
	font-size: 0.8125rem;
	color: var(--nexus-body-text, #0f172a);
}

.nexus-wc-builder-preview__count {
	color: var(--nexus-body-text-muted, #64748b);
}

.nexus-wc-builder-preview__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0 0 0.65rem;
}

.nexus-wc-builder-preview__chip {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: var(--nexus-surface, #fff);
	border: 1px solid var(--nexus-border-light, #e2e8f0);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--nexus-primary, #0f766e);
}

.nexus-wc-builder-preview__items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
	gap: 0.65rem;
}

.nexus-wc-builder-preview__item {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
	padding: 0.45rem;
	border-radius: 10px;
	background: var(--nexus-surface, #fff);
	border: 1px solid var(--nexus-border-light, #e2e8f0);
}

.nexus-wc-builder-preview__thumb {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--nexus-surface-alt, #f8fafc);
}

.nexus-wc-builder-preview__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nexus-wc-builder-preview__thumb--empty {
	display: block;
}

.nexus-wc-builder-preview__item-body {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.nexus-wc-builder-preview__item-title {
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nexus-wc-builder-preview__item-meta {
	font-size: 0.72rem;
	color: var(--nexus-body-text-muted, #64748b);
}

.nexus-wc-section-empty {
	margin: 0;
	padding: 1rem;
	border-radius: 10px;
	background: var(--nexus-surface-alt, #f8fafc);
	color: var(--nexus-body-text-muted, #64748b);
	text-align: center;
}

/* --------------------------------------------------------------------------
   Product tabs section
   -------------------------------------------------------------------------- */

.nexus-wc-product-tabs {
	padding: clamp(2rem, 4vw, 3rem) 0;
	container-type: inline-size;
}

.nexus-wc-product-tabs__head {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.35rem;
	margin: 0 0 1.5rem;
	border-bottom: 1px solid var(--nexus-border, rgba(0, 0, 0, 0.08));
	padding-bottom: 0.75rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	overscroll-behavior-x: contain;
}

.nexus-wc-product-tabs__head::-webkit-scrollbar {
	height: 4px;
}

.nexus-wc-product-tabs__btn {
	appearance: none;
	background: transparent;
	border: none;
	border-radius: var(--nexus-radius, 6px);
	color: var(--nexus-body-text-muted, #666);
	cursor: pointer;
	flex: 0 0 auto;
	font: inherit;
	font-weight: 600;
	padding: 0.5rem 1rem;
	white-space: nowrap;
	transition: color 0.2s ease, background 0.2s ease;
}

.nexus-wc-product-tabs__btn:hover,
.nexus-wc-product-tabs__btn:focus-visible {
	color: var(--nexus-primary, #2563eb);
	outline: none;
}

.nexus-wc-product-tabs__btn.is-active {
	background: color-mix(in srgb, var(--nexus-primary, #2563eb) 12%, transparent);
	color: var(--nexus-primary, #2563eb);
}

.nexus-wc-product-tabs__panel {
	display: none;
}

.nexus-wc-product-tabs__panel.is-active {
	display: block;
}

.nexus-wc-product-tabs__panel .nexus-wc-loop-wrap {
	max-width: 100%;
}

/* --------------------------------------------------------------------------
   Hot deals + countdown
   -------------------------------------------------------------------------- */

.nexus-wc-hot-deals {
	padding: clamp(2rem, 4vw, 3rem) 0;
}

.nexus-wc-hot-deals__loop,
.nexus-wc-price-drops__loop,
.nexus-wc-deal-of-day__loop {
	max-width: 100%;
}

.nexus-wc-deal-of-day__loop {
	max-width: min(100%, 340px);
	margin-inline: auto;
}

.nexus-wc-hot-deals .nexus-wc-deal-countdown {
	margin: -0.1rem 0.85rem 0.4rem;
}

.nexus-wc-deal-countdown {
	background: color-mix(in srgb, var(--nexus-primary, #2563eb) 10%, var(--nexus-surface, #fff));
	border-radius: var(--nexus-radius, 6px);
	color: var(--nexus-primary, #2563eb);
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 0.45rem 0.65rem;
	text-align: center;
}

.nexus-wc-deal-of-day,
.nexus-wc-price-drops {
	padding: clamp(2rem, 4vw, 3rem) 0;
}

/* --------------------------------------------------------------------------
   Category grid
   -------------------------------------------------------------------------- */

.nexus-wc-category-grid {
	padding: clamp(2rem, 4vw, 3rem) 0;
	container-type: inline-size;
}

.nexus-wc-category-grid__list {
	display: grid;
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nexus-wc-category-grid__item {
	min-width: 0;
}

.nexus-wc-category-grid__list.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nexus-wc-category-grid__list.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nexus-wc-category-grid__list.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nexus-wc-category-grid__list.columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.nexus-wc-category-grid__list.columns-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.nexus-wc-category-grid__item a {
	background: var(--nexus-surface, #fff);
	border: 1px solid var(--nexus-border, rgba(0, 0, 0, 0.08));
	border-radius: var(--nexus-radius, 8px);
	color: inherit;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	height: 100%;
	padding: 1rem;
	text-align: center;
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nexus-wc-category-grid__item a:hover {
	border-color: color-mix(in srgb, var(--nexus-primary, #2563eb) 35%, transparent);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
	transform: translateY(-2px);
}

.nexus-wc-category-grid__thumb {
	aspect-ratio: 1;
	border-radius: calc(var(--nexus-radius, 8px) - 2px);
	display: block;
	overflow: hidden;
}

.nexus-wc-category-grid__thumb img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.nexus-wc-category-grid__name {
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
	word-break: break-word;
	hyphens: auto;
}

.nexus-wc-category-grid__count {
	color: var(--nexus-body-text-muted, #666);
	font-size: 0.8125rem;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Brands row
   -------------------------------------------------------------------------- */

.nexus-wc-brands {
	padding: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.nexus-wc-brands__track {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nexus-wc-brands__item a {
	align-items: center;
	background: var(--nexus-surface, #fff);
	border: 1px solid var(--nexus-border, rgba(0, 0, 0, 0.08));
	border-radius: var(--nexus-radius, 8px);
	color: var(--nexus-body-text-muted, #666);
	display: flex;
	height: 72px;
	justify-content: center;
	min-width: 120px;
	padding: 0.75rem 1rem;
	text-decoration: none;
	transition: border-color 0.2s ease, opacity 0.2s ease;
}

.nexus-wc-brands__item a:hover {
	border-color: var(--nexus-primary, #2563eb);
	opacity: 0.92;
}

.nexus-wc-brands__item img {
	display: block;
	max-height: 48px;
	max-width: 110px;
	object-fit: contain;
	width: auto;
}

/* --------------------------------------------------------------------------
   Free shipping bar
   -------------------------------------------------------------------------- */

.nexus-wc-free-shipping-bar-wrap {
	margin: 0 0 1rem;
}

.nexus-mini-cart-panel .nexus-wc-free-shipping-bar-wrap {
	margin: 0 0 0.75rem;
	padding: 0;
}

.nexus-wc-free-shipping-bar__text {
	font-size: 0.875rem;
	margin: 0 0 0.5rem;
	text-align: center;
}

.nexus-wc-free-shipping-bar__track {
	background: var(--nexus-border, rgba(0, 0, 0, 0.08));
	border-radius: 999px;
	height: 8px;
	overflow: hidden;
}

.nexus-wc-free-shipping-bar__fill {
	background: linear-gradient(90deg, var(--nexus-primary, #2563eb), color-mix(in srgb, var(--nexus-primary, #2563eb) 70%, #22c55e));
	border-radius: 999px;
	display: block;
	height: 100%;
	transition: width 0.35s ease;
}

/* --------------------------------------------------------------------------
   Login to see price
   -------------------------------------------------------------------------- */

.nexus-wc-login-price a {
	color: var(--nexus-primary, #2563eb);
	font-weight: 600;
	text-decoration: none;
}

.nexus-wc-login-price a:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Add-to-cart toast
   -------------------------------------------------------------------------- */

.nexus-wc-cart-toast {
	background: var(--nexus-header-bg, #111);
	border-radius: var(--nexus-radius, 8px);
	bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
	color: #fff;
	font-size: 0.9375rem;
	left: 50%;
	max-width: min(92vw, 420px);
	opacity: 0;
	padding: 0.85rem 1.1rem;
	pointer-events: none;
	position: fixed;
	transform: translate(-50%, 12px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	z-index: 10050;
}

.nexus-wc-cart-toast.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.nexus-wc-cart-toast a {
	color: #fff;
	font-weight: 700;
	margin-left: 0.35rem;
	text-decoration: underline;
}

body.nexus-wc-mobile-bar-active .nexus-wc-cart-toast {
	bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
}

/* --------------------------------------------------------------------------
   Shop load more
   -------------------------------------------------------------------------- */

.nexus-wc-load-more-wrap {
	margin: 2rem 0 0;
	text-align: center;
}

.nexus-wc-load-more-btn.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

.nexus-wc-load-more-btn.is-done {
	opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Mobile shop bottom bar
   -------------------------------------------------------------------------- */

.nexus-wc-mobile-bar {
	background: var(--nexus-surface, #fff);
	border-top: 1px solid var(--nexus-border, rgba(0, 0, 0, 0.08));
	bottom: 0;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
	display: none;
	gap: 0;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	left: 0;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	position: fixed;
	right: 0;
	z-index: 9990;
}

body.nexus-wc-mobile-bar-active {
	padding-bottom: 0;
}

@media (max-width: 782px) {
	body.nexus-wc-mobile-bar-active {
		padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
	}
}

.nexus-wc-mobile-bar__item {
	align-items: center;
	appearance: none;
	background: transparent;
	border: none;
	color: var(--nexus-body-text, #222);
	display: flex;
	flex: 1;
	flex-direction: column;
	font: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	justify-content: center;
	min-height: 3.5rem;
	padding: 0.35rem 0.25rem;
	text-align: center;
	text-decoration: none;
}

.nexus-wc-mobile-bar__item span {
	display: block;
	line-height: 1.2;
	position: relative;
}

.nexus-wc-mobile-bar__badge {
	background: var(--nexus-primary, #2563eb);
	border-radius: 999px;
	color: #fff;
	display: inline-block;
	font-size: 0.625rem;
	font-style: normal;
	font-weight: 700;
	line-height: 1;
	margin-left: 0.25rem;
	min-width: 1.1rem;
	padding: 0.15rem 0.35rem;
	vertical-align: top;
}

@media (max-width: 782px) {
	.nexus-wc-mobile-bar {
		display: grid;
	}
}

@container (max-width: 720px) {
	.nexus-wc-category-grid__list.columns-4,
	.nexus-wc-category-grid__list.columns-5,
	.nexus-wc-category-grid__list.columns-6,
	.nexus-wc-category-grid__list.columns-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container (max-width: 380px) {
	.nexus-wc-category-grid__list[class*="columns-"] {
		grid-template-columns: 1fr;
	}
}

@container (min-width: 721px) {
	.nexus-wc-product-tabs__head {
		flex-wrap: wrap;
		overflow-x: visible;
	}
}

@media (max-width: 640px) {
	.nexus-wc-category-grid__list.columns-4,
	.nexus-wc-category-grid__list.columns-5,
	.nexus-wc-category-grid__list.columns-6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.nexus-wc-category-grid__list.columns-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* --------------------------------------------------------------------------
   Wishlist / compare (loop action icons live in .nexus-wc-loop-actions)
   -------------------------------------------------------------------------- */

.nexus-wc-wishlist-btn,
.nexus-wc-compare-btn {
	position: static;
	box-shadow: none;
}

.woocommerce ul.products li.product {
	position: relative;
}

.nexus-wc-compare-btn {
	font-size: 0;
	padding: 0;
}

.nexus-wc-single-product-actions {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	margin: 0 0 1rem;
}

/* Compact compare flyer (replaces full-width footer bar). */
.nexus-wc-compare-flyer {
	position: fixed;
	right: 1rem;
	bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
	left: auto;
	z-index: 9985;
	max-width: min(320px, calc(100vw - 2rem));
	background: var(--nexus-header-bg, #0f172a);
	color: #fff;
	padding: 0.5rem 0.65rem;
	border-radius: 999px;
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.28);
}

body:not(.woocommerce):not(.woocommerce-page) .nexus-wc-compare-flyer {
	display: none !important;
}

body.nexus-wc-mobile-bar-active .nexus-wc-compare-flyer {
	bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
}

.nexus-wc-compare-flyer__inner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: nowrap;
}

.nexus-wc-compare-flyer__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	height: 1.5rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--nexus-primary, #0f766e);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
}

.nexus-wc-compare-flyer__text {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

.nexus-wc-compare-flyer__actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-shrink: 0;
}

.nexus-wc-compare-flyer__go {
	display: inline-block;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	background: var(--nexus-surface);
	color: var(--nexus-body-text) !important;
	font-size: 0.75rem;
	font-weight: 700;
	text-decoration: none;
	line-height: 1.2;
}

.nexus-wc-compare-flyer__actions .nexus-wc-compare-clear {
	border: 0;
	background: transparent;
	color: rgba(255, 255, 255, 0.85);
	font-size: 1.25rem;
	line-height: 1;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	cursor: pointer;
	border-radius: 999px;
}

.nexus-wc-compare-flyer__actions .nexus-wc-compare-clear:hover {
	background: rgba(255, 255, 255, 0.12);
}

.nexus-wc-compare-table-wrap {
	overflow-x: auto;
}

.nexus-wc-compare-table .button,
.nexus-wc-compare-table a.button,
.nexus-wc-compare-card__atc .button,
.nexus-wc-compare-card__atc a.button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: auto !important;
	min-width: 8.5rem;
	min-height: 2.5rem !important;
	height: auto !important;
	padding: 0.5rem 1rem !important;
	font-size: 0.8125rem !important;
	font-weight: 600;
	white-space: nowrap;
}

.nexus-wc-compare-table .nexus-wc-icon-btn,
.nexus-wc-compare-card__atc .nexus-wc-icon-btn {
	width: auto !important;
	min-width: 8.5rem;
}

.nexus-wc-compare-table .screen-reader-text,
.nexus-wc-compare-card__atc .screen-reader-text {
	position: static !important;
	width: auto !important;
	height: auto !important;
	margin: 0;
	clip: auto;
	clip-path: none;
	overflow: visible;
}

.nexus-wc-compare-table {
	width: 100%;
	border-collapse: collapse;
}

.nexus-wc-compare-table th,
.nexus-wc-compare-table td {
	border: 1px solid var(--nexus-border, rgba(0, 0, 0, 0.08));
	padding: 0.75rem;
	vertical-align: top;
	color: var(--nexus-body-text, #0f172a);
	background: var(--nexus-surface, #fff);
}

.nexus-wc-compare-table thead th {
	color: var(--nexus-body-text, #0f172a);
	background: var(--nexus-surface-alt, #f8fafc);
}

.nexus-wc-compare-table tbody th[scope="row"] {
	font-weight: 600;
	color: var(--nexus-body-text, #0f172a);
}

.nexus-wc-compare-cards {
	display: none;
	gap: 1rem;
}

.nexus-wc-compare-card {
	border: 1px solid var(--nexus-border, rgba(0, 0, 0, 0.08));
	border-radius: 8px;
	padding: 1rem;
	background: var(--nexus-surface, #fff);
	color: var(--nexus-body-text, #0f172a);
}

.nexus-wc-compare-card__head {
	display: grid;
	grid-template-columns: 72px 1fr auto;
	gap: 0.75rem;
	align-items: start;
	margin-bottom: 0.75rem;
}

.nexus-wc-compare-card__head img {
	width: 72px;
	height: auto;
	border-radius: 4px;
}

.nexus-wc-compare-card__title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.35;
}

.nexus-wc-compare-card__rows {
	margin: 0 0 1rem;
}

.nexus-wc-compare-card__row {
	display: grid;
	grid-template-columns: minmax(6rem, 35%) 1fr;
	gap: 0.5rem;
	padding: 0.35rem 0;
	border-top: 1px solid var(--nexus-border, rgba(0, 0, 0, 0.06));
}

.nexus-wc-compare-card__row:first-child {
	border-top: 0;
}

.nexus-wc-compare-card__row dt {
	margin: 0;
	font-weight: 600;
}

.nexus-wc-compare-card__row dd {
	margin: 0;
}

@media (max-width: 767px) {
	.nexus-wc-compare-table-wrap {
		display: none;
	}

	.nexus-wc-compare-cards {
		display: grid;
	}

	.nexus-wc-compare-card.nexus-wc-compare-col-hidden {
		display: none;
	}
}

.nexus-wc-recently-viewed {
	padding: clamp(2rem, 4vw, 3rem) 0;
}

.nexus-wc-vertical-menu__nav {
	max-width: 320px;
}
.nexus-wc-vertical-menu__list,
.nexus-wc-vertical-menu__sub {
	list-style: none;
	margin: 0;
	padding: 0;
}
.nexus-wc-vertical-menu__sub {
	padding-left: 1rem;
	margin-top: 0.25rem;
}
.nexus-wc-vertical-menu__item {
	margin: 0;
	border-bottom: 1px solid var(--nexus-border-light, #e2e8f0);
}
.nexus-wc-vertical-menu__item > a {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.55rem 0;
	text-decoration: none;
	font-weight: 500;
	color: inherit;
}
.nexus-wc-vertical-menu__item > a:hover {
	color: var(--nexus-primary, #0f766e);
}
.nexus-wc-vertical-menu__count {
	font-size: 0.8rem;
	color: var(--nexus-body-text-muted, #64748b);
	font-weight: 400;
}

/* Dark mode */
body.nexus-dark-mode .nexus-wc-category-grid__item a,
body.nexus-dark-mode .nexus-wc-hot-deal-card,
body.nexus-dark-mode .nexus-wc-product-tabs__head {
	border-color: var(--nexus-border);
}

body.nexus-dark-mode .nexus-wc-mobile-bar {
	background: var(--nexus-surface);
	border-top-color: var(--nexus-border);
	color: var(--nexus-body-text);
}

body.nexus-dark-mode .nexus-wc-mobile-bar__item {
	color: var(--nexus-body-text);
}

body.nexus-dark-mode .nexus-wc-compare-table th,
body.nexus-dark-mode .nexus-wc-compare-table td {
	background: var(--nexus-surface);
	color: var(--nexus-body-text);
	border-color: var(--nexus-border);
}

body.nexus-dark-mode .nexus-wc-compare-flyer__go {
	background: var(--nexus-surface);
	color: var(--nexus-body-text) !important;
}

body.nexus-dark-mode .nexus-wc-vertical-menu__item {
	border-bottom-color: var(--nexus-border);
}

/* --------------------------------------------------------------------------
   Builder product loops — grid / carousel / list
   -------------------------------------------------------------------------- */

.nexus-wc-loop-wrap {
	--nexus-loop-cols: 4;
	max-width: 100%;
	overflow-x: clip;
}

.nexus-wc-loop-wrap .woocommerce ul.products {
	margin: 0;
	width: 100%;
}

.nexus-wc-loop-grid .woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(var(--nexus-loop-cols, 4), minmax(0, 1fr));
	gap: 1.25rem;
}

.nexus-wc-loop-carousel .woocommerce ul.products {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.35rem;
	scrollbar-width: thin;
	max-width: 100%;
}

.nexus-wc-loop-carousel .woocommerce ul.products li.product {
	flex: 0 0 clamp(220px, calc((100% - (var(--nexus-loop-cols, 4) - 1) * 1rem) / var(--nexus-loop-cols, 4)), 280px);
	scroll-snap-align: start;
	height: auto;
	align-self: flex-start;
}

.nexus-wc-loop-list .woocommerce ul.products {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.nexus-wc-loop-list .woocommerce ul.products li.product {
	display: grid;
	grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
	gap: 0.75rem 1rem;
	align-items: center;
}

/* Masonry — variable image heights (shop archive + builder sections) */
body.nexus-shop-cols-1 { --nexus-shop-cols: 1; }
body.nexus-shop-cols-2 { --nexus-shop-cols: 2; }
body.nexus-shop-cols-3 { --nexus-shop-cols: 3; }
body.nexus-shop-cols-4 { --nexus-shop-cols: 4; }
body.nexus-shop-cols-5 { --nexus-shop-cols: 5; }
body.nexus-shop-cols-6 { --nexus-shop-cols: 6; }

body.nexus-shop-layout-masonry .woocommerce ul.products {
	display: block;
	column-count: var(--nexus-shop-cols, 4);
	column-gap: 1.5rem;
}

body.nexus-shop-layout-masonry .woocommerce ul.products li.product {
	break-inside: avoid;
	display: inline-flex;
	flex-direction: column;
	margin-bottom: 1.5rem;
	width: 100%;
	vertical-align: top;
}

body.nexus-shop-layout-masonry .woocommerce ul.products li.product a img,
body.nexus-shop-layout-masonry .nexus-wc-loop-thumbnail,
body.nexus-shop-layout-masonry .nexus-wc-loop-thumbnail img {
	aspect-ratio: auto;
	height: auto;
}

.nexus-wc-loop-masonry .woocommerce ul.products {
	display: block;
	column-count: var(--nexus-loop-cols, 4);
	column-gap: 1.25rem;
}

.nexus-wc-loop-masonry .woocommerce ul.products li.product {
	break-inside: avoid;
	display: inline-flex;
	flex-direction: column;
	margin-bottom: 1.25rem;
	width: 100%;
	vertical-align: top;
}

.nexus-wc-loop-masonry .woocommerce ul.products li.product a img,
.nexus-wc-loop-masonry .nexus-wc-loop-thumbnail,
.nexus-wc-loop-masonry .nexus-wc-loop-thumbnail img {
	aspect-ratio: auto;
	height: auto;
}

@media (max-width: 782px) {
	body.nexus-shop-layout-masonry .woocommerce ul.products {
		column-count: var(--nexus-shop-cols-mobile, 2);
	}

	.nexus-wc-loop-masonry .woocommerce ul.products {
		column-count: min(var(--nexus-loop-cols, 4), 2);
	}
}

@media (max-width: 640px) {
	.nexus-wc-loop-grid .woocommerce ul.products {
		grid-template-columns: repeat(min(var(--nexus-loop-cols, 4), 2), minmax(0, 1fr));
	}

	.nexus-wc-loop-list .woocommerce ul.products li.product {
		grid-template-columns: 72px minmax(0, 1fr);
	}
}
