/* --- Sidebar Toggle Styles --- */
body {
  /* Prevent horizontal scroll caused by 0-width sidebar during transition */
  overflow-x: hidden;
}

.sidebar {
  /* Add transitions for smooth collapse/expand */
  transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease;
  /* Remove horizontal resize if previously added */
  /* resize: horizontal; REMOVE THIS */
  /* overflow-x: auto; REMOVE THIS */
  overflow-y: auto; /* Keep vertical scroll */
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden; /* Hide content when collapsed */
}

#sidebarToggle {
  position: fixed; /* Keep button visible */
  top: 70px; /* Adjust as needed below navbar */
  left: 10px; /* Start near the sidebar */
  z-index: 1000; /* Ensure it's above content */
  background-color: #5a6268;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 1.2em;
  transition: left 0.3s ease; /* Move button smoothly */
}

/* Style to move button when sidebar is collapsed */
body.sidebar-state-collapsed #sidebarToggle {
  left: 10px; /* Keep it near the edge */
}
/* (Optional) Change button position relative to sidebar width if needed */
/* body:not(.sidebar-state-collapsed) #sidebarToggle {
        left: 260px; /* Example: sidebar width + padding */
/* } */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f4f4f4;
  color: #333;
}

nav {
  background-color: #343a40;
  color: white;
  width: 100%;
  height: auto;
  box-sizing: border-box;
}

nav ul {
  list-style: none;
  padding: 10px;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

nav ul li {
  margin: 0 15px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: block;
}

nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #007bff;
}

nav ul li a.active {
  background-color: #007bff;
  color: white;
}

.main-container {
  display: flex;
  flex-grow: 1;
}

.sidebar {
  background-color: #e9ecef;
  width: 25%;
  min-width: 200px;
  padding: 20px;
  box-sizing: border-box;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
}

.sidebar h2 {
  margin-top: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li a {
  text-decoration: none;
  color: #007bff;
  display: block;
  padding: 5px 0;
}

.sidebar ul li a:hover {
  text-decoration: underline;
}

.content {
  flex-grow: 1;
  padding: 20px;
  box-sizing: border-box;
}

.commodity-list {
  list-style: none;
  padding: 0;
}

.commodity-list li {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 15px;
  padding: 15px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.commodity-list li a {
  color: #28a745;
  text-decoration: none;
  font-weight: bold;
  margin-right: 15px;
}

.commodity-list li a:hover {
  text-decoration: underline;
}

.commodity-list li img {
  max-height: 80px;
  margin-left: auto;
  border-radius: 4px;
}

h1 {
  color: #007bff;
  margin-bottom: 20px;
  text-align: center;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  margin-bottom: 15px;
}

p {
  line-height: 1.6;
  margin-bottom: 10px;
}

.price {
  color: #dc3545;
  font-weight: bold;
  font-size: 1.2em;
}

.availability {
  color: #28a745;
  font-weight: bold;
}

.out-of-stock {
  color: #ffc107;
  font-weight: bold;
}

a {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
}

a:hover {
  text-decoration: underline;
}

.back-link {
  margin-top: 20px;
}
