---
import '../styles/global.css';
import { getProducts } from '../lib/products';

export interface Props { title?: string; description?: string; page?: string; ogImage?: string; active?: string; }
const {
  title = 'PMPNZNG — Heizungsbauerausleidenschaft',
  description = 'PMPNZNG – Merch für die SHK-Community. Bio-Baumwolle, Fairtrade. Aus Ahlerstedt, Niedersachsen.',
  page = '', ogImage = '/product-images/p01-pmpnzng-hoodie-1.jpg', active = '',
} = Astro.props;

const allProducts = await getProducts();
const clientProducts = allProducts.map((p) => ({ id: p.slug, slug: p.slug, name: p.name, shortName: p.shortName, price: p.priceCents / 100, cardImage: p.cardImage }));

const UMAMI_SRC = process.env.UMAMI_SRC || 'https://analytics.heidrich-digital.de/script.js';
const UMAMI_WEBSITE_ID = process.env.UMAMI_WEBSITE_ID || '';

const marqueeItems = ['PMPNZNG','Heizungsbauer aus Leidenschaft','Bio-Baumwolle · Fairtrade','Aus Ahlerstedt, Niedersachsen',"Wenn's läuft, dann läuft's"];
const storeJsonLd = { '@context':'https://schema.org','@type':'Store',name:'PMPNZNG',url:'https://tgasolutions-shop.de',
  address:{'@type':'PostalAddress',streetAddress:'Kleine Kamp 1',addressLocality:'Ahlerstedt',postalCode:'21702',addressCountry:'DE'},
  parentOrganization:{'@type':'Organization',name:'TGA Solutions GmbH'} };
---
<!doctype html>
<html lang="de" data-theme="dark">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="color-scheme" content="dark" />
    <meta name="description" content={description} />
    <meta name="robots" content="noindex" />
    <meta property="og:title" content={title} />
    <meta property="og:description" content={description} />
    <meta property="og:image" content={ogImage} />
    <meta property="og:type" content="website" />
    <title>{title}</title>
    <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
    <script type="application/ld+json" set:html={JSON.stringify(storeJsonLd)} is:inline />
    {UMAMI_WEBSITE_ID && <script defer src={UMAMI_SRC} data-website-id={UMAMI_WEBSITE_ID} is:inline />}
  </head>
  <body data-page={page}>
    <a class="skip-link" href="#main-content">Zum Inhalt springen</a>
    <header class="site-header" role="banner">
      <a href="/" class="header-logo" aria-label="PMPNZNG Startseite">
        <div class="logo-mark">PMPN<strong>Z</strong>NG</div>
        <div class="logo-sub">by TGA Solutions</div>
      </a>
      <nav id="main-nav" class="header-nav" aria-label="Hauptnavigation">
        <a href="/shop" aria-current={active === 'shop' ? 'page' : undefined}>Shop</a>
        <a href="/faq" aria-current={active === 'faq' ? 'page' : undefined}>FAQ &amp; Größen</a>
        <a href="/ueber-uns" aria-current={active === 'ueber-uns' ? 'page' : undefined}>Über uns</a>
        <a href="https://instagram.com/tgasolutions" target="_blank" rel="noopener">@tgasolutions</a>
      </nav>
      <div class="header-actions">
        <a href="/warenkorb" class="cart-btn" aria-label="Warenkorb">Warenkorb
          <span class="js-cart-count" style="display:none" aria-hidden="true">0</span></a>
        <button id="menu-toggle" class="menu-toggle" aria-label="Menü öffnen" aria-expanded="false" aria-controls="main-nav">
          <span></span><span></span><span></span></button>
      </div>
    </header>
    <div class="marquee-band" aria-hidden="true">
      <div class="marquee-inner">
        {[0,1].map(() => (<div class="marquee-item">{marqueeItems.map((item) => (<><span>{item}</span><span class="marquee-sep"></span></>))}</div>))}
      </div>
    </div>
    <main id="main-content"><slot /></main>
    <footer class="site-footer" role="contentinfo">
      <div class="footer-grid">
        <div class="footer-brand">
          <a href="/" class="footer-brand-logo">PMPN<strong>Z</strong>NG</a>
          <p>Merch für Leute, die wissen, was eine Pumpenzange ist. Eine Marke der TGA Solutions GmbH — Meisterfachbetrieb für technische Gebäudeausrüstung, Ahlerstedt.</p>
          <span class="footer-badge">EST. 2021 · Ahlerstedt, DE</span>
        </div>
        <nav class="footer-col" aria-label="Sortiment"><h4>Sortiment</h4>
          <a href="/shop">Alle Produkte</a><a href="/produkt/hoodie-stick-druck">Hoodies</a>
          <a href="/produkt/tshirt-pumpenzange">T-Shirts</a><a href="/produkt/cap-shk">Caps</a><a href="/produkt/warmduscher-beutel">Taschen</a></nav>
        <nav class="footer-col" aria-label="Service"><h4>Service</h4>
          <a href="/faq">Größentabelle</a><a href="/faq">Versand &amp; Rückgabe</a><a href="/faq">FAQ</a><a href="mailto:info@tgasolutions-shop.de">Kontakt</a></nav>
        <nav class="footer-col" aria-label="Rechtliches"><h4>Rechtliches</h4>
          <a href="/impressum">Impressum</a><a href="/datenschutz">Datenschutz</a><a href="/datenschutz#agb">AGB</a><a href="/admin">Admin-Backend</a></nav>
      </div>
      <div class="footer-bar">
        <span>© 2026 PMPNZNG · TGA Solutions GmbH · Kleine Kamp 1 · 21702 Ahlerstedt · Demo</span>
        <span><a href="mailto:info@tgasolutions-shop.de">info@tgasolutions-shop.de</a> · <a href="tel:+494166899502">04166 8991 502</a></span>
      </div>
    </footer>
    <script is:inline define:vars={{ clientProducts }}>window.__PRODUCTS__ = clientProducts;</script>
    <script is:inline src="/shop.js"></script>
  </body>
</html>
