/* ✅ Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  color: #0f0f0f;
  display: flex;
  flex-direction: column;
}

/* ✅ Top Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  background: #fff;
  padding: 0 16px;
  border-bottom: 1px solid #ccc;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.nav-left,
.nav-center,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-left i {
  font-size: 24px;
  margin-right: 16px;
  cursor: pointer;
}

.nav-left .logo {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
}

.nav-left .logo img {
  height: 33px;
  margin-right: 8px;
  border-radius: 50%;
}

/* ✅ Search Bar */
.search-bar {
  display: flex;
  width: 100%;
  max-width: 600px;
  border: 1px solid #ccc;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 8px 16px;
  font-size: 16px;
  outline: none;
}

.search-bar button {
  border: none;
  background: #f8f8f8;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 16px;
}

/* ✅ Fix for top navigation overlapping content */
.main-content {
  padding: 16px;
  margin-top: 80px; /* Prevents top elements from overlapping */
}

/* ✅ Category Bar */
.category-bar {
  display: flex;
  align-items: center;
  background: #fff;
  height: 48px;
  border-bottom: 1px solid #ccc;
  padding: 0 16px;
  overflow-x: auto;
  position: sticky;
  top: 56px;
  z-index: 999;
  width: 100%;
}

.category-bar .category {
  white-space: nowrap;
  margin-right: 16px;
  padding: 8px 16px;
  background: #f2f2f2;
  border-radius: 18px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}

.category-bar .category:hover,
.category-bar .category.active {
  background: black;
  color: white;
}

/* ✅ Dashboard Title */
.dashboard-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 16px;
}

/* ✅ Fix Content Overflow */
.main-content {
  padding: 16px;
  min-height: calc(100vh - 100px);
  overflow-y: auto;
  width: 100%;
}

/* ✅ Cards Section - Full Width & Wrap Effect */
.cards {
  display: flex;
  flex-wrap: wrap; /* Prevents items from stretching */
  gap: 16px;
  width: 100%;
}

/* ✅ Card Styling */
.card {
  flex: 1;
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  min-width: 200px; /* Prevents cards from becoming too small */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.card i {
  font-size: 32px;
  color: #0b1446;
}

.card h3 {
  font-size: 22px;
  margin-bottom: 4px;
}

.card p {
  font-size: 14px;
  color: #606060;
}

/* ✅ Fix for Cards Layout */
@media (max-width: 768px) {
  .cards {
    flex-direction: column;
  }
}

/* ✅ Scrollable Content */
.scrollable-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ✅ Fix for Modal or Floating Buttons */
.fixed-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s ease-in-out;
}

.fixed-button:hover {
  background: #0056b3;
}

.search-results {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  width: 300px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.search-result-item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.search-result-item:hover {
  background: #f2f2f2;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px; /* reduce this value to control spacing */
}

.nav-right i,
.cart-icon {
  font-size: 22px;
  cursor: pointer;
  color: #0b1446;
}

.cart-icon {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.cart-icon:hover {
  color: #f5a100;
}

/* Hide hamburger on desktop, show on mobile */
#toggleButton {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-top: 80px; /* height of expanded mobile header */
  }
}

@media (max-width: 768px) {
  /* Top nav responsiveness */
  .top-nav {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 8px 12px;
  }

  .nav-left,
  .nav-center,
  .nav-right {
    width: 100%;
    margin-bottom: 8px;
  }

  .nav-left {
    justify-content: flex-start;
    gap: 10px;
  }

  .nav-center {
    justify-content: center;
  }

  .nav-right {
    justify-content: flex-end;
  }

  .search-bar {
    width: 100%;
    max-width: 100%;
  }

  /* Sidebar category menu */
  .category-bar {
    display: none;
    flex-direction: column;
    position: fixed;
    left: 0;
    width: 200px;
    height: 100%;
    background: #fff;
    padding: 16px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
  }

  .category-bar.active {
    display: flex;
  }

  .category-bar .category {
    margin: 8px 0;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
  }

  .main-content {
    margin-left: 0;
  }
  .category-bar {
    top: 140px; /* push below expanded mobile nav */
  }
}
.nav-right {
  position: relative;
}

#cartBell {
  position: relative;
}

.nav-icon-wrapper {
  position: relative;
  display: inline-block;
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -8px; /* Position it top-right on the bell */
  background: red;
  color: white;
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 50%;
  min-width: 18px;
  text-align: center;
  font-weight: bold;
  z-index: 10;
}
@media (max-width: 768px) {
  .cart-badge {
    top: -4px;
    right: -6px;
    font-size: 10px;
    min-width: 16px;
    padding: 1px 4px;
  }
}
.bell-wrapper {
  position: relative;
  display: inline-block;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: 103px;
  background-color: red;
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 50%;
  font-weight: bold;
  z-index: 10;
}

@media screen and (max-width: 768px) {
  #toggleButton {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
  }
}

@media (max-width: 768px) {
  /* Push main content below header */
  .main-content {
    margin-top: 120px; /* height of mobile header + optional spacing */
    padding: 16px;
  }

  /* If you have a category bar below the nav */
  .category-bar {
    top: 120px; /* same as header + spacing */
  }
}
