/* Performance Optimization CSS */

/* Critical CSS - Above the fold styles */
.hero {
    background-image: linear-gradient(rgba(21, 24, 28, 0.45), rgba(21,24,28,0.25)), url('https://horizons-cdn.hostinger.com/11b577ed-5772-4d4b-88c8-a46441bb6037/9fc8d0d70272545308efd2f69ec6dc88.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
    decoding: async;
}

/* Lazy loading for images */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* Font optimization */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* CSS Grid optimization */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Smooth scrolling optimization */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .hero {
        background-attachment: scroll;
        min-height: 80vh;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .section-container {
        padding: 1rem;
    }
}

/* Critical resource hints */
.preload {
    font-display: swap;
}

/* Optimize animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Performance-focused hover effects */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Optimize button interactions */
.btn-primary,
.btn-secondary {
    transition: all 0.2s ease;
    will-change: background-color, transform;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-1px);
}

/* Content visibility optimization */
.section {
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

/* Optimize text rendering */
body {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Critical above-the-fold content */
.hero-content {
    z-index: 2;
    position: relative;
}

/* Optimize background images */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(21, 24, 28, 0.45), rgba(21,24,28,0.25));
    z-index: 1;
}
