:root {
  --brand-green-dark: #14392b;
  --brand-green: #1f5c42;
  --brand-green-soft: #e8f1ea;
  --brand-gold: #b8934a;
  --brand-gold-soft: #f5ebd6;
  --brand-red: #d9432f;
  --brand-orange: #ef9f1f;
  --brand-yellow: #f4c430;
  --bg: #faf7f1;
  --card-bg: #ffffff;
  --border: #e6ddc9;
  --text: #24261f;
  --muted: #6b6a5e;

  /* legacy aliases used by the durian-tool components */
  --green-900: var(--brand-green-dark);
  --green-700: var(--brand-green);
  --green-600: #2c7350;
  --green-100: var(--brand-green-soft);
  --amber-100: #fff8e1;
  --amber-400: #ffb300;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image: url("assets/bg-fruits.png");
  opacity: 0.12;
}

body::before {
  bottom: -40px;
  right: -60px;
  width: 480px;
  height: 450px;
  background-size: 480px auto;
  background-position: bottom right;
}

body::after {
  top: -40px;
  left: -80px;
  width: 340px;
  height: 320px;
  background-size: 340px auto;
  background-position: top left;
  transform: scaleX(-1);
}

@media (max-width: 720px) {
  body::before {
    width: 260px;
    height: 240px;
    background-size: 260px auto;
  }

  body::after {
    width: 180px;
    height: 170px;
    background-size: 180px auto;
  }
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: inherit;
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand-green-dark);
}

.brand-tagline {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--brand-gold);
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--brand-green);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--brand-green-dark);
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
  background: #fff;
  text-align: center;
  padding-bottom: 28px;
}

.hero-banner {
  width: 100%;
  height: auto;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-orange));
  color: #fff;
  box-shadow: 0 8px 20px rgba(217, 67, 47, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--brand-green-dark);
  border: 2px solid var(--brand-green-dark);
}

/* ---------- Section shells ---------- */

.section-title {
  font-size: 1.6rem;
  color: var(--brand-green-dark);
  text-align: center;
  margin: 0 0 8px;
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 32px;
  font-size: 0.95rem;
}

.products-section {
  padding: 64px 0;
}

.tool-section {
  padding: 64px 0;
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-section {
  padding: 64px 0;
}

/* ---------- Product catalog ---------- */

.category-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.category-tab {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-tab:hover {
  border-color: var(--brand-green);
}

.category-tab.active {
  background: var(--brand-green-dark);
  border-color: var(--brand-green-dark);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(20, 57, 43, 0.12);
}

.product-card-image {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  padding: 16px;
}

.product-card-image img {
  max-height: 100%;
  width: auto;
  margin: 0 auto;
}

.product-card-body {
  padding: 16px 18px 20px;
  border-top: 1px solid var(--border);
}

.product-card-name {
  font-weight: 700;
  color: var(--brand-green-dark);
  margin: 0 0 6px;
  font-size: 1rem;
}

.product-card-tagline {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.product-card-rate {
  margin: 10px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-gold);
}

/* ---------- About ---------- */

.about-inner p {
  max-width: 720px;
  margin: 0 auto 20px;
  text-align: center;
}

.about-features {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

.about-features li {
  background: var(--brand-green-soft);
  color: var(--brand-green-dark);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
}

/* ---------- Contact ---------- */

.contact-section {
  padding: 64px 0 80px;
  background: #fff;
  border-top: 1px solid var(--border);
}

.contact-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-green-soft);
  color: var(--brand-green-dark);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

a.contact-link:hover {
  background: var(--brand-gold-soft);
}

/* ---------- Durian tool (existing) ---------- */

.crop-select {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.crop-select label {
  font-weight: 600;
  color: var(--green-900);
}

#crop-picker {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 1rem;
  font-family: inherit;
}

.stage-select h3 {
  font-size: 1.15rem;
  color: var(--green-900);
  margin-bottom: 14px;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.stage-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.stage-btn:hover {
  border-color: var(--green-600);
  transform: translateY(-1px);
}

.stage-btn.active {
  background: var(--green-600);
  border-color: var(--green-600);
  color: #fff;
  font-weight: 600;
}

.stage-btn .stage-num {
  display: inline-block;
  min-width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-900);
  font-size: 0.75rem;
  margin-right: 8px;
}

.stage-btn.active .stage-num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.recommendation {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px dashed var(--border);
}

.recommendation.hidden {
  display: none;
}

.recommendation h3 {
  color: var(--green-900);
  margin-bottom: 4px;
}

.summary {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 20px;
}

.rec-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.rec-card h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--green-900);
}

.rec-card p {
  margin: 0;
  color: var(--text);
}

.rec-card.highlight {
  background: #e6f3ff;
  border-color: #b9dcff;
}

.rec-card.note {
  background: var(--amber-100);
  border-color: #ffe0a3;
}

.chem-section.hidden {
  display: none;
}

.chem-card {
  background: #fdf1f1;
  border-color: #f3c9c9;
}

.chem-disclaimer {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e6bcbc;
}

.chem-restricted {
  background: #fdf1f1;
  border-color: #f3c9c9;
}

.chem-restricted p {
  color: #a13d3d;
  font-weight: 600;
  margin: 0;
}

.mild-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
}

.chem-group {
  margin-bottom: 18px;
}

.chem-group:last-child {
  margin-bottom: 0;
}

.chem-label {
  display: block;
  font-weight: 600;
  color: var(--green-900);
  margin-bottom: 6px;
  font-size: 0.92rem;
}

.chem-group-hint {
  margin: 0 0 8px;
  padding: 6px 10px;
  background: #fdf0f6;
  border: 1px dashed #f3b8d6;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #a13d6f;
}

.chem-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.chem-rec {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.chem-rec p {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.chem-rec p:last-child {
  margin-bottom: 0;
}

.chem-hint {
  color: var(--muted);
}

.chem-current {
  color: var(--text);
}

.chem-advice {
  font-weight: 600;
  color: var(--green-900);
}

.chem-alt-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.9rem;
}

.chem-alt-list li {
  margin-bottom: 8px;
}

.chem-group-tag {
  color: var(--muted);
  font-size: 0.85rem;
}

.chem-target {
  color: var(--green-700);
  font-size: 0.85rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--brand-green-dark);
  color: #d9e6dd;
  padding: 32px 0;
  font-size: 0.85rem;
}

.footer-inner {
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
}

.footer-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-inner p {
  margin: 4px 0;
}

.footer-disclaimer {
  color: #9fb3a8;
  font-size: 0.78rem;
  margin-top: 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.3rem;
  }
}
