// Home hero: copy on the left, the shop's own storefront on the right. The chevron
// pattern is tiled as a CSS background (not a stretched <img>) so the marks stay
// small and read as texture at any viewport width.
function Hero({ onShopMenu, t }) {
  const { Button } = window.TheCornerDesignSystem_28aa27;
  return (
    <section style={{
      position: 'relative', overflow: 'hidden',
      background: 'var(--ink-900)',
      backgroundImage: 'url(../../assets/corner-pattern-single.svg)',
      backgroundRepeat: 'repeat',
      backgroundSize: '84px',
      padding: '80px var(--page-gutter)',
    }}>
      {/* Darkening plate so the tiled pattern sits back behind the content. */}
      <div style={{ position: 'absolute', inset: 0, background: 'var(--ink-900)', opacity: 0.9, pointerEvents: 'none' }} />

      <div className="c-hero-grid" style={{
        position: 'relative',
        maxWidth: 'var(--content-max)', margin: '0 auto',
        display: 'grid', gridTemplateColumns: 'minmax(0, 1.05fr) minmax(0, 0.95fr)',
        gap: 'var(--space-16)', alignItems: 'center',
      }}>
        <div>
          <p style={{ font: 'var(--text-label-caps)', letterSpacing: 'var(--tracking-caps)', textTransform: 'uppercase', color: 'var(--red-400)', margin: '0 0 14px' }}>
            {t.hero.eyebrow}
          </p>
          <h1 style={{ font: 'var(--text-display-l)', color: 'var(--cream-0)', margin: '0 0 20px', letterSpacing: 'var(--tracking-tight)' }}>
            {t.hero.titleLine1}<br/>{t.hero.titleLine2}
          </h1>
          <p style={{ font: 'var(--text-body-l)', color: 'var(--ink-100)', margin: '0 0 32px', maxWidth: 440 }}>
            {t.hero.body}
          </p>
          <Button variant="primary" size="lg" onClick={onShopMenu}>{t.hero.cta}</Button>
        </div>

        <div className="c-hero-photo" style={{
          aspectRatio: '4 / 3', width: '100%', maxWidth: 520, marginLeft: 'auto',
          borderRadius: 'var(--radius-md)', overflow: 'hidden',
          background: 'var(--ink-700)',
          boxShadow: 'var(--shadow-stamp-red)',
        }}>
          <image-slot
            id="home-hero-photo"
            shape="rect"
            fit="cover"
            src="../../assets/shop/storefront.jpg"
          ></image-slot>
        </div>
      </div>
    </section>
  );
}
window.Hero = Hero;

// A row of feature notes under the hero — quick facts about the shop.
function AboutStrip({ t }) {
  return (
    <section className="c-about-strip" style={{
      display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 32,
      padding: '56px var(--page-gutter)', background: 'var(--surface-page)',
    }}>
      {t.about.map((it) => (
        <div key={it.t}>
          <h3 style={{ font: 'var(--text-h3)', color: 'var(--text-primary)', margin: '0 0 8px' }}>{it.t}</h3>
          <p style={{ font: 'var(--text-body-m)', color: 'var(--text-secondary)', margin: 0 }}>{it.d}</p>
        </div>
      ))}
    </section>
  );
}
window.AboutStrip = AboutStrip;

// Embedded Google Maps location, with a link out to the shop's actual listing.
function LocationMap({ t, lang }) {
  return (
    <section style={{ padding: '0 var(--page-gutter) 64px', background: 'var(--surface-page)' }}>
      <div style={{ maxWidth: 'var(--content-max)', margin: '0 auto' }}>
        <h2 style={{ font: 'var(--text-h2)', color: 'var(--text-primary)', margin: '0 0 20px' }}>
          {t.location.title}
        </h2>
        <div style={{
          borderRadius: 'var(--radius-md)', overflow: 'hidden',
          border: '1px solid var(--line-200)', boxShadow: 'var(--shadow-stamp-sm)',
        }}>
          <iframe
            title={t.location.title}
            src={window.CORNER_MAPS_EMBED_SRC(lang)}
            width="100%"
            height="360"
            style={{ border: 0, display: 'block' }}
            loading="lazy"
            referrerPolicy="no-referrer-when-downgrade"
          ></iframe>
        </div>
        <a
          href={window.CORNER_MAPS_LINK}
          target="_blank"
          rel="noopener noreferrer"
          style={{ display: 'inline-block', marginTop: 16, font: 'var(--text-body-m)', color: 'var(--text-link)' }}
        >
          {t.location.cta}
        </a>
      </div>
    </section>
  );
}
window.LocationMap = LocationMap;
