/* Mobile Cart Indicator Fixes */

/* Ensure cart indicators are always visible on mobile */
@media (max-width: 768px) {
    [data-cart-count],
    .cart-count,
    .cart-badge {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        min-height: 18px;
        font-size: 10px !important;
        font-weight: bold;
        line-height: 1;
        z-index: 10;
        pointer-events: none;
    }
    
    /* Navigation cart indicator */
    nav [data-cart-count] {
        position: absolute !important;
        top: -5px !important;
        right: -5px !important;
        background: #EAB308 !important;
        color: #333 !important;
        border-radius: 50% !important;
        padding: 2px 6px !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    /* Customer layout cart indicator */
    .customer-layout [data-cart-count] {
        position: absolute !important;
        top: -2px !important;
        right: -2px !important;
        background: #ef4444 !important;
        color: white !important;
        border-radius: 50% !important;
        width: 20px !important;
        height: 20px !important;
        font-size: 10px !important;
        animation: pulse 2s infinite;
    }
    
    /* Cart page header indicator */
    .cart-page [data-cart-count] {
        background: #ffc107 !important;
        color: #333 !important;
        border: 1px solid #333;
    }
    
    /* Force visibility even when count is 0 on mobile */
    [data-cart-count]:empty::after {
        content: '0';
    }
    
    /* Ensure cart links are touch-friendly */
    a[href*="cart"] {
        min-height: 44px;
        min-width: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        -webkit-tap-highlight-color: rgba(234, 179, 8, 0.2);
        touch-action: manipulation;
    }
    
    /* Mobile navigation adjustments */
    nav .header-actions {
        gap: 8px !important;
    }
    
    nav .header-link {
        padding: 8px 12px !important;
        font-size: 14px !important;
        position: relative;
    }
    
    /* Hide text on very small screens, keep icons and counts */
    @media (max-width: 480px) {
        nav .header-link span:not([data-cart-count]):not(.cart-count) {
            display: none;
        }
        
        nav .header-link i {
            font-size: 16px;
        }
        
        [data-cart-count],
        .cart-count {
            display: inline-flex !important;
            position: absolute !important;
            top: -3px !important;
            right: -3px !important;
            min-width: 16px !important;
            min-height: 16px !important;
            font-size: 9px !important;
        }
    }
}

/* Pulse animation for cart updates */
@keyframes cartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-updated {
    animation: cartPulse 0.6s ease-in-out;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    [data-cart-count],
    .cart-count {
        border: 2px solid currentColor !important;
        font-weight: 900 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    [data-cart-count],
    .cart-count {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    [data-cart-count],
    .cart-count {
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }
}