// Grow Hemp — legal pages (Privacy / Terms). Shared chrome.

function Nav() {
  return (
    <header className="nav" data-screen-label="Nav">
      <a href="index.html" className="brand">grow hemp<span className="brand-dot">.</span></a>
      <nav className="nav-links" aria-label="Primary">
        <div className="nav-item nav-has-sub">
          <a href="cbd-seeds/index.html">CBD Seeds</a>
          <div className="nav-sub" role="menu">
            <a href="/cbd-seeds/cherry-max">Cherry Max</a>
            <a href="/cbd-seeds/awaz-cobbler">Awaz Cobbler</a>
            <a href="/cbd-seeds/el-chabo">El Chabo</a>
          </div>
        </div>
        <a href="/blog">Blog</a>
        <a href="/#contact" data-open-contact>Contact</a>
      </nav>
      <button className="nav-burger" aria-label="Menu">
        <span></span><span></span><span></span>
      </button>
    </header>
  );
}

function Footer() {
  return (
    <footer className="foot" data-screen-label="Footer">
      <div className="foot-inner">
        <div className="foot-top">
          <div className="foot-brand">
            <span className="foot-brand-name">grow hemp.</span>
            <span className="foot-brand-sub">Far North · New Zealand</span>
          </div>
          <div className="foot-links">
            <a href="cbd-seeds/index.html">CBD Seeds</a>
            <a href="/blog">Blog</a>
            <a href="/#contact" data-open-contact>Contact</a>
          </div>
        </div>
        <div className="foot-bottom">
          <span className="foot-meta">© 2026 Grow Hemp Ltd · growhemp.co.nz</span>
          <div className="foot-legal">
            <a href="privacy.html">Privacy</a>
            <a href="terms.html">Terms of Sale</a>
          </div>
        </div>
      </div>
    </footer>
  );
}

function PrivacyBody() {
  return (
    <div className="legal-body">
      <p>Grow Hemp ("we", "us", "our") respects your privacy and is committed to protecting the personal information you share with us. This policy explains what we collect, how we use it, and your rights under the New Zealand Privacy Act 2020.</p>

      <h2>Information we collect</h2>
      <p>When you send us an enquiry through our website, we collect:</p>
      <ul>
        <li>Your name</li>
        <li>Email address</li>
        <li>Phone number (if you provide it)</li>
        <li>Any notes or messages you include, including the cultivar and pack size you asked about</li>
      </ul>
      <p>When you buy seeds directly on our website, payment is processed by Stripe. Stripe collects your name, email address, delivery address and payment details. We receive what we need to dispatch your order. We never see or store your card number.</p>
      <p>We use Google Analytics to understand how visitors use the site. It sets cookies that record anonymous usage data, such as which pages are viewed and how long people stay. We do not use cookies for marketing or advertising.</p>

      <h2>How we use your information</h2>
      <p>We use the information you provide to:</p>
      <ul>
        <li>Respond to your enquiry</li>
        <li>Process your order and payment</li>
        <li>Dispatch your order to your delivery address</li>
        <li>Contact you about your order or any issues that arise</li>
        <li>Maintain records of past transactions for our own business and tax purposes</li>
      </ul>

      <h2>Who we share your information with</h2>
      <p>We do not sell, rent, or trade your personal information.</p>
      <p>We share information only where necessary to fulfil your order, including:</p>
      <ul>
        <li>Stripe, our payment processor, which handles card payments</li>
        <li>Email service providers used to send and receive emails</li>
        <li>Cloud storage and hosting providers (Firebase) where order records are stored securely</li>
        <li>Shipping providers (e.g. NZ Post or courier services) to deliver your order</li>
        <li>Government agencies if legally required</li>
      </ul>

      <h2>How we store your information</h2>
      <p>Your information is stored securely in our business systems and cloud storage providers. We take reasonable steps to protect it from unauthorised access, loss, or misuse.</p>
      <p>We retain order records for as long as required for business and tax purposes (generally seven years under NZ law).</p>

      <h2>Your rights</h2>
      <p>Under the New Zealand Privacy Act 2020, you have the right to:</p>
      <ul>
        <li>Access the personal information we hold about you</li>
        <li>Request correction of any information that is inaccurate</li>
        <li>Ask us to delete your information where we no longer need it for the purposes above</li>
      </ul>
      <p>To exercise any of these rights, contact us at <a href="mailto:info@growhemp.co.nz">info@growhemp.co.nz</a>.</p>

      <h2>Changes to this policy</h2>
      <p>We may update this policy from time to time. The current version is always available on our website with the "last updated" date shown above.</p>

      <h2>Contact</h2>
      <p>If you have questions about this Privacy Policy or how we handle your information, contact us:</p>
      <div className="legal-contact">
        <p><strong>Email:</strong> <a href="mailto:info@growhemp.co.nz">info@growhemp.co.nz</a></p>
        <p><strong>Phone:</strong> +64 21 333 740</p>
      </div>
    </div>
  );
}

function TermsBody() {
  return (
    <div className="legal-body">
      <p>These Terms of Sale apply to all orders placed with Grow Hemp ("we", "us", "our"). By submitting an enquiry or placing an order, you agree to these terms.</p>

      <h2>Ordering</h2>
      <p>Cherry Max and Awaz Cobbler can be bought directly on our website. Your order is confirmed once payment is completed and Stripe sends your confirmation email.</p>
      <p>El Chabo, and larger volumes of any cultivar, are sold by enquiry. We respond within 24 hours to confirm availability, total cost and delivery details, and the order is confirmed once payment has been received.</p>

      <h2>Pricing and payment</h2>
      <p>Prices shown on our website are in New Zealand Dollars and include GST where applicable.</p>
      <p>Card payments are processed by Stripe. We accept Visa, Mastercard, American Express, UnionPay and JCB, as well as Klarna and Link where offered at checkout. We do not see or store your card details.</p>
      <p>For orders placed by enquiry, payment is by New Zealand bank transfer. Account details are provided once we have confirmed your order.</p>
      <p>Orders are dispatched only after full payment has been received and cleared.</p>

      <h2>Dispatch and delivery</h2>
      <p>We dispatch orders from the Far North of New Zealand. Standard dispatch time is within 3-5 working days of payment clearing, subject to stock availability.</p>
      <p>Delivery is via NZ Post or courier. Delivery times depend on your location. We are not responsible for delays caused by the postal or courier service.</p>
      <p>We currently ship within New Zealand only.</p>

      <h2>Your responsibilities as a buyer</h2>
      <p>By purchasing hemp seeds from Grow Hemp, you confirm that:</p>
      <ul>
        <li>You are 18 years of age or older</li>
        <li>You will comply with all relevant New Zealand laws and regulations regarding hemp cultivation</li>
        <li>You understand that under the Misuse of Drugs Amendment Regulations 2026, you must notify the Ministry for Primary Industries and the New Zealand Police of your intention to cultivate hemp before doing so</li>
        <li>You will not on-sell or supply our seeds to anyone for purposes that would breach New Zealand law</li>
      </ul>
      <p>You are responsible for understanding and complying with all regulatory requirements for growing hemp in your area. We do not provide legal or regulatory advice.</p>

      <h2>Seed viability and disclaimers</h2>
      <p>Hemp seeds are a natural product. While we take reasonable care to supply viable seeds, germination depends on many factors beyond our control, including:</p>
      <ul>
        <li>Storage conditions after dispatch</li>
        <li>Soil quality, climate, and growing conditions</li>
        <li>Sowing technique and timing</li>
        <li>Pests, weather, and seasonal variation</li>
      </ul>
      <p>We do not guarantee specific germination rates, yields, or final cannabinoid content of plants grown from our seeds. The plants you grow are your responsibility once they leave our care.</p>
      <p>Cannabinoid percentages and other test data shown on our website refer to results from our own grow-outs in our specific conditions. Your results may vary depending on your growing environment.</p>

      <h2>Refunds and returns</h2>
      <p>Due to the nature of the product, we do not accept returns of seeds once dispatched.</p>
      <p>If your order arrives damaged, contact us within 7 days of receipt and we will work with you to resolve the issue, which may include replacement at our discretion.</p>
      <p>If your order is lost in transit, contact us and we will investigate with the postal or courier service. Replacement is at our discretion and may depend on the outcome of the carrier's investigation.</p>
      <p>These terms do not affect your rights under the Consumer Guarantees Act 1993 or the Fair Trading Act 1986.</p>

      <h2>Cancellation</h2>
      <p>If you wish to cancel your order, contact us as soon as possible. Cancellation is at our discretion if the order has not yet been dispatched. Once dispatched, cancellation is not possible.</p>

      <h2>Intellectual property</h2>
      <p>Our cultivar names, branding, and the genetic material we breed and supply are our intellectual property. You are purchasing seeds for cultivation purposes only. You may not commercially breed, propagate for resale, or market plants grown from our seeds under our cultivar names without our written agreement.</p>

      <h2>Liability</h2>
      <p>Our liability is limited to the value of the order in question. We are not liable for any indirect or consequential losses, including loss of profits, crop failures, or regulatory penalties incurred by you as a buyer.</p>

      <h2>Governing law</h2>
      <p>These terms are governed by New Zealand law. Any disputes will be resolved in the courts of New Zealand.</p>

      <h2>Changes to these terms</h2>
      <p>We may update these Terms of Sale from time to time. The current version is always available on our website with the "last updated" date shown above. Terms applicable to your order are those in force at the time you placed your enquiry.</p>

      <h2>Contact</h2>
      <p>Questions about these Terms of Sale or any order:</p>
      <div className="legal-contact">
        <p><strong>Email:</strong> <a href="mailto:info@growhemp.co.nz">info@growhemp.co.nz</a></p>
        <p><strong>Phone:</strong> +64 21 333 740</p>
      </div>
    </div>
  );
}

function LegalPage({ kind }) {
  const isPrivacy = kind === "privacy";
  return (
    <div className="stage frame-desktop">
      <div className="site">
        <Nav />
        <section className="legal" data-screen-label="Legal">
          <div className="legal-inner">
            <span className="legal-eyebrow">{isPrivacy ? "Legal" : "Legal"}</span>
            <h1 className="legal-h1">{isPrivacy ? "Privacy Policy" : "Terms of Sale"}</h1>
            <p className="legal-updated">Last updated: 5 June 2026</p>
            {isPrivacy ? <PrivacyBody /> : <TermsBody />}
          </div>
        </section>
        <Footer />
      </div>
    </div>
  );
}

// document.currentScript is null inside a Babel-transpiled script, so query the
// tag directly (same approach as cultivar.jsx). Without this /terms rendered privacy.
const KIND_EL = document.querySelector("script[data-kind]");
const LEGAL_KIND = (KIND_EL && KIND_EL.dataset.kind) || "privacy";
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<LegalPage kind={LEGAL_KIND} />);
