/* Mobile Text Clarity Fixes for Product Categories */

@media (max-width: 991px) {
    /* Fix text rendering issues on mobile */
    #product-categories-dropdown .nav-link {
        /* Improve text rendering */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
        
        /* Ensure crisp text display */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        
        /* Better contrast and visibility */
        font-weight: 600 !important;
        color: #1a1f36 !important;
        
        /* Remove any effects that might cause blur */
        text-shadow: none !important;
        filter: none !important;
        backdrop-filter: none !important;
        
        /* Ensure proper font size and spacing */
        font-size: 16px !important;
        letter-spacing: 0.5px;
        
        /* Prevent text from being affected by transforms */
        will-change: auto;
        
        /* Clear any inherited transforms that might cause blur */
        transform: none !important;
        -webkit-transform: none !important;
    }
    
    /* Specific styling for PRODUCT CATEGORIES text */
    #product-categories-dropdown .nav-link {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        padding: 18px 20px !important;
        
        /* Ensure text is not affected by any parent transforms */
        position: relative;
        z-index: 1;
    }
    
    /* Fix any blur from backdrop filters */
    .header {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    
    /* Ensure the entire navigation menu has crisp text */
    .nav-menu {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    /* Remove any potential blur effects from parent elements */
    .nav-item {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    /* Ensure icons are also crisp */
    #product-categories-dropdown .nav-link i {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Force hardware acceleration for better rendering */
    #product-categories-dropdown {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        will-change: transform;
    }
}

/* Additional fixes for very small screens */
@media (max-width: 480px) {
    #product-categories-dropdown .nav-link {
        font-size: 15px !important;
        padding: 16px 15px !important;
        letter-spacing: 0.3px;
    }
}

/* Fix for high DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #product-categories-dropdown .nav-link {
        -webkit-font-smoothing: subpixel-antialiased;
        font-weight: 500 !important;
    }
}
