/* =========================
   GLOBAL
   ========================= */

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: #f7f7f7;
  color: #222;
  margin: 0;
  padding: 24px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5rem 0;
}

p {
  margin: 0.5rem 0;
}

/* =========================
   LAYOUT
   ========================= */

.app {
  max-width: 1100px;
  margin: 0 auto;
}

.app-header {
  margin-bottom: 24px;
}

.subtitle {
  font-size: 0.9rem;
  color: #555;
}

/* =========================
   CARDS / SECTIONS
   ========================= */

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
}

/* =========================
   FORM ELEMENTS
   ========================= */

.field {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: #333;
}

input,
select,
button {
  font-size: 0.95rem;
  padding: 6px 8px;
}

input[type="number"] {
  width: 100%;
}

button {
  cursor: pointer;
  border: 1px solid #999;
  background-color: #eee;
  border-radius: 4px;
}

button:hover {
  background-color: #e2e2e2;
}

/* =========================
   GRID
   ========================= */

.grid {
  display: grid;
  gap: 16px;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* =========================
   STOCK TABLE
   ========================= */

.stock-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.stock-table th,
.stock-table td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: left;
}

.stock-table th {
  background-color: #f0f0f0;
  font-size: 0.85rem;
}

.stock-table input,
.stock-table select {
  width: 100%;
}

.remove-stock-btn {
  background: #fff;
  border: 1px solid #999;
  padding: 4px 8px;
  font-size: 0.9rem;
}

.remove-stock-btn:hover {
  background-color: #f5f5f5;
}

/* =========================
   ACTIONS
   ========================= */

.actions {
  text-align: right;
  margin-bottom: 20px;
}

#addStockButton {
  margin-bottom: 8px;
}

/* =========================
   RESULTS
   ========================= */

.results h3 {
  margin-bottom: 8px;
}

.result-option {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
}

.result-option.best {
  border-color: #2b6cb0;
  background-color: #f0f6ff;
}

.result-option ul {
  margin: 8px 0 0 18px;
}

.result-option ul ul {
  margin-top: 6px;
}

#showMoreBtn {
  margin-top: 10px;
}

/* =========================
   HELPERS
   ========================= */

.hidden {
  display: none;
}

.help-text {
  font-size: 0.85rem;
  color: #555;
}
