/* ==========================================
   1. GLOBAL STYLES (Reset & Layout)
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Mitr&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /*  ป้องกัน Scroll bar เกินขนาด */
}

html {
    /* ทำให้การเลื่อนไปยัง Anchor Link นุ่มนวลขึ้น */
    scroll-behavior: smooth;

    /* กรณีมี Header แบบติดหนึบ (Fixed) ให้เผื่อระยะไม่ให้หัวข้อโดนบัง
    scroll-padding-top: 80px;  */
}



body {
    background: linear-gradient(0deg, #fafaf9 90%, #e8e7e2 100%);
    padding: 10px;
    font-family: "Mitr", sans-serif;
    line-height: 1.6;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* [cite: 37] ดัน Footer ชิดล่าง */
    cursor: default;


}

a {
    text-decoration: none;
    color: #666;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

main {
    flex: 1;
    /* [cite: 37] ให้ส่วนเนื้อหายืดเพื่อดัน Footer */
}

/* ==========================================
   2. HEADER & NAVIGATION
   ========================================== */
header {
    padding-top: 10px;
}

.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid #e8e7e2;
    padding-bottom: 5px;
    /* [cite: 20] โลโก้และเมนูอยู่กลางในจอใหญ่ */
}

.logo-img {
    height: 70px;
    display: block;
    margin-bottom: 5px;
}

.iso-img {
    height: 60px;

}

.iso-img:hover {
    transition: box-shadow 0.3s ease;
    box-shadow: 0 0 5px 0px #adab99;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #003366;
    /* Navy Blue */
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.mobile-menu-icon {
    display: none;
    /* [cite: 46] ซ่อนในจอใหญ่ */
    cursor: pointer;
    font-size: 24px;
    color: #003366;
}

/* ==========================================
   3. CAROUSEL (Image Slider) - แก้ไขรูปไม่ Fit
   ========================================== */
.carousel {
    max-width: 1920px;
    margin-left: auto;
    /* จัดขอบด้านซ้ายให้กึ่งกลางอัตโนมัติ  */
    margin-right: auto;
    /* จัดขอบด้านขวาให้กึ่งกลางอัตโนมัติ  */
    position: relative;
    width: 100%;
    height: 500px;
    /*  ปรับความสูงตามต้องการ */
    overflow: hidden;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    /* [cite: 91] เอฟเฟกต์การเลื่อน */
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /*  บังคับรูปให้เต็มพื้นที่โดยไม่เบี้ยว */
    object-position: center;
    /* [cite: 96] จัดให้กลางรูปเด่นเสมอ */
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 51, 102, 0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    border-radius: 8px;
    z-index: 10;
}

.carousel-btn:hover {
    background: #003366;
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

/* ==========================================
   4. HERO SECTION
   ========================================== */
.hero-section {
    padding: 20px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: #003366;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    margin: 10px;
    font-weight: bold;
}

.btn-primary {
    background: #003366;
    color: #fff;
}

.btn-secondary {
    border: 2px solid #003366;
    color: #003366;
}

/* ==========================================
   5. FOOTER
   ========================================== */
footer {
    padding: 20px 0;
    text-align: center;
}

#footer-text {
    font-size: 0.8rem;
    color: #666;
}

/* ==========================================
   6. RESPONSIVE (Mobile)
   ========================================== */
@media (max-width: 768px) {
    .header-top {
        width: 100%;
        display: flex;
        justify-content: space-between;
        /* [cite: 46] โลโก้ซ้าย ปุ่มขวา */
        align-items: center;
    }

    .mobile-menu-icon {
        display: block;
    }

    .navbar {
        display: none;
        /* [cite: 23] ซ่อนเมนูก่อนกด */
        width: 100%;
        padding-top: 20px;
    }

    .navbar.active {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .carousel {
        height: 300px;
    }

    /* ลดความสูงบนมือถือ */
}

/* ==========================================
   7. SERVICES SECTION
   ========================================== */
.services {
    padding: 30px 0;
}

.section-title {
    text-align: center;
    color: #003366;
    /* Navy Blue */
    font-size: 2rem;
    margin-bottom: 40px;
    text-transform: uppercase;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 คอลัมน์บนจอใหญ่ */
    gap: 30px;
}

.service-card {
    background: #f5f5f4;
    padding: 40px 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    background: linear-gradient(180deg, #fafaf9 50%, #e8e7e2 100%);
    transform: translateY(-10px);
    /* เอฟเฟกต์ยกตัว */
    box-shadow: 0 10px 20px rgba(0, 51, 102, 0.2);
}

.service-card i {
    font-size: 3rem;
    color: #003366;
    margin-bottom: 20px;
}

.service-card h3 {
    color: #003366;
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.service-card p {
    font-size: 0.9rem;
    color: #666;
}

/* ปรับแต่งสำหรับมือถือ */
@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 คอลัมน์บน Tablet */
    }
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        /* 1 คอลัมน์บนมือถือ */
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* SECTION: ABOUT US */
.about-section {
    padding: 80px 0;

}

.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
    /* รองรับการแสดงผลบนมือถือ */
}

.about-image {
    flex: 1;
    min-width: 300px;
}

.about-image img {
    padding: 20px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    /* ป้องกันรูปเบี้ยว */
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text h2 {
    color: #003366;
    /* Navy Blue */
    font-size: 2rem;
    margin-bottom: 10px;
}

.about-text .sub-heading {
    color: #555;
    font-weight: bold;
    margin-bottom: 20px;
}

.about-text .description p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* ปรับแต่งปุ่มให้เข้ากับธีม */
.btn-outline {
    display: inline-block;
    padding: 10px 25px;
    border: 2px solid #003366;
    color: #003366;
    text-decoration: none;
    border-radius: 5px;
    transition: 0.3s;
}

.btn-outline:hover {
    background-color: #003366;
    color: #ffffff;
}

/* Responsive สำหรับมือถือ */
@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
        /* เรียงเป็นแนวตั้งบนมือถือ */
        text-align: center;
    }
}

/* SECTION: CONTACT US */
.contact-section {
    padding: 80px 0;

}

.section-title {
    text-align: center;
    color: #003366;
    margin-bottom: 50px;
    font-size: 2rem;
}

.contact-wrapper {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.contact-info,
.contact-map {
    flex: 1;
    min-width: 300px;
}

.div-wrapper {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.div-left {
    flex: 1;
    min-width: 300px;
}

.div-right {
    text-align: right;
    flex: 1;
    min-width: 300px;
}


.contact-info h3 {
    color: #003366;
    margin-bottom: 20px;
}

.contact-info p {
    margin-bottom: 15px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info i {
    color: #003366;
    width: 20px;
}

.social-links {
    margin-top: 25px;
    display: flex;
    gap: 15px;
}

.social-btn {
    text-decoration: none;
    padding: 8px 20px;
    background-color: #003366;
    color: #fff;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: 0.3s;
}

.social-btn:hover {
    background-color: #004488;
}

/* แผนที่จำลอง */
.map-placeholder {
    width: 100%;
    height: 300px;
    background-color: #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #888;
    border: 1px dashed #ccc;
}

/* Responsive */
@media (max-width: 768px) {
    .contact-wrapper {
        flex-direction: column;
    }

    .section-title {
        margin-bottom: 30px;
    }
}

.fade-in-element {
    opacity: 0;
    /* ซ่อนไว้ก่อน */
    animation: fadeInUp 0.8s ease-out forwards;
    /* เล่นแอนิเมชั่น 0.8 วินาที */
}

/* เพิ่ม Delay ให้แต่ละส่วนเพื่อให้ค่อยๆ เลื่อนมาทีละอย่าง (ดูแพงขึ้น) */
.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

/* --- Animation สำหรับ Element เลื่อนเข้าหน้าจอ --- */

/* สร้างรูปแบบการเคลื่อนไหว */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
        /* เลื่อนลงไปข้างล่าง 20px ก่อนเริ่ม */
    }

    to {
        opacity: 1;
        transform: translateY(0);
        /* เลื่อนกลับมาตำแหน่งปกติ */
    }
}