/**
 * WooCommerce storefront layout (header search, secondary nav, category sidebar).
 *
 * @package Nexus
 */

/* Top bar split layout */
.nexus-top-bar-inner--storefront {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
}

.nexus-wc-top-bar-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 1rem;
	margin-left: auto;
	font-size: inherit;
}

.nexus-wc-top-bar-links a {
	color: inherit;
	text-decoration: none;
	opacity: 0.92;
}

.nexus-wc-top-bar-links a:hover,
.nexus-wc-top-bar-links a:focus-visible {
	opacity: 1;
	text-decoration: none;
}

.nexus-wc-top-bar-links__welcome {
	opacity: 0.85;
	margin-right: 0.25rem;
}

.nexus-wc-top-bar-contact {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.65rem;
}

.nexus-wc-top-bar-contact a {
	color: inherit;
	text-decoration: none;
}

.nexus-wc-top-bar-contact a:hover,
.nexus-wc-top-bar-contact a:focus-visible {
	text-decoration: none;
}

.nexus-wc-top-bar-contact__sep {
	opacity: 0.55;
}

/* Header row: logo | search | icons */
.site-header.nexus-wc-storefront-header .site-header-inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 1rem 1.5rem;
}

.site-header.nexus-wc-storefront-header .nexus-wc-header-product-search {
	min-width: 0;
	width: 100%;
	max-width: 640px;
	justify-self: center;
}

.nexus-wc-header-product-search__form {
	display: flex;
	align-items: stretch;
	width: 100%;
	border: 1px solid var(--nexus-border, #cbd5e1);
	border-radius: var(--nexus-radius, 6px);
	overflow: hidden;
	background: var(--nexus-surface, #fff);
}

.nexus-wc-header-product-search__cat {
	flex: 0 0 auto;
	max-width: 42%;
	border: 0;
	border-right: 1px solid var(--nexus-border, #cbd5e1);
	background: var(--nexus-surface-muted, #f8fafc);
	padding: 0.55rem 0.75rem;
	font-size: 0.875rem;
	color: inherit;
	cursor: pointer;
}

.nexus-wc-header-product-search__field {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	padding: 0.55rem 0.85rem;
	font-size: 0.9375rem;
	background: transparent;
	color: inherit;
}

.nexus-wc-header-product-search__field:focus {
	outline: none;
}

.nexus-wc-header-product-search__submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: var(--nexus-primary, #2563eb);
	color: var(--nexus-button-text, #fff);
	padding: 0 1rem;
	cursor: pointer;
}

.nexus-wc-header-product-search__submit:hover,
.nexus-wc-header-product-search__submit:focus-visible {
	filter: brightness(1.05);
}

/* Compare icon badge: see style.css .header-actions rules */

/* Secondary full-width nav */
.nexus-wc-secondary-nav {
	background: var(--nexus-primary, #2563eb);
	color: var(--nexus-button-text, #fff);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nexus-wc-secondary-nav__inner {
	display: flex;
	align-items: center;
	min-height: 2.75rem;
}

.nexus-wc-secondary-nav .main-navigation {
	width: 100%;
}

.nexus-wc-secondary-nav .nav-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nexus-wc-secondary-nav .nav-menu > li > a {
	display: block;
	padding: 0.75rem 1rem;
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9375rem;
}

.nexus-wc-secondary-nav .nav-menu > li > a:hover,
.nexus-wc-secondary-nav .nav-menu > li > a:focus-visible,
.nexus-wc-secondary-nav .nav-menu > li.current-menu-item > a {
	background: rgba(0, 0, 0, 0.12);
}

.nexus-wc-secondary-nav .nav-menu > li {
	position: relative;
}

.nexus-wc-secondary-nav .nav-menu .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 12rem;
	margin: 0;
	padding: 0.35rem 0;
	list-style: none;
	background: var(--nexus-surface, #fff);
	color: var(--nexus-text, #0f172a);
	border: 1px solid var(--nexus-border, #e2e8f0);
	box-shadow: var(--nexus-shadow-lg, 0 10px 25px rgba(15, 23, 42, 0.12));
	z-index: 10040;
}

.nexus-wc-secondary-nav .nav-menu li:hover > .sub-menu,
.nexus-wc-secondary-nav .nav-menu li:focus-within > .sub-menu {
	display: block;
}

.nexus-wc-secondary-nav .nav-menu .sub-menu a {
	display: block;
	padding: 0.45rem 0.85rem;
	color: var(--nexus-text, #0f172a);
	font-weight: 500;
	font-size: 0.875rem;
}

.nexus-wc-secondary-nav .nav-menu .sub-menu a:hover,
.nexus-wc-secondary-nav .nav-menu .sub-menu a:focus-visible {
	background: var(--nexus-surface-muted, #f1f5f9);
}

/* Shop layout: left categories + main + optional right sidebar */
.nexus-shop-storefront.content-sidebar-wrap {
	display: grid;
	grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
	gap: 1.5rem 2rem;
	align-items: start;
}

.nexus-shop-storefront.content-sidebar-wrap.nexus-shop-has-right-sidebar {
	grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(220px, 280px);
}

.nexus-wc-shopping-categories-wrap {
	position: sticky;
	top: calc(var(--nexus-sticky-offset, 80px) + 1rem);
}

.nexus-wc-shopping-categories {
	background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
	color: #fff;
	border-radius: var(--nexus-radius, 6px);
	overflow: hidden;
	box-shadow: var(--nexus-shadow, 0 4px 14px rgba(234, 88, 12, 0.25));
}

.nexus-wc-shopping-categories__title {
	margin: 0;
	padding: 0.85rem 1rem;
	font-size: 1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	background: rgba(0, 0, 0, 0.12);
}

.nexus-wc-shopping-categories .nexus-wc-cat-list {
	list-style: none;
	margin: 0;
	padding: 0.35rem 0;
}

.nexus-wc-shopping-categories .nexus-wc-cat-list a {
	display: block;
	padding: 0.45rem 1rem;
	color: #fff;
	text-decoration: none;
	font-size: 0.9rem;
	border-left: 3px solid transparent;
}

.nexus-wc-shopping-categories .nexus-wc-cat-list a:hover,
.nexus-wc-shopping-categories .nexus-wc-cat-list a:focus-visible,
.nexus-wc-shopping-categories .current-cat > a {
	background: rgba(0, 0, 0, 0.14);
	border-left-color: #fff;
}

.nexus-wc-shopping-categories .nexus-wc-cat-list--child {
	padding-left: 0.75rem;
	background: rgba(0, 0, 0, 0.08);
}

.nexus-wc-shopping-categories .nexus-wc-cat-list--child a {
	font-size: 0.8125rem;
	padding-top: 0.35rem;
	padding-bottom: 0.35rem;
}

@media (max-width: 991px) {
	.site-header.nexus-wc-storefront-header .site-header-inner {
		grid-template-columns: 1fr auto;
	}

	.site-header.nexus-wc-storefront-header .nexus-wc-header-product-search {
		grid-column: 1 / -1;
		max-width: none;
		order: 3;
	}

	.nexus-shop-storefront.content-sidebar-wrap,
	.nexus-shop-storefront.content-sidebar-wrap.nexus-shop-has-right-sidebar {
		grid-template-columns: 1fr;
	}

	.nexus-wc-shopping-categories-wrap {
		position: static;
	}
}
