/* --- Global Styles & Variables --- */
:root {
    --primary-color: #005A9C; /* สีน้ำเงินเข้ม */
    --secondary-color: #FDB813; /* สีเหลือง */
    --text-color: #333;
    --light-gray: #f4f4f4;
    --white-color: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sarabun', sans-serif; /* ใช้ฟอนต์ที่อ่านง่าย แนะนำให้ใส่ Google Font */
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 0 20px;
}

section {
    padding: 60px 0;
}

h1, h2, h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

h2 {
    text-align: center;
    font-size: 2.5rem;
}

.btn {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #e6a303;
}

.bg-light {
    background-color: var(--light-gray);
}

/* --- Header & Navigation --- */
header {
    background: var(--white-color);
    color: var(--text-color);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 10px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

.hero-content .logo-img {
    width: 100px; /* ขนาดโลโก้ */
    vertical-align: middle;
    border-radius: 50%;
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(rgba(0, 90, 156, 0.7), rgba(0, 90, 156, 0.7)), url('https://via.placeholder.com/1920x1080.png?text=Electronic+Circuit') no-repeat center center/cover;
    height: 100vh;
    color: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    color: var(--white-color);
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* --- About Section --- */
#about .about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

#about .about-image {
    max-width: 40%;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Services Section --- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background: var(--white-color);
    padding: 30px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* --- Contact Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 40px;
}

.contact-info p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.contact-info i {
    color: var(--primary-color);
    margin-right: 15px;
    width: 20px;
}

.social-links a {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 15px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.map-container {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.contact-form .btn {
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
}

/* --- Floating Chat Button --- */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #00B900; /* LINE Green */
    color: white;
    padding: 15px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 100;
    transition: all 0.3s ease;
}

.chat-button:hover {
    background-color: #009a00;
    transform: scale(1.05);
}

.chat-button i {
    font-size: 1.8rem;
    margin-right: 10px;
}

.chat-button span {
    font-weight: bold;
}

/* --- Footer --- */
footer {
    background: var(--primary-color);
    color: var(--white-color);
    text-align: center;
    padding: 20px 0;
}

/* --- Responsive Design (Mobile First Approach) --- */
@media (max-width: 768px) {
    h2 { font-size: 2rem; }

    .nav-links {
        position: fixed;
        right: -100%; /* Hide off-screen */
        top: 70px;
        height: calc(100vh - 70px);
        width: 60%;
        background: var(--white-color);
        flex-direction: column;
        align-items: center;
        padding-top: 50px;
        transition: right 0.4s ease-in-out;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    }

    .nav-links.nav-active {
        right: 0;
    }

    .nav-links li {
        margin: 20px 0;
    }
    
    .hamburger {
        display: block;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    #about .about-content {
        flex-direction: column;
    }
    #about .about-image {
        max-width: 80%;
        margin-bottom: 20px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .chat-button span {
        display: none; /* Hide text on small screens */
    }

    .chat-button {
        padding: 15px;
    }

    .chat-button i {
        margin-right: 0;
    }

}