/* ============================================================
 * BIOTA · SECTION · Header  (part: header.html)
 * Ported from the "Biota Navbar 1a" reference.
 * Tokens: #102C57 navy · #2563EB action · #25D366 WhatsApp · #128C4B chat-green
 * Type:   Poppins (wordmark/buttons) · DM Sans (links)
 *
 * Bar state is driven by a .solid class on #sitenav (added by header.js on the
 * home hero at scrollY > 80). Non-home pages are solid from the start via CSS,
 * so there is no first-paint flash and no JS dependency there.
 * ============================================================ */

/* --- NAV SHELL ------------------------------------------------------------- */
#sitenav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 48px;
	background: transparent;
	font-family: 'DM Sans', system-ui, sans-serif;
	transition: background 0.3s, padding 0.3s, box-shadow 0.3s;
}

/* Non-home content must clear the fixed bar (home's hero sits under it). */
body:not(.home) {
	padding-top: 66px;
}

/* --- TOP (transparent) STATE ---------------------------------------------- */
#navbrand {
	display: block;
	/* Logotype rendered as a mask so it recolours per bar state, the way the
	   wordmark's text colour used to. Only the PNG's alpha (the letterforms)
	   is used; background-color is the fill. The "BIOTA" text stays in the DOM
	   for screen readers but is hidden visually. */
	width: 104px;
	height: 20px;
	background-color: #ffffff;
	-webkit-mask: url(../../img/biota-logotype.png) left center / contain no-repeat;
	mask: url(../../img/biota-logotype.png) left center / contain no-repeat;
	font-size: 0;
	color: transparent;
	transition: background-color 0.3s;
}
#navlinks {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 30px;
	font-size: 14.5px;
	font-weight: 500;
	white-space: nowrap;
	color: #ffffff;
	transition: color 0.3s;
}
#navlinks a {
	color: inherit;
}
#navactions {
	display: flex;
	align-items: center;
	gap: 18px;
}
#navchat {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	font-weight: 500;
	color: #ffffff;
	transition: color 0.3s;
}
#navcart {
	position: relative;
	display: flex;
	align-items: center;
	border: none;
	background: none;
	padding: 6px;
	cursor: pointer;
	color: #ffffff;
	transition: color 0.3s, transform 0.3s;
}
#navbadge {
	position: absolute;
	top: 0;
	right: 0;
	background: #2563EB;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	display: none; /* shown (flex) by JS only when count > 0 */
	align-items: center;
	justify-content: center;
	transition: transform 0.3s;
}
#navshop {
	padding: 10px 22px;
	border-radius: 999px;
	font-family: 'Poppins', sans-serif;
	font-weight: 500;
	font-size: 14px;
	white-space: nowrap;
	background: #ffffff;
	color: #102C57;
	transition: background 0.3s, color 0.3s, filter 0.2s ease;
}
/* Same darken as every other button on the site (_button.css uses 0.93).
   Brightness rather than a fixed colour because this button is white over the
   hero and blue once the header goes solid — one rule covers both. */
#navshop:hover,
#navshop:focus-visible {
	filter: brightness(0.93);
}
#navham {
	display: none;
	flex-direction: column;
	gap: 4px;
	border: none;
	background: none;
	padding: 0;
	cursor: pointer;
	width: 24px;
}
#navham span {
	width: 19px;
	height: 2px;
	border-radius: 2px;
	background: #ffffff;
	transition: background 0.3s;
}
#navham span:last-child {
	width: 13px;
}

/* --- SOLID STATE ----------------------------------------------------------
   Applies when JS adds .solid (home, scrolled) OR on any non-home page. */
#sitenav.solid,
body:not(.home) #sitenav {
	background: rgba(255, 255, 255, 0.96);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
	padding-top: 15px;
	padding-bottom: 15px;
}
#sitenav.solid #navbrand,
body:not(.home) #navbrand {
	background-color: #102C57;
}
#sitenav.solid #navlinks,
body:not(.home) #navlinks {
	color: #444444;
}
#sitenav.solid #navchat,
body:not(.home) #navchat {
	color: #128C4B;
}
#sitenav.solid #navcart,
body:not(.home) #navcart {
	color: #102C57;
}
#sitenav.solid #navshop,
body:not(.home) #navshop {
	background: #2563EB;
	color: #ffffff;
}
#sitenav.solid #navham span,
body:not(.home) #navham span {
	background: #102C57;
}

/* --- COLLAPSE LADDER ------------------------------------------------------- */
@media (max-width: 1100px) {
	#navlinks {
		gap: 20px;
		font-size: 13.5px;
	}
	#navshop {
		padding: 9px 18px;
		font-size: 13.5px;
	}
	#sitenav {
		padding-left: 30px;
		padding-right: 30px;
	}
}
@media (max-width: 960px) {
	#navchat span {
		display: none;
	}
	#navshop {
		padding: 9px 16px;
		font-size: 13px;
	}
}
@media (max-width: 860px) {
	#navlinks,
	#navshop {
		display: none;
	}
	#navham {
		display: flex;
	}
	#sitenav {
		padding-left: 18px;
		padding-right: 18px;
	}
	/* In flow the wordmark sits wherever the burger and the actions leave room,
	   which is off-centre because they are not the same width. Take it out of
	   flow so it centres on the bar itself. Horizontal padding is symmetric, so
	   left:50% of the padding box is the true centre of the viewport. */
	#navbrand {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}
}

/* --- SLIDE-IN MENU (mobile) ------------------------------------------------ */
#menuscrim {
	position: fixed;
	inset: 0;
	background: rgba(10, 15, 26, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
	z-index: 60;
}
#menuscrim.open {
	opacity: 1;
	pointer-events: auto;
}
#menupanel {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 80%;
	max-width: 320px;
	background: #ffffff;
	transform: translateX(-100%);
	transition: transform 0.3s;
	z-index: 61;
	padding: 20px 22px 26px;
	display: flex;
	flex-direction: column;
	box-shadow: 6px 0 24px -12px rgba(0, 0, 0, 0.4);
}
#menupanel.open {
	transform: translateX(0);
}
.menupanel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}
.menupanel__brand {
	display: block;
	width: 92px;
	height: 18px;
	background-color: #102C57;
	-webkit-mask: url(../../img/biota-logotype.png) left center / contain no-repeat;
	mask: url(../../img/biota-logotype.png) left center / contain no-repeat;
	font-size: 0;
	color: transparent;
}
#menuclose {
	border: none;
	background: none;
	font-size: 24px;
	color: #888888;
	cursor: pointer;
	line-height: 1;
	padding: 0;
}
#menupanel .mlink {
	font-family: 'Poppins', sans-serif;
	font-weight: 500;
	font-size: 16.5px;
	padding: 13px 0;
	border-bottom: 1px solid #f2f4f7;
	color: #1a1a1a;
}
.menupanel__wa {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #25D366;
	color: #ffffff;
	font-family: 'Poppins', sans-serif;
	font-weight: 500;
	font-size: 14.5px;
	padding: 13px;
	border-radius: 999px;
}

/* --- CART PANEL (drawer >=861px · bottom sheet <=860px) -------------------- */
#cartscrim {
	position: fixed;
	inset: 0;
	background: rgba(10, 15, 26, 0.45);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
	z-index: 60;
}
#cartscrim.open {
	opacity: 1;
	pointer-events: auto;
}
#cartpanel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 340px;
	background: #ffffff;
	transform: translateX(100%);
	transition: transform 0.35s;
	z-index: 61;
	padding: 22px;
	display: flex;
	flex-direction: column;
	box-shadow: -8px 0 30px -14px rgba(0, 0, 0, 0.4);
}
#cartpanel.open {
	transform: translateX(0);
}
#cartgrip {
	display: none;
}
.cartpanel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	flex: none;
}
.cartpanel__title {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 16px;
}
#cartcount {
	color: #888888;
	font-weight: 500;
	font-size: 14px;
}
#cartclose {
	border: none;
	background: none;
	font-size: 22px;
	color: #888888;
	cursor: pointer;
	line-height: 1;
	padding: 0;
}
#cartbody {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

/* --- Cart contents -------------------------------------------------------- */
.cart-items {
	flex: 1;
	overflow-y: auto;
	min-height: 0;
}
.cart-item {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid #f2f4f7;
}
.cart-item__thumb {
	width: 56px;
	height: 56px;
	border-radius: 10px;
	overflow: hidden;
	flex: none;
	background: #eef1f5;
}
.cart-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.cart-item__main {
	flex: 1;
	min-width: 0;
}
.cart-item__name {
	font-size: 13.5px;
	font-weight: 600;
	margin-bottom: 6px;
}
.cart-item__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.cart-item__price {
	font-size: 12.5px;
	color: #888888;
	white-space: nowrap;
}
.qty {
	display: flex;
	align-items: center;
	border: 1px solid #e2e5ea;
	border-radius: 999px;
}
.qty__btn {
	width: 26px;
	height: 26px;
	border: none;
	background: none;
	color: #666666;
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.qty__val {
	font-size: 13px;
	width: 18px;
	text-align: center;
}
.cart-foot {
	flex: none;
	padding-top: 14px;
}
.cart-foot__subtotal {
	display: flex;
	justify-content: space-between;
	font-size: 13.5px;
	margin-bottom: 4px;
	color: #666666;
}
.cart-foot__val {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	color: #102C57;
}
.cart-foot__ship {
	font-size: 11.5px;
	margin-bottom: 14px;
}
.cart-foot__checkout {
	font-size: 14.5px;
	padding: 14px;
	margin-bottom: 9px;
}

/* Empty state — a route out, not a dead end. */
.cart-empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 20px 6px 6px;
}
.cart-empty__icon {
	width: 56px;
	height: 56px;
	border-radius: 999px;
	background: #F5F6F8;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
}
.cart-empty__title {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 15.5px;
	margin-bottom: 5px;
}
.cart-empty__text {
	font-size: 12.5px;
	color: #888888;
	line-height: 1.55;
	margin-bottom: 18px;
}
.cart-empty .biota-cartbtn {
	width: 100%;
	padding: 12px;
	font-size: 14px;
}
.cart-empty__text + .biota-cartbtn--primary {
	margin-bottom: 9px;
}
.cart-empty .biota-cartbtn--ghost {
	gap: 7px;
	font-size: 13.5px;
	padding: 11px;
}

/* Shared cart buttons. */
.biota-cartbtn {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	font-family: 'Poppins', sans-serif;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.2s ease;
}
/* Checkout and Lanjut belanja had no hover state at all, so the drawer's two
   actions gave no feedback. Same 0.93 darken as the rest of the site. */
.biota-cartbtn:hover,
.biota-cartbtn:focus-visible {
	filter: brightness(0.93);
}
.biota-cartbtn--primary {
	background: #2563EB;
	color: #ffffff;
	border: none;
	transition: background 0.3s;
}
.biota-cartbtn--ghost {
	width: 100%;
	background: #ffffff;
	color: #444444;
	border: 1.5px solid #d5d9e0;
	font-size: 14px;
	padding: 12px;
}

@media (max-width: 860px) {
	.qty__btn {
		width: 30px;
		height: 30px;
		font-size: 15px;
	}
}
@media (max-width: 860px) {
	#cartpanel {
		top: auto;
		left: 0;
		width: auto;
		max-height: 82%;
		border-radius: 20px 20px 0 0;
		transform: translateY(100%);
		padding: 14px 18px 20px;
		box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, 0.35);
	}
	#cartpanel.open {
		transform: translateY(0);
	}
	#cartgrip {
		display: block;
		width: 38px;
		height: 4px;
		border-radius: 2px;
		background: #e2e5ea;
		margin: 0 auto 14px;
		flex: none;
	}
}
