/* TURBOO STORE - Performance & Responsive Styles */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Optimize container for all screen sizes */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1536px;
    }
}

/* Optimize rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Lazy loading placeholder */
img.lazy {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    min-height: 200px;
}

img.loaded {
    animation: fadeIn 0.3s ease-in;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Reduce repaints on scroll */
.sticky {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize transitions */
.transition {
    transition-property: transform, opacity, background-color, color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile-first responsive improvements */
@media (max-width: 640px) {
    /* Reduce animations on mobile for better performance */
    * {
        transition-duration: 0.2s !important;
    }
    
    /* Hide non-essential elements on mobile */
    .hidden-mobile {
        display: none !important;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Large screen optimizations */
@media (min-width: 1025px) {
    /* Container max-width for readability */
    .container {
        max-width: 1280px;
    }
}

/* Reduce motion for accessibility */
@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;
    }
}

/* GPU acceleration for animations */
.transform {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimize text rendering */
body {
    text-rendering: optimizeLegibility;
}

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Skeleton loading placeholders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.5rem;
}

/* Responsive text sizes */
@media (max-width: 640px) {
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 640px) {
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Optimize hover effects on mobile */
@media (hover: none) {
    .hover\:scale-105:hover {
        transform: none;
    }
}
