/* === Base Reset & Typography === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #151817;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Header === */
header {
  background-color: #000; 
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.left-group {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  display: flex;
  align-items: center;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin-left: 2rem;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: blue;
}

/* === Search Bar === */
.search-bar {
  display: flex;
  gap: 0.5rem;
}

.search-bar input {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1.5px solid #ccc;
  background: #fff;
  color: #000;
}

.search-bar button {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: none;
  background-color: #2c3e50;
  color: white;
  cursor: pointer;
}

.search-bar button:hover {
  background-color: #1a252f;
}

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  height: calc(100vh - 60px);
  width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #111;
  transition: width 0.3s ease;
  z-index: 1000;
}

.sidebar.open {
  width: 200px;
  background-color: #000;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  opacity: 0;
  padding: 10px;
  transition: opacity 0.3s ease;
}

.sidebar.open .sidebar-content {
  opacity: 1;
}

.sidebar-content a {
  color: white;
  padding: 10px 0;
  text-decoration: none;
}

.sidebar-content a:hover {
  background-color: #000;
}

/* === Toggle Button === */
#toggleBtn {
  position: fixed;
  top: 100px;
  left: 20px;
  z-index: 1200;
  width: 50px;
  height: 50px;
  background-color: #000000;
  color: white;
  border: 3px solid white;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* === Dropdown === */
.dropdown-menu {
  display: none;
  flex-direction: column;
  background-color: #414040;
  color: white;
  padding: 10px;
  border-radius: 5px;
  margin-top: 5px;
}

.dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-toggle {
  background-color: #444;
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

/* === Main & Product Grid === */
main {
  width: 90%;
  max-width: 1400px;
  margin: 80px auto 4rem;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 30px 5px;
  padding: 40px;
  justify-items: center;
}

/* === Product Cards === */
.product {
  background: linear-gradient(to bottom, #353535, #bcd4e6);
  color: #000;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.1);
}

.product img {
  width: 200px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 2px solid white;
}

.product h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 10px;
}

.product .price {
  margin: 5px 0 10px;
  font-size: 16px;
  color: #333;
}

.product .add-to-cart {
  margin-top: auto;
  padding: 10px 15px;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.product .add-to-cart:hover {
  background-color: #333;
}

/* === Responsive Grid === */
@media (max-width: 1200px) {
  .products {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1000px) {
  .products {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
  }

  .product img {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .products {
    grid-template-columns: 1fr;
  }

  .product img {
    height: 180px;
  }
}

/* === Footer === */
.foot {
  background-color: #000;
  color: white;
  padding: 1rem;
  width: 100%;
  text-align: center;
}

/* === Utility === */
.bluetext {
  color: blue;
}

/* === 📱 Mobile-Friendly Header Fix (Cleaned) === */
@media (max-width: 768px) {
  header {
    flex-direction: row;           /* ✅ keep items in a row */
    align-items: center;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    position: static;             /* ✅ not sticky */
  }

  .left-group {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    width: auto;
  }

  .logo {
    font-size: 1.2rem;            /* ✅ smaller logo */
  }

  nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.8rem;
    padding-left: 0;
    margin: 0;
  }

  nav ul li a {
    font-size: 0.8rem;            /* ✅ smaller links */
    padding: 0.25rem 0.4rem;
  }

  .search-bar {
    flex-direction: row;          /* ✅ make it inline */
    flex-wrap: nowrap;
    width: auto;
    gap: 0.5rem;
    margin-left: auto;            /* ✅ align to right if needed */
  }

  .search-bar input,
  .search-bar button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}
