@font-face {
    font-family: 'DB Airy';
    src: url('../fonts/dbeairy.woff2') format('woff2'),
         url('../fonts/dbeairy.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* บังคับใช้งานฟอนต์ DB Airy ทั่วทั้งเว็บไซต์ทั้งหน้าบ้านและหลังบ้าน */
html, body, h1, h2, h3, h4, h5, h6, input, button, select, textarea {
    font-family: 'DB Airy', sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

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

body {
    background-color: #fdfdfd;
    color: #222;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* แถบเมนูบน (Navbar) */
.navbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: #000;
    text-decoration: none;
}
.nav-menu {
    display: flex;
    align-items: center;
}
.nav-menu a {
    text-decoration: none;
    color: #444;
    margin-left: 25px;
    font-size: 1rem;
    transition: 0.2s ease;
}
.nav-menu a:hover {
    color: #c8a27c;
}

/* บล็อกแบนเนอร์หน้าแรก (บน-กลาง-ล่าง) */
.banner-block {
    width: 100%;
    background: #f7f7f7;
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    text-decoration: none;
    transition: 0.3s ease;
}
.banner-block:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.banner-block img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* ส่วนหัวข้อเซกชันสินค้าและระบบกริด */
.section-title {
    font-size: 1.5rem;
    margin: 40px 0 20px 0;
    position: relative;
    padding-left: 15px;
    border-left: 4px solid #000;
    letter-spacing: 1px;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}
.product-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    transition: 0.3s ease;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* =========================================
   🍔 พลังฮาคิเกราะ (Responsive & Hamburger Menu) 
   ========================================= */

/* ซ่อนปุ่ม Hamburger ไว้ก่อนบนจอคอมพิวเตอร์ */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: #111;
    cursor: pointer;
    transition: 0.3s;
}
.menu-toggle:hover {
    color: #c8a27c;
}

/* รูปภาพไม่ล้นจอ */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* 💻 สำหรับแท็บเล็ตและหน้าจอขนาดกลาง (992px ลงไป) */
@media (max-width: 992px) {
    .container {
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
    }
    .checkout-container, .product-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* 📱 สำหรับสมาร์ทโฟน (768px ลงไป) */
@media (max-width: 768px) {
    
    /* 🌟 จัดการเมนู 3 ขีด */
    .nav-flex {
        flex-direction: row !important; 
        justify-content: space-between !important;
        align-items: center !important;
        position: relative;
        padding: 10px 0 !important;
    }
    
    .menu-toggle {
        display: block; /* โชว์ปุ่ม 3 ขีดบนมือถือ */
    }

    .nav-menu {
        display: none !important; /* ซ่อนแถบเมนูไว้ก่อน */
        flex-direction: column !important;
        width: 100%;
        background: #fff;
        position: absolute;
        top: 100%; 
        left: 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
        border-top: 1px solid #eee;
        z-index: 999;
        padding: 0 !important;
    }

    .nav-menu.active {
        display: flex !important; /* โชว์เมนูเมื่อกด 3 ขีด */
    }

    .nav-menu a {
        margin: 0 !important;
        padding: 15px 20px !important;
        border-bottom: 1px solid #f9f9f9;
        width: 100%;
        text-align: left;
        border-radius: 0 !important;
        border-left: 4px solid transparent; 
        font-size: 1rem !important;
        background: #fff;
    }

    .nav-menu a:hover {
        background: #fafafa;
        border-left: 4px solid #c8a27c; 
        color: #c8a27c;
    }

    /* 🌟 แก้ไขหน้าบทความ และกล่องที่เบียดกัน */
    .container > div[style*="display: flex"], 
    .container > div[style*="display: grid"],
    .article-item {
        display: flex !important;
        flex-direction: column !important; 
        width: 100% !important;
    }
    
    aside, .sidebar, .profile-sidebar {
        margin-top: 25px !important;
        width: 100% !important;
    }
    
    .img-box {
        flex: 0 0 auto !important;
        width: 100% !important;
    }

    /* 🌟 จัดการ Footer */
    footer .container, .footer-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 30px !important;
        padding: 30px 20px !important;
    }
    footer div { width: 100% !important; }

    /* 🌟 จัดการขนาดตัวอักษรและปุ่มทั่วไป */
    h2 { font-size: 1.25rem !important; }
    h3 { font-size: 1.1rem !important; }
    .checkout-box, .cart-container { padding: 15px !important; }
    .btn-confirm, .btn-checkout, .btn-update, .btn-shop {
        width: 100% !important;
        padding: 14px !important;
        font-size: 1rem !important;
        margin-top: 10px;
        text-align: center;
    }
    
    /* 🌟 หน้าโปรโมชั่น */
    .promo-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .promo-card { margin-bottom: 10px; }
    .promo-img { height: 200px !important; }
}