body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: #f9f9f9;
    padding: 20px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
}

.category-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    padding-top: 100%; /* Maintain square aspect ratio */
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    border-radius: 0 0 15px 15px;
}

@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 901px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

        /* Your existing CSS from the first part */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }
        .product-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 5px;
            width: 98%;
            max-width: 1200px;
            margin: 20px 20px 60px 20px;
        }
        .product-card {
    border: 1px solid #ddd;
            border-radius: 5px;
            padding: 10px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            background-color: #fff;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
    box-sizing: border-box;
    position: relative;
}

        .product-checkbox {
            position: absolute;
            top: 5px;
            left: auto;
            right: 5px;
            height: 20px;
            width: 20px;
        }

button {
    margin: 5px 0;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}


        .product-image {
            width: 100%;
            height: 200px;
            object-fit: cover;
            border-bottom: 1px solid #ddd;
            padding-bottom: 10px;
        }
        .product-name {
            font-size: 1.2em;
            margin-top: 10px;
            font-weight: bold;
            border-bottom: inset;
        }
        .product-price {
            color: #322945;
            font-size: 1.1em;
            margin-top: 5px;
            font-weight: bold;
        }
        .product-description {
            font-size: 0.9em;
            margin-top: 10px;
        }
        button {
            background-color: #3e3356;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            margin-top: 10px;
        }
        button:hover {
            background-color: #2c1363;
        }
        #loading-spinner {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        .spinner {
            border: 5px solid #f3f3f3;
            border-top: 5px solid #3498db;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 2s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        @media (max-width: 600px) {
            .product-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        .header {
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            background-color: #fff;
        }
        .logo-container {
            display: flex;
            align-items: center;
        }
        .logo-icon {
            width: 50px;
            height: auto;
        }
        .logo-text {
            font-size: 1.5em;
            font-weight: bold;
            margin-left: 10px;
            display: none;
        }
        .search-container {
            position: relative;
            width: 100%;
            max-width: 300px;
        }
        .search-input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }
        .search-icon {
            position: absolute;
            right: 10px;
            top: 50%;
            width: 20px;
            transform: translateY(-50%);
            cursor: pointer;
        }
        @media (min-width: 600px) {
            .logo-text {
                display: block;
            }
            .search-container {
                width: auto;
            }
        }
        #suggestions {
            top: 0;
            left: 0;
            right: 0;
            background-color: white;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            z-index: 10;
            text-align: center;
            padding-top: 10px;
            width: 100%;
            list-style: none;
        }
        .suggestion-item {
            font-size: 1.1em;
            font-weight: bold;
            padding: 10px 20px;
            border-bottom: 1px solid #ddd;
            cursor: pointer;
        }
        .suggestion-item:last-child {
            border-bottom: none;
        }
        @media (max-width: 600px) {
            .suggestion-item {
                padding: 10px;
            }
        }

        .navbar {
            display: flex;
            justify-content: space-around;
            align-items: center;
            position: fixed;
            bottom: 0;
            width: 100%;
            background-color: #f8f8f8;
            border-top: 1px solid #ddd;
            padding: 5px 0;
        }
        .navbar a {
            text-decoration: none;
            color: #333;
            text-align: center;
            flex: 1;
        }
        .navbar a .icon {
            display: block;
            font-size: 18px;
            margin-bottom: 2px;
        }
        .navbar a .label {
            font-size: 12px;
        }