/* =========================================================
   Legal pages — Privacy, Terms, Shipping & Returns
   Copy based on widely-used peptide-industry templates.
   Review with counsel before relying for binding policy.
   ========================================================= */

function LegalShell({ title, eyebrow, updated, children }) {
  return (
    <section style={{ padding: '72px 0 96px' }}>
      <div className="container-narrow">
        <div className="eyebrow" style={{ marginBottom: 14 }}>{eyebrow}</div>
        <h1 style={{ fontSize: 48, fontWeight: 900, color: 'var(--fg-brand)', letterSpacing: '-0.02em', margin: '0 0 10px' }}>{title}</h1>
        <div style={{ fontFamily: 'var(--font-mono)', fontSize: 11, color: 'var(--fg2)', letterSpacing: '.08em', marginBottom: 40 }}>
          LAST UPDATED: {updated}
        </div>
        <div className="legal-body">
          {children}
        </div>
      </div>
    </section>
  );
}

function LegalH2({ children }) {
  return <h2 style={{ fontSize: 22, fontWeight: 800, color: 'var(--fg-brand)', letterSpacing: '-0.01em', margin: '40px 0 14px' }}>{children}</h2>;
}
function LegalP({ children }) {
  return <p style={{ fontSize: 15, lineHeight: 1.7, color: 'var(--fg1)', margin: '0 0 14px' }}>{children}</p>;
}
function LegalUL({ children }) {
  return <ul style={{ fontSize: 15, lineHeight: 1.7, color: 'var(--fg1)', margin: '0 0 14px', paddingLeft: 22 }}>{children}</ul>;
}

/* ---------------- PRIVACY POLICY ---------------- */
function PrivacyPage() {
  return (
    <LegalShell title="Privacy Policy" eyebrow="LEGAL" updated="April 18, 2026">
      <LegalP>
        Clarion Peptides ("we," "us," or "our") respects the privacy of our customers and visitors. This Privacy Policy explains what information we collect when you visit clarionpeptides.com, why we collect it, how we use it, and the choices you have.
      </LegalP>

      <LegalH2>1. Information we collect</LegalH2>
      <LegalP>We collect information you provide directly and information collected automatically when you use our site:</LegalP>
      <LegalUL>
        <li><strong>Account &amp; order information:</strong> name, email address, shipping and billing address, phone number, and institutional affiliation if provided.</li>
        <li><strong>Payment information:</strong> payment card data is transmitted directly to our PCI-compliant processor. We do not store full card numbers on our servers.</li>
        <li><strong>Research attestation:</strong> a record that you attested to research-use-only intent before browsing the catalog.</li>
        <li><strong>Usage data:</strong> pages visited, referrer URL, browser type, device information, and approximate location derived from IP address.</li>
        <li><strong>Communications:</strong> messages you send us via the contact form, email, or customer support.</li>
      </LegalUL>

      <LegalH2>2. How we use information</LegalH2>
      <LegalUL>
        <li>To process, fulfill, and ship your orders.</li>
        <li>To issue certificates of analysis and lot documentation.</li>
        <li>To respond to inquiries and provide customer support.</li>
        <li>To send transactional email (order confirmations, shipping updates, COA delivery).</li>
        <li>To send marketing email, only if you opt in. You can unsubscribe at any time.</li>
        <li>To detect and prevent fraud, abuse, or violations of our Terms.</li>
        <li>To comply with legal obligations and respond to lawful requests.</li>
      </LegalUL>

      <LegalH2>3. Cookies &amp; analytics</LegalH2>
      <LegalP>
        We use strictly necessary cookies to keep you signed in and remember your cart. We use first-party analytics (Vercel Analytics and Speed Insights) to measure page performance and anonymized traffic patterns. We do not sell your data or share it with third-party advertising networks.
      </LegalP>

      <LegalH2>4. Sharing of information</LegalH2>
      <LegalP>We share information only with service providers who need it to deliver the service:</LegalP>
      <LegalUL>
        <li><strong>Payment processors</strong> (Stripe or equivalent) to process your payment.</li>
        <li><strong>Shipping carriers</strong> (UPS, FedEx, USPS) to deliver your order.</li>
        <li><strong>Email service providers</strong> to send transactional and marketing email.</li>
        <li><strong>Hosting &amp; analytics providers</strong> to operate and measure the site.</li>
      </LegalUL>
      <LegalP>We may disclose information if required by law, subpoena, or to protect rights, property, or safety.</LegalP>

      <LegalH2>5. Data retention</LegalH2>
      <LegalP>
        Order records and certificates of analysis are retained for at least seven years to support traceability. Marketing preferences are retained until you opt out. Account data is retained while your account is active and for a reasonable period after closure to handle returns, disputes, and legal requirements.
      </LegalP>

      <LegalH2>6. Your rights</LegalH2>
      <LegalP>
        Depending on your jurisdiction, you may have the right to access, correct, delete, or port your personal data, and to object to or restrict certain processing. California residents have rights under the CCPA/CPRA; EU/UK residents have rights under the GDPR/UK GDPR. To exercise any of these rights, email <a href="mailto:privacy@clarionpeptides.com">privacy@clarionpeptides.com</a>. We will verify your identity and respond within the statutory window.
      </LegalP>

      <LegalH2>7. Security</LegalH2>
      <LegalP>
        All traffic is encrypted in transit over TLS. Payment data is handled by a PCI-DSS Level 1 processor. We restrict internal access to personal data on a need-to-know basis. No method of transmission or storage is 100% secure, but we continuously review our controls.
      </LegalP>

      <LegalH2>8. Children</LegalH2>
      <LegalP>
        Our site is not directed to children under 18. We do not knowingly collect personal information from children. If you believe a child has provided us information, please contact us and we will delete it.
      </LegalP>

      <LegalH2>9. Changes to this policy</LegalH2>
      <LegalP>
        We may update this Privacy Policy from time to time. When we do, we will update the "Last updated" date above and, for material changes, notify you by email or a site banner.
      </LegalP>

      <LegalH2>10. Contact</LegalH2>
      <LegalP>
        Questions about this policy? Email <a href="mailto:privacy@clarionpeptides.com">privacy@clarionpeptides.com</a>.
      </LegalP>
    </LegalShell>
  );
}

/* ---------------- TERMS OF SERVICE ---------------- */
function TermsPage() {
  return (
    <LegalShell title="Terms of Service" eyebrow="LEGAL" updated="April 18, 2026">
      <LegalP>
        These Terms of Service ("Terms") govern your access to and use of clarionpeptides.com and any purchases made through the site. By using the site or placing an order, you agree to these Terms. If you do not agree, do not use the site.
      </LegalP>

      <LegalH2>1. Research use only</LegalH2>
      <LegalP>
        <strong>All products sold by Clarion Peptides are for laboratory research use only.</strong> Products are not drugs, not dietary supplements, not cosmetics, and not intended for human or veterinary diagnostic or therapeutic use. Products are not approved by the FDA, EMA, or any regulatory authority for such use. By purchasing, you represent that you are a qualified researcher or affiliate of a registered laboratory or institution, and that you will use the product solely for in-vitro research, analytical reference, or non-human investigational purposes.
      </LegalP>
      <LegalP>
        You agree not to administer, consume, apply, inject, compound, resell for consumption, or otherwise introduce any product into a human or animal body. You agree not to misrepresent the intended use of the product.
      </LegalP>

      <LegalH2>2. Eligibility</LegalH2>
      <LegalP>
        You must be at least 21 years of age and legally capable of entering into a binding contract. We reserve the right to refuse service, cancel orders, or limit purchases at our sole discretion, including for suspected misuse or non-research intent.
      </LegalP>

      <LegalH2>3. Orders, pricing &amp; payment</LegalH2>
      <LegalUL>
        <li>All prices are in U.S. dollars and exclude applicable taxes and shipping.</li>
        <li>Prices, availability, and specifications may change without notice. We reserve the right to correct pricing or inventory errors.</li>
        <li>Payment is due at the time of order. We accept major credit cards and bank transfers for qualifying institutional orders.</li>
        <li>Placing an order is an offer to buy; the order is only accepted when we ship it or send an order confirmation.</li>
      </LegalUL>

      <LegalH2>4. Shipping &amp; title</LegalH2>
      <LegalP>
        Title and risk of loss pass to you upon delivery to the carrier. We are not responsible for delays caused by the carrier, customs, or force majeure. International shipments are subject to importation laws of the destination country; you are responsible for ensuring legality of import and for paying any duties or taxes. See our <em>Shipping &amp; Returns</em> page for full details.
      </LegalP>

      <LegalH2>5. Returns &amp; refunds</LegalH2>
      <LegalP>
        Because our products are sensitive research materials, returns are limited. See our <em>Shipping &amp; Returns</em> page for return eligibility, the return window, and how to initiate a return.
      </LegalP>

      <LegalH2>6. Warranties &amp; disclaimers</LegalH2>
      <LegalP>
        We warrant that each released lot meets the specifications stated on its Certificate of Analysis at the time of shipment. <strong>We make no other warranties, express or implied, including no warranty of merchantability or fitness for a particular purpose.</strong> The sole and exclusive remedy for a non-conforming lot is replacement or refund of the purchase price of that lot, at our option.
      </LegalP>

      <LegalH2>7. Limitation of liability</LegalH2>
      <LegalP>
        To the maximum extent permitted by law, Clarion Peptides shall not be liable for any indirect, incidental, special, consequential, or punitive damages, or for lost profits, revenues, data, or goodwill, arising from or related to the products or this site. Our aggregate liability for any claim shall not exceed the amount you paid for the product giving rise to the claim.
      </LegalP>

      <LegalH2>8. Indemnification</LegalH2>
      <LegalP>
        You agree to indemnify, defend, and hold harmless Clarion Peptides and its affiliates, officers, employees, and agents from any claims, damages, losses, liabilities, and expenses (including reasonable attorneys' fees) arising out of your breach of these Terms, your misuse of any product, or your violation of applicable law.
      </LegalP>

      <LegalH2>9. Intellectual property</LegalH2>
      <LegalP>
        All content on this site — including logos, text, photography, and product documentation — is owned by Clarion Peptides or its licensors and is protected by intellectual-property law. You may not reproduce, distribute, or create derivative works without our prior written consent.
      </LegalP>

      <LegalH2>10. Governing law &amp; disputes</LegalH2>
      <LegalP>
        These Terms are governed by the laws of the State of Delaware, without regard to conflict-of-laws rules. Any dispute shall be resolved exclusively in the state or federal courts located in Delaware, and you consent to the jurisdiction of those courts.
      </LegalP>

      <LegalH2>11. Changes to these Terms</LegalH2>
      <LegalP>
        We may update these Terms from time to time. Continued use of the site after changes are posted constitutes acceptance.
      </LegalP>

      <LegalH2>12. Contact</LegalH2>
      <LegalP>
        Questions about these Terms? Email <a href="mailto:legal@clarionpeptides.com">legal@clarionpeptides.com</a>.
      </LegalP>
    </LegalShell>
  );
}

/* ---------------- SHIPPING & RETURNS ---------------- */
function ShippingPage() {
  return (
    <LegalShell title="Shipping & Returns" eyebrow="POLICY" updated="April 18, 2026">
      <LegalH2>Shipping</LegalH2>
      <LegalP>
        Orders placed before 2:00 PM ET on a business day typically ship the same day. Orders placed after 2:00 PM ET or on weekends ship the next business day.
      </LegalP>
      <LegalUL>
        <li><strong>Standard (domestic U.S.):</strong> $10 — 3 to 5 business days.</li>
        <li><strong>Expedited (domestic U.S.):</strong> $25 — 1 to 2 business days.</li>
        <li><strong>Free standard shipping</strong> on domestic U.S. orders over $150.</li>
        <li><strong>International:</strong> calculated at checkout. 5 to 14 business days depending on destination and customs clearance.</li>
      </LegalUL>
      <LegalP>
        All shipments include tracking. A tracking number is emailed the moment the label is generated.
      </LegalP>

      <LegalH2>Cold-chain &amp; handling</LegalH2>
      <LegalP>
        Lyophilized peptides are shelf-stable at ambient temperature for standard ground-transit durations and are shipped without ice unless requested. Upon receipt, store unreconstituted vials at −20°C for long-term storage or 2–8°C for short-term (under 30 days). See our storage guide in the <a href="#" onClick={(e)=>{e.preventDefault(); window.__go && window.__go('blog','storage-stability-basics');}}>blog</a> for details.
      </LegalP>

      <LegalH2>International orders</LegalH2>
      <LegalP>
        We ship to most countries. You are the importer of record and are responsible for confirming that research chemicals can be lawfully imported into your country, and for paying all duties, taxes, and brokerage fees. Orders may be held or returned by customs; Clarion is not liable for such seizures.
      </LegalP>

      <LegalH2>Order issues</LegalH2>
      <LegalUL>
        <li><strong>Damaged in transit:</strong> email <a href="mailto:orders@clarionpeptides.com">orders@clarionpeptides.com</a> with a photograph within 72 hours of delivery. We will replace the affected item at no cost.</li>
        <li><strong>Lost in transit:</strong> if tracking stalls for 10+ business days, contact us and we will open a carrier trace and reship or refund at our option.</li>
        <li><strong>Incorrect item shipped:</strong> contact us within 14 days for a prepaid return label and replacement.</li>
      </LegalUL>

      <LegalH2>Returns</LegalH2>
      <LegalP>
        Because our products are sensitive reference materials whose chain of custody cannot be verified once the tamper-evident seal is broken, returns are limited as follows:
      </LegalP>
      <LegalUL>
        <li><strong>Sealed, unopened vials</strong> may be returned within 30 days of delivery for a full refund, less original shipping. Contact us first to obtain an RMA number.</li>
        <li><strong>Opened or reconstituted vials</strong> are non-returnable.</li>
        <li><strong>Lot failures:</strong> if a released lot fails to meet the specifications stated on its Certificate of Analysis, we will replace or refund at our option. Contact <a href="mailto:analytical@clarionpeptides.com">analytical@clarionpeptides.com</a>.</li>
      </LegalUL>
      <LegalP>
        To initiate a return, email <a href="mailto:orders@clarionpeptides.com">orders@clarionpeptides.com</a> with your order number. Refunds are issued to the original payment method within 5–10 business days of our receipt of the returned item.
      </LegalP>

      <LegalH2>Contact</LegalH2>
      <LegalP>
        Shipping questions: <a href="mailto:orders@clarionpeptides.com">orders@clarionpeptides.com</a>. Typical response within one business day.
      </LegalP>
    </LegalShell>
  );
}

Object.assign(window, { PrivacyPage, TermsPage, ShippingPage });
