/**
 * Nexus — native WooCommerce shop sections & extras
 *
 * @package Nexus
 */

/* --------------------------------------------------------------------------
   Product tabs section
   -------------------------------------------------------------------------- */

.nexus-wc-product-tabs {
	padding: clamp(2rem, 4vw, 3rem) 0;
}

.nexus-wc-product-tabs__head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
	border-bottom: 1px solid var(--nexus-border, rgba(0, 0, 0, 0.08));
	padding-bottom: 0.75rem;
}

.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;
	font: inherit;
	font-weight: 600;
	padding: 0.5rem 1rem;
	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;
}

/* --------------------------------------------------------------------------
   Hot deals + countdown
   -------------------------------------------------------------------------- */

.nexus-wc-hot-deals {
	padding: clamp(2rem, 4vw, 3rem) 0;
}

.nexus-wc-hot-deals__grid {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nexus-wc-hot-deal-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.nexus-wc-hot-deal-card__link {
	color: inherit;
	display: block;
	text-decoration: none;
}

.nexus-wc-hot-deal-card__link:hover .nexus-wc-hot-deal-card__title {
	color: var(--nexus-link-hover, var(--nexus-primary, #2563eb));
}

.nexus-wc-hot-deal-card__title {
	font-size: 1rem;
	font-weight: 600;
	margin: 0.75rem 0 0.35rem;
	line-height: 1.35;
	transition: color 0.2s ease;
}

.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;
}

/* --------------------------------------------------------------------------
   Category grid
   -------------------------------------------------------------------------- */

.nexus-wc-category-grid {
	padding: clamp(2rem, 4vw, 3rem) 0;
}

.nexus-wc-category-grid__list {
	display: grid;
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 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;
}

.nexus-wc-category-grid__count {
	color: var(--nexus-body-text-muted, #666);
	font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   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 1rem;
}

.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;
	}
}

@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-wishlist-single-wrap,
.nexus-wc-compare-single-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0 0 1rem;
}

.nexus-wc-compare-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9985;
	background: var(--nexus-header-bg, #111);
	color: #fff;
	padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
}

body:not(.woocommerce):not(.woocommerce-page) .nexus-wc-compare-bar {
	display: none !important;
}

body.nexus-wc-mobile-bar-active .nexus-wc-compare-bar {
	bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
}

.nexus-wc-compare-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.nexus-wc-compare-bar__actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.nexus-wc-compare-table-wrap {
	overflow-x: auto;
}

.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;
}

.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: #64748b;
	font-weight: 400;
}
