body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 1em;
  background: #fff;
  font-size: 16px;
  line-height: 1.4;
}

h1 {
  font-size: 1.4em;
  margin-bottom: 1em;
  text-align: center;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.card {
  touch-action: manipulation;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
  cursor: pointer;
}

.card img {
  width: 100%;
  display: block;
  height: auto;
  border-radius: 6px;
}

.card:active {
  transform: scale(0.96);
}

button.category {
  font-size: 1em;
  padding: 0.75em 1em;
  margin: 0.2em;
  border: 1px solid #ccc;
  background: #f9f9f9;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
}

button.category:hover {
  background: #eee;
}

#selected-category-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5em;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1em;
  box-sizing: border-box;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 1em;
  max-width: 95vw;
  max-height: 90vh;
  width: 100%;
  overflow: auto;
  text-align: center;
  box-sizing: border-box;
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 60vh;
  max-width: 90vw;
  object-fit: contain;
  border-radius: 8px;
  margin: 1em 0;
}

.modal-content button {
  font-size: 1em;
  margin: 0.5em;
  padding: 0.5em 1em;
  border: none;
  border-radius: 6px;
  background: #007aff;
  color: white;
  cursor: pointer;
}

.modal-content button.secondary {
  background: #aaa;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1em 0;
  gap: 1em;
  flex-wrap: wrap;
}

.qty-group,
.action-group {
  display: flex;
  gap: 0.5em;
}

.qty-group button,
.action-group button {
  font-size: 1.2em;
  width: 3em;
  height: 3em;
  line-height: 1;
  text-align: center;
  padding: 0;
  border: none;
  background: #007aff;
  color: white;
  border-radius: 4px;
  flex-shrink: 0;
}

.qty-group button:hover,
.action-group button:hover {
  background: #005ec2;
}

.qty-group input {
  text-align: center;
  font-size: 1.2em;
  width: 3em;
  height: 3em;
}
