/* ===== Colors and fonts used across the whole site =====
   Change these values to restyle every page at once. */
:root {
  --green-dark: #2f4a2c;
  --green: #4d7a3f;
  --green-light: #e8f0e1;
  --cream: #faf8f2;
  --text: #2a2a2a;
  --muted: #666;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
}

a { color: var(--green); }

/* ===== Header and navigation bar ===== */
header {
  background: var(--green-dark);
  color: white;
  padding: 16px;
}
.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
}
nav a {
  color: white;
  text-decoration: none;
  margin-left: 16px;
}
nav a:hover { text-decoration: underline; }

/* ===== Main content area ===== */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Big welcome banner on the front page */
.hero {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  margin-bottom: 32px;
}
.hero h1 { margin-top: 0; color: var(--green-dark); }

/* ===== Category cards (front page) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.card {
  display: block;
  background: white;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}
.card h3 { margin-top: 0; color: var(--green); }

/* ===== Seed listings (category pages) ===== */
.seed-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.seed {
  background: white;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 20px;
}
.seed h3 { margin-top: 0; }
.price { font-weight: bold; color: var(--green-dark); }

/* Photos on cards and seed listings: same size and crop everywhere */
.card img,
.seed img,
.category-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin-bottom: 12px;
}
.category-photo {
  max-width: 480px;
  aspect-ratio: 16 / 9;
}

/* Links on the species cards */
.seed-link { color: var(--text); text-decoration: none; }
.seed-link:hover { color: var(--green); text-decoration: underline; }
.more-link { display: block; margin-top: 12px; font-size: 0.9rem; }

/* ===== Species page ===== */
.seed-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.seed-main-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}
.seed-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.seed-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.seed-thumb:hover, .seed-thumb:focus { border-color: var(--green); }
.seed-thumb img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.seed-info h1 { margin: 0 0 4px; color: var(--green-dark); font-style: italic; }
.seed-price { font-size: 1.3rem; margin: 12px 0 4px; }
.seed-description { margin-top: 24px; }
@media (max-width: 700px) {
  .seed-detail { grid-template-columns: 1fr; gap: 20px; }
}

/* Stock level under each seed */
.stock { color: var(--green); margin: 4px 0; }
.stock.low { color: #b26a00; }
.stock.sold-out { color: #a33; font-weight: bold; }

/* Add to cart button */
.buy {
  display: inline-block;
  background: var(--green);
  color: white;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 6px;
  margin-top: 8px;
}
.buy:hover { background: var(--green-dark); }
.buy:disabled {
  background: #bbb;
  cursor: default;
}

/* ===== Cart page ===== */
.muted { color: var(--muted); font-size: 0.9rem; }
.cart-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  background: white;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.cart-name { flex: 1 1 200px; }
.qty { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
}
.qty-btn:disabled { opacity: 0.4; cursor: default; }
.line-total { min-width: 70px; text-align: right; font-weight: bold; }
.link-btn {
  background: none;
  border: none;
  color: #a33;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.cart-summary { text-align: right; margin: 16px 0 24px; }
.cart-summary p { margin: 4px 0; }
.cart-total { font-size: 1.3rem; font-weight: bold; color: var(--green-dark); }
#checkout { max-width: 420px; margin-left: auto; }
.checkout-message {
  background: #fdecea;
  color: #8a1f1f;
  border-radius: 6px;
  padding: 10px 14px;
}

/* ===== Restock page ===== */
.admin-login {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 480px;
}
.admin-login label { width: 100%; font-weight: bold; }
.admin-login input,
.stock-input {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.admin-login input { flex: 1 1 200px; }
.admin-login .buy { margin-top: 0; }
.stock-input { width: 90px; }
.cart-row .buy { margin-top: 0; }
.order { margin-bottom: 12px; }
.order p { margin: 4px 0; }
.back { display: inline-block; margin-bottom: 16px; }

/* ===== Footer ===== */
footer {
  text-align: center;
  color: var(--muted);
  padding: 24px 16px;
  font-size: 0.9rem;
}

/* On phones, stack the nav links under the logo */
@media (max-width: 600px) {
  nav a { margin: 0 12px 0 0; }
}
