/* ====== GLOBAL ====== */
/* .swf-container {
  max-width: 1100px;
  margin: 40px auto;
  font-family: Inter, system-ui, sans-serif;
  color: #222;
} */

.swf-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.swf-card h3 {
  margin-top: 0;
  font-size: 20px;
}

/* ====== BUILDER ====== */
.swf-builder {
  display: flex;
  gap: 16px;
  align-items: center;
}

.swf-builder input {
  flex: 1;
  padding: 10px 12px;
  font-size: 15px;
}

.swf-builder button {
  background: #ffb133;
  border: none;
  padding: 12px 20px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}

/* ====== SAVED RECIPES ====== */
#savedRecipes > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

#savedRecipes button {
  margin-left: 8px;
  background: #489f10;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}

/* ====== INGREDIENTS ====== */
.swf-ingredients .ingredient-row {
  display: grid;
  grid-template-columns: 1fr 100px auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.swf-ingredients input[type="number"] {
  padding: 8px;
}

.swf-ingredients button {
  background: #489f10;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
}

/* ====== RESULTS ====== */
.swf-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.nutrient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nutrient-tile {
  background: #f8f8f8;
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
}

.nutrient-tile span {
  font-weight: 600;
}
ul:last-child, ol li:last-child {
    margin-bottom: 0px;
    cursor: pointer !important;
}

/* Base input style */
.swf-container input[type="text"],
.swf-container input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid #d0d5dd;
  font-size: 14px;
  background: #fff;
  transition: all 0.25s ease;
  outline: none;
}

#search {
  border: 2px solid #e5e7eb;
  font-weight: 500;
}

#search:focus {
  border-color: #10b981;              /* green */
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
}

input[type="number"] {
  max-width: 110px;
  text-align: center;
}

.swf-container button {
  padding: 6px 14px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.swf-container button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37,99,235,0.25);
}

.ingredient-row input {
  margin: 0 10px;
}

/* ===============================
   FAVORITE BUTTON
================================ */

.favorite-btn {
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  color: #000; /* ☆ text black */
}

.favorite-btn .star {
  font-size: 18px;
  line-height: 1;
}

/* ☆ (not favorite) */
.favorite-btn:not(.active) .star {
  color: #000;
}

/* ⭐ (favorite) */
.favorite-btn.active .star {
  color: #ffb300;
}

/* text */
.favorite-btn .fav-text {
  font-size: 13px;
  color: #000000;
}

.favorite-btn.active .fav-text {
  color: #fff;
  background-color: #489f10;
}

/* hover */
.favorite-btn:hover .fav-text {
  text-decoration: underline;
}

/* =========================
   Recent Recipes
========================= */

#recentRecipes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fafafa;
  border: 1px solid #eee;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.recent-row:hover {
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.05);
}

.recent-name {
  font-weight: 600;
  color: #333;
  text-transform: capitalize;
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

/* ===============================
   INGREDIENT ROW – FINAL FIX
================================ */

.ingredient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 12px;
  flex-wrap: wrap; /* 🔥 KEY FIX */
}

.ingredient-info {
  flex: 1 1 240px;
  min-width: 0;
}

.ingredient-info strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.ingredient-info small {
  display: block;
  color: #777;
  margin-top: 4px;
  font-size: 12px;
}

.ingredient-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;   /* 🔥 KEY FIX */
}

.ingredient-controls input {
  width: 72px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 0 10px;
  text-align: center;
}

.btn-outline {
  background: #ffd27d;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-outline:hover {
  background: #ffbf4d;
}

.btn-remove {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
}

.btn-remove:hover {
  color: #e53935;
}

/* ===============================
   MOBILE FIX
================================ */
@media (max-width: 600px) {
  .ingredient-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ingredient-controls {
    justify-content: flex-start;
  }
}

.swf-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.swf-modal.hidden { display: none; }

.swf-modal-box {
  background: #fff;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
}

.cf-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 10px;
  margin: 15px 0;
}

.swf-btn-primary {
  background: #ffb02e; /* StoffwechselFit yellow */
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.swf-btn-primary:hover {
  background: #ffa000;
}

.swf-btn-secondary {
  background: #f3f3f3;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.swf-btn-secondary:hover {
  background: #e9e9e9;
}

/* Modal input base */
#customFoodModal input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1.5px solid #e3e3e3;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

/* Placeholder color */
#customFoodModal input::placeholder {
  color: #9a9a9a;
  font-size: 13px;
}

/* Focus state (important) */
#customFoodModal input:focus {
  outline: none;
  border-color: #ffb02e;
  box-shadow: 0 0 0 3px rgba(255, 176, 46, 0.25);
}

@media (max-width: 480px) {
  .cf-grid {
    grid-template-columns: 1fr;
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f3f3;
  color: #444;
  font-size: 20px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #ffb02e;
  color: #fff;
}

.swf-modal-box {
  position: relative;
}

.swf-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #2ecc71;
  color: #fff;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 9999;
}

.swf-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.cf-success {
  background: #e8f7ee;
  color: #1e7e34;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 10px;
}

.cf-success.hidden {
  display: none;
}
.saved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 768px) {
  .saved-actions {
  margin-top: 10px;
}
}