/* ============================================================
   Ecohomes Sidebar — self-contained styles for [side_menu_eh]
   Safe to enqueue on any page independently of eh-myaccount.css
   ============================================================ */

:root {
	--eh-green:       #2ECC71;
	--eh-green-dark:  #27AE60;
	--eh-blue:        #3498DB;
	--eh-orange:      #F39C12;
	--eh-red:         #E74C3C;
	--eh-gray-100:    #F8F9FA;
	--eh-gray-200:    #E9ECEF;
	--eh-gray-500:    #6C757D;
	--eh-gray-800:    #343A40;
	--eh-white:       #FFFFFF;
	--eh-sidebar-w:   240px;
	--eh-radius:      8px;
	--eh-shadow:      0 2px 8px rgba(0,0,0,.08);
}

/* ── Sidebar Shell ── */
.eh-myaccount-sidebar {
	width: var(--eh-sidebar-w);
	flex-shrink: 0;
	background: var(--eh-white);
	border-radius: var(--eh-radius);
	box-shadow: var(--eh-shadow);
	overflow: hidden;
	position: sticky;
	top: 24px;
}

/* ── Profile Header ── */
.eh-sidebar-profile {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px 16px;
	background: linear-gradient(135deg, var(--eh-green) 0%, var(--eh-green-dark) 100%);
	color: var(--eh-white);
}

.eh-sidebar-avatar {
	border-radius: 50%;
	border: 2px solid rgba(255,255,255,.6);
	width: 56px;
	height: 56px;
	object-fit: cover;
}

.eh-sidebar-name {
	font-size: .9rem;
	font-weight: 600;
	display: block;
	color: var(--eh-white);
}

.eh-sidebar-type {
	display: block;
	font-size: 0.7rem;
	font-weight: 600;
	color: rgba(255,255,255,.75);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-top: 2px;
	line-height: 1.4;
}

.eh-verification-badge {
	font-size: .75rem;
	letter-spacing: 2px;
	color: rgba(255,255,255,.85);
}

/* ── Nav Items ── */
.eh-sidebar-nav {
	padding: 8px 0;
}

.eh-sidebar-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	text-decoration: none;
	color: var(--eh-gray-800);
	font-size: .875rem;
	transition: background .15s, color .15s;
	border-left: 3px solid transparent;
}

.eh-sidebar-item:hover,
.eh-sidebar-item.eh-active {
	background: var(--eh-gray-100);
	color: var(--eh-green-dark);
	border-left-color: var(--eh-green);
}

.eh-sidebar-item.eh-locked {
	color: var(--eh-gray-500);
	cursor: not-allowed;
}

.eh-sidebar-item.eh-locked:hover {
	background: transparent;
	border-left-color: transparent;
}

/* ── Icons ── */
.eh-nav-icon {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	text-align: center;
}

.eh-nav-icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

.eh-nav-lock {
	margin-left: auto;
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	display: flex;
	align-items: center;
	color: var(--eh-gray-500);
}

.eh-nav-lock svg {
	width: 14px;
	height: 14px;
	display: block;
}

/* ── Footer / Logout ── */
.eh-sidebar-footer {
	border-top: 1px solid var(--eh-gray-200);
	padding: 8px 0;
}

.eh-sidebar-logout {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	color: var(--eh-red);
	font-size: .875rem;
	text-decoration: none;
}

.eh-sidebar-logout:hover { background: #fff0ee; }

/* ── Bottom CTA ── */
.eh-sidebar-cta {
	padding: 16px;
	background: var(--eh-gray-100);
	border-top: 1px solid var(--eh-gray-200);
	font-size: .8rem;
	text-align: center;
}

.eh-btn-konsultasi {
	display: block;
	margin-top: 8px;
	background: var(--eh-green);
	color: var(--eh-white) !important;
	border: none;
	border-radius: 6px;
	padding: 8px 16px;
	font-size: .8rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.eh-btn-konsultasi:hover { background: var(--eh-green-dark); }

/* ── Molla left-sidebar template context ── */
/* When sidebar is rendered inside col-lg-3, let the column control width.
   Molla's sticky-sidebar JS handles the sticky behaviour itself. */
.page-template-page-container-left-sidebar-ecohomes-php .eh-myaccount-sidebar {
	width: 100%;
	position: static;
}

/* Suppress the empty <p> block-editor shortcode wrapper adds above the aside */
.widget_block > p:empty {
	margin: 0;
	padding: 0;
	line-height: 0;
}

/* ── Nav badge (unread count pill) ── */
.eh-nav-badge {
	margin-left: auto;
	flex-shrink: 0;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: #E74C3C;
	color: #fff;
	font-size: .7rem;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	display: inline-block;
}

/* ── Mobile sidebar toggle button (always hidden on desktop) ── */
.eh-sidebar-toggle {
	display: none;
}
.eh-sidebar-close-btn {
	display: none;
}
.eh-sidebar-backdrop {
	display: none !important;
}

/* ── Responsive — off-canvas drawer ── */
@media (max-width: 768px) {
	/* Drawer shell */
	.eh-myaccount-sidebar {
		/* position: fixed !important; */
		top: 0 !important;
		left: -100% !important;
		width: min(280px, 85vw) !important;
		height: 100vh !important;
		z-index: 9999 !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		border-radius: 0 !important;
		box-shadow: 4px 0 32px rgba(0,0,0,.2) !important;
		transition: left .25s cubic-bezier(.4,0,.2,1) !important;
		background: #fff !important;
	}

	.eh-myaccount-sidebar.is-open {
		left: 0 !important;
	}

	/* Overlay backdrop */
	.eh-sidebar-backdrop {
		display: none;
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,.48);
		z-index: 9998;
	}
	.eh-sidebar-backdrop.is-visible {
		display: block !important;
	}

	body.eh-sidebar-open {
		overflow: hidden;
	}

	/* Hamburger toggle button injected by JS */
	.eh-sidebar-toggle {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		padding: 8px 14px;
		background: #fff;
		border: 1.5px solid #ddd;
		border-radius: 6px;
		font-size: 13px;
		font-weight: 600;
		color: #333;
		cursor: pointer;
		margin-bottom: 14px;
		line-height: 1;
	}
	.eh-sidebar-toggle:hover {
		border-color: var(--eh-green);
		color: var(--eh-green-dark);
	}
	.eh-sidebar-toggle-icon {
		font-size: 18px;
		line-height: 1;
	}

	/* Close button inside drawer */
	.eh-sidebar-close-btn {
		display: flex;
		width: 100%;
		justify-content: flex-end;
		background: none;
		border: none;
		font-size: 26px;
		cursor: pointer;
		color: #666;
		padding: 10px 16px 6px;
		line-height: 1;
	}
	.eh-sidebar-close-btn:hover { color: #111; }

	/* Nav reverts to clean vertical list */
	.eh-sidebar-nav {
		display: block !important;
		flex-wrap: unset !important;
	}

	.eh-sidebar-item {
		flex: none !important;
		width: 100%;
		border-left: 3px solid transparent !important;
		border-bottom: none !important;
		justify-content: flex-start !important;
		font-size: .875rem !important;
		padding: 10px 16px !important;
	}
}
