/* === General Styling === */
:root {
    --primary-color: #7f5539; /* สีน้ำตาลหลัก */
    --secondary-color: #b08968; /* สีน้ำตาลอ่อน */
    --background-color: #fefae0; /* สีพื้นหลัง */
    --text-color: #3d2b1f; /* สีตัวอักษร */
    --card-bg-color: #fff;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
    background-color: white;
    color: var(--text-color);
}

/* === Reusable Components === */
.content-section {
    padding: 60px 5%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.content-section h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
}

/* === Navigation Bar (Milky White Style) === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 92%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    z-index: 1000;
    
    /* (1) ตั้งค่าพื้นหลังเป็นขาวขุ่นและเบลอถาวร */
    background-color: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    /* (2) เปลี่ยนสีตัวอักษรเป็นสีน้ำตาลถาวร */
    color: var(--primary-color);
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    /* (2) เปลี่ยนสีตัวอักษรเป็นสีน้ำตาลถาวร */
    color: var(--primary-color);
    transition: color 0.3s ease-out;
}

/* ทำให้ลิงก์ที่ Active หรือ Hover เปลี่ยนเป็นสีน้ำตาลอ่อน */
.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary-color);
}

.lang-switcher a {
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    transition: all 0.3s ease-out;
    /* (2) เปลี่ยนสีตัวอักษรและเส้นขอบเป็นสีน้ำตาลถาวร */
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.lang-switcher a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* === (ลบ) ไม่จำเป็นต้องใช้ .navbar.scrolled อีกต่อไป === */
/* เนื่องจากสไตล์ของ Navbar ไม่เปลี่ยนแปลงเมื่อเลื่อน จึงลบส่วนนี้ออก */


/* === Slider Container (โค้ดเดิมของคุณ) === */
.slider-container {
    height: 100vh;
    width: 100%;
    position: relative; /* สำคัญมาก สำหรับการวางตำแหน่งลูกศรและจุด */
    overflow: hidden;
}

/* === Slider Wrapper (ตัวที่เคลื่อนที่) === */
.slider-wrapper {
    display: flex; /* ทำให้สไลด์เรียงต่อกันในแนวนอน */
    height: 100%;
    /* ความกว้างจะถูกกำหนดโดย JavaScript ตามจำนวนสไลด์ */
    transition: transform 0.5s ease-in-out; /* เพิ่ม animation ตอนเลื่อน */
}

/* === Slide (แต่ละภาพ) === */
.slide {
    min-width: 100%; /* แต่ละสไลด์กว้าง 100% ของ container */
    height: 100%;
    box-sizing: border-box;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ทำให้รูปภาพเต็มพื้นที่โดยไม่เสียสัดส่วน */
}

/* === Slider Controls (ปุ่มลูกศร) === */
.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none; /* ทำให้ไม่สามารถคลิกพื้นที่ว่างระหว่างปุ่มได้ */
}

.slider-btn {
    pointer-events: all;
    background: none; /* ลบพื้นหลัง */
    border: none; /* ลบเส้นขอบ */
    color: white;
    font-size: 36px; /* ปรับขนาดไอคอนให้เห็นชัดขึ้น */
    cursor: pointer;
    margin: 0 20px;
    user-select: none;
    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.7); /* เพิ่มเงา */
    transition: opacity 0.3s ease; /* เพิ่ม transition เล็กน้อย */
    border-radius: 0; /* ไม่ต้องมีขอบมน */
    padding: 10px 15px; /* ปรับ padding เล็กน้อย */
}

.slider-btn:hover {
    opacity: 0.8; /* ลดความทึบเมื่อ hover */
}

/* === Slider Dots (จุดบอกหน้า) === */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px; /* ระยะห่างระหว่างจุด */
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.dot.active {
    background-color: white;
}

/* === Sections Styling (No major changes from before) === */
.services-container { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.service-card {  /* เพิ่ม position: relative เพื่อเป็นจุดอ้างอิง */
                position: relative;
                /* แนะนำ: อาจจะต้องกำหนดความสูงคงที่เพื่อให้ทุกการ์ดเท่ากัน */
                height: 280px; 
                padding-bottom: 60px; /* เพิ่มพื้นที่ด้านล่างเผื่อข้อความ */
                background-color: var(--card-bg-color); 
                padding: 30px;
                border-radius: 20px; 
                width: 200px; 
                text-align: center; 
                box-shadow: 0 0px 15px rgba(113, 58, 3, 0.245);
            }

 .service-card p {

    /* จัดตำแหน่งเทียบกับ .service-card */
    position: absolute;
    bottom: 30px; /* สูงจากขอบล่างขึ้นมา 30px */
    
    /* ทำให้ข้อความอยู่ตรงกลางแนวนอนของการ์ด */
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    font-size: 1.5rem;
}           

.service-card .icon { 
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    height: 200px;
    padding: 0px; 
    border-radius: 20px;
    width: 250px; 
    text-align: center;

    /* กำหนดขนาดไอคอน */
    width: 250px;
    height: 250px;
    object-fit: contain; 
    margin-bottom: 10px; 

    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;

}

.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }
.portfolio-card { 
   background-color: #ccc; /* สีพื้นหลังเผื่อภาพไม่โหลด */
    height: 250px;
    border-radius: 15px;
}
.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* --- นี่คือส่วนสำคัญ --- */
    border-radius: 15px; /* ทำให้มุมของภาพโค้งมนตามการ์ด */
}
.about-container { display: flex; align-items: center; gap: 40px; text-align: left; }
.about-image { 
    flex: 1;
    height: auto; /* ปรับความสูงตามขนาดรูปภาพ */
    max-width: 50%; /* หรือขนาดที่ต้องการ */
    background-color: transparent; /* เอาพื้นหลังสีน้ำตาลออก */
    border-radius: 15px; /* ถ้าต้องการให้ขอบมน */
    display: flex; /* ใช้ Flexbox ในการจัดตำแหน่ง */
    justify-content: center; /* จัดให้อยู่ตรงกลางแนวนอน */
    align-items: center; /* จัดให้อยู่ตรงกลางแนวตั้ง */
 }
.about-text { flex: 1; }
.contact-form { max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: 15px; background-color: var(--primary-color); padding: 40px; border-radius: 20px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 15px; border-radius: 10px; border: 1px solid #ccc; font-family: 'Sarabun', sans-serif; font-size: 1rem; box-sizing: border-box; }
.contact-form button { background-color: var(--background-color); color: var(--primary-color); font-weight: bold; }
footer { text-align: center; padding: 20px; background-color: var(--primary-color); color: #fff; }

/* === Hamburger Menu (Hidden on Desktop) === */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}
.hamburger .line {
    width: 25px;
    height: 3px;
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
    /* (3) เปลี่ยนสีเส้น Hamburger เป็นสีน้ำตาลถาวร */
    background-color: var(--primary-color);
}

/* === RESPONSIVE DESIGN (For tablets and mobile) === */
@media (max-width: 768px) {
    /* --- Hamburger Menu Activation --- */
    .hamburger {
        display: flex;
    }
    .nav-links {
        display: none; /* ซ่อนเมนูปกติ */
        position: absolute;
        top: 65px; /* ความสูงของ navbar */
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        text-align: center;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    .nav-links.active {
        display: flex; /* แสดงเมนูเมื่อกด hamburger */
    }
    .nav-links li {
        padding: 15px 0;
    }
    .nav-links a, .navbar .nav-links a {
        color: var(--primary-color);
        text-shadow: none;
    }
    /* --- General Layout Adjustments --- */
    .content-section h2 {
        font-size: 2rem;
    }
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .about-container {
        flex-direction: column;
    }
    
    .about-image {
        max-width: 100%;
        width: 100%;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}