@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
    --primary-color: #0891b2; /* Cyan-600 */
    --primary-hover: #0e7490; /* Cyan-700 */
    --accent-color: #06b6d4; /* Cyan-500 */
}

html, body {
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
    font-family: 'Cairo', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f8fafc; /* Slate-50 */
    color: #1e293b; /* Slate-800 */
    scrollbar-width: thin; /* Firefox - make scrollbar thin */
    scrollbar-color: #cbd5e1 #f1f5f9; /* Firefox - thumb and track colors */
}

/* Scrollbar Customization - Always visible, thin, and smooth */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    border-radius: 4px;
    border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track,
.dark::-webkit-scrollbar-track {
    background: #1e293b;
}
.dark ::-webkit-scrollbar-thumb,
.dark::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #475569 0%, #334155 100%);
    border: 2px solid #1e293b;
}
.dark ::-webkit-scrollbar-thumb:hover,
.dark::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
}

/* Custom scrollbar for specific containers */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Component Styles */
.zaleto-text {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Mobile Performance Optimizations */
.product-card {
    opacity: 1 !important; /* Force cards to always be visible */
    visibility: visible !important; /* Prevent any visibility issues */
    /* CSS Containment for better performance */
    contain: layout style paint; /* Isolate card rendering */
    will-change: transform; /* GPU acceleration hint for hover effects */
}

.product-card img {
    aspect-ratio: 1 / 1.05; /* Enforce aspect ratio to prevent layout shifts */
    width: 100%;
    object-fit: cover;
    background-color: #f1f5f9; /* Placeholder color while loading */
    opacity: 1; /* Ensure images are always visible */
    display: block; /* Prevent inline spacing issues */
    /* Performance optimization */
    transform: translateZ(0); /* Force GPU rendering */
}

/* Reduce animations on low-performance devices */
@media (prefers-reduced-motion: reduce) {
    .product-card img {
        transition: none !important;
    }
    .animate-fade-in,
    .animate-slide-up {
        animation: none !important;
    }
    .card-hover:hover {
        transform: none !important;
    }
}

/* Optimize animations for better performance */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
