    @import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Prompt:wght@300;400;600&display=swap');

:root {
    --primary-color: #E67E22; 
    --secondary-color: #2C3E50; 
    --bg-color: #F8F9F9;
    /*--bg-color: #0b0f14;*/ 
    --text-color: #333333;
    --font-main: 'Lato', 'Prompt', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; 
}

/* --- โครงสร้าง Header (Desktop & Mobile) --- */
.main-header {
    background-color: #FFFFFF;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 15px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1000;
}
.logo-img { height: 40px; }
.mobile-menu-btn { display: none; font-size: 28px; color: var(--secondary-color); cursor: pointer; }

.nav-list {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 0;
    padding: 0;
}
.nav-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 600;
    transition: color 0.3s;
}
.nav-link:hover { color: var(--primary-color); }

/* Dropdown Menu */
.dropdown { position: relative; }
.dropdown-menu {
    display: none; 
    position: absolute; 
    top: 100%;
    left: 0;
    background-color: #FFFFFF;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-radius: 8px;
    flex-direction: column;
    padding: 10px 0;
    margin-top: 15px;
    z-index: 1000;
}
.dropdown-menu.show {
    display: flex; 
    animation: fadeIn 0.2s ease-in-out;
}
.dropdown-menu li { list-style: none; width: 100%; }
.dropdown-menu a {
    padding: 12px 20px;
    display: block;
    text-decoration: none;
    color: var(--secondary-color);
    white-space: normal !important; 
    line-height: 1.5;
}
.dropdown-menu a:hover { background-color: #F8F9F9; color: var(--primary-color); }

/* Nested Dropdown */
.dropdown-menu li.nested-dropdown { position: relative; }
.nested-dropdown-menu {
    display: none; 
    position: absolute;
    left: 100%; 
    top: 0;
    background-color: #FFFFFF;
    min-width: 300px; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-radius: 8px;
    flex-direction: column;
    padding: 10px 0;
    margin-left: 2px; 
    z-index: 1001;
}
.nested-dropdown-menu a { white-space: normal !important; line-height: 1.5; }
.dropdown-menu li.nested-dropdown:hover .nested-dropdown-menu { display: flex; animation: fadeIn 0.2s ease-in-out; }
.dropdown-menu li.nested-dropdown:hover > a { color: var(--primary-color); background-color: #F8F9F9; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .main-header { 
        padding: 15px 20px;
        display: flex;             /* บังคับใช้ flex */
        justify-content: space-between; /* ✨ ดันของ 2 อย่างแยกซ้าย-ขวา ✨ */
        align-items: center;
    }
    
    .logo {
        flex: 1;                   /* ให้โลโก้กินพื้นที่ฝั่งซ้าย */
    }

    .mobile-menu-btn { 
        display: block !important; /* ✨ บังคับให้แสดงผล ✨ */
        font-size: 28px;
        cursor: pointer;
        order: 2;                  /* บังคับให้อยู่ลำดับสุดท้าย (ขวาสุด) */
        padding: 5px;
    }
    
    .nav-list {
        display: none; 
        position: absolute;
        top: 100%; /* หล่นลงมาใต้ Header พอดี */
        left: 0;
        width: 100%;
        height: auto; /* ✨ เปลี่ยนเป็น auto ให้สูงพอดีกับจำนวนเมนู ไม่กินที่หน้าจอ */
        background-color: #FFFFFF;
        flex-direction: column;
        justify-content: flex-start; /* ✨ เรียงจากบนลงล่างตามปกติ */
        align-items: stretch; /* ให้พื้นที่ปุ่มกว้างเต็มจอ */
        box-shadow: 0 10px 20px rgba(0,0,0,0.08); /* เงาฟุ้งๆ ดรอปลงมา */
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
        z-index: 999;
        padding: 10px 0 20px 0; 
        border-top: 1px solid #f5f5f7; /* เส้นคั่นบางๆ แยก Header ออกจากเมนู */
    }
    
    .nav-list.active { 
        display: flex; 
        animation: fadeIn 0.2s ease-in-out; /* เพิ่มแอนิเมชันให้ดูสมูท */
    }
    
    .nav-list li { 
        margin: 0; /* ลบระยะห่างแปลกๆ ออก */
        width: 100%; 
        text-align: center; 
    }
    
    .nav-link { 
        display: block;
        padding: 16px 20px; /* ✨ เพิ่มพื้นที่ให้ปลายนิ้วกดง่ายขึ้น */
        font-size: 1.1rem; 
        border-bottom: 1px solid #fbfbfd; /* เส้นคั่นแบ่งแต่ละเมนู */
    }
    
    .nav-link:hover, .nav-link:active {
        background-color: var(--bg-body); /* เปลี่ยนสีเทาอ่อนตอนเอานิ้วจิ้ม */
        color: var(--accent-color);
    }
    
    /* เผื่อสำหรับเมนูย่อย (ถ้ามี) */
    .dropdown-menu { 
        position: relative; 
        box-shadow: none; 
        background-color: #fbfbfd; 
        margin-top: 0; 
        min-width: 100% !important; 
        border-radius: 0; 
    }
    .nested-dropdown-menu { 
        position: relative; left: 0; min-width: 100%; margin-left: 0; box-shadow: none; background-color: #F4F6F7; border-radius: 0; 
    }
    .dropdown-menu li.nested-dropdown:hover .nested-dropdown-menu { 
        display: flex; 
    }
}
/* --- โครงสร้าง Footer --- */
.complex-footer { width: 100%; margin-top: auto; color: #FFFFFF; font-family: var(--font-main); font-size: 0.9rem; }
.footer-main { background-color: var(--secondary-color); padding: 50px 50px 30px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 30px; }
.footer-logo { max-width: 180px; margin-bottom: 20px; background-color: white; padding: 10px; border-radius: 8px; }
.footer-col h4 { color: #FFFFFF; font-size: 1.1rem; margin-bottom: 20px; font-weight: 600; }
.footer-col p { color: #BDC3C7; line-height: 1.8; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul a { color: #BDC3C7; text-decoration: none; transition: color 0.3s; }
.footer-col ul a:hover { color: var(--primary-color); }
.social-icons { display: flex; gap: 15px; }
.social-icons a { display: flex; justify-content: center; align-items: center; width: 40px; height: 40px; background-color: #FFFFFF; color: var(--secondary-color); border-radius: 50%; text-decoration: none; font-size: 1.2rem; transition: all 0.3s; }
.social-icons a:hover { background-color: var(--primary-color); color: #FFFFFF; transform: translateY(-3px); }
.footer-phone-bar { background-color: var(--primary-color); padding: 20px 50px; display: flex; justify-content: space-between; align-items: center; position: relative; }
.phone-content { font-size: 1.5rem; font-weight: bold; color: #FFFFFF; display: flex; align-items: center; gap: 10px; }
.back-to-top { display: flex; justify-content: center; align-items: center; width: 50px; height: 50px; background-color: #A04000; color: white; border-radius: 50%; text-decoration: none; font-size: 1.5rem; transition: background-color 0.3s; }
.back-to-top:hover { background-color: #2C3E50; }
.footer-bottom { background-color: #1A252F; padding: 15px 50px; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: #95A5A6; }
.footer-bottom-links a { color: #95A5A6; text-decoration: none; transition: color 0.3s; }
.footer-bottom-links a:hover { color: white; }


@media (max-width: 992px) {
    .footer-main { grid-template-columns: repeat(2, 1fr); }
    .address-col { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .footer-main { grid-template-columns: 1fr; padding: 40px 20px; }
    .footer-phone-bar { padding: 20px; flex-direction: column; gap: 15px; text-align: center; }
    .footer-bottom { padding: 15px 20px; flex-direction: column; gap: 10px; text-align: center; }
}

.about-wrapper { max-width: 1100px; margin: 0 auto; padding: 20px; }

/* --- Slider (Clean Version) --- */
.slider-container {
    position: relative; width: 100%; margin: 40px auto; 
    border-radius: 24px; overflow: hidden; box-shadow: 0 15px 40px rgba(0,0,0,0.05);
}
.slider { display: flex; transition: transform 0.5s ease-in-out; }
.slide { min-width: 100%; position: relative; }
.slide img { width: 100%; height: 450px; object-fit: cover; display: block; }
.iot-caption {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    color: #ffffff; font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 800;
    text-shadow: 0 4px 15px rgba(0,0,0,0.4); white-space: nowrap; text-align: center;
}
.nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    background: rgba(255,255,255,0.9); border: none; width: 50px; height: 50px;
    border-radius: 50%; font-size: 20px; color: var(--text-main); cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); transition: 0.3s; display: flex; justify-content: center; align-items: center;
}
.nav-btn:hover { background: #fff; transform: translateY(-50%) scale(1.1); color: var(--accent-color); }
.prev { left: 20px; }
.next { right: 20px; }

/* --- Content Blocks (Clean Version) --- */
.about-card {
    background: var(--card-bg); border-radius: 24px; padding: 50px; margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04); transition: transform 0.3s ease; border: none;
}
.about-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }

.about-text h3, .about-text h2 { color: var(--text-main); font-weight: 800; margin-bottom: 20px; font-size: 1.8rem; }
.about-text h2::after, .about-text h3::after {
    content: ''; display: block; width: 40px; height: 4px; background: var(--accent-color); margin-top: 10px; border-radius: 2px;
}
.about-text p { color: var(--text-muted); line-height: 1.8; font-size: 1.1rem; margin-bottom: 15px; }
.about-text ul { padding-left: 20px; color: var(--text-muted); line-height: 1.8; font-size: 1.1rem; }
.about-text li { margin-bottom: 8px; }

.about-img { width: 100%; border-radius: 16px; box-shadow: 0 15px 40px rgba(0,0,0,0.06); object-fit: cover; }

/* --- Features (วงกลม) --- */
.feature-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-top: 20px; }
.feature-card { text-align: center; padding: 40px 20px; background: var(--bg-body); border-radius: 20px; transition: 0.3s; }
.feature-card:hover { transform: translateY(-10px); background: #ffffff; box-shadow: 0 15px 40px rgba(0,0,0,0.06); }
.feature-card img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; margin-bottom: 20px; border: 6px solid #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.feature-card h3 { color: var(--text-main); font-size: 1.3rem; margin-bottom: 10px; font-weight: 700; }
.feature-card p { color: var(--text-muted); font-size: 1rem; line-height: 1.6; margin: 0; }

/* --- Gear Section --- */
.gear-layout { display: grid; grid-template-columns: 1fr auto 1fr; gap: 40px; align-items: center; }
.gear-center { font-size: 140px; color: var(--accent-color); animation: spin-slow 15s linear infinite; filter: drop-shadow(0 10px 20px rgba(224, 69, 0, 0.2)); }
@keyframes spin-slow { 100% { transform: rotate(360deg); } }

.info-glass {
    background: var(--bg-body); padding: 30px; border-radius: 16px; margin-bottom: 20px; transition: 0.3s;
}
.info-glass:hover { background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.05); transform: translateY(-5px); }
.info-glass h3 { color: var(--text-main); margin-bottom: 10px; font-size: 1.2rem; display: flex; align-items: center;}
.info-glass h3 i { color: var(--accent-color); margin-right: 10px; }
.info-glass p { color: var(--text-muted); margin: 0; line-height: 1.6; font-size: 1.05rem; }

/* --- Mobile Fix --- */
@media (max-width: 992px) {
    .about-grid-2 { grid-template-columns: 1fr; }
    .gear-layout { grid-template-columns: 1fr; text-align: center; }
    .gear-center { margin: 30px 0; }
    .slide img { height: 300px; }
    .about-card { padding: 30px 20px; }
    .info-glass h3 { justify-content: center; }
    .about-text h2::after, .about-text h3::after { margin: 10px auto; }
    .about-text { text-align: center; }
}
.copy-tooltip {
    visibility: hidden;
    background-color: var(--secondary-color);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 6px 12px;
    position: absolute;
    z-index: 1;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 0.85rem;
    font-family: var(--font-main);
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.copy-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--secondary-color) transparent transparent transparent;
}

.copy-tooltip.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0); 
}

#particles-js {
    position: fixed;   /* ล็อกไว้กับที่ ไม่ให้เลื่อนตามตอนเราไถจอ */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;       /* บังคับให้อยู่ "หลังสุด" ใต้เนื้อหาทั้งหมด */
    background-color: var(--bg-color); /* สีพื้นหลังหลักของเว็บ */
}

.outline-border {
    background-color: rgba(255, 255, 255, 0.85); /* สีขาวแบบโปร่งแสงนิดๆ (กระจกฝ้า) */
    backdrop-filter: blur(10px); /* เอฟเฟกต์เบลอพื้นหลัง */
}
/* =========================================
   Floating Navigation - refined for IoTE
========================================= */
.ios-float-menu {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.ios-float-menu.show-btn {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ios-menu-items {
    width: 220px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(230, 126, 34, 0.12);
    box-shadow: 0 12px 28px rgba(44, 62, 80, 0.14);
    display: flex;
    flex-direction: column;
    gap: 4px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s ease;
}

.ios-menu-items.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ios-menu-header {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 6px 10px 8px;
    letter-spacing: 0.3px;
}

.ios-menu-divider {
    height: 1px;
    background: rgba(44, 62, 80, 0.10);
    margin: 6px 6px 4px;
}

.ios-menu-items a,
.scroll-top-btn {
    text-decoration: none;
    color: var(--secondary-color);
    background: transparent;
    border: none;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ios-menu-items a i,
.scroll-top-btn i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    color: #4b4b4b;
    flex-shrink: 0;
}

.ios-menu-items a:hover,
.scroll-top-btn:hover {
    background: rgba(230, 126, 34, 0.10);
    color: var(--primary-color);
    transform: translateX(2px);
}

.ios-menu-items a:hover i,
.scroll-top-btn:hover i {
    color: var(--primary-color);
}

.scroll-top-btn {
    color: var(--primary-color);
    font-weight: 700;
}

.scroll-top-btn i {
    color: var(--primary-color);
}

.ios-gear-btn {
    width: 56px;
    height: 56px;
    border: 1px solid rgba(44, 62, 80, 0.12);
    border-radius: 14px;
    background: #ffffff;
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(44, 62, 80, 0.12);
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ios-gear-btn i {
    font-size: 1.3rem;
}

.ios-gear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(44, 62, 80, 0.18);
}

.ios-gear-btn.spin {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 12px 24px rgba(230, 126, 34, 0.32);

    animation: gearSpin 0.6s ease;
}

@keyframes gearSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .ios-gear-btn {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }

    .ios-gear-btn i {
        font-size: 1.15rem;
    }
}

.info-title{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px 0;
    position: relative;
    padding-bottom: 10px;
}

.info-title::after{
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 3px;
    background: #f36f21;
    border-radius: 999px;
}

/* กัน style เดิมที่ทำเส้นไปอยู่ข้างหัวข้อ */
.info-glass h3::before,
.info-glass h3::after{
    content: none !important;
}

.left-title{
    text-align: left;
    margin-bottom: 30px;
}

.left-title{
    text-align: left;
    display: inline-block;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.left-title::after{
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 3px;
    background: #f36f21;
    border-radius: 999px;
}