/* ============ OVERSCROLL / BOUNCE FIX ============ */

/* Prevent body/html from scrolling and bouncing */
html {
    overflow: hidden;
    height: 100%;
    overscroll-behavior: none;
}

body {
    overflow: hidden;
    height: 100%;
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
}

/* Main container takes full height */
.main-container {
    height: calc(100vh - 61px); /* Subtract nav height */
    overflow: hidden;
}

/* Sidebar scrollable area - contained */
.sidebar {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Main content scrollable area - contained */
.main-content {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Saved clients container - contained */
.saved-clients-container {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 61px);
}

/* Compare container - contained */
.compare-container {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 61px);
}

/* Prevent pull-to-refresh on mobile */
body {
    overscroll-behavior-y: none;
}

/* Modal overlays - prevent background scroll */
.modal-overlay,
.carrier-modal-overlay,
.email-modal-overlay,
.iul-preview-overlay {
    overscroll-behavior: contain;
    touch-action: none;
}

/* Modal bodies that need scroll */
.carrier-modal-body,
.email-modal-body,
.iul-preview-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Dropdowns and autocomplete */
.autocomplete-dropdown {
    overscroll-behavior: contain;
}

/* AI Chat window */
#ai-chat-window {
    overscroll-behavior: contain;
}

.ai-chat-messages {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Carrier settings panel */
.carrier-settings-panel {
    overscroll-behavior: contain;
}

/* Fix for any nested scrollable elements */
[style*="overflow: auto"],
[style*="overflow-y: auto"],
[style*="overflow-y: scroll"] {
    overscroll-behavior: contain;
}

/* Prevent horizontal overscroll everywhere */
* {
    overscroll-behavior-x: none;
}

/* Top nav should never scroll */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}