/*prevent FOUC on mobile when using sidebar */
.dwc-mobile :is(.bricks-is-frontend.brx-header-left, .bricks-is-frontend.brx-header-right) #brx-header {
  position: relative;
  inline-size: 100%;
  flex-direction: column;
}

.dwc-mobile .bricks-is-frontend:is(.brx-header-left, .brx-header-right) :is(#brx-content, #brx-footer) {
  margin-inline-start: 0;
}

/*prevent FOUC on desktop when using sidebar */
.bricks-is-frontend:is(.brx-header-left, .brx-header-right):not(.show-nav) .dwc-nav-wrapper {
  display: none;
}

/*=== sidebar css ===*/
html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header {
  flex-direction: column;
  box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.7);  
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]).no-scroll {
  overflow: visible;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu.brxe-nav-nested .brx-nav-nested-items {
  max-block-size: 100dvb;
  padding-block-end: 12rem;
  overscroll-behavior: contain;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nav-wrapper {
  position: relative;
  overflow: hidden;
  block-size: 100%;
  transform: translateX(0%);
  visibility: visible;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) .dwc-nest-menu .brxe-toggle {
  display: none !important;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu {
  display: flex;
  flex-direction: column;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-header > div {
  display: flex;
  grid-template-columns: 1fr;
  block-size: 100%;
  flex-direction: column;
  justify-content: flex-start;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-menu-wrap {
  inline-size: 100%;
  display: grid;
  grid-template-columns: 1fr;
  block-size: 100%;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header :is(.brxe-code, .dwc-nest-menu-overlay) {
  display: none;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-header {
  inline-size: 100%;
  padding-inline: 0;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu-top {
  min-block-size: var(--top-offset);
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu:not( [data-hide-close-bar = 'true']) .brx-dropdown-content {
  inset-block-start: calc(var(--top-offset) + 1px) !important;

}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu:not( [data-submenu-reveal = 'slide']) .brx-dropdown-content:not([data-submenu-reveal = 'slide'] *) {  
  inset-inline-start: 0;
  inset-block-start: unset !important;
  overflow: hidden;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu:not([data-submenu-reveal = 'slide']) .brxe-dropdown:not(.open.active) > .brx-dropdown-content > .brxe-dropdown:not([data-submenu-reveal = 'slide'] *){
  visibility: hidden;  
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu.brxe-nav-nested.brx-open .brxe-dropdown > .brx-dropdown-content {
  overscroll-behavior: contain;
  min-inline-size: var(--mobile-menu-width);

}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu .brxe-dropdown.open > .brx-submenu-toggle button:not([data-submenu-reveal = 'expand'] button)  {
  min-block-size: calc(var(--top-offset) - 1px);
  inset-block-start: 0;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu .brxe-dropdown.open[data-submenu-reveal = 'slide'] > .brx-submenu-toggle button  {
  min-block-size: calc(var(--top-offset) - 1px);
  inset-block-start: 0;
}

html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu .brxe-dropdown .brx-submenu-toggle button {
  min-block-size: 0;    
}

/* sidebar css ends*/



/*sidebar in builder*/
/*=== sidebar css ===*/
:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header {
  flex-direction: column;
  box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.7);
  --top-offset: 40px;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-menu.brxe-nav-nested .brx-nav-nested-items {
  max-block-size: 100dvb;
  padding-block-end: 12rem;
  overscroll-behavior: contain;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nav-wrapper {
  position: relative;
  overflow: hidden;
  block-size: 100%;
  transform: translateX(0%);
  visibility: visible;
}

body:is(.brx-header-left, .brx-header-right)[data-builder-window] .dwc-nest-menu .brxe-toggle {
  display: none !important;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-menu {
  display: flex;
  flex-direction: column;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-header > div {
  display: flex;
  grid-template-columns: 1fr;
  block-size: 100%;
  flex-direction: column;
  justify-content: flex-start;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-menu-wrap {
  inline-size: 100%;
  display: grid;
  grid-template-columns: 1fr;
  block-size: 100%;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-header {
  inline-size: 100%;
  padding-inline: 0;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-menu-top {
  min-block-size: var(--top-offset);
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-menu .brx-dropdown-content {
  inset-block-start: calc(var(--top-offset) - 1px) !important;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-menu.brxe-nav-nested.brx-open .brxe-dropdown > .brx-dropdown-content {
  overscroll-behavior: contain;  
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-menu .brxe-dropdown.open > .brx-submenu-toggle button {
  min-block-size: calc(var(--top-offset) - 1px);
  inset-block-start: 0;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-menu .brxe-dropdown .brx-submenu-toggle button {
  min-block-size: 0;    
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] .dwc-nest-menu {
  margin: 0 !important;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] .brx-nav-nested-items {  
  flex-direction: column !important;  
}
   
:is(.brx-header-left, .brx-header-right)[data-builder-window] .dwc-nest-toggle--open.brxe-toggle {
  display: flex !important;
}
 
:is(.brx-header-left, .brx-header-right)[data-builder-window] .dwc-nest-menu .brx-nav-nested-items {
  position: relative !Important;
  background: var(--mobile-menu-bg) !important;
  align-items: stretch;
  flex: 1;
}

:where(.brx-header-left, .brx-header-right)[data-builder-mode]:not(:has(.dwc-sidebar)) .dwc-nest-menu-top::before {
    content: 'this space is the back text bar';
    padding: 1rem;
    background-color: gray;
    color: white;
    width: 100%;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}
 
/* MENU CTA (LAST BUTTON) */
:is(.brx-header-left, .brx-header-right)[data-builder-window] [data-last-item-is-button="true"].dwc-nest-menu .brx-nav-nested-items > .menu-item:last-of-type {
  padding-inline: var(--menu-item-inline-padding) !important;
  padding-block: var(--menu-item-block-padding) !important;
}
 
:is(.brx-header-left, .brx-header-right)[data-builder-window] .dwc-nest-menu-top {
  min-block-size: 80px !important;
}
 
:is(.brx-header-left, .brx-header-right)[data-builder-window] .dwc-nest-nav-items {
  overflow-y: scroll;
}

:is(.brx-header-left, .brx-header-right)[data-builder-mode] .brx-dropdown-content {
  min-inline-size: var(--mobile-menu-width);
  position: static;
}

:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-menu.brxe-nav-nested .brx-nav-nested-items {
  flex-wrap: nowrap;
}
:is(.brx-header-left, .brx-header-right)[data-builder-window] #brx-header .dwc-nest-menu .brx-dropdown-content {   
  visibility: visible !important;
  opacity: 1;
}

/*OVERLAY SIDEBAR*/


html:not(.dwc-mobile):has([data-overlay-sidebar=true])  {
 --mobile-menu-bg: rgb(255 255 255 / 0%);
  --menu-item-border: solid 1px rgb(255 255 255 / 50%);
 
}

html:not(.dwc-mobile):has([data-overlay-sidebar=true]) :is(.brx-header-left, .brx-header-right):not([data-builder-modee]) :is(main, footer){
  margin: 0 !important
}

html:not(.dwc-mobile):has([data-overlay-sidebar=true]) :is(.brx-header-left, .brx-header-right):not([data-builder-modee]) :is(main, footer) :where(section):not(section>section) {
  padding-inline-start: calc(var(--mobile-menu-width) + clamp(1.5rem, calc(0.625vw + 1.375rem), 1.875rem));
  max-inline-size: 100%
}

html:not(.dwc-mobile):has([data-overlay-sidebar=true]) :is(.brx-header-left, .brx-header-right):not([data-builder-modee]) #brx-header {
  border-radius: var(--overlay-sidebar-radius);
  overflow: hidden;
  background: var(--overlay-sidebar-bg);
  box-shadow: var(--overlay-sidebar-shadow) !important;
  inset: var(--overlay-sidebar-inset);
}

html:not(.dwc-mobile):has([data-overlay-sidebar=true]) :is(.brx-header-left, .brx-header-right):not([data-builder-modee]) .dwc-nest-header{
  backdrop-filter: blur(13px);
  background: transparent !important;
}

html:not(.dwc-mobile):has([data-overlay-sidebar=true]):not([data-builder-modee])  .brx-dropdown-content {
   background-color: rgb(255 255 255 / 100%);
}

/*NO BRX-OPEN STYLES*/
html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) #brx-header .dwc-nest-menu.brxe-nav-nested .brx-nav-nested-items {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: column !important;
}


  html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) .dwc-nest-menu.brxe-nav-nested .brxe-dropdown .brx-dropdown-content {
      visibility: visible;
      min-inline-size: var(--mobile-menu-width) !important;
  }


  html:not(.dwc-mobile) :is(.brx-header-left, .brx-header-right):not([data-builder-window]) .dwc-nest-menu[data-submenu-reveal="expand"] .brxe-dropdown.open>.brx-dropdown-content {
   position: static;
}


class SidebarNavigation {
  constructor(options = {}) {
    // Basic configuration properties
    this.config = {
      minWidth: options.minWidth || MegaMenuCONFIG.minWidth, // Using external minWidth variable
      menuSelector: options.menuSelector || '.dwc-nest-menu',
      openClass: options.openClass || 'brx-open',
      activeClasses: options.activeClasses || ['open', 'active'],
      leftHeaderClass: options.leftHeaderClass || 'brx-header-left',
      rightHeaderClass: options.rightHeaderClass || 'brx-header-right',
      debounceDelay: options.debounceDelay || 100,
      menuItemClickDelay: options.menuItemClickDelay || 300
    };
    
    // Set dependent selectors
    const menuSelector = this.config.menuSelector;
    this.config.submenuToggleSelector = options.submenuToggleSelector || `${menuSelector} .brx-submenu-toggle`;
    this.config.dropdownSelector = options.dropdownSelector || `${menuSelector} .brxe-dropdown`;
    this.config.dropdownContentSelector = options.dropdownContentSelector || `${menuSelector} .brx-dropdown-content`;
    
    // State
    this.previousHeaderClass = null;
    this.dropdownClickHandlers = new Map();
    this.menuHoverHandlers = null;
    this.menuItemClickTimeout = null;
    this.keyboardNavHandler = null;
    this.cachedFocusableElements = null;
    this.cachedElements = {
      menuElement: null,
      navElement: null,
      dropdowns: null,
      dropdownToggles: null,
      menuItems: null
    };
    
    // Bind methods to this instance
    this.handleResize = this.debounce(this.handleMenu.bind(this), this.config.debounceDelay);
    this.handleOutsideClick = this.handleOutsideClick.bind(this);
  }
  
  // Initialize everything - called once
  init() {
    // Wait for DOM to be fully loaded before attaching events
    if (document.readyState === 'loading') {
      document.addEventListener('DOMContentLoaded', () => {
        this.initAfterDOMLoaded();
      }, { once: true });
    } else {
      this.initAfterDOMLoaded();
    }
    
    return this;
  }
  
  // Separate initialization method to run after DOM is loaded
  initAfterDOMLoaded() {
    // Cache DOM elements once
    this.cacheElements();
    
    // Setup resize event with passive flag
    window.addEventListener('resize', this.handleResize, { passive: true });
    
    // Setup mutation observer for critical class changes only
    this.setupMutationObserver();
    
    // Initial setup based on current screen size
    this.handleMenu();
    
    // Cache focusable elements once if header class is present
    if (this.hasHeaderClass()) {
      this.cacheFocusableElements();
      this.setupMenuFocusNavigation();
    }
  }
  
  // Cache all required DOM elements upfront
  cacheElements() {
    this.cachedElements.menuElement = document.querySelector(this.config.menuSelector);
    
    if (this.cachedElements.menuElement) {
      this.cachedElements.navElement = this.cachedElements.menuElement.querySelector('.dwc-nest-nav-items');
      this.cachedElements.dropdowns = Array.from(document.querySelectorAll(this.config.dropdownSelector));
      this.cachedElements.dropdownToggles = Array.from(document.querySelectorAll(this.config.submenuToggleSelector));
      this.cachedElements.menuItems = Array.from(document.querySelectorAll(`${this.config.menuSelector} .menu-item`));
    }
  }
  
  // Set up a focused mutation observer only for dropdown state changes
  setupMutationObserver() {
    if (!this.cachedElements.dropdowns || this.cachedElements.dropdowns.length === 0) return;
    
    const callback = (mutations) => {
      for (let mutation of mutations) {
        if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
          const target = mutation.target;
          const prevClassList = mutation.oldValue ? mutation.oldValue.split(' ') : [];
          const hadBothBefore = prevClassList.includes('open') && prevClassList.includes('active');
          const hasBothNow = target.classList.contains('open') && target.classList.contains('active');
    
          if (hadBothBefore !== hasBothNow) {
            this.updateDropdownAccessibility();
            break; // Only need to update once per batch
          }
        }
      }
    };
    
    // Create observer with optimized options
    this.classObserver = new MutationObserver(callback);
    
    // Observe only the dropdown elements
    this.cachedElements.dropdowns.forEach(dropdown => {
      this.classObserver.observe(dropdown, { 
        attributes: true, 
        attributeFilter: ['class'], 
        attributeOldValue: true 
      });
    });
  }
  
  // Cache focusable elements for keyboard navigation
  cacheFocusableElements() {
    if (!this.cachedElements.navElement) return;
    
    // Get direct children of nav
    const directChildren = Array.from(this.cachedElements.navElement.children);
    
    // Find the first focusable element within each direct child
    this.cachedFocusableElements = directChildren.map(child => {
      // Check if the child itself is focusable
      if (child.matches('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])')) {
        return child;
      }
      // Otherwise, find the first focusable element within this child
      return child.querySelector('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])');
    }).filter(Boolean); // Remove null/undefined values
  }
  
  // Clean up all event listeners and observers
  destroy() {
    // Clean up the mutation observer
    if (this.classObserver) {
      this.classObserver.disconnect();
      this.classObserver = null;
    }
    
    // Clean up resize listener
    window.removeEventListener('resize', this.handleResize);
    
    // Clean up click handlers
    if (this.dropdownClickHandlers.size > 0) {
      this.dropdownClickHandlers.forEach((handler, toggle) => {
        toggle.removeEventListener('click', handler);
      });
      this.dropdownClickHandlers.clear();
    }
    
    // Clean up hover handlers
    this.cleanupMenuHover();
    
    // Clean up menu item click handlers
    this.cleanupMenuItemClicks();
    
    // Clean up outside click handler
    document.removeEventListener('click', this.handleOutsideClick);
    
    // Clean up keyboard navigation
    if (this.keyboardNavHandler) {
      document.removeEventListener('keydown', this.keyboardNavHandler);
      this.keyboardNavHandler = null;
    }
    
    // Clear any pending timeouts
    if (this.menuItemClickTimeout) {
      clearTimeout(this.menuItemClickTimeout);
      this.menuItemClickTimeout = null;
    }
  }
  
  // Utility methods
  hasHeaderClass() {
    return document.body.classList.contains(this.config.leftHeaderClass) || 
           document.body.classList.contains(this.config.rightHeaderClass);
  }
  
  debounce(func, delay) {
    let timer;
    return (...args) => {
      clearTimeout(timer);
      timer = setTimeout(() => func(...args), delay);
    };
  }

  // Check if an element has all the required active classes
  hasAllActiveClasses(element) {
    return this.config.activeClasses.every(className => element.classList.contains(className));
  }
  
  // Toggle all active classes on an element
  toggleActiveClasses(element) {
    this.config.activeClasses.forEach(className => {
      element.classList.toggle(className);
    });
  }
  
  // Core functionality methods
  handleMenu() {
    if (!this.cachedElements.menuElement) return;
    if (!this.hasHeaderClass() && !this.previousHeaderClass) return;

    const screenWidth = window.innerWidth;
    const isLargeScreen = screenWidth >= this.config.minWidth;
    const menuElement = this.cachedElements.menuElement;

    if (!isLargeScreen) {
      // Save which class was present before removal
      if (this.hasHeaderClass()) {
        this.previousHeaderClass = document.body.classList.contains(this.config.leftHeaderClass) 
          ? this.config.leftHeaderClass 
          : this.config.rightHeaderClass;
        
        // Remove header classes
        document.body.classList.remove(this.config.leftHeaderClass, this.config.rightHeaderClass);
        menuElement.classList.remove(this.config.openClass);
        
        // Reset accessibility attributes
        this.resetAccessibilityAttributes();
      }
      
      // Clean up event handlers for mobile view
      this.cleanupMenuHover();
      this.cleanupMenuItemClicks();
      this.cleanupDropdownHandlers();
      document.removeEventListener('click', this.handleOutsideClick);
      
      return;
    }

    // Large screen behavior
    if (!this.hasHeaderClass() && this.previousHeaderClass) {
      document.body.classList.add(this.previousHeaderClass);
    }

    if (this.hasHeaderClass()) {
      if (!menuElement.classList.contains(this.config.openClass)) {
        menuElement.classList.add(this.config.openClass);
      }
      
      // Setup elements for large screen view
      this.setupMenuHover();
      this.setupMenuItemClicks();
      this.setupDropdownHandlers();
      this.setupMenuFocusNavigation();
      this.updateDropdownAccessibility();
      
      // Ensure outside click handler is set up
      document.removeEventListener('click', this.handleOutsideClick);
      document.addEventListener('click', this.handleOutsideClick, { passive: false });
    }
  }
  
  // Reset accessibility attributes when switching to mobile
  resetAccessibilityAttributes() {
    if (!this.cachedElements.dropdowns) return;
    
    // Remove all inert attributes from dropdown contents
    this.cachedElements.dropdowns.forEach(dropdown => {
      const content = dropdown.querySelector(this.config.dropdownContentSelector);
      if (content) {
        content.removeAttribute('inert');
      }
      
      const button = dropdown.querySelector('button');
      if (button) {
        button.setAttribute('aria-expanded', 'false');
      }
    });
  }
  
  setupMenuFocusNavigation() {
    // Only run if hasHeaderClass() is true and we have focusable elements
    if (!this.hasHeaderClass() || !this.cachedFocusableElements || this.cachedFocusableElements.length === 0) {
      return;
    }
    
    // Clean up previous handler if it exists
    if (this.keyboardNavHandler) {
      document.removeEventListener('keydown', this.keyboardNavHandler, true);
      this.keyboardNavHandler = null;
    }
    
    const navMenu = this.cachedElements.menuElement;
    const focusableElements = this.cachedFocusableElements;
    const firstFocusableElement = focusableElements[0];
    const lastFocusableElement = focusableElements[focusableElements.length - 1];
    
    // Find adjacent focusable elements outside the menu (only once during setup)
    const headerElement = navMenu.closest('header') || document.querySelector('header');
    
    // Prepare variables to hold adjacent elements
    let prevFocusableElement = null;
    let nextFocusableElement = null;
    let firstElementAfterHeader = null;
    
    if (headerElement) {
      // Get all focusable elements within the header - do this once and cache the result
      const headerFocusables = Array.from(
        headerElement.querySelectorAll('a:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), select:not([tabindex="-1"]), textarea:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])')
      ).filter(el => window.getComputedStyle(el).display !== 'none');
      
      // Find the index of our first and last menu elements in one pass
      const menuStartIndex = headerFocusables.indexOf(firstFocusableElement);
      const menuEndIndex = headerFocusables.indexOf(lastFocusableElement);
      
      // Cache the adjacent elements
      if (menuStartIndex > 0) {
        prevFocusableElement = headerFocusables[menuStartIndex - 1];
      }
      
      if (menuEndIndex !== -1 && menuEndIndex < headerFocusables.length - 1) {
        nextFocusableElement = headerFocusables[menuEndIndex + 1];
      }
      
      // Pre-calculate the first element after header - but only if needed
      if (!nextFocusableElement) {
        // Use a more efficient selector that targets immediate children of body that aren't the header
        const selector = 'body > *:not(header)';
        const nonHeaderElements = document.querySelectorAll(selector);
        
        // Only process if we have elements
        if (nonHeaderElements.length > 0) {
          // Create a function to find the first focusable element (used later if needed)
          this.findFirstFocusableAfterHeader = () => {
            for (const element of nonHeaderElements) {
              const focusable = element.querySelector('a:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), select:not([tabindex="-1"]), textarea:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])');
              if (focusable && window.getComputedStyle(focusable).display !== 'none') {
                return focusable;
              }
            }
            return null;
          };
        }
      }
    }
    
    // Create keyboard navigation handler with closure over the cached elements
    this.keyboardNavHandler = (e) => {
      // Quick check for Tab key first
      if (e.key !== 'Tab') return;
      
      // Then check if focus is inside the menu
      if (!navMenu.contains(document.activeElement)) return;
      
      let targetElement = null;
      
      // Handle tab navigation at boundaries only
      if (!e.shiftKey && document.activeElement === lastFocusableElement) {
        // Forward tab from last element
        e.preventDefault();
        e.stopPropagation();
        
        if (nextFocusableElement) {
          targetElement = nextFocusableElement;
        } else if (this.findFirstFocusableAfterHeader) {
          // Only search for elements after header if needed and not already found
          firstElementAfterHeader = this.findFirstFocusableAfterHeader();
          targetElement = firstElementAfterHeader;
        }
        
        // Focus on the target or body as fallback
        setTimeout(() => {
          if (targetElement) {
            targetElement.focus();
          } else {
            document.body.setAttribute('tabindex', '-1');
            document.body.focus();
            document.body.removeAttribute('tabindex');
          }
        }, 10);
      } 
      else if (e.shiftKey && document.activeElement === firstFocusableElement) {
        // Backward tab from first element
        e.preventDefault();
        e.stopPropagation();
        
        setTimeout(() => {
          if (prevFocusableElement) {
            prevFocusableElement.focus();
          } else {
            document.body.setAttribute('tabindex', '-1');
            document.body.focus();
            document.body.removeAttribute('tabindex');
          }
        }, 10);
      }
    };
    
    // Use capture phase for the event
    document.addEventListener('keydown', this.keyboardNavHandler, true);
  }
  
  setupMenuHover() {
    const menuElement = this.cachedElements.menuElement;
    if (!menuElement) return;
    
    // Clean up existing hover handlers first
    this.cleanupMenuHover();
    
    // Create event handlers
    const mouseenterHandler = () => {
      menuElement.classList.add(this.config.openClass);
    };
    
    const mouseleaveHandler = () => {
      menuElement.classList.remove(this.config.openClass);
    };
    
    // Add event listeners with passive flag for better performance
    menuElement.addEventListener('mouseenter', mouseenterHandler, { passive: true });
    menuElement.addEventListener('mouseleave', mouseleaveHandler, { passive: true });
    
    // Store the handlers for cleanup
    this.menuHoverHandlers = {
      element: menuElement,
      mouseenter: mouseenterHandler,
      mouseleave: mouseleaveHandler
    };
  }
  
  cleanupMenuHover() {
    if (this.menuHoverHandlers) {
      const { element, mouseenter, mouseleave } = this.menuHoverHandlers;
      element.removeEventListener('mouseenter', mouseenter);
      element.removeEventListener('mouseleave', mouseleave);
      this.menuHoverHandlers = null;
    }
  }
  
  setupMenuItemClicks() {
    if (!this.cachedElements.menuItems || this.cachedElements.menuItems.length === 0) return;
    
    // Clean up existing handlers first
    this.cleanupMenuItemClicks();
    
    const menuElement = this.cachedElements.menuElement;
    const menuItemHandlers = new Map();
    
    this.cachedElements.menuItems.forEach(item => {
      const clickHandler = () => {
        if (this.hasHeaderClass()) {
          // Clear any existing timeout
          if (this.menuItemClickTimeout) {
            clearTimeout(this.menuItemClickTimeout);
          }
          
          // Set timeout before adding the class
          this.menuItemClickTimeout = setTimeout(() => {
            if (!menuElement.classList.contains(this.config.openClass)) {
              menuElement.classList.add(this.config.openClass);
            }
          }, this.config.menuItemClickDelay);
        }
      };
      
      menuItemHandlers.set(item, clickHandler);
      item.addEventListener('click', clickHandler);
    });
    
    this.menuItemClickHandlers = menuItemHandlers;
  }
  
  cleanupMenuItemClicks() {
    if (this.menuItemClickHandlers && this.menuItemClickHandlers instanceof Map) {
      this.menuItemClickHandlers.forEach((handler, item) => {
        item.removeEventListener('click', handler);
      });
      this.menuItemClickHandlers.clear();
    }
    
    if (this.menuItemClickTimeout) {
      clearTimeout(this.menuItemClickTimeout);
      this.menuItemClickTimeout = null;
    }
  }
  
  setupDropdownHandlers() {
    if (!this.hasHeaderClass() || !this.cachedElements.dropdownToggles) return;
    
    // Clean up existing handlers first
    this.cleanupDropdownHandlers();
    
    this.cachedElements.dropdownToggles.forEach(toggle => {
      const clickHandler = (event) => {
        event.stopPropagation();
        event.preventDefault();
        
        const dropdown = toggle.closest(this.config.dropdownSelector);
        if (dropdown) {
          this.toggleActiveClasses(dropdown);
          this.updateDropdownAccessibility();
        }
      };
      
      this.dropdownClickHandlers.set(toggle, clickHandler);
      toggle.addEventListener('click', clickHandler);
    });
  }
  
  cleanupDropdownHandlers() {
    if (this.dropdownClickHandlers.size > 0) {
      this.dropdownClickHandlers.forEach((handler, toggle) => {
        toggle.removeEventListener('click', handler);
      });
      this.dropdownClickHandlers.clear();
    }
  }
  
  handleOutsideClick(event) {
    if (event.target.tagName === 'A') return;
    if (!event.target.closest(this.config.dropdownSelector)) return;
    if (!event.target.closest(this.config.submenuToggleSelector)) {
      event.preventDefault();
      event.stopPropagation();
    }
  }
  
  updateDropdownAccessibility() {
    // Only run if hasHeaderClass() is true
    if (!this.hasHeaderClass() || !this.cachedElements.dropdowns) return;
    
    this.cachedElements.dropdowns.forEach(dropdown => {
      const content = dropdown.querySelector(this.config.dropdownContentSelector);
      const button = dropdown.querySelector('button');
      
      // Check if dropdown has all active classes
      const isOpen = this.hasAllActiveClasses(dropdown);
      
      if (content) {
        if (isOpen) {
          content.removeAttribute('inert');
        } else {
          content.setAttribute('inert', '');
        }
      }
      
      if (button) {
        button.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
      }
    });
  }
}


const sidebarNav = new SidebarNavigation().init();

DEFINED ROUTES BELOW GROUND

Trenching Services for Metro Vancouver Construction Projects

Precision trenching services for drainage, utilities, and foundation work, ensuring efficient and accurate installations. Professional trenching for utilities, drainage, and foundations with precise depth and layout control. VALROC excavates trenches for specified drainage, utility and structural routes. Alignment, depth, access and the receiving trade are established from the project plan and actual site conditions.

Excavating the trench and installing the system inside it are separate scopes.

Workers performing trench excavation with shovels on construction site
ROUTE

Work to the planned alignment

Locate the trench in relation to the destination and nearby services.

DEPTH

Check grade and excavation depth

Use the plan and field conditions to establish the required trench profile.

HANDOFF

Prepare for the next trade

Clarify bedding, inspection, backfill and restoration responsibilities.

HOW THE WORK PROCEEDS

How trenching service is planned and carried out

Whether you’re installing perimeter drainage, underground wiring, or foundation footings, our team ensures each trench is clean, accurate, and ready for the next phase. Efficient material removal and site cleanup The connected stages cover mobilization and careful excavation near existing underground services. The installation that follows depends on whether the trench serves drainage, utilities or a structural element.

  1. Construction site safety briefing with tradespeople and officials

    Step 2

    Trenching Site Prep

    Our trenching service mobilization process includes equipment loading, access path setup, materials prep, and job site safety planning for residential, strata, and commercial excavation projects.

    • Trench mobilization
    • Equipment access
    • Site setup
  2. Utility locating team reviewing site plans to identify water and electrical lines

    Step 3

    Utility Excavation

    Our team carefully locates, marks, and excavates around existing underground utilities, following local regulations and best practices to ensure safety and accuracy.

    • Utility locates
    • Trench alignment
    • Safe excavation

Video, Excavation, Demolition & Site Preparation Overview

A project compilation showing VALROC Development Ltd. performing excavation, demolition, trucking, grading, drainage preparation, asphalt removal, and site preparation services across Metro Vancouver and the Fraser Valley.

can you 

MATCH THE WORK TO THE SITE

Where trenching service fits

VALROC Development Ltd. offers professional trenching services designed for utility installation, foundation tie-ins, drainage lines, and more. Serving residential, strata, and commercial sites across Metro Vancouver, our team uses precision equipment to deliver fast, clean, and code-compliant results.

Purpose-Built Trenching for Every Need in Vancouver

Equipment Built for Tight Access or Deep Work

Mini excavators with retractable rubber tracks for backyard access

Mechanical dumpers that remove spoil efficiently in confined areas

Full-size excavators for large-scale and deep trenching

Custom bucket sizes for specific trench width and depth control

Why Contractors and Homeowners Trust VALROC

Precise layout, depth control, and clean trench lines

Trenching creates a controlled route through the ground for drainage pipe, utility conduit or footing work. Width, grade, ground stability and access vary by site and by the system that will occupy the trench.

UTILITIES

Open a service route

Plan utility locates and the required separation before excavation.

DRAINAGE

Hold the required grade

Coordinate trench elevations with the selected drainage design.

STRUCTURE

Prepare for a footing

Use supplied structural plans to define the excavation.

ACCESS

Select suitable equipment

Match the excavation method to lot access and nearby structures.

DEFINE THE CONTRACTED TASK

Scope choices for trenching service

Trench depth, bedding, spoil removal, backfill and surface restoration depend on the connected system and site conditions. Each stage is coordinated around safe access and the required finished grade.

Trenching work we can coordinate

Included in our service:

  • • Trench route and access review

  • • Utility information checked before excavation

  • • Required depths and grades confirmed

  • • Equipment selected for available site access

  • • Excavated material managed onsite or hauled

  • • Pipe, conduit or drainage interfaces coordinated

  • • Aggregate bedding and backfill placement

  • • Compaction completed in controlled lifts

  • • Work areas protected around occupied properties

  • • Final grading and site cleanup

Bedding, spoil removal, trench protection, backfill and surface restoration depend on the design and agreed handoff. The connected system is not included merely because its trench is excavated.

Coordinate the task and the handoff

COORDINATE THE NEXT PHASE

Coordinate trenching service with adjacent work

Trenching for water, gas, sewer, electrical, and storm lines Footing trench excavation for foundations or retaining walls Integration with other services like drainage, foundations, or slab prep Trenching can prepare routes for perimeter drainage, utility installation, retaining wall footings or foundation work. Each installation and its approvals must be scoped separately.

Utility connections, drainage components, shoring, bedding, backfill and reinstatement are included only when the specific proposal says so.

  • Aaron team member installing a trench drain in front of a garage diverting water that has been damaging the concrete and undermining the foundation

    Trenching for channel drain installation

    • Drain trenching
    • Channel drain
    • Outlet connection

    Trench drains need a prepared channel, stable base and a route to an appropriate outlet. Coordinating excavation and drain installation helps protect elevations and surrounding surfaces.

    Explore trench drain installation
  • To catch basins tied into perimeter drainage system on a new build that was done with Valroc as the contractor in Burnaby Canada

    Trenching for perimeter drainage systems

    • Perimeter drain trench
    • Drain pipe grade
    • Foundation drainage

    Perimeter drainage installation relies on consistent trench depth, pipe fall and suitable bedding around the building. Planned trenching helps the drainage system follow foundation elevations and discharge requirements.

    Explore perimeter drainage systems
  • Perimeter foundation drainage installed around footings

    Foundation trenching for drainage and waterproofing

    • Foundation trenching
    • Waterproofing access
    • Drainage repair

    Existing foundations may need careful excavation to expose walls, drainage pipe and problem areas. Trenching access can support waterproofing repairs while managing soil, utilities and nearby hardscape.

    Explore foundation drainage and waterproofing
  • Catch basin being installed on subbase ground while contractor holds level and excavator helps lift in the catch basin

    Pipe trenching for catch basin connections

    • Catch basin trench
    • Drainage pipe
    • Stormwater connection

    Catch basins need underground pipe routes that carry collected water to an approved destination. Trenching can be coordinated with basin depth, pipe slope and restoration of the surrounding surface.

    Explore catch basin installation
  • Valroc excavators clearing residential demolition debris in Metro Vancouver

    Excavation equipment for larger trenching projects

    • Machine trenching
    • Excavation equipment
    • Soil removal

    Long runs, deeper services and difficult ground may require excavation equipment and coordinated trucking. Matching the machine to the trench improves access, production and material handling.

    Explore excavation and machine services

DOCUMENTED EXPERIENCE

Trenching experience across Metro Vancouver properties

VALROC provides trenching for drainage, utilities and connected construction work across Metro Vancouver. Our crews consider access, depth, soil conditions, existing services and restoration needs so the trench supports the wider project. Based from our Langley construction yard, we mobilize trenching crews throughout Surrey, Burnaby, Coquitlam, Maple Ridge and Richmond, with experience working around municipal requirements, engineers, utilities and occupied properties.

DEFINE THE WORK BEFORE BOOKING

Discuss a trenching service proposal

Share your plans, photos and work goals with VALROC. An onsite review can establish equipment needs, access and the limits of a trenching service scope.

  • Share the task

    Explain the planned excavation, site access and available drawings.

  • Review the property

    Review the route, underground locate information, access, soil, proposed trench dimensions and the work the receiving trade needs next.

  • Confirm the arrangement

    Review equipment, materials, timing and handoff in the written scope.

  • What affects a trenching service estimate?

    Length, depth, width, ground conditions, existing services, access and material removal affect the trenching scope. A current site review is needed for a property specific price.

    What affects a trenching service estimate?

    Length, depth, width, ground conditions, existing services, access and material removal affect the trenching scope. A current site review is needed for a property specific price.

    Request Your Free On-site Estimate

    CHECK THE ACTUAL CONDITIONS

    Assess the site before trenching service

    Proper separation and depth compliance for multiple utilities Safety-first approach to underground work near structures Review the route, underground locate information, access, soil, proposed trench dimensions and the work the receiving trade needs next.

  • 01

    Define the task

    Review the route, underground locate information, access, soil, proposed trench dimensions and the work the receiving trade needs next.

  • 02

    Review access

    Check machine access, adjacent structures and the work area.

  • 03

    Check known services

    Confirm available locate information and any excavation constraints.

  • 04

    Write the scope

    Specify machine work, material handling and handoff responsibilities.

  • What the surface cannot show

    A plan cannot reveal every buried obstruction or ground condition. The excavation method and safety controls must respond to what is found onsite.

    What the surface cannot show

    A plan cannot reveal every buried obstruction or ground condition. The excavation method and safety controls must respond to what is found onsite.

    ANSWERS NEED PROJECT CONTEXT

    Questions about trenching service

    The linked questions cover trench purpose, equipment, depth and safety. Fixed depths or guaranteed outcomes cannot be assumed without a design and site review.

    What is trenching, and why is it necessary for construction projects?

    Trenching is the process of excavating narrow channels in the ground to install utilities, create foundations, or prepare sites for structural work. It is a critical step in excavation and site preparation for:

    • Underground utility installation – Including water lines, sewer systems, electrical conduits, and gas lines.

    • Foundation and footing preparation – Creating trenches for reinforced concrete footings.

    • Drainage systems – Preparing sites for perimeter drainage, sump pumps, and stormwater management.

    • Roadway and driveway trenching – Excavating for curbs, gutters, and drainage solutions.

    • Structural trenching for retaining walls and fencing – Ensuring proper support and anchoring.

    At VALROC Development Ltd., we provide precision trenching services for residential, commercial, and industrial projects, ensuring accurate, efficient, and code-compliant excavation.

    What is trenching, and why is it necessary for construction projects?

    Trenching is the process of excavating narrow channels in the ground to install utilities, create foundations, or prepare sites for structural work. It is a critical step in excavation and site preparation for:

    • Underground utility installation – Including water lines, sewer systems, electrical conduits, and gas lines.

    • Foundation and footing preparation – Creating trenches for reinforced concrete footings.

    • Drainage systems – Preparing sites for perimeter drainage, sump pumps, and stormwater management.

    • Roadway and driveway trenching – Excavating for curbs, gutters, and drainage solutions.

    • Structural trenching for retaining walls and fencing – Ensuring proper support and anchoring.

    At VALROC Development Ltd., we provide precision trenching services for residential, commercial, and industrial projects, ensuring accurate, efficient, and code-compliant excavation.

    What types of trenching services does VALROC offer?

    We specialize in a wide range of trenching solutions, including:

    • Utility trenching – For sewer, water, gas, electrical, and fiber optic installations.

    • Structural trenching – Preparing trenches for concrete footings, retaining walls, and slab foundations.

    • Road and driveway trenching – Excavation for curbs, drainage systems, and asphalt prep.

    • Commercial and industrial trenching – Large-scale excavation for high-load infrastructure projects.

    Our experienced operators and advanced equipment ensure that trenches are dug safely, efficiently, and with exact precision.

    What types of trenching services does VALROC offer?

    We specialize in a wide range of trenching solutions, including:

    • Utility trenching – For sewer, water, gas, electrical, and fiber optic installations.

    • Structural trenching – Preparing trenches for concrete footings, retaining walls, and slab foundations.

    • Road and driveway trenching – Excavation for curbs, drainage systems, and asphalt prep.

    • Commercial and industrial trenching – Large-scale excavation for high-load infrastructure projects.

    Our experienced operators and advanced equipment ensure that trenches are dug safely, efficiently, and with exact precision.

    What equipment does VALROC use for trenching?

    We own and operate a full fleet of excavation equipment, allowing us to handle trenching jobs of all sizes and complexities. Our equipment includes:

    • Excavators with trenching attachments – For deep and wide trench excavation.

    • Trenchers & chain trenchers – For narrow, deep trenches required for utilities.

    • Backhoes & skid steers – For smaller, detailed trenching applications.

    • Laser-guided excavation equipment – Ensuring precise depth and slope control.

    Because we own our equipment, we provide cost-effective and fast turnaround times, avoiding delays from third-party rentals.

    What equipment does VALROC use for trenching?

    We own and operate a full fleet of excavation equipment, allowing us to handle trenching jobs of all sizes and complexities. Our equipment includes:

    • Excavators with trenching attachments – For deep and wide trench excavation.

    • Trenchers & chain trenchers – For narrow, deep trenches required for utilities.

    • Backhoes & skid steers – For smaller, detailed trenching applications.

    • Laser-guided excavation equipment – Ensuring precise depth and slope control.

    Because we own our equipment, we provide cost-effective and fast turnaround times, avoiding delays from third-party rentals.

    How does VALROC ensure trenches are properly excavated and safe?

    Safety and precision are our top priorities. We follow industry best practices, including:

    • Laser-guided trenching – Ensuring accurate depth, alignment, and grading.

    • Shoring & trench boxes – Preventing trench collapse in deep or unstable soil conditions.

    • Soil stabilization techniques – Using compaction and benching methods to prevent erosion.

    • Compliance with excavation safety regulations – Meeting British Columbia’s WorkSafeBC and municipal codes.

    By combining advanced excavation techniques with strict safety protocols, we guarantee trenching work that is stable, efficient, and long-lasting.

    How does VALROC ensure trenches are properly excavated and safe?

    Safety and precision are our top priorities. We follow industry best practices, including:

    • Laser-guided trenching – Ensuring accurate depth, alignment, and grading.

    • Shoring & trench boxes – Preventing trench collapse in deep or unstable soil conditions.

    • Soil stabilization techniques – Using compaction and benching methods to prevent erosion.

    • Compliance with excavation safety regulations – Meeting British Columbia’s WorkSafeBC and municipal codes.

    By combining advanced excavation techniques with strict safety protocols, we guarantee trenching work that is stable, efficient, and long-lasting.

    How deep can VALROC dig trenches?

    The required trench depth depends on the project type and soil conditions, but common trench depths include:

    • Shallow utility trenches – 18 inches to 3 feet for irrigation, fiber optic, and electrical lines.

    • Sewer and drainage trenches – 3 to 8 feet, depending on slope and gravity flow requirements.

    • Foundation and structural trenches – Up to 10 feet or more, based on engineering requirements.

    • Heavy-duty industrial trenching – Varies based on project scope and structural demands.

    With VALROC’s expertise in deep excavation and specialized trenching techniques, we ensure that every trench is built to spec, structurally sound, and ready for the next phase of construction.

    How deep can VALROC dig trenches?

    The required trench depth depends on the project type and soil conditions, but common trench depths include:

    • Shallow utility trenches – 18 inches to 3 feet for irrigation, fiber optic, and electrical lines.

    • Sewer and drainage trenches – 3 to 8 feet, depending on slope and gravity flow requirements.

    • Foundation and structural trenches – Up to 10 feet or more, based on engineering requirements.

    • Heavy-duty industrial trenching – Varies based on project scope and structural demands.

    With VALROC’s expertise in deep excavation and specialized trenching techniques, we ensure that every trench is built to spec, structurally sound, and ready for the next phase of construction.

    What challenges can arise during trenching, and how does VALROC handle them?

    Trenching can encounter various obstacles, but with our experience and equipment, we efficiently manage:

    • Difficult soil conditions – Adapting methods for rocky terrain, clay, or high water tables.

    • Narrow access areas – Using compact excavators and trenching tools for urban or tight spaces.

    • Unforeseen underground utilities – Conducting thorough site assessments and utility locates to avoid disruptions.

    • Weather-related delays – Adjusting excavation schedules for rain, frost, or unstable ground conditions.

    By planning ahead and utilizing advanced excavation techniques, we ensure trenching projects stay on schedule and meet all structural and safety requirements.

    What challenges can arise during trenching, and how does VALROC handle them?

    Trenching can encounter various obstacles, but with our experience and equipment, we efficiently manage:

    • Difficult soil conditions – Adapting methods for rocky terrain, clay, or high water tables.

    • Narrow access areas – Using compact excavators and trenching tools for urban or tight spaces.

    • Unforeseen underground utilities – Conducting thorough site assessments and utility locates to avoid disruptions.

    • Weather-related delays – Adjusting excavation schedules for rain, frost, or unstable ground conditions.

    By planning ahead and utilizing advanced excavation techniques, we ensure trenching projects stay on schedule and meet all structural and safety requirements.

    Does VALROC handle trenching for complex projects like retaining walls and multi-service utility installations?

    Yes! We specialize in trenching for complex, multi-service projects, including:

    • Retaining walls & footings – Excavating trenches for reinforced concrete and deep-set structures.

    • Multi-utility trenches – Coordinating sewer, water, electrical, and gas line trenching within one site.

    • Commercial & municipal projects – Large-scale trenching for infrastructure, parking lots, and roadways.

    Our team works closely with engineers, surveyors, and project managers to ensure that all trenching is strategically planned and executed with precision.

    Does VALROC handle trenching for complex projects like retaining walls and multi-service utility installations?

    Yes! We specialize in trenching for complex, multi-service projects, including:

    • Retaining walls & footings – Excavating trenches for reinforced concrete and deep-set structures.

    • Multi-utility trenches – Coordinating sewer, water, electrical, and gas line trenching within one site.

    • Commercial & municipal projects – Large-scale trenching for infrastructure, parking lots, and roadways.

    Our team works closely with engineers, surveyors, and project managers to ensure that all trenching is strategically planned and executed with precision.

    What are the risks of improper trenching, and how does VALROC prevent them?

    Improper trenching can lead to serious structural and safety issues, including:

    • Trench collapse – If the soil is not stabilized or properly supported.

    • Water accumulation – If trenches are not graded for proper drainage.

    • Utility damage – If existing pipes or cables are not properly located before excavation.

    • Foundation issues – If trenches for footings and retaining walls are not accurately dug to specifications.

    To prevent these risks, VALROC ensures:

    ✅ Pre-trenching site assessments – To identify underground utilities and soil conditions.

    ✅ Shoring & safety measures – To prevent collapse and ensure a safe worksite.

    ✅ Precision grading & sloping – To guarantee proper water flow and load-bearing capacity.

    ✅ Quality control inspections – Ensuring trenches meet all engineering and municipal requirements.

    What are the risks of improper trenching, and how does VALROC prevent them?

    Improper trenching can lead to serious structural and safety issues, including:

    • Trench collapse – If the soil is not stabilized or properly supported.

    • Water accumulation – If trenches are not graded for proper drainage.

    • Utility damage – If existing pipes or cables are not properly located before excavation.

    • Foundation issues – If trenches for footings and retaining walls are not accurately dug to specifications.

    To prevent these risks, VALROC ensures:

    ✅ Pre-trenching site assessments – To identify underground utilities and soil conditions.

    ✅ Shoring & safety measures – To prevent collapse and ensure a safe worksite.

    ✅ Precision grading & sloping – To guarantee proper water flow and load-bearing capacity.

    ✅ Quality control inspections – Ensuring trenches meet all engineering and municipal requirements.

    What’s the next step after trenching?

    Once trenching is complete, VALROC Development Ltd. provides:

    • Pipe & conduit installation – Laying water, sewer, and electrical lines securely.

    • Backfilling & compaction – Ensuring the trench is properly stabilized to prevent settlement.

    • Concrete or asphalt finishing – If trenches are part of a road, driveway, or parking lot project.

    • Final grading & landscaping – Restoring the site to match the surrounding area.

    We handle every phase of the excavation process, ensuring that trenching transitions smoothly into the next stage of construction.

    What’s the next step after trenching?

    Once trenching is complete, VALROC Development Ltd. provides:

    • Pipe & conduit installation – Laying water, sewer, and electrical lines securely.

    • Backfilling & compaction – Ensuring the trench is properly stabilized to prevent settlement.

    • Concrete or asphalt finishing – If trenches are part of a road, driveway, or parking lot project.

    • Final grading & landscaping – Restoring the site to match the surrounding area.

    We handle every phase of the excavation process, ensuring that trenching transitions smoothly into the next stage of construction.

    METRO VANCOUVER GROUNDWORK

    Property specific trenching service across Metro Vancouver

    VALROC coordinates trenching from its Langley construction yard for drainage pipe, utilities, electrical conduit and other underground routes. Equipment size, trench depth, bedding, excavated material and backfill are selected around site access and the requirements of the connected system.

    Longer service routes across Surrey and Delta may require organized trucking and material placement, while Burnaby and White Rock projects can involve tighter access or changing elevations. Utility information, surface protection and final restoration are coordinated for the property.