/* Error and Loading States */
#error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff3333;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 2000;
    display: none;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 5px;
    z-index: 2000;
}

/* Fallback styles for no-image cases */
.hero {
    height: 80vh;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url('../../images/hero-bg.jpg');
    background-color: #1a1a1a;
    /* Fallback color if image fails */
}

/* Offline indicator */
.offline {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #333;
    color: white;
    padding: 10px;
    border-radius: 5px;
    display: none;
}

body.offline .offline {
    display: block;
}

/* Mobile responsive styles for home page */
@media (max-width: 768px) {
    .hero-slideshow {
        height: auto;
        margin-bottom: 0;
        background: none;
    }

    .section {
        padding: var(--space-2) 0;
    }

    .trending-bar-section {
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    #categories.section {
        padding-top: 0;
        padding-bottom: var(--space-2);
        margin-top: 0;
        transform: translateY(-8px);
        position: relative;
        z-index: 10;
    }

    .categories-grid {
        animation: categoriesAutoScroll 20s linear infinite;
    }

    .categories-grid:hover {
        animation-play-state: paused;
    }

    /* Mobile products grid - show 2 columns */
    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: var(--space-1) var(--space-2) var(--space-2);
    }

    .product-card {
        width: 100% !important;
        min-height: auto !important;
        border-radius: 16px !important;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08) !important;
        overflow: hidden !important;
        background: var(--white) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .product-card .product-image {
        min-height: 150px !important;
        height: auto !important;
        padding: 15px !important;
        background: #f4f6ff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .product-card .product-image img {
        height: 120px !important;
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
    }

    .product-card .product-info {
        padding: 10px 12px 15px !important;
        gap: 2px !important;
        flex: 1 !important;
    }

    .product-card .product-category {
        font-size: 10px !important;
        margin-bottom: 2px !important;
    }

    .product-card .product-name {
        font-size: 14px !important;
        line-height: 1.3 !important;
        min-height: 36px;
        margin-bottom: 4px !important;
    }

    .product-card .product-rating {
        margin-bottom: 6px !important;
        transform: scale(0.9);
        transform-origin: left;
    }

    .product-card .product-price {
        gap: 6px !important;
        margin-bottom: 10px !important;
        flex-wrap: wrap !important;
    }

    .product-card .product-price .current-price {
        font-size: 16px !important;
    }

    .product-card .product-price .original-price {
        font-size: 12px !important;
    }

    .product-card .add-to-cart {
        width: calc(100% - 24px) !important;
        margin: 0 12px 12px !important;
        padding: 10px !important;
        font-size: 12px !important;
        border-radius: 999px !important;
    }

    .product-card .product-actions {
        display: none !important;
    }

    /* Hide countdown timer on mobile */
    .coupon-countdown-box {
        display: none !important;
    }
}

@keyframes categoriesAutoScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}