/* ==========================================================================
   DeshipOS — Header Navigation widget
   Mobile-first, fully responsive header with hamburger, dropdowns, sticky.
   Depends on assets/css/base.css for design tokens.
   ========================================================================== */

.deshipos-nav {
	--dnv-bg:           var(--dew-bg, #FFFFFF);
	--dnv-sticky-bg:    rgba(255, 255, 255, .85);
	--dnv-text:         var(--dew-ink, #0F172A);
	--dnv-muted:        var(--dew-muted, #475569);
	--dnv-accent:       var(--dew-brand, #2563EB);
	--dnv-divider:      var(--dew-divider, #E2E8F0);
	--dnv-panel:        var(--dew-bg, #FFFFFF);
	--dnv-cta-bg:       var(--dew-brand-gradient, linear-gradient(135deg, #2563EB 0%, #4F8DFF 100%));
	--dnv-cta-text:     #FFFFFF;
	--dnv-bp:           960px;

	color: var(--dnv-text);
	background: var(--dnv-bg);
	width: 100%;
	box-sizing: border-box;
	position: relative;
	z-index: 50;
	border: 0;
	box-shadow: none;
}

.deshipos-nav *,
.deshipos-nav *::before,
.deshipos-nav *::after { box-sizing: border-box; }

/* ----- Sticky on scroll ----- */
.deshipos-nav--sticky {
	transition: background var(--dew-dur-base) var(--dew-ease-out),
	            backdrop-filter var(--dew-dur-base) var(--dew-ease-out),
	            box-shadow var(--dew-dur-base) var(--dew-ease-out),
	            border-color var(--dew-dur-base) var(--dew-ease-out);
}
.deshipos-nav--sticky.is-fixed {
	position: fixed !important;
	top: 0; left: 0; right: 0;
	z-index: 9999;
	width: 100%;
	animation: deshipos-nav-slide var(--dew-dur-base) var(--dew-ease-out) both;
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	background: var(--dnv-sticky-bg);
	border-bottom: 1px solid var(--dnv-divider);
	box-shadow: var(--dew-shadow-sm);
}
@keyframes deshipos-nav-slide {
	from { transform: translateY(-100%); }
	to   { transform: translateY(0); }
}

/* ----- Container: brand | menu | actions ----- */
.deshipos-nav__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--dew-space-3);
	max-width: 1280px;
	margin: 0 auto;
	padding: 14px 18px;
	position: relative;
}

/* ----- Brand ----- */
.deshipos-nav__brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--dnv-text);
	flex-shrink: 0;
	min-width: 0;
	transition: opacity var(--dew-dur-fast) var(--dew-ease-out);
}
.deshipos-nav__brand:hover { opacity: .85; }

.deshipos-nav__logo {
	--dnv-logo-w: 36px;
	--dnv-logo-h: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--dnv-logo-w);
	height: var(--dnv-logo-h);
	flex: 0 0 var(--dnv-logo-w);
}
.deshipos-nav__logo img,
.deshipos-nav__logo svg {
	max-width: 100%; max-height: 100%;
	width: auto; height: auto;
	display: block;
	object-fit: contain;
}

.deshipos-nav .deshipos-nav__brand-name {
	font-size: 1.125rem;
	font-weight: 800;
	letter-spacing: var(--dew-tracking-tight);
	color: var(--dnv-text);
	white-space: nowrap;
	line-height: 1;
}

/* ============================================================
   Mobile-first defaults: hamburger visible, menu collapsed.
   ============================================================ */

.deshipos-nav__hamburger {
	display: inline-flex;
	width: 44px;
	height: 44px;
	padding: 0;
	background: var(--dew-surface, #F8FAFC);
	border: 1px solid var(--dnv-divider);
	border-radius: 10px;
	cursor: pointer;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	color: var(--dnv-text);
	-webkit-tap-highlight-color: transparent;
	transition: background-color var(--dew-dur-fast) var(--dew-ease-out),
	            border-color var(--dew-dur-fast) var(--dew-ease-out);
}
.deshipos-nav__hamburger:hover {
	background-color: var(--dew-surface-2, #F1F5F9);
	border-color: var(--dew-border-strong, #CBD5E1);
}
.deshipos-nav__hamburger:focus-visible {
	outline: none;
	box-shadow: var(--dew-ring);
}
.deshipos-nav__hamburger-bar {
	display: block;
	width: 20px; height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform var(--dew-dur-base) var(--dew-ease-out),
	            opacity var(--dew-dur-fast) var(--dew-ease-out);
}
.deshipos-nav.is-open .deshipos-nav__hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.deshipos-nav.is-open .deshipos-nav__hamburger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.deshipos-nav.is-open .deshipos-nav__hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.deshipos-nav__actions {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	margin-left: auto;
}

/* Mobile: hide login + CTA in the header bar. Only the hamburger stays.
   Note the .deshipos-nav prefix — needed to beat the specificity of
   `.deshipos-nav a.deshipos-nav__cta { display: inline-flex }`. */
.deshipos-nav .deshipos-nav__actions > .deshipos-nav__login,
.deshipos-nav .deshipos-nav__actions > .deshipos-nav__cta {
	display: none;
}

/* ----- Language toggle (বাং | EN) -----
   A two-segment pill. The active language is highlighted with the brand
   colour. Stays visible at every breakpoint (unlike login/CTA) so visitors
   can always switch language, including next to the mobile hamburger. */
.deshipos-nav__lang {
	display: inline-flex;
	align-items: stretch;
	flex-shrink: 0;
	border: 1.5px solid var(--dnv-divider, #E2E8F0);
	border-radius: 999px;
	padding: 2px;
	gap: 2px;
	background: #FFFFFF;
}
.deshipos-nav .deshipos-nav__lang-btn,
.deshipos-nav a.deshipos-nav__lang-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: .8125rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--dnv-text, #1E293B);
	text-decoration: none;
	white-space: nowrap;
	transition:
		background var(--dew-dur-fast, 120ms) var(--dew-ease-out, ease),
		color var(--dew-dur-fast, 120ms) var(--dew-ease-out, ease);
}
.deshipos-nav .deshipos-nav__lang-btn:hover {
	color: #16A34A;
}
.deshipos-nav .deshipos-nav__lang-btn.is-active,
.deshipos-nav a.deshipos-nav__lang-btn.is-active {
	background: #16A34A;
	color: #FFFFFF;
}

/* Sheet-bottom actions (inside the mobile drawer) — visible by default. */
.deshipos-nav__sheet-actions {
	display: flex;
	flex-direction: column;
	gap: var(--dew-space-2);
	padding-top: var(--dew-space-4);
	margin-top: var(--dew-space-3);
	border-top: 1px solid var(--dnv-divider);
}
.deshipos-nav__sheet-actions .deshipos-nav__login {
	display: block;
	padding: 14px 8px;
	font-size: 1rem;
	text-align: center;
}
.deshipos-nav__sheet-actions .deshipos-nav__cta {
	display: inline-flex;
	width: 100%;
	justify-content: center;
	padding: 14px 22px;
	font-size: 1rem;
}

/* ----- Login (text link, no background) ----- */
.deshipos-nav .deshipos-nav__login,
.deshipos-nav a.deshipos-nav__login {
	color: var(--dnv-text);
	font-size: .9375rem;
	font-weight: 600;
	text-decoration: none;
	padding: 10px 12px;
	letter-spacing: var(--dew-tracking-snug);
	white-space: nowrap;
	transition: color var(--dew-dur-fast) var(--dew-ease-out);
}
.deshipos-nav .deshipos-nav__login:hover,
.deshipos-nav .deshipos-nav__login:focus-visible {
	color: var(--dnv-accent);
	outline: none;
}

.deshipos-nav .deshipos-nav__cta,
.deshipos-nav a.deshipos-nav__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 22px;
	background: var(--dnv-cta-bg);
	color: var(--dnv-cta-text);
	border-radius: 999px;
	text-decoration: none;
	font-size: .9375rem;
	font-weight: 700;
	letter-spacing: var(--dew-tracking-snug);
	white-space: nowrap;
	box-shadow: var(--dew-shadow-brand-sm);
	transition: transform var(--dew-dur-fast) var(--dew-ease-out),
	            box-shadow var(--dew-dur-fast) var(--dew-ease-out),
	            filter var(--dew-dur-fast) var(--dew-ease-out);
}
.deshipos-nav .deshipos-nav__cta:hover {
	color: #FFFFFF;
	transform: translateY(-1px);
	box-shadow: var(--dew-shadow-brand-md);
	filter: saturate(1.05);
}
.deshipos-nav .deshipos-nav__cta:focus-visible {
	outline: none;
	box-shadow: var(--dew-shadow-brand-md), var(--dew-ring);
}
.deshipos-nav__cta-arrow {
	display: inline-block;
	transition: transform var(--dew-dur-base) var(--dew-ease-out);
}
.deshipos-nav__cta:hover .deshipos-nav__cta-arrow { transform: translateX(3px); }

/* ----- Collapse panel (mobile sheet by default) ----- */
.deshipos-nav__collapse {
	order: 99;
	width: 100%;
	flex-basis: 100%;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--dew-space-3);
	margin: 0;
	padding: 0;
	background: var(--dnv-panel);
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	transition: max-height var(--dew-dur-slow) var(--dew-ease-out),
	            opacity var(--dew-dur-base) var(--dew-ease-out),
	            padding var(--dew-dur-slow) var(--dew-ease-out),
	            margin var(--dew-dur-slow) var(--dew-ease-out);
}
.deshipos-nav.is-open .deshipos-nav__collapse {
	max-height: calc(100vh - 80px);
	opacity: 1;
	pointer-events: auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: var(--dew-space-3) 4px var(--dew-space-5);
	margin-top: var(--dew-space-2);
	border-top: 1px solid var(--dnv-divider);
}
.deshipos-nav.is-open .deshipos-nav__collapse::-webkit-scrollbar { width: 0; height: 0; }

/* ----- Menu (mobile stack) ----- */
.deshipos-nav__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	width: 100%;
}
.deshipos-nav__menu-item {
	position: relative;
	display: block;
}
.deshipos-nav__menu-item + .deshipos-nav__menu-item {
	border-top: 1px solid var(--dnv-divider);
}

.deshipos-nav .deshipos-nav__menu-item > a {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	text-decoration: none;
	color: var(--dnv-text);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: var(--dew-tracking-snug);
	line-height: 1.2;
	padding: 14px 8px;
	border-radius: 8px;
	background: transparent;
	box-shadow: none;
	min-height: 44px;
	transition: color var(--dew-dur-fast) var(--dew-ease-out),
	            background-color var(--dew-dur-fast) var(--dew-ease-out);
}
.deshipos-nav .deshipos-nav__menu-item > a:hover,
.deshipos-nav .deshipos-nav__menu-item > a:focus-visible {
	color: var(--dnv-accent);
	background: var(--dew-surface, #F8FAFC);
	outline: none;
}
.deshipos-nav .deshipos-nav__menu-item.is-active > a {
	color: var(--dnv-accent);
	font-weight: 700;
}

.deshipos-nav__chevron {
	display: inline-block;
	flex-shrink: 0;
	transition: transform var(--dew-dur-fast) var(--dew-ease-out);
}
.deshipos-nav__menu-item.has-dropdown.is-open > a .deshipos-nav__chevron {
	transform: rotate(180deg);
}

.deshipos-nav__sub {
	list-style: none;
	margin: 0;
	padding: 4px 8px 8px 20px;
	background: transparent;
	border: 0;
	box-shadow: none;
	display: none;
}
.deshipos-nav__menu-item.has-dropdown.is-open > .deshipos-nav__sub {
	display: block;
}
.deshipos-nav__sub-item a {
	display: block;
	padding: 10px 8px;
	border-radius: 8px;
	font-size: .9375rem;
	font-weight: 500;
	color: var(--dnv-muted);
	text-decoration: none;
	min-height: 40px;
	transition: background-color var(--dew-dur-fast) var(--dew-ease-out),
	            color var(--dew-dur-fast) var(--dew-ease-out);
}
.deshipos-nav__sub-item a:hover {
	background: var(--dew-brand-soft, rgba(37, 99, 235, .12));
	color: var(--dnv-accent);
}

/* ============================================================
   Desktop layout — apply above the configured breakpoint.
   ============================================================ */
@media (min-width: 960px) {
	.deshipos-nav__inner {
		flex-wrap: nowrap;
		padding: 18px 32px;
		gap: var(--dew-space-6);
	}

	.deshipos-nav__hamburger { display: none; }

	.deshipos-nav__actions { gap: 16px; }

	/* Desktop: show login + CTA in the bar, hide the sheet-bottom block entirely. */
	.deshipos-nav .deshipos-nav__actions > .deshipos-nav__login { display: inline-block; }
	.deshipos-nav .deshipos-nav__actions > .deshipos-nav__cta   { display: inline-flex; }
	.deshipos-nav .deshipos-nav__sheet-actions { display: none; }

	.deshipos-nav__collapse {
		order: 0;
		width: auto;
		flex: 1 1 auto;
		flex-basis: auto;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		gap: 0;
		padding: 0;
		margin: 0;
		background: transparent;
		max-height: none;
		overflow: visible;
		opacity: 1;
		pointer-events: auto;
		border-top: 0;
		transition: none;
	}

	.deshipos-nav__menu {
		flex-direction: row;
		align-items: center;
		gap: 28px;
		width: auto;
	}
	.deshipos-nav__menu-item {
		display: inline-flex;
		align-items: center;
	}
	.deshipos-nav__menu-item + .deshipos-nav__menu-item {
		border-top: 0;
	}

	.deshipos-nav .deshipos-nav__menu-item > a {
		display: inline-flex;
		justify-content: flex-start;
		padding: 8px 4px;
		font-size: .9375rem;
		font-weight: 500;
		color: var(--dnv-text);
		min-height: 0;
		border-radius: 0;
		background: transparent;
	}
	.deshipos-nav .deshipos-nav__menu-item > a:hover,
	.deshipos-nav .deshipos-nav__menu-item > a:focus-visible {
		color: var(--dnv-accent);
		background: transparent;
	}

	.deshipos-nav .deshipos-nav__menu-item > a .deshipos-nav__menu-label {
		position: relative;
	}
	.deshipos-nav .deshipos-nav__menu-item > a .deshipos-nav__menu-label::after {
		content: "";
		position: absolute;
		left: 50%;
		bottom: -6px;
		transform: translateX(-50%) scaleX(0);
		transform-origin: center;
		width: 100%;
		height: 2px;
		border-radius: 2px;
		background: var(--dnv-accent);
		transition: transform var(--dew-dur-base) var(--dew-ease-out);
	}
	.deshipos-nav .deshipos-nav__menu-item > a:hover .deshipos-nav__menu-label::after,
	.deshipos-nav .deshipos-nav__menu-item > a:focus-visible .deshipos-nav__menu-label::after,
	.deshipos-nav .deshipos-nav__menu-item.is-active > a .deshipos-nav__menu-label::after {
		transform: translateX(-50%) scaleX(1);
	}

	.deshipos-nav__sub {
		display: block;
		position: absolute;
		top: calc(100% + 12px);
		left: 50%;
		transform: translateX(-50%) translateY(-6px);
		min-width: 200px;
		padding: 8px;
		background: var(--dew-bg, #FFFFFF);
		border: 1px solid var(--dnv-divider);
		border-radius: 12px;
		box-shadow: var(--dew-shadow-lg);
		opacity: 0;
		pointer-events: none;
		visibility: hidden;
		transition: opacity var(--dew-dur-base) var(--dew-ease-out),
		            transform var(--dew-dur-base) var(--dew-ease-out),
		            visibility var(--dew-dur-base) var(--dew-ease-out);
		z-index: 60;
	}
	.deshipos-nav__sub::before {
		content: "";
		position: absolute;
		left: 0; right: 0;
		bottom: 100%;
		height: 16px;
		background: transparent;
	}
	.deshipos-nav__menu-item.has-dropdown:hover > .deshipos-nav__sub,
	.deshipos-nav__menu-item.has-dropdown:focus-within > .deshipos-nav__sub,
	.deshipos-nav__menu-item.has-dropdown.is-open > .deshipos-nav__sub {
		opacity: 1;
		pointer-events: auto;
		visibility: visible;
		transform: translateX(-50%) translateY(0);
	}
	.deshipos-nav__sub-item a {
		padding: 9px 12px;
		color: var(--dnv-text);
	}
}

/* ----- Below the breakpoint: keep brand + actions on ONE row.
   The brand is allowed to shrink and the logo is capped so a wide wordmark
   never pushes the language pill + hamburger onto a second line (which made
   the bar ~150px tall on small phones). ----- */
@media (max-width: 959px) {
	.deshipos-nav__brand {
		flex: 0 1 auto;
		overflow: hidden;
	}
	.deshipos-nav__logo {
		flex: 0 1 auto;
		width: auto;
		height: auto;
		max-width: 40vw;
		max-height: 40px;
	}
	.deshipos-nav__logo img,
	.deshipos-nav__logo svg {
		width: auto;
		height: auto;
		max-width: 100%;
		max-height: 40px;
	}
	.deshipos-nav .deshipos-nav__brand-name {
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

@media (max-width: 480px) {
	.deshipos-nav__inner {
		padding: 12px 14px;
		gap: var(--dew-space-2);
	}
	.deshipos-nav .deshipos-nav__brand-name {
		font-size: 1rem;
	}
	.deshipos-nav__logo,
	.deshipos-nav__logo img,
	.deshipos-nav__logo svg { max-height: 34px; }
}

@media (max-width: 360px) {
	.deshipos-nav .deshipos-nav__brand-name { display: none; }
	.deshipos-nav__hamburger { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
	.deshipos-nav,
	.deshipos-nav *,
	.deshipos-nav *::before,
	.deshipos-nav *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}
