 body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background-color: #f9f9f9;
      margin: 0;
      padding-top: 70px; /* For fixed navbar */
    }

    /* Login prompt banner */
    #login-banner {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      background-color: #28b244;
      color: white;
      text-align: center;
      padding: 0.75rem 1rem;
      font-weight: 600;
      font-size: 1rem;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 1rem;
      z-index: 1100;
      box-shadow: 0 2px 6px rgb(0 0 0 / 0.15);
    }
    #login-banner button {
      background: white;
      color: #28b244;
      border: none;
      padding: 0.4rem 1rem;
      border-radius: 6px;
      font-weight: 700;
      cursor: pointer;
      transition: background-color 0.3s;
    }
    #login-banner button:hover {
      background-color: #e6e6e6;
    }

    /* Navbar */
    nav.navbar {
      background-color: #fff;
      box-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
      
      width: 100%;
      z-index: 1000;
      top: 40px; /* Adjust because of login banner */
      transition: top 0.3s;
    }
    nav .navbar-brand {
      font-weight: 700;
      font-size: 1.5rem;
      color: #28b244;
    }
    nav .nav-link {
      color: #555;
      font-weight: 600;
      margin-right: 1rem;
      transition: color 0.3s;
      cursor: pointer;
    }
    nav .nav-link:hover,
    nav .nav-link.active {
      color: #28b244;
    }

    /* Hero banner */
    .hero-banner {
      position: relative;
      height: 300px;
      background: url('https://images.unsplash.com/photo-1567306226416-28f0efdc88ce?auto=format&fit=crop&w=1400&q=80') center/cover no-repeat;
      border-radius: 12px;
      margin: 0 1rem 2rem;
      display: flex;
      align-items: center;
      padding-left: 3rem;
      color: white;
      box-shadow: 0 8px 20px rgb(0 0 0 / 0.2);
      overflow: hidden;
    }
    .hero-banner::before {
      content: "";
      position: absolute;
      inset: 0;
      background-color: rgba(0,0,0,0.4);
      z-index: 0;
    }
    .hero-banner .content {
      position: relative;
      z-index: 1;
      max-width: 500px;
    }
    .hero-banner h1 {
      font-size: 2.8rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      animation: fadeInDown 1s ease forwards;
      opacity: 0;
    }
    .hero-banner p {
      font-size: 1.2rem;
      margin-bottom: 1rem;
      animation: fadeInUp 1.2s ease forwards;
      opacity: 0;
    }
    .hero-banner button {
      background-color: #28b244;
      border: none;
      padding: 0.75rem 1.5rem;
      font-weight: 600;
      border-radius: 6px;
      color: white;
      cursor: pointer;
      transition: background-color 0.3s;
      animation: fadeInUp 1.4s ease forwards;
      opacity: 0;
    }
    .hero-banner button:hover {
      background-color: #28b244;
    }

    @keyframes fadeInDown {
      to { opacity: 1; transform: translateY(0); }
      from { opacity: 0; transform: translateY(-30px); }
    }
    @keyframes fadeInUp {
      to { opacity: 1; transform: translateY(0); }
      from { opacity: 0; transform: translateY(30px); }
    }

    /* Category section */
    .categories {
      display: flex;
      overflow-x: auto;
      padding: 0 1rem;
      gap: 1rem;
      margin-bottom: 2rem;
    }
    .category-card {
      min-width: 140px;
      background: white;
      border-radius: 12px;
      box-shadow: 0 2px 5px rgb(0 0 0 / 0.1);
      cursor: pointer;
      flex-shrink: 0;
      transition: transform 0.3s, box-shadow 0.3s;
      text-align: center;
      padding: 1rem 0.5rem;
      user-select: none;
      border: 2px solid transparent;
    }
    .category-card:hover,
    .category-card.active {
      box-shadow: 0 5px 15px rgb(0 0 0 / 0.15);
      transform: translateY(-5px);
      border-color: #28b244;
    }
    .category-card img {
      width: 60px;
      margin-bottom: 0.5rem;
    }
    .category-card span {
      font-weight: 600;
      font-size: 1rem;
      color: #333;
      display: block;
    }

    /* Products grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 0 1rem 2rem;
}

    #product-list.products-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 0 1rem 2rem;
}

    .product-card, .ad-card {
      opacity: 0;
      transform: translateY(30px);
      transition: opacity 0.6s ease, transform 0.6s ease;
    }
    .product-card.visible, .ad-card.visible {
      opacity: 1;
      transform: translateY(0);
    }
    .product-card {
      background: white;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
      transition: transform 0.3s;
      display: flex;
      flex-direction: column;
    }
    .product-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 20px rgb(0 0 0 / 0.15);
    }
   .product-card img,
.ad-card img {
  width: 100%;
  height: 300px;
  object-fit: cover; /* Ensures perfect fit */
  display: block;
}
    .product-card .details {
      padding: 1rem;
      flex-grow: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
    .product-card .details h4 {
      font-weight: 600;
      font-size: 1.1rem;
      margin-bottom: 0.5rem;
      color: #222;
    }
    .product-card .details p {
      color: #555;
      font-weight: 600;
      margin-bottom: 0rem;
    }
    .product-card .details button {
      align-self: flex-start;
      background-color: #28b244;
      border: none;
      color: white;
      padding: 0.5rem 1rem;
      border-radius: 6px;
      cursor: pointer;
      transition: background-color 0.3s;
      font-weight: 600;
      font-size: 0.9rem;
    }
    .product-card .details button:hover {
      background-color: #28b244;
    }

    /* Ad cards spanning full width */
    .ad-card {
      grid-column: 1 / -1; /* Span full width */
      display: flex;
      background: #28b244;
      border-radius: 12px;
      color: #fff;
      overflow: hidden;
      box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
      cursor: pointer;
      user-select: none;
      transition: transform 0.3s, box-shadow 0.3s;
    }
    .ad-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 10px 25px rgb(0 0 0 / 0.25);
    }

    .ad-card img {
      width: 300px;
      object-fit: cover;
      border-top-left-radius: 12px;
      border-bottom-left-radius: 12px;
      flex-shrink: 0;
    }
    .ad-card .ad-content {
      padding: 1.5rem 2rem;
      display: flex;
      flex-direction: column;
      justify-content: center;
      flex: 1;
    }
    .ad-card h3 {
      font-size: 2rem;
      margin-bottom: 0.5rem;
      font-weight: 700;
    }
    .ad-card p {
      font-size: 1.1rem;
      margin-bottom: 1.2rem;
    }
    .ad-card button {
      align-self: flex-start;
      background: #fff;
      color: #28b244;
      border: none;
      padding: 0.75rem 1.8rem;
      border-radius: 8px;
      font-weight: 700;
      font-size: 1rem;
      transition: background-color 0.3s;
      cursor: pointer;
    }
    .ad-card button:hover {
      background-color: #e6e6e6;
    }

    /* Scrollbar for categories */
    .categories::-webkit-scrollbar {
      height: 8px;
    }
    .categories::-webkit-scrollbar-thumb {
      background: #ccc;
      border-radius: 4px;
    }
    .categories::-webkit-scrollbar-track {
      background: #f9f9f9;
    }
     .cart-container {
      max-width: 900px;
      margin: 50px auto;
    }
    .cart-item {
      border-bottom: 1px solid #ccc;
      padding: 20px 0;
    }
    .cart-item:last-child {
      border-bottom: none;
    }
    .footer {
      background-color: #28b244;
      color: white;
      padding: 20px 0;
      text-align: center;
      margin-top: 50px;
    }
    .checkout-btn {
      background-color: #28a745;
      border: none;
    }
@media (max-width: 768px) {
  body {
    padding-top: 110px; /* navbar + login banner */
  }

  nav.navbar {
    top: 70px;
  }

  .hero-banner {
    height: 220px;
    padding-left: 1.5rem;
  }

  .hero-banner h1 {
    font-size: 1.9rem;
  }

  .ad-card {
    flex-direction: column;
  }

  .ad-card img {
    width: 100%;
    height: 180px;
    border-radius: 12px 12px 0 0;
  }

  .ad-card .ad-content {
    padding: 1rem 1rem;
  }

  /* ✅ Show 2 product cards per row on mobile */
  .products-grid,
  #product-list.products-grid {
    grid-template-columns: repeat(2,2fr) !important;
    padding:0;
  
  }
}
