.category {
  width: 150px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden; /* Ensures the label stays within the button */
}

.category img {
  width: 100px;
  height: 100px;
  margin: auto;
}

.category:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.category:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* General Layout */
.categories-bill-layout {
  display: flex;
  height: 100%;
  overflow: hidden; /* Prevent whole-page scrolling */
}

/* Categories Section */
.categories {
  position: relative; /* Ensures the add button is positioned relative to this container */
  padding: 0;
  margin: 0;
  flex: 1; /* Use available space */
  overflow-y: auto; /* Independent scrolling */
  border-right: 3px solid #d2b48c; /* Light brown */
}

/* Categories and Items Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Minimum width per button: 150px */
  max-width: calc(168px * 5); /* Restrict the grid to 5 columns */
  gap: 20px;
  justify-content: center;
  margin: 0 auto; /* Center the grid */
  padding-right: 10px;
}

.categories-grid button {
  width: 150px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background-color: #f8f4f0;
  border: 2px solid #e0ddd8;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.categories-grid button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.categories-grid img {
  width: 100px;
  height: 100px;
  margin-bottom: 5px;
}

.categories-grid .button-label {
  background-color: #5a3921; /* Dark brown */
  color: white;
  width: 100%;
  text-align: center;
  padding: 5px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  font-size: 14px;
  font-weight: bold;

  /* Ensure consistent height for text */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Handle long text gracefully */
  white-space: normal; /* Allow text to wrap */
  overflow: hidden;
  text-overflow: ellipsis;

  /* Center-align multi-line text */
  line-height: 1.2; /* Adjust spacing between lines */
}


/* specific settings for category detail */
/* Specific styling for category-item buttons */
.categories-grid .category-item {
  width: 165px;
  height: 210px; /* Fixed height for uniformity */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between; /* Ensures proper spacing */
  background-color: #f8f4f0;
  border: 2px solid #e0ddd8;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.categories-grid .category-item img {
  width: 115px;
  height: 115px;
  margin-top: 10px;
}

.categories-grid .category-item .button-price {
  font-size: 16px;
  font-weight: bold;
  color: #555;
  margin: 5px 0; /* Spacing between image and price */
}

.categories-grid .category-item .button-label {
  font-size: 16px;
  font-weight: bold;
  color: white;
  background-color: #5a3921; /* Brown background */
  width: 100%;
  padding: 5px;
  text-align: center;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;

  /* Ensure consistent height for text */
  min-height: 36px; /* Minimum height for single line */
  max-height: 48px; /* Allow for two lines */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Handle long text gracefully */
  white-space: normal; /* Allow text to wrap */
  overflow: hidden;
  text-overflow: ellipsis;

  /* Center-align multi-line text */
  line-height: 1.2; /* Adjust spacing between lines */
}

#selected-item {
  border: 5px solid #d2b48c; /* Thick border */
  transform: scale(1.5); /* Scale the item to 50% larger */
  z-index: 10; /* Ensure it appears above others */
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3); /* Add a shadow for depth */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions */
  position: relative; /* Allow adjustment via JavaScript */
}

/* Vertical Divider */


.bill-section {
  width: 450px; /* Wider bill section */
  padding: 20px;
  height: calc(100vh - 185px);
}

/* Bill Section */
.bill {
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  height: 100%;
}

.bill .bill-logo {
  text-align: center;
  width: 150px;
  margin-bottom: 10px;
  position: relative;
  left: calc(50% - 75px);
}

/* Bill List Layout */
.bill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto auto; /* Name | Price | Delete Button */
  gap: 10px;
  align-items: center;
}

.bill-list li {
  display: contents; /* Make the list items flow in grid cells */
}

.bill-list span {
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
}

.bill-list .delete-button {
  display: inline-block;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
  text-align: center;
}

.bill-list .delete-button:hover {
  background-color: #d32f2f;
}

/* Total Section */
.total {
  font-size: 18px;
  font-weight: bold;
  text-align: right;
  margin-top: 10px;
}

/* Bill Buttons */
.bill-buttons {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 20px;
  margin-bottom: 20px;
  position: relative;
  bottom: 10px;
  width: 100%;
}

.bill-buttons .btn {
  flex: 1;
  padding: 20px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  color: white;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.bill-buttons .btn:active {
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

.bill-buttons .btn.finish {
  background-color: #4caf50; /* Green */
}

.bill-buttons .btn.delete {
  background-color: #f44336; /* Red */
}

.bill-buttons .btn.switch {
  background-color: #9e9e9e; /* Gray */
}

.remove-item {
  background-color: #f44336; /* Red */
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  padding: 5px 10px;
}

.remove-item:hover {
  background-color: #d32f2f;
}

/** details **/
/* General Button Style for Category Items */
.category-button {
  width: 150px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background-color: #fdfaf5;
  border: 2px solid #d2b48c;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.category-button:active {
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
  transform: translateY(2px);
}

.category-button img {
  width: 80px;
  height: 80px;
  margin-top: 10px;
}

.category-button .label {
  background-color: #8b4513; /* Dark Brown */
  color: #ffffff;
  text-align: center;
  font-size: 16px;
  padding: 5px 0;
  width: 100%;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Numeric Keypad Buttons */
.keypad-button {
  width: 80px;
  height: 80px;
  border: none;
  border-radius: 50%;
  font-size: 30px;
  font-weight: bold;
  color: white;
  background-color: #333;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s, box-shadow 0.1s;
}

.keypad-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* Action Buttons (OK and Cancel) */
.action-button {
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s, box-shadow 0.1s;
}

.action-button.ok {
  background-color: #28a745; /* Green */
}

.action-button.cancel {
  background-color: #dc3545;
}

.action-button.back {
  background-color: #dc3545; /* Red */
  position: absolute;
  top: 10px;
  right: 10px;
}

.action-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* Add Button */
.categories button.edit-button {
  position: sticky;
  top: 100vh;
  left: 100%;
  margin: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #ffe5b4; /* Light brown circle */
  color: green; /* Dark plus sign */
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15); /* Floating shadow */
  font-size: 36px; /* Bold plus sign */
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hover Effect */
.edit-button:hover {
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.25); /* More pronounced shadow */
  transform: scale(1.1); /* Slight grow */
}

/* Active/Pressed Effect */
.edit-button:active {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Smaller shadow */
  transform: scale(0.9); /* Slight shrink */
}

/* Ensure button stands out */
.edit-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.5); /* Orange focus ring */
}

/* Edit Button */
.edit-button {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #ffe5b4; /* Light brown */
  color: #333;
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edit-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}


/* Category Edit Row */
.category-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.category-edit-row input {
  flex: 1;
  margin-right: 10px;
}

.category-edit-row button {
  margin: 0 5px;
  padding: 5px 10px;
  background-color: #ffcc00;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.category-edit-row button:hover {
  background-color: #ffaa00;
}

/** category detail edit */
/* Item Edit Row */
.item-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.item-edit-row input {
  margin-right: 10px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.item-edit-row input[type="number"] {
  width: 80px; /* Smaller width for price input */
}

.item-edit-row button {
  margin: 0 5px;
  padding: 5px 10px;
  background-color: #ffcc00;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.item-edit-row button:hover {
  background-color: #ffaa00;
}

.scrollable-section {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  border: 1px solid #e0ddd8;
  padding: 10px;
  border-radius: 10px;
}



