/* ตั้งค่า Base Font Size: 1rem = 16px */
html {
    font-size: 15px; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
}

body {
    background-color: #ffffff;
    color: #333;
    
}

.container {
    margin: 0 auto;
    max-width: 1920px;
}

/* --- Navbar --- */
.navbar {
    background-color: #003db3; 
    padding: 0.9375rem 1.25rem; 
    position: relative;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #ffffff;
    font-size: 1.4rem; 
    font-weight: 600;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4rem; 
}

.nav-links li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem; 
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.nav-links li a:hover {
    opacity: 0.8;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none; 
    position: absolute;
    top: 100%;
    right: 0;     /* ให้ขอบขวาของ Dropdown ตรงกับขอบขวาของปุ่มหลัก */
    left: auto;   /* ยกเลิกการยึดขอบซ้าย */
    background-color: #003db3;
    min-width: 11.25rem;
    box-shadow: 0 0.5rem 1rem 0 rgba(0,0,0,0.2);
    z-index: 1;
    padding: 0.625rem 0;
    border-radius: 0 0 0.25rem 0.25rem; 
}

.dropdown-content a {
    color: white;
    padding: 0.625rem 1.25rem; 
    text-decoration: none;
    display: block;
    font-size: 0.9375rem;
}

.dropdown-content a:hover {
    background-color: #00287a;
}

.dropdown:hover .dropdown-content,
.dropdown.show .dropdown-content {
    display: block;
}

/* =========================================
   Mobile Responsive (Navbar Modal)
   ========================================= */

/* Hamburger Icon Style */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 0.3125rem; /* 5px */
}

.menu-toggle .bar {
    width: 1.5625rem; /* 25px */
    height: 0.1875rem; /* 3px */
    background-color: #ffffff;
    transition: all 0.3s ease-in-out;
}

@media (max-width: 48rem) {
    /* 1. จัดการปุ่ม Hamburger ให้ลอยอยู่เหนือ Modal เสมอ */
    .menu-toggle {
        display: flex;
        z-index: 999; 
    }

    /* 2. เปลี่ยน Nav-links เป็น Modal เต็มจอ */
    .nav-links {
        display: flex;
        flex-direction: column;
        justify-content: center; /* จัดให้อยู่กลางจอแนวตั้ง */
        align-items: center; /* จัดให้อยู่กลางจอแนวนอน */
        position: fixed; /* ลอยทับหน้าเว็บ */
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh; /* สูงเต็มหน้าจอ */
        background-color: rgba(0, 61, 179, 0.98); /* สีน้ำเงินเข้มแบบโปร่งใสนิดๆ */
        gap: 2.5rem; /* ระยะห่างแต่ละเมนู */
        
        /* ซ่อนไว้ก่อนด้วย opacity */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 998; 
    }

    /* 3. เมื่อ JS เติมคลาส active จะแสดง Modal ขึ้นมา */
    .nav-links.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links li a {
        font-size: 1.5rem; /* ขยายฟอนต์ให้กดง่ายขึ้น */
        display: block;
    }

    /* 4. จัดการ Dropdown ติดต่อเรา ภายใน Modal */
    .dropdown-content {
        position: static;
        box-shadow: none;
        background-color: transparent;
        display: none;
        padding-top: 1rem;
    }

    .dropdown.show .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        font-size: 1.2rem;
        padding: 0.5rem 0;
        color: #b3caff; /* ปรับสีเมนูย่อยให้อ่อนลงเพื่อความแตกต่าง */
    }

    /* 5. Animation เปลี่ยนปุ่ม Hamburger เป็นกากบาท (X) */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* =========================================
   Section 9: Footer (Full Version)
   ========================================= */

/* --- 1. โครงสร้างหลักและ CTA --- */
.site-footer {
    font-family: 'Prompt', sans-serif;
    background-color: #fff; 
}

.footer-cta-container {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    gap: 12rem; 
    padding: 1rem 0 3rem 0; 
    background-color: #fff; 
}

.btn-footer-cta {
    background: #0d47a1; 
    color: white;
    padding: 0.2rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    display: inline-block;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.footer-main-group {
    background: #1b4482;  
    padding: 1rem 4rem ; 
    color: #fff;

}

/* --- 2. ส่วนกลาง (ช่องทางติดต่อ & ตัวแทน) --- */
.footer-main {
    display: flex;
    justify-content: space-between;
    max-width: 1400px;
    gap: 3rem;
    padding-top: 3rem;
}

.footer-contact-section {
    flex: 1; 

}
/* หัวข้อ "ช่องทางติดต่อ ตัวแทน" จัดให้อยู่กึ่งกลาง */
    .footer-contact-section h3 {
        text-align: center;
    }
    
.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* บังคับให้เป็น 3 คอลัมน์ กว้างเท่ากันเป๊ะ (1 Fraction) */
    gap: 2rem 1.5rem; /* ระยะห่าง บน-ล่าง 2rem และ ซ้าย-ขวา 1.5rem */
    width: 100%;
    margin: 0 auto;
}
.social-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%; /* ให้ทุกกล่องยืดความสูงเท่ากับกล่องที่สูงที่สุดในแถว */
    min-width: 0; /* ป้องกันข้อความยาวดันจน Grid แตก */
}

.social-logo {
    width: 45px;
    height: 45px;
    background: #fff;
    border-radius: 20%; 
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 5px;
    margin-bottom: 0.5rem; /* เพิ่มระยะห่างระหว่างโลโก้กับข้อความ */
}

.social-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.social-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1; /* สำคัญ: สั่งให้กล่องนี้ขยายตัวเต็มพื้นที่ว่างด้านล่าง */
    width: 100%;
}

.social-name {
    color: #fff;
    font-size: 1rem;
    font-weight: 400;
    word-break: break-word; /* ถ้าชื่อยาวเกินไป ให้ปัดขึ้นบรรทัดใหม่ */
    margin-bottom: 1rem; /* ระยะห่างก่อนถึงปุ่ม */
    line-height: 1.4;
}

.btn-social-action {
    background: #ffffff;
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 1rem; /* ปรับ Padding ให้ปุ่มดูสวยขึ้น */
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    margin-top: auto; /* โค้ดพระเอก: ดันปุ่มไปชิดขอบล่างสุดของกล่องเสมอ */
}

/* กล่อง Profile (Agent Card) */
.footer-agent-card {
    background: #2b3952; 
    padding: 1rem 1rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    min-width: 450px;
    width: 100%;
}

.agent-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent; 
}

.agent-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.agent-info h4 {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.agent-info p {
    color: #f1f5f9;
    font-size: 0.8rem;
    font-weight: 400;
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

.agent-info .license {
    font-weight: 300;
    font-size: 1rem;
    color: #cbd5e1;
    margin-bottom: 0;
}

/* --- 3. ส่วนล่าง (Links & Copyright) --- */
.footer-links-flex {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3); /* ปรับเส้นขอบให้ชัดขึ้นเล็กน้อย */
    padding: 3rem 4rem 1rem 4rem;
    margin: 3rem auto 0 auto;
    max-width: 1400px;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 500; /* ให้หัวข้อดูหนาและชัดเจนขึ้น */
    margin-bottom: 1.2rem;
    line-height: 1.4;
}

.footer-col p {
    color: #e9e8e8; /* เปลี่ยนเป็นสีขาว */
    line-height: 1.6;
    font-size: .9rem;
    font-weight: 200; /* ปรับจาก 300 เป็น 400 ให้อ่านง่ายแบบในภาพ */
    margin: 0;
}

/* เพิ่มคลาสนี้เพื่อให้ระยะห่างบรรทัด p ในคอลัมน์ 3 เท่ากับภาพ */
.mt-2 {
    margin-top: 1.2rem !important; 
}

.footer-col ul {
    list-style-type: disc; 
    margin-left: 2rem;
}

.footer-col ul li {
    position: relative;
    
    color: #ffffff; /* เปลี่ยนเป็นสีขาว */
    font-size: 1rem;
    font-weight: 200;
}


.footer-bottom {
    /* ลบ background: #11213d; ออกเพื่อให้สีกลืนเป็นแผ่นเดียวกัน */
    background: transparent; 
    padding: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    color: #ffffff; /* เปลี่ยนเป็นสีขาว */
    font-weight: 400;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-bottom p {
    margin: 0.3rem 0;
}

/* =========================================
   Responsive 
   ========================================= */
@media (max-width: 1200px) {
    .footer-cta-container {
        gap: 5rem;
    }
    .footer-main, .footer-links-flex {
        padding: 2rem 2rem;
    }
    .footer-main {
        flex-direction: column;
        align-items: center;
        justify-content: space-around;
    }
    .footer-agent-card {
        
        width: 100%;
    }
}

@media (max-width: 992px) {
    .social-grid {
        grid-template-columns: repeat(2, 1fr); /* บนมือถือปรับเป็น 2 คอลัมน์เท่ากัน */
        gap: 1.5rem 1rem;
        max-width: 400px; /* จำกัดความกว้างไม่ให้ล้นจอ */
        margin: 0 auto;
    }
    
    .social-item {
        max-width: 100%; /* ลบการจำกัดความกว้างเดิมออก เพื่อให้ยืดตาม Grid */
    }
    .footer-agent-card {
        flex-direction: column;
        text-align: center;
    }
    .agent-info {
        text-align: center;
    }

}

@media (max-width: 768px) {
    .footer-cta-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 2rem 1rem;
    }
    .btn-footer-cta {
        width: 90%;
        text-align: center;
        padding: 1rem 2rem;
    }
}




/* โครงสร้าง Grid แบบใหม่ */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* ดีไซน์ Card ตามภาพอ้างอิง */
.modern-card {
    background: #f8f9fc;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    border: 1px solid #eef2f6;
}
.modern-card-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.modern-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.modern-card-category {
    background: #e6f0ff;
    color: #003db3;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
    align-self: flex-start;
}
.modern-card-title {
    font-size: 1.15rem;
    color: #003db3;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.4;
}
.modern-card-divider {
    border: none;
    border-top: 1px dashed #cbd5e1;
    margin: 10px 0 15px 0;
}
.modern-card-excerpt {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex-grow: 1;
    /* ตัดคำถ้ายาวเกิน 3 บรรทัด */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.modern-card-btn {
    background: #1a56db;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: block;
    margin-top: auto;
    transition: background 0.3s;
}
.modern-card-btn:hover {
    background: #0d42b3;
    color: white;
}


.pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}
.page-btn {
    padding: 8px 16px;
    border: 1px solid #1a56db;
    background: white;
    color: #1a56db;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}
.page-btn:hover { background: #e6f0ff; }
.page-btn.active { background: #1a56db; color: white; cursor: default; }

.single-page{
    padding: 2rem 4rem;
}

.padding{
    padding-left: 2rem;
    padding-right: 2rem;
}


/* =========================================
   แก้ไข Footer (สีลิงก์ + จัดระเบียบมือถือ + ul ชิดซ้าย)
   ========================================= */

/* 1. แก้ไขลิงก์ใน Footer ให้เป็นสีขาวและลบเส้นใต้ */
.footer-col ul li a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-col ul li a:hover {
    opacity: 0.7;
    text-decoration: underline; 
}

/* 2. ป้องกันรูปตัวแทนโดนบีบจนแบน */
.agent-avatar {
    flex-shrink: 0; 
}

/* 3. จัดระเบียบ Footer สำหรับหน้าจอมือถือ/แท็บเล็ต */
/* =========================================
   แก้ไข Footer สำหรับ Mobile & Tablet (แทนที่ของเดิม)
   ========================================= */
@media (max-width: 992px) {
    .footer-contact-section{
        flex:none;
        width: 100%;
    }
    .footer-contact-section h3 {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    /* 1. จัดการ Social Grid ให้เป็น 2 คอลัมน์บนมือถือ ประหยัดพื้นที่แนวตั้ง */
    .social-grid {
        display: grid !important; /* บังคับใช้ Grid แทน Flex Column เดิม */
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        width: 100%;
        max-width: 380px; 
        margin: 0 auto;
    }
    
    .social-item {
        width: 100%;
        justify-content: flex-start;
        max-width: 150px;
    }

    /* 2. จัดการ Agent Card ให้อยู่แนวนอนบนมือถือ */
    .footer-agent-card {
        flex-direction: row; /* เปลี่ยนจาก column เป็น row */
        justify-content: center;
        align-items: center;
        text-align: left;
        padding: 1.2rem 1rem;
        gap: 1.2rem;
        margin-top: 2rem;
        min-width: unset;
    }
    
    .agent-avatar {
        width: 80px; /* ลดขนาดรูปภาพบนมือถือ */
        height: 80px;
    }

    .agent-info {
        align-items: flex-start;
        text-align: left;
    }
    
    .agent-info h4 { font-size: 1.1rem; margin-bottom: 0.2rem; }
    .agent-info p { font-size: 0.85rem; margin-bottom: 0.5rem; }
    .agent-info .license { font-size: 0.85rem; }

    /* 3. จัดการ Footer Links ลดความสูงและจัดระเบียบ */
    .footer-links-flex {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem 1.5rem 1rem 1.5rem; /* ลด Padding บนมือถือ */
        gap: 4rem; /* ลดช่องว่างระหว่างหมวดหมู่ */
    }

    .footer-col ul {
        list-style-type: none; 
        margin: 1rem auto 0 auto;
        padding-left: 0;
        text-align: center; 
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1.5rem; /* นำลิงก์มาเรียงชิดกันแบบไหลตามบรรทัด */
    }
    
    .footer-col ul li {
        margin-bottom: 0; 
    }
}

/* เพิ่มเติมสำหรับมือถือจอเล็กมาก */
@media (max-width: 480px) {
    .social-grid {
        gap: 0.8rem;
    }
    .btn-social-action {
        padding: 0.2rem 0.5rem; /* ลดขนาดปุ่ม Follow ลงนิดหน่อยเพื่อไม่ให้ล้นกล่อง */
        font-size: 0.65rem;
    }
}

.section-single{
    margin: 5rem 0 5rem 0!important;
}