.grocery-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 150ms ease;
}

.grocery-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.3);
}
/* for the remove in the to-buy */
.grocery-btn.secondary {
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
  color: #fff;
  font-size: 14px;
}

.grocery-table {
  width: 100%;
  max-width: 720px;
  border-collapse: collapse;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.85);
}

#selected-recipes {
  overflow-x: auto;
}

.grocery-table th,
.grocery-table td {
  border: 1px solid #d6d9e0;
  padding: 6px 8px;
  line-height: 0.85;  
  text-align: left;
  vertical-align: top;
}

/* Column widths */
/* First column: Recipe */
.grocery-table th:nth-child(1),
.grocery-table td:nth-child(1) {
  min-width: 190px;
}
/* Second column: Ingredient and Have it */
.grocery-table th:nth-child(2),
.grocery-table td:nth-child(2) {
  min-width: 70px;
}

.grocery-table th:nth-child(3),
.grocery-table td:nth-child(3) {
  min-width: 34px;
  width: 34px;
  max-width: 34px;
  padding: 4px;
  text-align: center;
}

.grocery-table td.have-cell input[type="checkbox"] {
  display: block;
  margin: 0 auto;
}

.grocery-table th:nth-child(4),
.grocery-table td:nth-child(4) {
  min-width: 70px;
  text-align: center;
}

.grocery-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.grocery-btn.remove {
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.grocery-link {
  color: #4f46e5;
  font-weight: 600;
  text-decoration: none;
}

.grocery-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .grocery-table {
    font-size: 15px;
    max-width: 100%;
  }

  .grocery-table th,
  .grocery-table td {
    padding: 4px 6px;
  }

  /* Narrower columns on mobile */
  .grocery-table th:nth-child(1),
  .grocery-table td:nth-child(1) {
    min-width: 150px;
  }

  .grocery-table th:nth-child(2),
  .grocery-table td:nth-child(2) {
    min-width: 70px;
  }

  .grocery-table th:nth-child(3),
  .grocery-table td:nth-child(3) {
    min-width: 30px;
    width: 30px;
    max-width: 30px;
    padding: 2px;
  }

  .grocery-table th:nth-child(4),
  .grocery-table td:nth-child(4) {
    min-width: 60px;
  }
}
