/* Approved 17 September 2026: cream, sage, olive and the existing peach.
 * Colour-only layer over the production storefront. Keep layout and behaviour.
 * Scope with main to outrank the application's lazy-loaded Marketplace theme.
 */
body:has(main.goodseed-marketplace-theme),
main.goodseed-marketplace-theme {
  --olive-paper: #f5f1e9;
  --olive-surface: #fffcf7;
  --olive-ink: #29352b;
  --olive-muted: #687060;
  --olive-line: #d9ddce;
  --olive-primary: #536b32;
  --olive-deep: #334b32;
  --olive-sage: #e6ecda;
  --olive-peach: #ead8c9;
  --olive-accent: #e5a154;
}

main.goodseed-marketplace-theme {
  --paper: var(--olive-paper);
  --paper-light: var(--olive-surface);
  --peach: var(--olive-peach);
  --peach-light: #f1e6db;
  --charcoal: var(--olive-ink);
  --warm-muted: var(--olive-muted);
  --warm-line: var(--olive-line);
  --marketplace-forest: var(--olive-deep);
  --marketplace-brand: var(--olive-primary);
  --marketplace-leaf: #83965f;
  --marketplace-teal: var(--olive-muted);
  --marketplace-mint: var(--olive-sage);
  --marketplace-orange: var(--olive-accent);
  --marketplace-ivory: var(--olive-surface);
  --marketplace-body: var(--olive-muted);
  background: var(--olive-paper);
  color: var(--olive-ink);
  scrollbar-color: #969e89 var(--olive-paper);
}
main.goodseed-marketplace-theme > [aria-hidden="true"] > div:first-child {
  background: var(--olive-peach);
  opacity: .12;
}
main.goodseed-marketplace-theme > [aria-hidden="true"] > div:last-child {
  background: var(--olive-sage);
  opacity: .24;
}
main.goodseed-marketplace-theme ::selection { background: #d5dfbf; color: var(--olive-ink); }
main.goodseed-marketplace-theme .marketplace-header-surface {
  background: rgb(255 252 247 / 96%);
  border-color: var(--olive-line);
  box-shadow: 0 4px 24px rgb(41 53 43 / 4%);
}
main.goodseed-marketplace-theme .marketplace-hero-shell::before {
  border-color: var(--olive-surface);
  background:
    radial-gradient(ellipse 48% 115% at 108% -5%, #ead8c9 0%, #ead8c9 61%, transparent 61.3%),
    linear-gradient(113deg, #f8f5ee 32%, #e4ebd7 100%);
  box-shadow: 0 18px 44px rgb(41 53 43 / 6%), inset 0 0 0 7px rgb(255 252 247 / 24%);
}
main.goodseed-marketplace-theme .marketplace-hero-shell h1 { color: var(--olive-ink); }
main.goodseed-marketplace-theme .marketplace-hero-shell h1::before { background: var(--olive-accent); }
main.goodseed-marketplace-theme .marketplace-hero-shell h1 > span { color: var(--olive-primary); }
main.goodseed-marketplace-theme .marketplace-search-shell {
  border-color: var(--olive-line);
  background: var(--olive-surface);
  box-shadow: 0 8px 22px rgb(41 53 43 / 5%);
}
main.goodseed-marketplace-theme .marketplace-search-shell:focus-within,
main.goodseed-marketplace-theme .marketplace-catalog-search > input:focus {
  border-color: var(--olive-primary);
  box-shadow: 0 0 0 3px rgb(83 107 50 / 18%);
}
main.goodseed-marketplace-theme [data-testid="marketplace-global-search"]::placeholder,
main.goodseed-marketplace-theme .marketplace-catalog-search > input::placeholder { color: var(--olive-muted); }
main.goodseed-marketplace-theme .marketplace-hero-shell aside > div:first-child {
  border-color: var(--olive-surface);
  outline-color: var(--olive-line);
  box-shadow: 0 22px 30px rgb(41 53 43 / 14%);
}
main.goodseed-marketplace-theme .marketplace-hero-shell aside > div:nth-child(3) { background: #dde2d1; }
main.goodseed-marketplace-theme .marketplace-hero-shell aside > div:has(> div > button) {
  background: var(--olive-surface);
  box-shadow: 0 15px 35px rgb(41 53 43 / 12%), 0 0 0 5px rgb(255 252 247 / 24%);
}
main.goodseed-marketplace-theme .marketplace-category-band { background: rgb(255 252 247 / 80%); }
main.goodseed-marketplace-theme .marketplace-category-footer {
  background: linear-gradient(180deg, var(--olive-surface), #f0f2e7) !important;
}
main.goodseed-marketplace-theme .marketplace-category-card:hover,
main.goodseed-marketplace-theme .marketplace-cloud-garden-card:hover {
  border-color: #83965f !important;
  box-shadow: 0 12px 30px rgb(41 53 43 / 10%);
}
main.goodseed-marketplace-theme .marketplace-cloud-garden-placeholder {
  background: linear-gradient(140deg, #f1f3e8, var(--olive-sage));
  color: var(--olive-muted);
}
main.goodseed-marketplace-theme #marketplace-trust > div {
  background: linear-gradient(110deg, #f8f5ee, var(--olive-sage));
}
main.goodseed-marketplace-theme .marketplace-network-panel {
  border-color: var(--olive-deep) !important;
  background:
    radial-gradient(ellipse 34% 140% at 110% 125%, #83965f 0%, #83965f 62%, transparent 62.5%),
    linear-gradient(125deg, #334b32, #536b32) !important;
  box-shadow: 0 16px 40px rgb(41 53 43 / 14%);
}
main.goodseed-marketplace-theme .marketplace-network-panel p,
main.goodseed-marketplace-theme .marketplace-network-panel .text-seed-100,
main.goodseed-marketplace-theme .marketplace-network-panel .text-seed-200,
main.goodseed-marketplace-theme .marketplace-network-panel [class*="text-[#"] { color: #edf1e4; }
main.goodseed-marketplace-theme .marketplace-network-panel [aria-label="ขั้นตอนลงทะเบียนสวน"] span {
  background: var(--olive-sage);
  color: var(--olive-deep);
}

/* Keep the status meaning and all catalogue data supplied by the application. */
main.goodseed-marketplace-theme .marketplace-cloud-product-card {
  --product-ink: var(--olive-ink);
  --product-muted: var(--olive-muted);
  --product-line: var(--olive-line);
  --product-peach: var(--olive-peach);
  --product-green: var(--olive-primary);
  --product-green-ink: var(--olive-deep);
  --product-soft: var(--olive-sage);
  background: var(--olive-surface) !important;
  box-shadow: 0 8px 24px rgb(41 53 43 / 6%) !important;
}
main.goodseed-marketplace-theme .marketplace-cloud-product-card > img { border-color: var(--olive-peach); }
main.goodseed-marketplace-theme .marketplace-cloud-product-card-body header span {
  background: var(--olive-sage);
  color: var(--olive-deep);
}
main.goodseed-marketplace-theme .marketplace-cloud-product-card[data-product-category="ไม้กำลังอยู่ระหว่างปลูก"] .marketplace-cloud-product-card-body header span,
main.goodseed-marketplace-theme .marketplace-card-status.is-growing {
  background: #f1e8da;
  color: #796348;
}
main.goodseed-marketplace-theme .marketplace-cloud-product-card-body header em { background: #f2eee5; color: var(--olive-muted); }
main.goodseed-marketplace-theme .marketplace-card-specs dt,
main.goodseed-marketplace-theme .marketplace-card-category { color: var(--olive-deep); }
main.goodseed-marketplace-theme .marketplace-six-filters button {
  background: var(--olive-surface);
  border-color: var(--olive-line);
  color: var(--olive-primary);
}
main.goodseed-marketplace-theme .marketplace-six-filters button[aria-pressed="true"] {
  background: var(--olive-primary);
  border-color: var(--olive-primary);
  color: var(--olive-surface);
}
main.goodseed-marketplace-theme .marketplace-six-filters button:focus-visible {
  outline: 3px solid var(--olive-accent);
  outline-offset: 3px;
}

/* Replace the previous per-button palette while preserving geometry/handlers. */
main.goodseed-marketplace-theme button:not(.marketplace-category-card):not(.marketplace-cloud-garden-card) {
  --marketplace-forest: var(--olive-deep);
  --marketplace-brand: var(--olive-primary);
  --marketplace-leaf: #83965f;
  --marketplace-teal: var(--olive-muted);
  --marketplace-mint: var(--olive-sage);
  --marketplace-orange: var(--olive-accent);
  --marketplace-body: var(--olive-muted);
}
main.goodseed-marketplace-theme .marketplace-cta-orange,
main.goodseed-marketplace-theme .marketplace-cloud-product-card-body > footer button {
  background: var(--olive-primary) !important;
  color: #fffcf7 !important;
  border-color: transparent !important;
  box-shadow: 0 6px 16px rgb(83 107 50 / 12%);
}
main.goodseed-marketplace-theme .marketplace-cta-orange:hover,
main.goodseed-marketplace-theme .marketplace-cloud-product-card-body > footer button:hover {
  background: #435828 !important;
  box-shadow: 0 8px 20px rgb(83 107 50 / 16%);
}
main.goodseed-marketplace-theme .marketplace-cta-orange:focus-visible { outline-color: var(--olive-accent); }
main.goodseed-marketplace-theme .marketplace-admin-entry { background: var(--olive-deep); border-color: var(--olive-deep); }
main.goodseed-marketplace-theme .marketplace-admin-entry span { color: var(--olive-sage); }
main.goodseed-marketplace-theme button.bg-seed-50,
main.goodseed-marketplace-theme .bg-seed-100 { background-color: var(--olive-sage); }
main.goodseed-marketplace-theme .bg-seed-50 { background-color: #f0f3e8; }
main.goodseed-marketplace-theme button.text-seed-950 { color: var(--olive-deep); }
main.goodseed-marketplace-theme button.text-seed-600 { color: var(--olive-primary); }
main.goodseed-marketplace-theme .hover\:bg-seed-50:hover,
main.goodseed-marketplace-theme .hover\:bg-seed-100:hover,
main.goodseed-marketplace-theme button.hover\:bg-seed-50:hover,
main.goodseed-marketplace-theme button.hover\:bg-seed-100:hover { background-color: #dce5ce; }
main.goodseed-marketplace-theme .ring-seed-100,
main.goodseed-marketplace-theme .ring-seed-200 { --tw-ring-color: rgb(83 107 50 / 22%); }
main.goodseed-marketplace-theme .marketplace-footer-surface { background: var(--olive-sage); }
main.goodseed-marketplace-theme::-webkit-scrollbar-track { background: var(--olive-paper); }
main.goodseed-marketplace-theme::-webkit-scrollbar-thumb { background: #969e89; border-color: var(--olive-paper); }

/* Public product and garden dialogs are siblings of the app root. */
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-overlay,
body:has(main.goodseed-marketplace-theme) .marketplace-cloud-garden-detail { background: rgb(41 53 43 / 60%); }
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-card,
body:has(main.goodseed-marketplace-theme) .marketplace-cloud-garden-detail > section {
  border-color: var(--olive-line);
  background: var(--olive-surface);
  color: var(--olive-ink);
}
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-hero > div { background: linear-gradient(130deg, #f8f5ee, var(--olive-sage)); }
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-hero p { color: var(--olive-primary); }
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-hero span,
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-specs small,
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-full article small,
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-full > p,
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-full > small { color: var(--olive-muted); }
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-specs > div,
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-full,
body:has(main.goodseed-marketplace-theme) .marketplace-cloud-detail-products article { border-color: var(--olive-line); }
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-full { background: #f0f3e8; }
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-actions button {
  background: var(--olive-primary);
  color: var(--olive-surface);
  box-shadow: 0 8px 20px rgb(83 107 50 / 16%);
}
body:has(main.goodseed-marketplace-theme) .marketplace-product-detail-actions button:hover { background: #435828; }

@media (max-width: 639px) {
  main.goodseed-marketplace-theme .marketplace-hero-shell::before {
    background:
      radial-gradient(ellipse 100% 55% at 115% 100%, #ead8c9 0%, #ead8c9 61%, transparent 61.4%),
      linear-gradient(113deg, #f8f5ee 32%, #e4ebd7 100%);
  }
}
