/**
 * VERHI BetterDocs navigation & footer layer - v3.5.117
 *
 * This file is loaded ONLY on BetterDocs pages (single docs, docs archives,
 * docs taxonomies and pages using BetterDocs blocks). It contains just the
 * site header navigation dropdown and footer accordion refinements so the
 * BetterDocs document content keeps the plugin's native rendering.
 *
 * Desktop (>= 1025px):
 *   - Products mega menu accordions open by default; clicking never closes
 *     any pane, and the toggle arrows are hidden.
 *   - Footer accordions follow the same open-by-default / no-close rule and
 *     hide their toggle arrows.
 * Tablet/mobile (<= 1024px):
 *   - Accordions start closed, open on click, keep the toggle arrows, and
 *     keep the one-open/one-closed click linkage.
 *
 * Selectors are scoped to .verhi-products-mega and .site-footer only, so no
 * BetterDocs content selector is touched.
 */

/* Accordion + tab-card refinement -------------------------------------- */

@media (min-width: 1025px) {
	/* BetterDocs layout-7 sidebar uses z-index:9999. Keep the header and its
	   mega menu above it so the Products dropdown is never covered. */
	#masthead.site-header {
		z-index: 10000;
	}

	#masthead .header-navigation .verhi-products-mega > ul.sub-menu {
		z-index: 10010;
	}

	/* Empty custom-link anchor inside the mega element is not needed. */
	.verhi-products-mega > ul.sub-menu > li > a {
		display: none;
	}

	/* Structural guards: keep Kadence rows/columns inside the viewport. */
	.verhi-products-mega .kb-row-layout-wrap,
	.verhi-products-mega .kt-row-column-wrap,
	.verhi-products-mega .wp-block-kadence-column,
	.verhi-products-mega .kt-inside-inner-col,
	.verhi-products-mega .kt-tabs-wrap,
	.verhi-products-mega .kt-tabs-title-list,
	.verhi-products-mega .kt-tabs-content-wrap,
	.verhi-products-mega .wp-block-kadence-tab {
		box-sizing: border-box;
		max-width: 100%;
		min-width: 0;
	}

	/* Accordions: JS opens them on desktop; no toggle arrows, clean headers. */
	.verhi-products-mega .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger {
		display: none !important;
	}

	/* Footer accordions: hide the toggle arrows on desktop only. */
	.site-footer .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger {
		display: none !important;
	}

	/* Left tab-card rail keeps one gray surface; right panel stays white. */
	.verhi-products-mega > ul.sub-menu > li > .kb-row-layout-wrap:first-of-type > .kt-row-column-wrap > .wp-block-kadence-column:first-of-type > .kt-inside-inner-col {
		background-color: #f5f5f5;
		/* The outer row wrapper keeps Kadence's edge padding, so pull the
		   gray surface to the panel edge while its content stays padded.
		   The right column and the area below remain untouched. */
		margin-left: calc(-1 * var(--global-content-edge-padding, 15px));
		padding-left: var(--global-content-edge-padding, 15px);
		width: calc(100% + var(--global-content-edge-padding, 15px));
	}

	.verhi-products-mega .kt-blocks-accordion-header {
		background: transparent !important;
		border: 0 !important;
		border-bottom: 1px solid #e3ebf5 !important;
		border-radius: 0 !important;
		padding: 15px 6px 13px 0 !important;
	}

	.verhi-products-mega .kt-blocks-accordion-header:hover,
	.verhi-products-mega .kt-blocks-accordion-header.kt-accordion-panel-active {
		background: transparent !important;
	}

	.verhi-products-mega .kt-accordion-panel-inner {
		background: transparent !important;
		border: 0 !important;
		padding: 12px 6px 14px 0 !important;
	}

	/* Product link lists stay light and easy to scan. */
	.verhi-products-mega .kb-table td,
	.verhi-products-mega .kb-table-data {
		border: 0 !important;
		padding: 8px 6px !important;
	}

	.verhi-products-mega .kb-table a {
		display: inline-block;
		transition: color .2s ease;
	}

	/* Huawei-style mega menu copy: only the Products panel, footer untouched. */
	ul.menu .verhi-products-mega .kt-blocks-accordion-header {
		padding: 13px 6px 12px 0 !important;
	}

	ul.menu .verhi-products-mega .kt-accordion-panel-inner {
		padding: 10px 6px 14px 0 !important;
	}
}

/* Tablet and mobile: keep the Kadence native accordion interaction. ------- */

@media (max-width: 1024px) {
	.verhi-products-mega > ul.sub-menu > li > .kb-row-layout-wrap {
		box-sizing: border-box;
		max-width: 100%;
		width: 100%;
		padding: 0;
	}

	.verhi-products-mega .kb-row-layout-wrap,
	.verhi-products-mega .kt-row-column-wrap,
	.verhi-products-mega .wp-block-kadence-column,
	.verhi-products-mega .kt-inside-inner-col,
	.verhi-products-mega .kt-tabs-wrap,
	.verhi-products-mega .kt-tabs-title-list,
	.verhi-products-mega .kt-tabs-content-wrap,
	.verhi-products-mega .wp-block-kadence-tab {
		box-sizing: border-box;
		max-width: 100%;
		min-width: 0;
	}

	/* Chevron trigger refined for the VERHI color system. */
	.verhi-products-mega .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger,
	.site-footer .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger {
		background: transparent !important;
		height: 14px !important;
		min-width: 14px !important;
		width: 14px !important;
	}

	.verhi-products-mega .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger::before,
	.verhi-products-mega .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger::after,
	.site-footer .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger::before,
	.site-footer .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger::after {
		background: #16324f;
		border-radius: 2px;
		content: "";
		height: 2px !important;
		left: auto !important;
		right: auto !important;
		top: 4px !important;
		transition: transform .22s ease, background .22s ease;
		width: 7px !important;
	}

	.verhi-products-mega .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger::before,
	.site-footer .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger::before {
		left: 2px !important;
		transform: rotate(45deg);
	}

	.verhi-products-mega .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger::after,
	.site-footer .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger::after {
		left: 7px !important;
		transform: rotate(-45deg);
	}

	.verhi-products-mega .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger::before,
	.verhi-products-mega .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger::after,
	.verhi-products-mega .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger::before,
	.verhi-products-mega .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger::after,
	.site-footer .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger::before,
	.site-footer .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger::after,
	.site-footer .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger::before,
	.site-footer .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger::after {
		background: #c7000b;
	}

	.verhi-products-mega .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger::before,
	.site-footer .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger::before {
		transform: rotate(-45deg);
	}

	.verhi-products-mega .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger::after,
	.site-footer .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger::after {
		transform: rotate(45deg);
	}

	.verhi-products-mega .kt-blocks-accordion-header {
		background: #ffffff !important;
		border: 0 !important;
		border-bottom: 1px solid #e3ebf5 !important;
		border-radius: 0 !important;
		padding: 14px 6px 12px 0 !important;
	}

	.verhi-products-mega .kt-accordion-panel-inner {
		background: transparent !important;
		border: 0 !important;
		padding: 8px 6px 12px 0 !important;
	}
}
