/* style.css */

/* --- ส่วนที่ 1: ดึงฟอนต์จาก Folder "fonts" ในเครื่อง --- */
@font-face {
    font-family: 'Kanit';
    /* ชี้ไปที่ folder fonts ของพี่ */
    src: url('fonts/Kanit-Regular.woff2') format('woff2'),
         url('fonts/Kanit-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #000000;
    --card-bg: #111111;
    --primary-color: #ff0000;
    --text-color: #FFFFFF;
    --navbar-height: 70px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    /* เรียกใช้ฟอนต์ Kanit ที่เราประกาศไว้ข้างบน */
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    padding-top: var(--navbar-height);
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--navbar-height);
    background-color: #000000;
    border-bottom: 2px solid var(--primary-color);
    z-index: 9999;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- LOGO Styles (แก้ไขใหม่) --- */
.logo {
    display: flex;         /* จัดเรียงแบบ Flexbox */
    align-items: center;   /* จัดให้อยู่กึ่งกลางแนวตั้ง */
    font-size: 1.5rem; 
    font-weight: 700; 
    color: #fff; 
    text-transform: uppercase;
}

/* กำหนดขนาดรูปโลโก้ */
.logo img {
    height: 40px;          /* ความสูงให้พอดีกับบาร์ */
    width: auto;
    margin-right: 10px;    /* เว้นระยะห่างจากตัวหนังสือ */
}

.nav-links { display: flex; gap: 20px; align-items: center; }

.nav-item {
    color: #B3B3B3; font-size: 1rem; font-weight: 500;
    padding: 5px 0; border-bottom: 2px solid transparent; transition: 0.3s;
}
.nav-item:hover, .nav-item.active { color: #fff; }
.nav-item.active { border-bottom: 2px solid var(--primary-color); }

.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: #fff; transition: 0.3s; }


/* --- Hero Section & Banner --- */
.hero-section {
    padding: 40px 20px;
    background-color: #000;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-banner {
    display: block; margin: 0 auto; width: 100%; max-width: 1200px;
    height: auto; border-radius: 15px;
    box-shadow: 0 10px 40px rgba(255, 0, 0, 0.15);
}

/* --- Components --- */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; width: 100%; }

.btn-neon {
    background-color: var(--primary-color); color: #fff; font-weight: 700;
    border-radius: 50px; padding: 12px 35px; border: none; cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3); display: inline-block;
    transition: transform 0.2s;
}
.btn-neon:hover { transform: translateY(-2px); }

.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card { background-color: var(--card-bg); border: 1px solid #222; border-radius: 10px; overflow: hidden; }
.card-body { padding: 15px; }
.price { color: var(--primary-color); font-size: 1.2rem; font-weight: bold; margin: 10px 0; }


/* =========================================
   MOBILE FIXES (คง Layout เดิม + แก้ Hamburger)
========================================= */
@media (max-width: 768px) {
    .navbar { z-index: 99999 !important; }
    
    .hamburger { 
        display: block; 
        z-index: 100000;
        width: 45px; height: 45px;
        padding-top: 8px;
    }

    .nav-links {
        position: fixed; top: var(--navbar-height); left: 0; width: 100%;
        background-color: #000; flex-direction: column; padding: 0;
        max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out;
        border-bottom: none; z-index: 99998;
    }

    .nav-links.active {
        max-height: 80vh; padding: 20px 0;
        border-bottom: 2px solid var(--primary-color);
        box-shadow: 0 10px 20px rgba(0,0,0,0.9);
    }
    
    .nav-links li { margin: 15px 0; width: 100%; text-align: center; }
    
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .hero-section {
        padding-top: 20px; padding-bottom: 10px !important;
        padding-left: 0 !important; padding-right: 0 !important;
        min-height: auto !important; display: block;
    }

    .hero-section .container {
        padding: 0 !important; width: 100% !important; text-align: center;
    }

    .hero-banner {
        width: 95% !important; height: auto; display: block;
        margin: 0 auto !important; border-radius: 15px !important; box-shadow: none;
    }

    .hero-section .container div[style*="margin-top"] {
        margin-top: 15px !important; margin-bottom: 5px !important;
    }

    section.container[style] { margin-top: 10px !important; padding-top: 0 !important; }
    section h2 { margin-bottom: 15px !important; font-size: 1.4rem; }
}