@inject Microsoft.Extensions.Configuration.IConfiguration Configuration
<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>
        @ViewData["Title"]
        @if (!string.IsNullOrEmpty(ViewData["Title"] as string))
        {
            <text>-</text>
        }
        쿠팡 상품 카탈로그
    </title>

    <meta http-equiv="refresh" content="3000" />
    <meta name="description" content="다양한 쿠팡의 특별 상품을 파악 및 검색해보실 수 있습니다." />
    <meta name="keywords" content="쿠팡,쿠팡인기상품,쿠팡PL,쿠팡골드박스,쿠팡이벤트,쿠팡상품,coupang,쿠팡카탈로그,쿠팡검색,쿠팡파트너스" />
    <meta name="author" content="김진오" />
    <meta name="naver-site-verification" content="534321e6b7402169fc787ae2f795049aef0232e3" />

    @*
        정규 주소(canonical). 쿼리스트링이 붙은 주소가 별도 페이지로 색인되는 것을 막는다.
        리버스 프록시 뒤에서는 Request.Scheme 이 http 로 들어올 수 있어 SitemapController 와 동일하게
        설정값(Site:BaseUrl)을 우선 사용한다.
        색인 대상이 아닌 페이지(검색 결과, 오류)는 ViewData["NoIndex"] = true 로 표시해 canonical 대신 noindex 를 내보낸다.
    *@
    @if (ViewData["NoIndex"] is true)
    {
        <meta name="robots" content="noindex, follow" />
    }
    else
    {
        var canonicalBase = (Configuration["Site:BaseUrl"] ?? "https://goods.web.or.kr").TrimEnd('/');
        <link rel="canonical" href="@(canonicalBase + Context.Request.Path)" />
    }

    <link rel="stylesheet" href="~/css/tailwind.output.css" asp-append-version="true" />
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />

    @await RenderSectionAsync("Styles", required: false)

    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-0115KLFFLY"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', 'G-0115KLFFLY');
    </script>
</head>
<body>

    <div class="overlay" id="overlay">
        <img id="btnCancel" src="/image/btn-cancel.svg" alt="X" />
    </div>

    <div class="flex flex-row flex-nowrap">
        <aside class="flex-initial border-r-1">
            <section>
                <iframe src="https://coupa.ng/cgY9Th" width="100%" height="75" frameborder="0" scrolling="no" referrerpolicy="unsafe-url" browsingtopics></iframe>
            </section>
            <hr/>
            <nav>
                <ul class="list-outside">
                    <li><a asp-area="" asp-controller="Home" asp-action="Index"> 처음으로</a></li>
                    <li><a asp-area="" asp-controller="Home" asp-action="GoldBox">골드박스</a></li>
                    <li><a asp-area="" asp-controller="Home" asp-action="Event"> 이벤트</a></li>
                </ul>

                <hr/>

                <details open>
                    <summary>인기상품</summary>
                    <ul class="list-outside">
                        <li><a href="/category/1001">여성패션</a></li>
                        <li><a href="/category/1002">남성패션</a></li>
                        <li><a href="/category/1010">뷰티</a></li>
                        <li><a href="/category/1011">출산/유아동</a></li>
                        <li><a href="/category/1012">식품</a></li>
                        <li><a href="/category/1013">주방용품</a></li>
                        <li><a href="/category/1014">생활용품</a></li>
                        <li><a href="/category/1015">홈인테리어</a></li>
                        <li><a href="/category/1016">가전디지털</a></li>
                        <li><a href="/category/1017">스포츠/레저</a></li>
                        <li><a href="/category/1018">자동차용품</a></li>
                        <li><a href="/category/1019">도서/음반/DVD</a></li>
                        <li><a href="/category/1020">완구/취미</a></li>
                        <li><a href="/category/1021">문구/오피스</a></li>
                        <li><a href="/category/1024">헬스/건강식품</a></li>
                        <li><a href="/category/1025">국내여행</a></li>
                        <li><a href="/category/1026">해외여행</a></li>
                        <li><a href="/category/1029">반려동물용품</a></li>
                        <li><a href="/category/1030">유아동패션</a></li>
                    </ul>
                </details>

                <hr/>

                <details open>
                    <summary>쿠팡PL</summary>
                    <ul class="list-outside">
                        <li><a href="/pl/1001">탐사</a></li>
                        <li><a href="/pl/1002">코멧</a></li>
                        <li><a href="/pl/1003">Gomgom</a></li>
                        <li><a href="/pl/1004">줌</a></li>
                        <li><a href="/pl/1006">곰곰</a></li>
                        <li><a href="/pl/1007">꼬리별</a></li>
                        <li><a href="/pl/1008">베이스알파에센셜</a></li>
                        <li><a href="/pl/1010">비타할로</a></li>
                        <li><a href="/pl/1011">비지엔젤</a></li>
                    </ul>
                </details>
            </nav>
        </aside>

        <main class="flex-initial w-full">
            <div class="flex flex-col w-full">
                <header class="flex-initial w-full">
                    <form name="f_search" id="fSearch" method="get" class="w-full lg:w-1/2 mx-auto" accept-charset="UTF-8" rel="search" autocomplete="off" asp-controller="Home" asp-action="Search">
                        <div class="flex items-center rounded overflow-hidden">
                            <img id="btnMenuToggle" src="/image/btn-menu.svg" alt="메뉴"/>
                            <input type="search" name="keyword" class="flex-grow outline-none" placeholder="인기상품을 검색합니다." autofocus value="@ViewBag?.Keyword" />
                            <button type="submit" id="btnSearchSubmit" class="w-auto lg:max-w-[14%]">검색</button>
                        </div>
                    </form>
                </header>
                <div class="flex-1 w-full">
                    @RenderBody()
                </div>
                <footer class="flex-initial w-full">
                    <div class="flex flex-col pb-8 sm:flex-row sm:justify-between items-center sm:pb-0">
                        <div class="flex-none mb-2 sm:mb-0">
                            <span>&copy; 2024~@DateTime.Now.Year TOSIRO. All rights reserved.</span>
                        </div>
                        <div class="flex-grow text-center sm:text-right">
                            <small>※ 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.</small>
                        </div>
                    </div>
                </footer>
            </div>
        </main>
    </div>
    
    <script src="@Url.Content("~/lib/jquery/dist/jquery.min.js")"></script>
    <script src="@Url.Content("~/js/site.js")"></script>

    @await RenderSectionAsync("Scripts", required: false)

</body>
</html>
