/* =============================================================
   PocketVibes — Navigation v2
   Smart Sticky Header · Mobile Bottom Sheet · Mobile Bottom Nav
   ============================================================= */

/* ─────────────────────────────────────────────────────────────
   1. HEADER — BASE + TRANSITIONS
   ───────────────────────────────────────────────────────────── */
#pv-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: var(--pv-z-nav, 1000);
	width: 100%;
	will-change: transform;

	/* Default: at top — fully transparent */
	background: transparent;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border-bottom: 1px solid transparent;
	box-shadow: none;

	transition:
		transform          0.35s cubic-bezier(0.4, 0, 0.2, 1),
		background-color   0.28s ease,
		border-color       0.28s ease,
		box-shadow         0.28s ease;
}

/* 2. STATE: compact (scrolled) — frosted glass */
#pv-header.pv-header--compact {
	background: rgba(255, 255, 255, 0.78);
	backdrop-filter: blur(12px) saturate(160%);
	-webkit-backdrop-filter: blur(12px) saturate(160%);
	border-bottom-color: rgba(234, 234, 234, 0.55);
	box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

/* 3. STATE: hidden — slide offscreen upward */
#pv-header.pv-header--hidden {
	transform: translateY(-100%);
}

/* ─────────────────────────────────────────────────────────────
   2. INNER CONTAINER
   ───────────────────────────────────────────────────────────── */
.pv-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 80rem;
	margin: 0 auto;
	padding: 1.125rem 1.5rem;
	gap: 1.25rem;
	transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pv-header.pv-header--compact .pv-header__inner {
	padding-top:    0.5625rem;
	padding-bottom: 0.5625rem;
}

@media (min-width: 1024px) {
	.pv-header__inner {
		padding-left:  2rem;
		padding-right: 2rem;
	}
}

/* ─────────────────────────────────────────────────────────────
   3. LOGO
   ───────────────────────────────────────────────────────────── */
.pv-header__logo {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	text-decoration: none !important;
	opacity: 1 !important;
}

.pv-header__logo-img {
	height: 1.75rem;
	width: auto;
	display: block;
	transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pv-header.pv-header--compact .pv-header__logo-img {
	height: 1.375rem;
}

@media (max-width: 480px) {
	.pv-header__logo-img { height: 1.5rem; }
	#pv-header.pv-header--compact .pv-header__logo-img { height: 1.25rem; }
}

/* ─────────────────────────────────────────────────────────────
   4. DESKTOP CENTER NAV
   ───────────────────────────────────────────────────────────── */
.pv-header__nav {
	flex: 1;
	display: none;
	align-items: center;
	justify-content: center;
}

@media (min-width: 768px) {
	.pv-header__nav { display: flex; }
}

/* WordPress menu list reset */
.pv-header__nav .pv-nav-menu,
.pv-header__nav ul {
	display:   flex   !important;
	align-items: center !important;
	list-style: none  !important;
	margin:  0        !important;
	padding: 0        !important;
	gap: 0.125rem;
}

.pv-header__nav .pv-nav-menu > li { list-style: none !important; }

.pv-header__nav .pv-nav-menu > li > a {
	display:     block       !important;
	position:    relative;
	padding:     0.4375rem 0.9375rem !important;
	font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
	font-size:   0.8rem  !important;
	font-weight: 400     !important;
	letter-spacing: 0.03em;
	color:       #1A1A1B !important;
	text-decoration: none !important;
	background:  transparent !important;
	border-radius: 0.5rem;
	transition:  color 0.2s ease, background-color 0.2s ease !important;
}

/* Underline reveal on hover / active */
.pv-header__nav .pv-nav-menu > li > a::after {
	content: '';
	position: absolute;
	bottom: 5px;
	left:  0.9375rem;
	right: 0.9375rem;
	height: 1px;
	background: #D51016;
	transform: scaleX(0);
	transform-origin: right center;
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.pv-header__nav .pv-nav-menu > li > a:hover {
	color:      #D51016 !important;
	background: rgba(213, 16, 22, 0.05) !important;
}

.pv-header__nav .pv-nav-menu > li > a:hover::after,
.pv-header__nav .pv-nav-menu > li.current-menu-item      > a::after,
.pv-header__nav .pv-nav-menu > li.current-menu-ancestor  > a::after {
	transform: scaleX(1);
	transform-origin: left center;
}

.pv-header__nav .pv-nav-menu > li.current-menu-item      > a,
.pv-header__nav .pv-nav-menu > li.current-menu-ancestor  > a {
	color: #D51016 !important;
}

/* Dropdown sub-menus */
.pv-header__nav .pv-nav-menu > li { position: relative; }

.pv-header__nav .pv-nav-menu .sub-menu {
	position:   absolute;
	top: calc(100% + 8px);
	left: 0;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid rgba(234, 234, 234, 0.75);
	border-radius: 0.875rem;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
	list-style: none;
	margin:  0;
	padding: 0.375rem;
	min-width: 10.5rem;
	opacity:    0;
	visibility: hidden;
	transform:  translateY(6px);
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
	z-index: 10;
}

.pv-header__nav .pv-nav-menu > li:hover      > .sub-menu,
.pv-header__nav .pv-nav-menu > li:focus-within > .sub-menu {
	opacity:    1;
	visibility: visible;
	transform:  translateY(0);
	pointer-events: auto;
}

.pv-header__nav .pv-nav-menu .sub-menu li a {
	display:     block;
	padding:     0.5rem 0.75rem;
	border-radius: 0.5rem;
	font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
	font-size:   0.8rem;
	color:       #1A1A1B !important;
	text-decoration: none !important;
	white-space: nowrap;
	transition:  color 0.2s ease, background-color 0.2s ease;
}

.pv-header__nav .pv-nav-menu .sub-menu li a:hover {
	color:      #D51016 !important;
	background: rgba(213, 16, 22, 0.05);
}

/* ─────────────────────────────────────────────────────────────
   5. HEADER ACTIONS (right cluster)
   ───────────────────────────────────────────────────────────── */
.pv-header__actions {
	display:     flex;
	align-items: center;
	gap: 0.4375rem;
	flex-shrink: 0;
}

/* ── Cart icon button ─────────────────────────────── */
.pv-header__cart {
	position: relative;
	display:  inline-flex;
	align-items: center;
	justify-content: center;
	width:  2.25rem;
	height: 2.25rem;
	border-radius: 0.625rem;
	color:           #1A1A1B !important;
	text-decoration: none    !important;
	opacity: 1 !important;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.pv-header__cart:hover {
	background: rgba(213, 16, 22, 0.07);
	color: #D51016 !important;
}

/* WooCommerce cart-fragment target — keep this class */
.pv-nav__cart-count {
	position:  absolute;
	top:   0;
	right: 0;
	min-width: 1.1rem;
	height:    1.1rem;
	border-radius: 9999px;
	background:  #D51016;
	color:       #fff;
	font-family: 'IBM Plex Mono', monospace;
	font-size:   0.575rem;
	font-weight: 700;
	display:     flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0 0.2rem;
	transform: translate(30%, -30%);
}

.pv-nav__cart-count[hidden] { display: none !important; }

/* ── Desktop CTA button ───────────────────────────── */
.pv-header__cta {
	display:     none;
	align-items: center;
	gap: 0.375rem;
	background: #1A1A1B;
	color:       #ffffff !important;
	font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
	font-size:   0.73rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	padding: 0.5rem 1rem;
	border-radius: 0.625rem;
	text-decoration: none !important;
	opacity: 1 !important;
	white-space: nowrap;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

@media (min-width: 768px) {
	.pv-header__cta { display: inline-flex; }
}

.pv-header__cta:hover {
	background: #D51016;
	transform:  translateY(-1px);
}

/* ── Hamburger (mobile only) ──────────────────────── */
.pv-header__hamburger {
	display:         flex;
	flex-direction:  column;
	align-items:     center;
	justify-content: center;
	gap: 5px;
	width:  2.25rem;
	height: 2.25rem;
	border:     none;
	background: none;
	cursor:     pointer;
	border-radius: 0.625rem;
	padding: 0;
	transition: background-color 0.2s ease;
}

@media (min-width: 768px) {
	.pv-header__hamburger { display: none; }
}

.pv-header__hamburger:hover { background: rgba(0, 0, 0, 0.06); }

.pv-hamburger__line {
	display:    block;
	width:  20px;
	height: 1.5px;
	background:       #1A1A1B;
	border-radius:    2px;
	transform-origin: center;
	transition:
		transform   0.3s cubic-bezier(0.4, 0, 0.2, 1),
		opacity     0.2s ease;
}

/* Morph to × when open */
.pv-header__hamburger[aria-expanded="true"] .pv-hamburger__line:nth-child(1) {
	transform: translateY(6.5px) rotate(45deg);
}
.pv-header__hamburger[aria-expanded="true"] .pv-hamburger__line:nth-child(2) {
	opacity:   0;
	transform: scaleX(0);
}
.pv-header__hamburger[aria-expanded="true"] .pv-hamburger__line:nth-child(3) {
	transform: translateY(-6.5px) rotate(-45deg);
}

/* ─────────────────────────────────────────────────────────────
   6. PAGE OFFSET — compensate for fixed header on non-bento pages
   ───────────────────────────────────────────────────────────── */
body:not(.pv-is-dashboard) #page {
	padding-top: 4.75rem;
	transition: padding-top 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────
   7. MOBILE BOTTOM SHEET
   ───────────────────────────────────────────────────────────── */
#pv-mobile-sheet {
	position:       fixed;
	inset:          0;
	z-index:        calc(var(--pv-z-nav, 1000) - 1);
	visibility:     hidden;
	pointer-events: none;
}

#pv-mobile-sheet.pv-sheet--open {
	visibility:     visible;
	pointer-events: auto;
}

/* Backdrop */
.pv-sheet__backdrop {
	position: absolute;
	inset:    0;
	background: rgba(26, 26, 27, 0.32);
	opacity:  0;
	transition: opacity 0.32s ease;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

#pv-mobile-sheet.pv-sheet--open .pv-sheet__backdrop { opacity: 1; }

/* Panel */
.pv-sheet__panel {
	position: absolute;
	bottom: 0;
	left:   0;
	right:  0;
	background:    #ffffff;
	border-radius: 1.375rem 1.375rem 0 0;
	padding:       0.75rem 1.5rem;
	padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
	transform:   translateY(105%);
	transition:  transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
	box-shadow:  0 -8px 48px rgba(0, 0, 0, 0.13);
	max-height:  85dvh;
	overflow-y:  auto;
}

#pv-mobile-sheet.pv-sheet--open .pv-sheet__panel {
	transform: translateY(0);
}

/* Drag handle */
.pv-sheet__handle {
	width:  2.5rem;
	height: 3px;
	background:    #EAEAEA;
	border-radius: 9999px;
	margin: 0 auto 1.625rem;
}

/* Nav links (using wp_nav_menu output) */
.pv-sheet__nav { }

.pv-sheet__nav ul {
	list-style: none !important;
	margin:  0 !important;
	padding: 0 !important;
}

.pv-sheet__nav > ul > li {
	border-bottom: 1px solid #F5F5F5;
}

.pv-sheet__nav > ul > li:last-child { border-bottom: none; }

.pv-sheet__nav > ul > li > a {
	display:     flex;
	align-items: center;
	justify-content: space-between;
	padding:     1rem 0;
	font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
	font-size:   1rem;
	font-weight: 500;
	letter-spacing: 0.015em;
	color:           #1A1A1B !important;
	text-decoration: none    !important;
	transition: color 0.2s ease;
}

.pv-sheet__nav > ul > li > a::after {
	content:   '→';
	font-size: 0.875rem;
	opacity:   0.3;
	transition: opacity 0.2s ease, transform 0.2s ease;
	flex-shrink: 0;
}

.pv-sheet__nav > ul > li > a:hover,
.pv-sheet__nav > ul > li.current-menu-item > a {
	color: #D51016 !important;
}

.pv-sheet__nav > ul > li > a:hover::after { opacity: 1; transform: translateX(3px); }

/* Sheet cart link */
.pv-sheet__cart-row {
	display:     flex;
	align-items: center;
	justify-content: space-between;
	padding:     1rem 0;
	border-top:  1px solid #F5F5F5;
	margin-top:  0.25rem;
	font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
	font-size:   1rem;
	font-weight: 500;
	color:           #1A1A1B !important;
	text-decoration: none    !important;
	transition: color 0.2s ease;
}

.pv-sheet__cart-row:hover { color: #D51016 !important; }

/* Cart badge inside sheet (static position override) */
.pv-sheet__cart-badge {
	display:    inline-flex;
	align-items: center;
	justify-content: center;
	min-width:  1.25rem;
	height:     1.25rem;
	background:  #D51016;
	color:       #fff;
	border-radius: 9999px;
	font-family: 'IBM Plex Mono', monospace;
	font-size:   0.625rem;
	font-weight: 700;
	padding: 0 0.25rem;
}

/* Sheet CTA */
.pv-sheet__cta {
	display:     flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top:  1.25rem;
	padding:     1rem 1.5rem;
	background:  #1A1A1B;
	color:       #ffffff !important;
	font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
	font-size:   0.875rem;
	font-weight: 500;
	letter-spacing: 0.03em;
	border-radius: 0.875rem;
	text-decoration: none !important;
	transition: background-color 0.2s ease;
}

.pv-sheet__cta:hover { background: #D51016; }

/* ─────────────────────────────────────────────────────────────
   8. MOBILE BOTTOM NAVIGATION (JS-injected, unchanged pattern)
   ───────────────────────────────────────────────────────────── */
.pv-bottom-nav {
	display:  none;
	position: fixed;
	bottom: 0;
	left:   0;
	right:  0;
	height: 60px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(20px) saturate(140%);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
	border-top: 1px solid var(--pv-border, rgba(0,0,0,.07));
	box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
	z-index: var(--pv-z-nav, 1000);
	padding: 0 4px;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	align-items: center;
	justify-content: space-around;
}

@media (max-width: 1024px) {
	.pv-bottom-nav { display: flex; }
}

.pv-bottom-nav__item {
	display:         flex;
	flex-direction:  column;
	align-items:     center;
	justify-content: center;
	gap: 3px;
	padding: 6px 14px;
	border-radius: var(--pv-r-sm, 8px);
	color:    var(--pv-text-3, #8A95A8);
	text-decoration: none !important;
	font-size:       0.6rem;
	font-weight:     600;
	font-family:     var(--pv-font-mono, monospace);
	letter-spacing:  0.05em;
	text-transform:  uppercase;
	transition:
		color      var(--pv-t-base, .2s) var(--pv-ease, ease),
		background var(--pv-t-base, .2s) var(--pv-ease, ease);
	min-width:  52px;
	min-height: 48px;
	position:   relative;
	border:     none;
	cursor:     pointer;
	background: none;
}

.pv-bottom-nav__item svg {
	width:  22px;
	height: 22px;
	stroke-width: 1.75;
	flex-shrink: 0;
}

.pv-bottom-nav__item:hover,
.pv-bottom-nav__item.is-active {
	color:      #D51016 !important;
	background: rgba(213, 16, 22, 0.06);
	opacity:    1;
}

.pv-bottom-nav__item.is-active::before {
	content:  '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width:  28px;
	height: 2px;
	background:    #D51016;
	border-radius: 0 0 3px 3px;
}

/* Cart badge inside bottom nav */
.pv-bottom-nav .pv-nav__cart-count {
	position:  absolute;
	top:   3px;
	right: 6px;
	transform: none;
}
