<?php
// Uso: $seo = ['title'=>..., 'description'=>..., 'path'=>'/catalogo/', 'noindex'=>false];
$seo   = $seo ?? [];
$title = $seo['title'] ?? 'Telware Perú | Computadoras, monitores y componentes en Lima';
$desc  = $seo['description'] ?? '';
$base  = 'https://www.telwareperu.com'; // un solo valor; igual al dominio canónico
$path  = $seo['path'] ?? '/';
$canonical = $base . $path;
$robots = !empty($seo['noindex']) ? 'noindex, follow' : 'index, follow, max-image-preview:large';
header('Content-Type: text/html; charset=UTF-8');
?>
<meta charset="utf-8">
<title><?= htmlspecialchars($title, ENT_QUOTES, 'UTF-8') ?></title>
<meta name="description" content="<?= htmlspecialchars($desc, ENT_QUOTES, 'UTF-8') ?>">
<meta name="robots" content="<?= $robots ?>">
<link rel="canonical" href="<?= htmlspecialchars($canonical, ENT_QUOTES, 'UTF-8') ?>">
<meta property="og:type" content="website">
<meta property="og:locale" content="es_PE">
<meta property="og:site_name" content="Telware Perú">
<meta property="og:title" content="<?= htmlspecialchars($title, ENT_QUOTES, 'UTF-8') ?>">
<meta property="og:description" content="<?= htmlspecialchars($desc, ENT_QUOTES, 'UTF-8') ?>">
<meta property="og:url" content="<?= htmlspecialchars($canonical, ENT_QUOTES, 'UTF-8') ?>">
<meta property="og:image" content="<?= $base ?>/assets/img/og/telware-og.jpg"><!-- crear 1200x630 -->
<meta name="twitter:card" content="summary_large_image">
<script type="application/ld+json">
<?= json_encode([
  '@context'=>'https://schema.org','@type'=>'Organization',
  'name'=>'Telware Perú','url'=>$base.'/',
  'email'=>'ventas@telwareperu.com',
  'contactPoint'=>[['@type'=>'ContactPoint','telephone'=>'+51-918-156-887','contactType'=>'sales','areaServed'=>'PE','availableLanguage'=>'es']],
  'address'=>['@type'=>'PostalAddress','addressLocality'=>'Lima','addressCountry'=>'PE']
], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) ?>
</script>