/**
 * Performance Optimizations & Enhancements
 *
 * @package NEWTIV
 * @since 1.0.0
 */

/* ============================================
   GPU Acceleration & Smooth Animations
   ============================================ */
.entry,
.product-card,
.widget,
.card,
.button {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ============================================
   Optimized Transitions
   ============================================ */
* {
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

a, button, input, select, textarea {
    transition-property: color, background-color, border-color, transform, opacity, box-shadow;
}

/* ============================================
   Lazy Loading Images
   ============================================ */
img {
    loading: lazy;
    decoding: async;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ============================================
   Content Visibility for Performance
   ============================================ */
.sidebar,
.widget-area,
.footer-widget-area {
    content-visibility: auto;
    contain-intrinsic-size: 300px;
}

/* ============================================
   Optimized Font Loading
   ============================================ */
body {
    font-display: swap;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   Print Optimizations
   ============================================ */
@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .site-header,
    .site-footer,
    .sidebar,
    .widget,
    .button,
    .no-print {
        display: none !important;
    }
}

