* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}
body {
  padding-bottom: 1px;
}

/* Search Bar */
.search-bar {
  display: flex;
  gap: 10px;
  margin: 15px;
}

.search-bar input {
  flex: 1;
  padding: 10px;
  border: 2px solid green;
  border-radius: 6px;
  outline: none;
}

/* Search box + button container */
#searchBox {
  padding: 8px 12px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 6px 0 0 6px;
  outline: none;
  width: 250px;
  transition: all 0.3s ease;
}

#searchBox:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.4);
}

.search-bar button {
  padding: 9px 16px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  background: #007bff;
  color: white;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.search-bar button:hover {
  background: #0056b3;
  transform: scale(1.05);
}

/* Table */

/* ======================================================= */

.product-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.product-table th {
  background: purple;
  color: #fff;
  padding: 10px;
  text-align: center;
}

.product-table td {
  text-align: center;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.group-row td {
  background: #ffe6e6;
  color: red;
  font-weight: bold;
}

.old-price {
  text-decoration: line-through;
  color: red;
  font-size: 0.9em;
}

.real-amt {
  color: #272727;
}

.product-table input[type="number"] {
  width: 60px;
  padding: 5px;
  text-align: center;
}

.pic-btn {
  background: #0da9c5;
  border: none;
  border-radius: 50%;
  padding: 10px;
  cursor: pointer;
  color: #fff;
}

/* .totals {
  margin-top: 15px;
  padding: 12px 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  text-align: center;
  font-weight: bold;
  background: #006400;
  color: white;
  border-radius: 6px;
  position: sticky;
  bottom: 0;
} */



.totals {
  position: sticky;
  z-index: 10;
  bottom: 1px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #006400;
  color: white;
  padding: 15px 20px;
  margin-top: 15px;
  font-weight: bold;
  border-radius: 4px;
}


.btn-cart {
  background: #ffcc00;
  border: none;
  color: #000;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  position: relative;
}

.cart-count {
  background: red;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  padding: 2px 6px;
  position: absolute;
  top: -8px;
  right: -8px;
}

#customerForm {
  width: 600px;
  max-width: 100%;
  background: #daf86d;
  box-shadow: -5px 0 12px rgba(0, 0, 0, 0.34);
  padding: 20px 30px;
  color: #3f3f3f;
  position: fixed;
  top: 0;
  right: -100%;
  bottom: 0;
  z-index: 150;
  transition: right 0.4s ease;
  overflow-y: auto;
}

#customerForm.active {
  right: 0;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #333;
}

#customerForm h2 {
  text-align: center;
  margin-bottom: 15px;
}

table.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
}

table.cart-table th,
table.cart-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}

table.cart-table th {
  background: #f03355;
  color: #fff;
}

.summary-box {
  background: #333;
  color: #fff;
  padding: 10px;
  text-align: right;
  font-weight: bold;
  margin-bottom: 10px;
}

.summary-box span {
  color: yellow;
}

.min-amt {
  background: #fff;
  padding: 10px;
  text-align: center;
  border: 1px solid #ccc;
  margin-bottom: 15px;
}

.min-amt span {
  color: red;
  font-weight: bold;
}

form label {
  font-weight: bold;
  margin-top: 8px;
  display: block;
}

form .form-control {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 4px;
}

form button {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  margin-top: 12px;
  cursor: pointer;
  font-weight: bold;
}

form button:hover {
  background: #0056b3;
}

@media(max-width:768px) {
  #customerForm {
    width: 100%;
  }

  .totals {
    flex-direction: column;
  }
}


@media(max-width:768px){
  .search-bar {
    flex-direction: column;
    gap: 8px;
    margin: 10px;
  }

  .search-bar input,
  .search-bar button {
    width: 80%;
  }
}


/* Make table container scrollable horizontally on small screens */
.product-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

/* Keep the table width flexible */
.product-table {
  width: 100%;
  min-width: 800px; /* ensures columns don’t shrink too much */
  border-collapse: collapse;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  /* Allow horizontal scroll on small screens */
  .product-table-wrapper {
    overflow-x: auto;
  }

  .product-table th, 
  .product-table td {
    padding: 8px 5px;
    font-size: 14px;
  }

  .product-table input.qty {
    width: 50px;
  }

  .pic-btn {
    padding: 8px;
    font-size: 14px;
  }

  .search-bar {
    flex-direction: column;
    gap: 10px;
  }

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

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

  .totals {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* Optional: add smooth scrolling for touch devices */
.product-table-wrapper {
  -webkit-overflow-scrolling: touch;
}



/* Responsive Cart / Customer Form */
@media (max-width: 768px) {
  #customerForm {
    width: 100%;
    padding: 15px;
    box-shadow: none;
  }

  #customerForm h2 {
    font-size: 22px;
  }

  .cart-table,
  .cart-table thead,
  .cart-table tbody,
  .cart-table th,
  .cart-table td,
  .cart-table tr {
    display: block;
    width: 100%;
  }

  .cart-table thead {
    display: none; /* Hide table headers */
  }

  .cart-table tbody tr {
    margin-bottom: 15px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
  }

  .cart-table td {
    padding: 6px 10px;
    text-align: left;
    position: relative;
  }



  .summary-box {
    font-size: 14px;
    text-align: center;
  }

  .min-amt {
    font-size: 14px;
    text-align: center;
    padding: 8px;
  }

  form label {
    font-size: 14px;
  }

  form .form-control {
    padding: 6px;
    font-size: 14px;
  }

  form button {
    width: 100%;
    padding: 10px;
    font-size: 16px;
  }

  .close-btn {
    font-size: 28px;
    top: 8px;
    right: 12px;
  }
}

