/* =====================================================
   MySmartSCart - Performance Optimizations CSS
   ===================================================== */

/* =====================================================
   CUSTOM THEME COLORS - Royal Blue Top Notice Bar
   ===================================================== */
.top-notice {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%) !important;
}

.top-notice .category {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.top-notice .category:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.top-notice .mfp-close {
    color: #fff !important;
}

.top-notice .mfp-close:hover {
    color: #ffeb3b !important;
}

/* =====================================================
   HEADER TOP BAR - Orange/Saffron Color
   ===================================================== */
.header-top {
    background: #f68b28 !important;
    color: #fff !important;
}

.header-top a {
    color: #fff !important;
}

.header-top a:hover {
    color: #ffe0b2 !important;
}

.header-top .separator {
    background: rgba(255, 255, 255, 0.3) !important;
}

.header-top .dropdown-toggle::after {
    border-top-color: #fff !important;
}

.header-top .dropdown-menu {
    background: #f68b28;
    border: none;
}

.header-top .dropdown-menu a {
    color: #fff !important;
}

.header-top .dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Lazy Loading Image Styles */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy.loaded {
    opacity: 1;
}

/* Placeholder shimmer effect */
.lazy-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Product grid skeleton loading */
.product-skeleton {
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.product-skeleton .skeleton-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.product-skeleton .skeleton-text {
    height: 20px;
    margin: 10px 15px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.product-skeleton .skeleton-text.short {
    width: 60%;
}

/* Loading spinner for infinite scroll */
.loading-more {
    text-align: center;
    padding: 30px;
}

.loading-more .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Optimized product card */
.product-default figure {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
}

.product-default figure img {
    transition: transform 0.3s ease;
    will-change: transform;
}

.product-default:hover figure img {
    transform: scale(1.05);
}

/* Better image loading */
.product-default figure img[data-src] {
    min-height: 200px;
    background: #f5f5f5;
}

/* Scroll to top button animation */
#scroll-top {
    transition: opacity 0.3s, transform 0.3s;
}

#scroll-top:hover {
    transform: translateY(-3px);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* GPU acceleration for animations */
.product-default,
.banner,
.owl-item {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce repaints on hover */
.product-action,
.label-group {
    will-change: opacity, transform;
}

/* Optimize font loading */
.font-loading body {
    visibility: hidden;
}

.fonts-loaded body,
body {
    visibility: visible;
}

/* Content visibility for below fold content */
.below-fold {
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

/* No products message */
.no-products {
    text-align: center;
    padding: 50px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.no-products i {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
}

/* Quick view modal optimization */
.modal {
    will-change: opacity;
}

.modal-backdrop {
    will-change: opacity;
}

/* Price display optimization */
.price-box {
    min-height: 24px;
}

.old-price {
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

/* Category badge */
.category-count {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 5px;
}

/* Toast notification for cart */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.success {
    background: #28a745;
}

.toast-notification.error {
    background: #dc3545;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .product-default figure img {
        height: auto;
        max-height: 200px;
        object-fit: cover;
    }
    
    /* Reduce animations on mobile for performance */
    .product-default figure img {
        transition: none;
    }
    
    .product-default:hover figure img {
        transform: none;
    }
}

/* Print optimization - hide unnecessary elements */
@media print {
    .header, .footer, .sidebar, .product-action, .loading-more {
        display: none !important;
    }
}

