body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #fafafa;
}

.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 240px;
  background: white;
  border-right: 1px solid #ddd;
  padding: 15px;
}

.sidebar h3 {
  margin-bottom: 10px;
}

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

.sidebar li {
  padding: 10px 8px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  border: 1px solid transparent;
}

.sidebar li:hover,
.sidebar li.active {
  background: #ffecec;
  border-color: tomato;
}

.main {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

.filter-chips {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid #ddd;
  padding: 6px 12px;
  border-radius: 20px;
  background: white;
  cursor: pointer;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 15px;
}

.product-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #ddd;
  overflow: hidden;
  transition: 0.2s;
}

.product-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.product-image {
  height: 160px;
  background-size: cover;
  background-position: center;
}

.product-details {
  padding: 10px;
}

.product-name {
  font-size: 15px;
  margin-bottom: 6px;
  font-weight: 600;
}

.product-price {
  margin-bottom: 10px;
  color: #555;
}

.add-btn {
  background: tomato;
  color: white;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}

.search-container {
  margin-bottom: 15px;
}

#productSearch {
  width: 20%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

#productSearch:focus {
  outline: none;
  border-color: tomato;
  box-shadow: 0 0 5px rgba(255, 99, 71, 0.4);
}

.add-btn.disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

#cartOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

#cartPopup {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9999;
  max-width: 90vw; /* for mobile */
  width: 350px;    /* or whatever you want */
}


.user-fields input,
.user-fields textarea {
  width: 100%;
  padding: 7px;
  margin-bottom: 8px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.cart-actions button {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.55);
  z-index: 999;
}

#cartPopup.modal {
  width: auto !important;
  height: auto !important;
  max-height: 90vh !important;
  max-width: 95vw !important;
  overflow-y: auto !important;
}

.confirm { position:fixed; top:0; left:0; right:0; bottom:0; background:#0008; display:flex; justify-content:center; align-items:center; }
.confirm-box { background:white; padding:20px; border-radius:8px; text-align:center; }
.hidden { display:none; }


@media (max-width:600px) {
  #cartPopup.modal {
    width: 80vw !important;
    height: 75vh !important;
  }
}


.modal-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px;
}

.section {
  margin-bottom: 18px;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
}
.product-table th {
  background: #f3f5f7;
  text-align: left;
  padding: 8px;
}
.product-table td {
  padding: 8px;
  border-bottom: 1px solid #e4e7ea;
}

.modal-footer {
  text-align: right;
  margin-top: 16px;
}

.close-btn {
  padding: 8px 18px;
  background: #e9ecef;
  border-radius: 7px;
  cursor: pointer;
  border: none;
  font-weight: 600;
}

.hidden {
  display: none;
}








/* --- Base styles (already in your code) --- */
/* body, .container, .sidebar, .main, .filter-chips, .product-grid, etc. */

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
  .container {
    flex-direction: column; /* stack sidebar and main */
    height: auto;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
    display: flex;
    overflow-x: auto; /* horizontal scroll for categories if too many */
  }

  .sidebar ul {
    display: flex;
    gap: 10px;
  }

  .sidebar li {
    white-space: nowrap; /* prevent text wrapping */
  }

  .main {
    padding: 10px;
  }

  .filter-chips {
    justify-content: flex-start; /* align left */
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* smaller cards */
    gap: 10px;
  }

  .product-card {
    font-size: 14px; /* slightly smaller font */
  }

  .product-image {
    height: 120px; /* smaller images */
  }

  .add-btn {
    padding: 5px 10px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr; /* single column for very small screens */
  }

  .filter-chips {
    gap: 6px;
  }

  .chip {
    padding: 4px 8px;
    font-size: 13px;
  }
}
#cartFloat{
  position:fixed;
  bottom:20px;
  right:20px;
  background:#ff9800;
  color:#fff;
  padding:14px 16px;
  border-radius:50%;
  cursor:pointer;
  font-size:20px;
}

#cartBadge{
  background:red;
  padding:2px 6px;
  border-radius:10px;
  font-size:12px;
  position:absolute;
  top:-5px;
  right:-5px;
}

#cartOverlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
}

#cartPopup{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  background:white;
  padding:15px;
  border-radius:12px 12px 0 0;
  max-height:60vh;
  overflow-y:auto;
}

.hidden{
  display:none;
}

.cart-item{
  display:flex;
  justify-content:space-between;
  margin-bottom:6px;
}

.top-bar{
  padding:10px;
}

#productSearch{
  width:100%;
  padding:10px;
  border-radius:6px;
  border:1px solid #ccc;
}


.field {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.field input, .field textarea {
  padding: 6px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.submit-btn {
  width: 100%;
  padding: 10px;
  background: green;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

#pastOrdersBtn {
  padding: 8px 14px;
  background: #ff6a4a;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

#pastOrdersBtn:hover {
  opacity: 0.9;
}
