/* ===== CENTER FIX ===== */
.page-wrapper {
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.diet-container {
  width: 100%;
  max-width: 820px;
}

/* ===== HEADINGS ===== */
h1 {
  text-align: center;
  margin-bottom: 10px;
}
.subtitle {
  text-align: center;
  color: var(--text-body); /* Mustang */
  margin-bottom: 28px;
}

/* ===== CARD ===== */
/* Removed - rely on global .card in style.css */

/* ===== TABLE ===== */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}
th, td {
  padding: 10px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-soft); /* Subtle border */
}
th {
  text-align: left;
  color: var(--text-body); /* Mustang */
}

/* ===== BUTTONS ===== */
/* Removed .primary-btn - rely on global .primary-btn in style.css */
.ghost-btn {
  background: transparent;
  border: 1px solid var(--accent-saddle); /* Saddle */
  color: var(--accent-saddle); /* Saddle */
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

.danger-btn {
  background: var(--danger); /* Rust/brown */
  border: none;
  padding: 12px;
  border-radius: 10px;
  width: 100%;
  color: var(--text-white); /* White */
  margin-top: 18px;
}

/* ===== CALCULATOR ===== */
.calculator {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
select, input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  /* Removed border: none; background: #0f1220; color: #fff; to rely on global input styles */
  border-radius: 10px;
  /* border: none; */ /* Rely on global style's border */
  /* background: var(--bg-input); */ /* Rely on global style */
  /* color: var(--text-main-headings); */ /* Rely on global style */
}

/* ===== SELECTED ===== */
.selected-list div {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-body); /* Mustang */
}

/* ===== TOTALS ===== */
.totals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.totals div {
  background: var(--bg-card); /* Rein */
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}
.totals span {
  font-size: 12px;
  color: var(--text-body); /* Mustang */
}
/* =========================
   RESPONSIVE ADDON
========================= */

/* GLOBAL SAFETY */
body {
  overflow-x: hidden;
}

/* CENTER PAGE PROPERLY */
.container {
  margin: 0 auto;
  padding: 20px;
}

/* =========================
   TABLE RESPONSIVENESS
========================= */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

table {
  min-width: 600px; /* allows horizontal scroll on mobile */
}

/* =========================
   CALCULATOR RESPONSIVE
========================= */
.calculator {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.calculator select,
.calculator input,
.calculator button {
  flex: 1 1 160px;
  min-height: 44px; /* mobile tap size */
}

/* =========================
   SELECTED FOOD LIST
========================= */
#selectedFoods {
  margin-top: 16px;
}

.selected-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* =========================
   TOTALS GRID
========================= */
.totals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* =========================
   BUTTONS
========================= */
button {
  min-height: 44px;
  touch-action: manipulation;
}


/* =========================
   MOBILE INPUT SIZE FIX
========================= */
@media (max-width: 600px) {

  .calculator {
    gap: 8px;
  }

  .calculator select,
  .calculator input {
    min-height: 36px;
    font-size: 14px;
    padding: 6px 10px;
  }

  .calculator button {
    min-height: 38px;
    font-size: 14px;
    padding: 8px 12px;
  }
}


/* =========================
   TABLET (601px – 900px)
========================= */
@media (min-width: 601px) and (max-width: 900px) {

  .container {
    max-width: 720px;
  }

  .totals {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================
   DESKTOP (901px+)
========================= */
@media (min-width: 901px) {

  .container {
    max-width: 900px;
  }

  .calculator select,
  .calculator input {
    max-width: 240px;
  }

  .calculator button {
    max-width: 180px;
  }
}
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .mobile-menu.show {
    display: flex;
  }
}