/**
 * Tab Styling and Scroll Prevention
 * Aggressively prevents visual jumping and ensures tabs stay in place
 */

/* ========================================
   Scroll Prevention - Critical
======================================== */

/* Prevent anchor jump on hash change */
.edgtf-tabs *[id],
.wpb_tabs *[id],
.vc_tta-tabs *[id] {
    scroll-margin-top: 0 !important;
    scroll-snap-margin-top: 0 !important;
}

/* Disable smooth scrolling only within tab containers */
.edgtf-tabs,
.wpb_tabs,
.vc_tta-tabs {
    scroll-behavior: auto !important;
}

/* Prevent focus scroll */
.edgtf-tabs-nav a:focus,
.wpb_tabs_nav a:focus,
.vc_tta-tabs-list a:focus {
    outline: none;
    scroll-margin: 0;
}

/* Prevent tab activation from triggering scroll */
.edgtf-tab-container,
.wpb_tab,
.vc_tta-panel {
    scroll-margin-top: 0 !important;
}

/* ========================================
   Tab Positioning
======================================== */

/* Keep tabs fixed in viewport during switch */
.edgtf-tabs,
.wpb_tabs {
    position: relative;
    isolation: isolate;
}

/* Ensure tab containers don't cause reflow */
.edgtf-tabs-nav,
.wpb_tabs_nav {
    position: relative;
    z-index: 10;
}

/* ========================================
   Content Stability
======================================== */

/* Prevent content jump */
.edgtf-tab-container,
.wpb_tab {
    opacity: 1;
    transition: opacity 0.2s ease;
    position: relative;
}

/* Hidden tabs */
.edgtf-tab-container.edgtf-hidden,
.wpb_tab[style*="display: none"] {
    opacity: 0;
    position: absolute;
    visibility: hidden;
}

/* Keep minimum height to prevent jump */
.edgtf-tabs-content,
.wpb_tabs_wrapper {
    min-height: 300px;
    position: relative;
}

/* ========================================
   Anchor Override
======================================== */

/* Prevent ALL hash-based scrolling in tabs */
.edgtf-tabs a[href^="#"],
.wpb_tabs a[href^="#"] {
    scroll-behavior: auto !important;
}

/* Remove scroll on focus */
.edgtf-tabs a:focus-visible {
    outline-offset: -2px;
}

/* ========================================
   Additional Safeguards
======================================== */

/* Prevent overflow anchor */
.edgtf-tabs *,
.wpb_tabs * {
    overflow-anchor: none !important;
}

/* Force rendering stability */
.edgtf-tabs,
.wpb_tabs {
    will-change: auto;
    contain: layout;
}