<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta http-equiv="refresh" content="600;url={{ config('app.url') }}"/>
    <meta name="apple-mobile-web-app-title" content="Pick-쿠팡 최적의 상품을 찾아보고 구매하기"/>
    <meta name="robots" content="all"/>
    <meta name="author" content="PLAYR"/>
    <meta name="keywords" content="Pick,가격,상품,골드박스,쿠팡,Coupang,쿠팡PL,로켓배송,로켓프레시,쇼핑몰,쇼핑,인기상품,게임,애플,삼성,카테고리"/>
    <meta name="description" content="쿠팡의 다양한 상품을 확인하고 구매하실 수 있습니다."/>
    <meta property="og:type" content="website"/>
    <meta property="og:title" content="Pick-쿠팡 상품 카탈로그"/>
    <meta property="og:description" content="쿠팡의 다양한 상품을 확인하고 구매하실 수 있습니다."/>
    <meta property="og:image" content="{{ config('app.url') }}/images/title.png"/>
    <meta property="og:url" content="{{ config('app.url') }}"/>
    <meta name="twitter:card" content="summary"/>
    <meta name="twitter:title" content="Pick-쿠팡 상품 카탈로그"/>
    <meta name="twitter:description" content="쿠팡의 다양한 상품을 확인하고 구매하실 수 있습니다."/>
    <meta name="twitter:image" content="{{ config('app.url') }}/images/title.png"/>
    <meta name="twitter:domain" content="{{ config('app.url') }}"/>

    <link rel="icon" type="image/x-icon" href="/images/favicon.ico"/>
    <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico"/>

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}"/>

    <title>Pick－쿠팡 상품 카탈로그</title>

    <!-- Scripts -->
    @vite(['resources/sass/app.scss', 'resources/js/app.js'])
    <link rel="stylesheet" href="{{ asset('css/mobile.css') }}"/>
    <script src="{{ asset('/js/common.js') }}" defer></script>
    <script src="{{ asset('/js/mobile.js') }}" defer></script>

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

    gtag('config', 'G-7M3EKQF4GD');
    </script>
</head>
<body>
    <div id="app">
        <header>
            <button type="button" data-bs-toggle="offcanvas" data-bs-target="#navbarMenu" aria-controls="navbarMenu">
                <i class="bi bi-justify"></i>
            </button>
            <a href="{{ config('app.url') }}">{{ config('app.name') }}</a>
            <button type="button" id="btnBookmark" value="{{ config('app.url') }}">
                <i class="bi bi-bookmark-fill"></i>
            </button>
        </header>

        <nav>
            <form name="f_main_search" id="fMainSearch" method="post" action="{{ route('main.search') }}" autocomplete="on" accept-charset="UTF-8" role="search">
                @csrf
                <div class="row g-2 p-1">
                    <div class="col">
                        <input type="search" name="keyword" class="form-control" placeholder="쿠팡 URL 또는 제품 검색을 해보세요!" aria-label="Search" @isset($keyword) value="{{ $keyword }}" @endisset/>
                    </div>
                    <div class="col-auto">
                        <button type="submit" class="btn btn-outline-success">검색</button>
                    </div>
                </div>
            </form>
        </nav>

        <main>
            @yield('content')

            <!-- 맨 위로 -->
            <div id="btnMoveTop">
                <img src="/images/btn_top.png" alt="scrollTop"/>
            </div>
        </main>

        <footer>
            <p>
                <a href="{{ url('/') }}" class="">이 사이트</a>는 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.
            </p>
            <cite>
                © 2023~{{ date('Y') }} TOSIRO. All rights reserved.
            </cite>
        </footer>

        <!-- 메뉴 -->
        <div class="offcanvas offcanvas-start" tabindex="-1" id="navbarMenu" aria-labelledby="offcanvasExampleLabel">
            <div class="offcanvas-header border-bottom">
                <h5 class="offcanvas-title" id="offcanvasExampleLabel">{{ config('app.name') }}</h5>
                <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
            </div>
            <div class="offcanvas-body">
                <ul class="nav flex-column">
                    <li class="nav-item dropdown">
                        <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" data-bs-offset="-5,-5" aria-expanded="false">인기상품</a>
                        <ul class="dropdown-menu">
                            @foreach(CATEGORIES as $id => $name)
                                <li><a class="dropdown-item" href="/category/{{ $id }}">{{ $name }}</a></li>
                            @endforeach
                        </ul>
                    </li>
                    <li class="nav-item dropdown">
                        <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" data-bs-offset="-5,-5" aria-expanded="false">쿠팡 PL</a>
                        <ul class="dropdown-menu">
                            @foreach(BRANDS as $id => $name)
                                <li><a class="dropdown-item" href="/recommend/{{ $id }}">{{ $name }}</a></li>
                            @endforeach
                        </ul>
                    </li>
                    <li class="nav-item">
                        <a href="/goldbox" class="nav-link">골드박스</a>
                    </li>
                    <li class="nav-item">
                        <a href="/event" class="nav-link">이벤트/프로모션</a>
                    </li>
                </ul>

                <hr/>

                <table>
                    <caption>방문자 수</caption>
                    <tr>
                        <th>오늘</th>
                        <td>{{ $visitorTodayCount }}</td>
                    </tr>
                    <tr>
                        <th>어제</th>
                        <td>{{ $visitorYesterdayCount }}</td>
                    </tr>
                    <tr>
                        <th>누적</th>
                        <td>{{ $visitorTotalCount }}</td>
                    </tr>
                </table>

                <br/>

                <iframe src="https://ads-partners.coupang.com/widgets.html?id=686500&template=carousel&trackingCode=AF0305179&subId=&width=270&height=140&tsource=" frameborder="0" scrolling="no" referrerpolicy="unsafe-url"></iframe>
            </div>
        </div>
    </div>
</body>
</html>
