* {
    -webkit-tap-highlight-color: transparent;
}

body {
    background: black;
    touch-action: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
}

/* Content mask to hide scrolled content */
.content-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: black;
    z-index: 999;
    pointer-events: none;
}

/* Content scrolling styles */
.content-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
}

.content-section:not(.active) {
    display: none;
}

/* Custom Scroll Bar Styles - Now for content scrolling */
#custom-scrollbar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    gap: 2px;
    width: auto;
    height: auto;
}

.scroll-bar-thumb {
    width: 100%;
    background-color: rgba(49, 209, 88, 1);
    border-radius: 2px;
    position: absolute;
    top: 0;
    left: 0;
    transition: background-color 0.3s ease, height 0.2s ease, transform 0.1s ease;
    min-height: 20px;
    cursor: pointer;
    will-change: transform, height, background-color;
    transform-origin: top left;
    /* Ensure smooth sub-pixel rendering */
    transform: translateY(0px) translateZ(0);
}

.scroll-bar-thumb:hover {
    background-color: rgba(49, 209, 88, 1);
    cursor: grab;
}

.scroll-bar-thumb:active {
    background-color: rgba(49, 209, 88, 1);
    cursor: grabbing;
}

.scroll-bar-track {
    width: 3px;
    height: 33.33vh;
    background-color: white;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.scroll-bar-track:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Show scroll bar when content is scrollable */
#custom-scrollbar.show {
    opacity: 1;
    display: flex;
}

#products.content-section.active~#custom-scrollbar,
#contact.content-section.active~#custom-scrollbar {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

@media (max-width: 768px) {
    .content-mask {
        height: 90px;
    }

    .mobile-nav-arrows {
        display: flex;
    }

    #custom-scrollbar {
        right: 5px;
        padding: 0;
        gap: 1px;
    }

    .scroll-bar-track {
        height: 33.33vh;
        width: 2px;
    }

    .scroll-bar-thumb {
        min-height: 15px;
    }

    /* Mobile-specific scroll optimizations */
    .content-section {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        overscroll-behavior-y: auto;
        /* Allow natural bounce for better UX */
        touch-action: pan-y;
        /* Allow vertical panning for scroll */
    }

    /* Improve touch performance */
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    /* Allow text selection for readable content */
    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    .email-link {
        -webkit-user-select: text;
        user-select: text;
    }

    .edge-swipe-indicator {
        height: 80px;
        width: 3px;
    }

    /* Subtle edge shadows to hint at swipe areas */
    .main-content::before,
    .main-content::after {
        content: '';
        position: fixed;
        top: 0;
        width: 2px;
        height: 100vh;
        background: linear-gradient(to right, rgba(49, 209, 88, 0.1), transparent);
        z-index: 998;
        opacity: 0.5;
        pointer-events: none;
    }

    .main-content::before {
        left: 0;
    }

    .main-content::after {
        right: 0;
        transform: rotate(180deg);
    }
}

/* Desktop specific styles */
@media (min-width: 769px) {
    #custom-scrollbar {
        right: 0;
        padding: 0;
        gap: 2px;
    }

    .scroll-bar-track {
        height: 33.33vh;
        width: 3px;
    }

    .scroll-bar-thumb {
        min-height: 20px;
    }
}

/* Edge Swipe Visual Indicators */
.edge-swipe-indicator {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(49, 209, 88, 0.3), transparent);
    border-radius: 2px;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.edge-swipe-indicator.left {
    left: 0;
}

.edge-swipe-indicator.right {
    right: 0;
}

.edge-swipe-indicator.show {
    opacity: 1;
}