<?php
declare(strict_types=1);
require dirname(__DIR__).'/private/app.php';security_headers();start_session();
try{$c=catalog();$html=file_get_contents(APP_DIR.'/shop-template.html');echo str_replace(['__PRODUCTS_JSON__','__FILTERS_JSON__','__CATEGORIES_JSON__','__ORDER_CSRF__'],[encode($c['products']),encode(array_values(array_filter($c['filters'],fn($f)=>$f['enabled']))),encode($c['categories']),encode($_SESSION['csrf'])],$html);}catch(Throwable $e){http_response_code(503);echo '<!doctype html><meta charset="utf-8"><title>Дина Галиотис</title><p>Магазин готовится к открытию.</p>';}
