/* ── ZafaPay Docs Sidebar ────────────────────────────────────── */

.zfp-docs-sidebar {
	min-height: 100%;
}

.elementor-widget-zafapay_docs_sidebar > .elementor-widget-container {
	padding: 0 !important;
	height: 100%;
}

/* ── Search input ────────────────────────────────────────────── */

.zfp-sidebar-search {
	display: block !important;
	width: 100% !important;
	height: 36px !important;
	padding: 0 2rem 0 2.25rem !important;   /* pr-8 pl-9 */
	font-size: 13.2px !important;
	font-family: inherit !important;
	line-height: 1.4 !important;
	border-radius: 0.5rem !important;        /* rounded-lg */
	background-color: #f4f4f5 !important;   /* zinc-100 */
	border: 1px solid transparent !important;
	color: #18181b !important;              /* zinc-900 */
	box-shadow: none !important;
	outline: none !important;
	transition: border-color 0.15s ease !important;
	box-sizing: border-box !important;
}

.zfp-sidebar-search::placeholder {
	color: #a1a1aa !important; /* zinc-400 */
}

.zfp-sidebar-search:focus {
	border-color: rgba(56, 189, 248, 0.6) !important; /* sky-400/60 */
	outline: none !important;
	box-shadow: none !important;
}

html.dark .zfp-sidebar-search {
	background-color: #18181b !important; /* zinc-900 */
	color: #f4f4f5 !important;
}

html.dark .zfp-sidebar-search::placeholder {
	color: #71717a !important; /* zinc-500 */
}

/* ── Nav items ───────────────────────────────────────────────── */

.zfp-nav-item {
	display: flex !important;
	align-items: center;
	gap: 0.5rem;
	border-radius: 0.375rem;
	padding: 0.375rem 0.5rem;
	text-decoration: none !important;
	transition: background-color 0.15s ease;
	position: relative;
}

.zfp-nav-item span {
	font-size: 13.2px !important;
	color: #52525b !important; /* zinc-600 */
	transition: color 0.15s ease;
	text-transform: none !important;
	letter-spacing: normal !important;
}

.zfp-nav-item {
	background-color: transparent !important;
}

.zfp-nav-item:hover {
	background-color: #f4f4f5 !important; /* zinc-100 */
	text-decoration: none !important;
}

.zfp-nav-item:hover span {
	color: #18181b !important; /* zinc-900 */
}

/* Active item */
.zfp-nav-item[aria-current="page"] {
	background-color: rgba(14, 165, 233, 0.1) !important; /* sky-500/10 */
}

.zfp-nav-item[aria-current="page"] span {
	font-size: 13.2px !important;
	font-weight: 600 !important;
	color: rgb(45,107,207) !important; /* sky-500 */
}

/* Active left bar */
.zfp-nav-item[aria-current="page"] > span.absolute {
	position: absolute;
	left: 0;
	top: 4px;
	bottom: 4px;
	width: 3px;
	border-radius: 9999px;
	background-color: rgb(45,107,207); /* sky-500 */
}

/* Dark mode nav */
html.dark .zfp-nav-item span {
	color: #a1a1aa !important; /* zinc-400 */
}

html.dark .zfp-nav-item:hover {
	background-color: rgba(39, 39, 42, 0.5) !important; /* zinc-800/50 */
}

html.dark .zfp-nav-item:hover span {
	color: #e4e4e7 !important; /* zinc-200 */
}

html.dark .zfp-nav-item[aria-current="page"] {
	background-color: rgba(56, 189, 248, 0.15) !important; /* sky-400/15 */
}

html.dark .zfp-nav-item[aria-current="page"] span {
	font-weight: 600 !important;
	color: rgb(88,145,225) !important; /* sky-400 */
}

html.dark .zfp-nav-item[aria-current="page"] > span.absolute {
	background-color: rgb(88,145,225); /* sky-400 */
}

/* ── Group headings ──────────────────────────────────────────── */

.zfp-docs-sidebar [role="listitem"] > span,
.zfp-docs-sidebar .px-2 > span {
	font-size: 10.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #a1a1aa; /* zinc-400 */
}

html.dark .zfp-docs-sidebar [role="listitem"] > span,
html.dark .zfp-docs-sidebar .px-2 > span {
	color: #71717a; /* zinc-500 */
}

/* ── Collapsible button ──────────────────────────────────────── */

.zfp-collapsible-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	border: none;
	background-color: transparent !important;
	border-radius: 0.375rem;
	padding: 0.375rem 0.5rem;
	cursor: pointer;
	text-align: left;
	transition: background-color 0.15s ease;
}

.zfp-collapsible-btn > span:first-of-type {
	font-size: 13.2px !important;
	font-weight: 500 !important;
	color: #3f3f46 !important; /* zinc-700 */
	text-transform: none !important;
	letter-spacing: normal !important;
}

.zfp-collapsible-btn:hover {
	background-color: #f4f4f5 !important; /* zinc-100 */
}

html.dark .zfp-collapsible-btn > span:first-of-type {
	color: #d4d4d8 !important; /* zinc-300 */
}

html.dark .zfp-collapsible-btn:hover {
	background-color: rgba(39, 39, 42, 0.5) !important;
}

.zfp-collapsible-btn .zfp-chevron {
	color: #a1a1aa !important;
	margin-left: auto;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

html.dark .zfp-collapsible-btn .zfp-chevron {
	color: #71717a !important;
}

/* ── Collapsible panel ───────────────────────────────────────── */

.zfp-collapsible-children {
	overflow: hidden;
	transition: height 0.2s ease;
}

/* ── Scrollbar ───────────────────────────────────────────────── */

.zfp-sidebar-nav {
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.zfp-sidebar-nav::-webkit-scrollbar {
	width: 0;
	background: transparent;
}

.zfp-sidebar-nav:hover {
	scrollbar-width: thin;
	scrollbar-color: #d4d4d8 transparent;
}

.zfp-sidebar-nav:hover::-webkit-scrollbar {
	width: 6px;
}

.zfp-sidebar-nav:hover::-webkit-scrollbar-thumb {
	background-color: #d4d4d8;
	border-radius: 3px;
}

html.dark .zfp-sidebar-nav:hover {
	scrollbar-color: #3f3f46 transparent;
}

html.dark .zfp-sidebar-nav:hover::-webkit-scrollbar-thumb {
	background-color: #3f3f46;
}

/* ── Focus ring ──────────────────────────────────────────────── */

.zfp-nav-item:focus-visible,
.zfp-collapsible-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.25);
	border-radius: 6px;
}

html.dark .zfp-nav-item:focus-visible,
html.dark .zfp-collapsible-btn:focus-visible {
	box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

/* ── Environment toggle ──────────────────────────────────────── */

.zfp-env-toggle-wrap {
	transition: background-color 0.2s ease;
}

.zfp-env-dot {
	width: 8px;
	height: 8px;
	border-radius: 9999px;
	background-color: rgb(45,107,207); /* sky-500, overridden by JS */
	transition: background-color 0.2s ease;
}

.zfp-env-label {
	font-size: 13.2px;
	font-weight: 600;
	color: rgb(45,107,207); /* sky-500, overridden by JS */
	transition: color 0.2s ease;
}

.zfp-env-track {
	transition: background-color 0.2s ease;
}

/* ── Clear button ────────────────────────────────────────────── */

.zfp-search-clear {
	background: none !important;
	border: none !important;
	padding: 0 !important;
	cursor: pointer;
	line-height: 1;
}

/* Tailwind-free semantic layout */
.hidden {
	display: none !important;
}

.zfp-docs-sidebar {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 100%;
	background-color: #fff;
	border-right: 1px solid #f4f4f5;
	padding-right: 0.5rem;
}

html.dark .zfp-docs-sidebar {
	background-color: transparent;
	border-color: #27272a;
}

@media (max-width: 1023px) {
	.zfp-docs-sidebar {
		border-right: none;
		padding-right: 0;
	}
}

.zfp-search-wrap {
	flex-shrink: 0;
	padding: 4px 12px 12px;
}

.zfp-search-inner {
	position: relative;
}

.zfp-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #a1a1aa;
	pointer-events: none;
}

html.dark .zfp-search-icon {
	color: #71717a;
}

.zfp-search-clear {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	color: #a1a1aa;
	transition: color 0.15s ease;
}

.zfp-search-clear:hover {
	color: #52525b;
}

html.dark .zfp-search-clear {
	color: #71717a;
}

html.dark .zfp-search-clear:hover {
	color: #d4d4d8;
}

.zfp-sidebar-nav {
	flex: 1 1 0%;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0 8px 80px;
}

.zfp-nav-list,
.zfp-section-children,
.zfp-col-inner {
	display: flex;
	flex-direction: column;
}

.zfp-nav-list {
	gap: 4px;
}

.zfp-section-children,
.zfp-col-inner {
	gap: 2px;
}

.zfp-col-inner {
	padding-top: 2px;
}

.zfp-nav-text {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.zfp-nav-active-bar {
	position: absolute;
	left: 0;
	top: 4px;
	bottom: 4px;
	width: 3px;
	border-radius: 9999px;
	background-color: rgb(45,107,207);
}

html.dark .zfp-nav-active-bar {
	background-color: rgb(88,145,225);
}

.zfp-section-sep {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #f4f4f5;
}

html.dark .zfp-section-sep {
	border-color: #27272a;
}

.zfp-section-label-wrap {
	margin-bottom: 4px;
	padding: 0 8px;
}

.zfp-group-heading {
	padding: 16px 8px 6px;
}

.zfp-section-label-wrap > span,
.zfp-group-heading > span {
	font-size: 10.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #a1a1aa;
}

html.dark .zfp-section-label-wrap > span,
html.dark .zfp-group-heading > span {
	color: #71717a;
}

.zfp-env-toggle-wrap {
	flex-shrink: 0;
	margin: 0 12px 12px;
	padding: 10px;
	border-radius: 8px;
	background-color: rgba(14,165,233,0.05);
}

html.dark .zfp-env-toggle-wrap {
	background-color: rgba(56,189,248,0.05);
}

.zfp-env-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.zfp-env-left {
	display: flex;
	align-items: center;
	gap: 8px;
}

.zfp-env-switch-label {
	position: relative;
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	user-select: none;
}

.zfp-env-checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.zfp-env-track {
	width: 40px;
	height: 22px;
	border-radius: 9999px;
	background-color: #d4d4d8;
}

html.dark .zfp-env-track {
	background-color: #3f3f46;
}

.zfp-env-knob {
	position: absolute;
	left: 3px;
	top: 3px;
	width: 16px;
	height: 16px;
	border-radius: 9999px;
	background-color: #fff;
	box-shadow: 0 1px 2px rgba(0,0,0,0.15);
	transition: transform 0.2s ease;
}

.zfp-env-checkbox:checked ~ .zfp-env-knob {
	transform: translateX(18px);
}

.zfp-docs-sidebar[data-env="production"] .zfp-env-dot,
.zfp-docs-sidebar[data-env="production"] .zfp-env-track {
	background-color: rgb(45,107,207);
}

html.dark .zfp-docs-sidebar[data-env="production"] .zfp-env-dot,
html.dark .zfp-docs-sidebar[data-env="production"] .zfp-env-track {
	background-color: rgb(88,145,225);
}

.zfp-docs-sidebar[data-env="sandbox"] .zfp-env-dot {
	background-color: #f59e0b;
}

/* ── Mobile off-canvas drawer support ────────────────────────────
   Quy uoc CSS ID co dinh khi dat widget nay trong 1 drawer mobile
   (dung chung voi widget "ZafaPay Mobile Drawer Toggle"):
     #zfp-docs-drawer         Container ngoai cung (bien thanh panel fixed)
     #zfp-docs-drawer-scroll  Container chua back-link + heading + widget nay
     #zfp-docs-drawer-footer  Container footer (social links...), ghim day
   Elementor co the tu chen them div bao (.e-con-inner khi content-width
   la "boxed", hoac container long nhau) — cac rule duoi day tu thich nghi
   voi bat ky so lop long nao, khong phu thuoc cau truc DOM cu the. */

@media (max-width: 1023px) {
	/* Ep flex-direction:column ngay tren chinh #zfp-docs-drawer (khong chi
	   qua .e-con-inner) — vi Elementor mac dinh flex-direction:row cho
	   container, khien cac con tinh width qua flex-basis (co the dinh gia
	   tri rac tu luc dung page, VD 291%) thay vi qua thuoc tinh width binh
	   thuong, lam vo layout du da set width:100% !important. */
	#zfp-docs-drawer {
		display: flex !important;
		flex-direction: column !important;
		overflow: hidden !important;
	}

	#zfp-docs-drawer > .e-con-inner {
		display: flex !important;
		flex-direction: column !important;
		height: 100% !important;
		overflow: hidden !important;
	}

	#zfp-docs-drawer-scroll {
		display: flex !important;
		flex-direction: column !important;
		flex: 1 1 100% !important;
		min-height: 0 !important;
		min-width: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		max-height: none !important;
		overflow-y: auto !important;
		overflow-x: hidden !important;
		box-sizing: border-box !important;
	}

	/* Moi lop container Elementor tu chen bao quanh widget deu phai
	   thanh flex column va gian het khong gian con lai. min-width:0 bat
	   buoc phai co — thieu no thi flex item khong tu co hep lai theo
	   drawer duoc, khien input/hang toggle ben trong bi tran ra ngoai. */
	#zfp-docs-drawer-scroll div:has(.elementor-widget-zafapay_docs_sidebar) {
		display: flex !important;
		flex-direction: column !important;
		flex: 1 1 auto !important;
		min-height: 0 !important;
		min-width: 0 !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}

	#zfp-docs-drawer-scroll .elementor-widget-zafapay_docs_sidebar {
		display: flex !important;
		flex-direction: column !important;
		flex: 1 1 auto !important;
		min-height: 0 !important;
		min-width: 0 !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}

	#zfp-docs-drawer-scroll .elementor-widget-zafapay_docs_sidebar > .elementor-widget-container {
		flex: 1 1 auto !important;
		min-height: 0 !important;
		min-width: 0 !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}

	#zfp-docs-drawer-footer {
		flex: 0 0 auto !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
		margin-top: auto !important;
	}
}
