/* Custom CSS */

/* Loading Screen */
.loader {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #0B5ED7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.dark ::-webkit-scrollbar-thumb { background: #334155; }
.dark ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth transition for sections */
section {
    scroll-margin-top: 80px;
}

/* Card hover lift */
.card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-lift:hover {
    transform: translateY(-4px);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #0B5ED7;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* Navbar solid state */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
#navbar.scrolled.dark {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Nav active link */
.nav-link.active {
    color: #0B5ED7;
    background: rgba(11, 94, 215, 0.05);
}

/* Back to top visibility */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Product card image hover */
.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-img {
    transition: transform 0.5s ease;
}

/* Counter animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Hero parallax */
@media (min-width: 1024px) {
    .hero-parallax {
        transition: transform 0.3s ease-out;
    }
}

/* Custom select arrow */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10000;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
}
.toast.show {
    transform: translateX(0);
}
.toast.success {
    background: #10b981;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}
.toast.error {
    background: #ef4444;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

/* Print styles */
@media print {
    #navbar, #back-to-top, .floating-buttons, #loading-screen {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
}
