:root {
    --full-size-width: 1920px;
    --text-size-80: 80px;
    /*100pt*/
    --text-size-35: 35px;
    --text-size-25: 25px;
    --text-size-20: 20px;
    --color-main: #78a5c5;
    --color-reserve-main: #6b94b1;
    --font-weight-300: 300;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: gray;
    display: flex;
    color: #fff;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* ฟอนต์สำหรับ h1, h2, h3, h4 */
h1,
h2,
h3,
h4 {
    font-family: 'Kanit', sans-serif;
    font-weight: 100;
    /* ExtraLight */
}

/* ฟอนต์สำหรับ p, span, div, a, li */
p,
span,
div,
a,
li {
    font-family: 'Kanit', sans-serif;
    font-weight: 100;
    /* Light */
}

#nav {
    width: var(--full-size-width);
    height: auto;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav_row2 {
    background-color: #6894B1;
}

.nav_row2.fixed {
    background-color: #6894B1;
}


#section1_main {
    background-color: rgb(255, 255, 255);
    width: var(--full-size-width);
    height: 860px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container_sec1 {
    flex-direction: column;
    display: flex;
    justify-content: center;
    align-items: center;
}

.headtext_sec1 {
    font-size: var(--text-size-80);
    font-weight: var(--font-weight-300);
    margin: 30px;
    display: flex;
    justify-content: center;
    color: #78A5C5;
}


.container_box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

}

.container_inbox1 {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.box_sec1,
.box_sec2,
.box_sec3,
.box_sec4 {
    background-color: rgba(120, 165, 197, 0.4);
    width: 600px;
    height: 300px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    margin: 20px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;

}

.text_infobox {
    color: #FFFFFF;
    font-weight: 200;
}

.box_sec1:hover {
    background-color: #6894B1;
}

.box_sec1:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec2:hover {
    background-color: #6894B1;
}

.box_sec2:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec3:hover {
    background-color: #6894B1;
}

.box_sec3:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec3:hover {
    background-color: #6894B1;
}

.box_sec3:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec4:hover {
    background-color: #6894B1;
}

.box_sec4:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec4:hover {
    background-color: #6894B1;
}

.box_sec4:hover .text_infobox {
    color: #FFFFFF;
}

.container_img {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    z-index: 1
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ซ่อนภาพที่สอง (img_inbox1_1) โดยค่าเริ่มต้น */
.box_sec1 .img_inbox1_1,
.box_sec2 .img_inbox2_1,
.box_sec3 .img_inbox3_1,
.box_sec4 .img_inbox4_1 {
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    /* ทำให้ภาพซ้อนทับกัน */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* แสดงภาพที่สองเมื่อ hover ที่ box_sec1 */
.box_sec1:hover .img_inbox1_1,
.box_sec2:hover .img_inbox2_1,
.box_sec3:hover .img_inbox3_1,
.box_sec4:hover .img_inbox4_1 {
    opacity: 1;
    /* เปลี่ยนให้ภาพที่สองแสดง */
}

.box_sec1:hover .thumbnail {
    opacity: 0;
    /* ซ่อนภาพแรกเมื่อ hover */
    transition: opacity 0.3s ease;
}

/* จัดให้ภาพอยู่ในตำแหน่งเดียวกัน */
.container_img {
    position: relative;
}


.container_text {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    z-index: 2;
    text-align: center;
}

.text_infobox {
    font-size: var(--text-size-25);
    color: #78A5C5;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.bg_lightbox {
    background-color: #78a5c5;
    display: flex;
    width: 60%;
    height: 60%;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
}

.lightbox-left {
    flex: 1;
    text-align: center;
    width: 40%;
    height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: zoom-in;

}

#lightbox-image-name {
    margin: 10px;
    text-align: center;
    font-size: 30px;
    color: #fff;
    height: 10%;
}

.lightbox-left img {
    width: 90%;
    height: 90%;
    border-radius: 20px;
    object-fit: cover;
}

.container_right {
    width: 50%;
    height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-right {
    flex: 1;
    overflow: hidden;
    width: 100%;
    /* height: 90%; */
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    /* max-height: 300px; */
    /* overflow-y: auto; */
    width: 90%;
    justify-content: center;
    height: 80%;
    align-content: center;

}

.image-gallery img {
    width: 150px;
    height: 150px;
    cursor: pointer;
    object-fit: cover;
}

.container_close {
    width: 90%;
    height: 5%;
    display: flex;
    justify-content: flex-end;
}

/**ซูม**/
/* .thumbnail_container {

} */

/* .thumbnail_container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
} */

.zoom_box {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 2px solid #3131319c;
    background-color: rgba(207, 207, 207, 0.3);
    pointer-events: none;
    display: none;
}

.zoom_preview {
    width: 800px;
    height: 800px;
    margin-left: 20px;
    border: 2px solid #ddd;
    overflow: hidden;
    position: relative;
    display: none;
    /* เริ่มต้นซ่อนพรีวิว */
    object-fit: cover;
}

.zoom_preview img {
    position: absolute;
    width: 1500px;
    /* คำนวณตามอัตราส่วน */
    height: 1500px;
    /* คำนวณตามอัตราส่วน */
    object-fit: cover;
}

/**ซูม**/
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    width: 90%;
    height: 10%;
}

#pagination-info {
    font-size: 30px;
    color: #fff;
}

.pagination button {
    color: #78a5c5;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background-color: #ffffff;
    border: 2px solid #78a5c5;
    cursor: pointer;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.pagination button:hover {
    color: #ffffff;
    background-color: #78a5c5;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid #ffffff;
}

.pagination button:disabled {
    background-color: #ccc;
}

.selected-image {
    border: 10px solid #6894B1;
    /* กำหนดกรอบสีน้ำเงิน */
    border-radius: 5px;
    /* ทำให้กรอบมีมุมมน */
}

#close-lightbox {
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid rgb(255 255 255);
    cursor: pointer;
    /* ตั้งตำแหน่งให้ปุ่มอยู่ที่มุมขวาบน */
    position: absolute;
    /* top: 22%;
    right: 21%; */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}


@media (min-width: 1200px) and (max-width: 1919px) {

    .nav_row1,
    .nav_row2 {
        width: 100%;
    }

    /* Media Query สำหรับหน้าจอมือถือ */
    #nav {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    #section1_main {
        width: 100%;
    }

    #lightbox-image-name,
    #pagination-info {
        font-size: 18px;
    }

    /* .close-lightbox {
        position: absolute;
        top: 10px;
        right: 20px;
        background-color: transparent;
        border: none;
        color: white;
        font-size: 14px;
        cursor: pointer;
    } */

    .close-lightbox:hover {
        color: red;
    }

    #close-lightbox {
        color: #fff;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background-color: transparent;
        border: 2px solid rgb(255 255 255);
        cursor: pointer;
        /* ตั้งตำแหน่งให้ปุ่มอยู่ที่มุมขวาบน */
        position: absolute;
        /* top: 23%;
        right: 22%; */
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    }

    .image-gallery img {
        width: 80px;
        height: 80px;
        cursor: pointer;
        object-fit: cover;
    }

    .nav_col2_container {
        display: flex;
        flex-direction: row;
        justify-content: center;
        width: 45%;
    }

    .zoom_box {
        position: absolute;
        width: 140px;
        height: 140px;
        border: 2px solid #3131319c;
        background-color: rgba(207, 207, 207, 0.3);
        pointer-events: none;
        display: none;
    }

    .zoom_preview {
        width: 400px;
        height: 400px;
        margin-left: 20px;
        border: 2px solid #ddd;
        overflow: hidden;
        position: relative;
        display: none;
        /* เริ่มต้นซ่อนพรีวิว */
        object-fit: cover;
    }

    .zoom_preview img {
        position: absolute;
        width: 890px;
        /* คำนวณตามอัตราส่วน */
        height: 890px;
        /* คำนวณตามอัตราส่วน */
        object-fit: cover;
    }
}

@media (max-width: 1199px) {

    /* ปิดการแสดงผลของการซูมและ lightbox บนมือถือ */
    #zoomBox,
    #zoomPreview{
        display: none !important;
    }

    .nav_row1,
    .nav_row2 {
        width: 100%;
    }

    /* Media Query สำหรับหน้าจอมือถือ */
    #nav {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .nav_row1 {
        width: 100%;
        height: auto;
        justify-content: center;
        padding: 10px 20px;
        background-color: #78a5c5;
        display: flex;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .nav_col1 {
        width: 0px;
    }

    .logomain {
        width: 100px;
        height: 70px;
    }

    .nav_col2 {
        width: auto;
        justify-content: flex-end;
    }

    .nav_col2_container {
        width: auto;
        display: none;
    }

    /* .nav_row2 {
        display: none;
        background-color: #78a5c5;
        width: 100%;
    }


    .nav_row2.show {
        display: block;
    }

    .nav_row2_container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background-color: rgb(255, 255, 255);
        width: 100%;
    } */

    .containernav1 {
        width: 90%;
        display: flex;
        flex-direction: column;
    }


    .dropdown-content {
        background-color: #ffffff;
        box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);

    }

    /* แสดง navbar เมื่อมีคลาส show-nav */
    .show-nav {
        display: block;
    }

    /* ปุ่ม hamburger สำหรับเปิดเมนู */
    .hamburger {
        font-size: 30px;
        cursor: pointer;
        color: white;
        display: inline-block;
        width: 20px;
        height: 20px;
    }

    /* ปุ่ม close สำหรับปิดเมนู (ซ่อนปุ่มนี้ตอนแรก) */
    .close-button {
        font-size: 30px;
        cursor: pointer;
        color: white;
        display: none;
        width: 20px;
        height: 20px;
    }

    /* แสดงปุ่ม close เมื่อเมนูถูกแสดง */
    .show-nav .close-button {
        display: inline-block;
    }

    /* ซ่อนปุ่ม hamburger เมื่อเมนูถูกแสดง */
    .show-nav .hamburger {
        display: none;
    }

    /* ขนาดและตำแหน่งของปุ่มเปิดเมนู */
    #hamburgerMenu {
        width: 20px;
        height: 20px;
        top: 40px;
        right: 5%;
        position: absolute;
        cursor: pointer;
        display: block;
    }

    /* ขนาดและตำแหน่งของปุ่มปิดเมนู (ซ่อนตอนแรก) */
    #closeMenu {
        width: 20px;
        height: 20px;
        top: 40px;
        right: 5%;
        position: absolute;
        cursor: pointer;
        display: none;
    }


    .show-nav .hamburger {
        display: none;
        /* ซ่อน hamburger เมื่อแสดงเมนู */
    }




    /* Calculator Icon Box */
    .calculator-container {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 15px;
    }

    .calculator-container .cal {
        width: 50px;
        height: 50px;
        background-color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 5px;
    }

    .cal img {
        width: 30px;
        height: 30px;
    }

    .cal img {
        width: 15px;
        height: auto;
        filter: brightness(0.600);
    }


    #section1_main {
        width: 100%;
        height: auto;
    }

    .container_box {
        display: flex;
        flex-direction: column;
    }

    .headtext_sec1 {
        font-size: 36px;
        text-align: center;
        margin: 20px;
    }

    .text_infobox {
        font-size: 26px;
    }

    .box_sec1,
    .box_sec2,
    .box_sec3,
    .box_sec4 {
        width: 340px;
        height: 200px;
        margin: 10px;
    }

    .container_inbox1 {
        display: flex;
        flex-direction: column;
    }

    .bg_lightbox {
        background-color: #99caffd1;
        display: flex;
        width: 90%;
        height: 90%;
        justify-content: center;
        align-items: center;
        border-radius: 10px;
        flex-direction: column;
    }

    .lightbox-left {
        flex: 1;
        text-align: center;
        width: 100%;
        height: 50%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .lightbox-left img {
        width: 90%;
        height: 80%;
        border-radius: 15px;
        object-fit: cover;
    }

    .container_right {
        width: 90%;
        height: 50%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .lightbox-right {
        flex: 1;
        overflow: hidden;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }


    .pagination {
        width: 90%;
        height: 20%;
    }

    .image-gallery {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        width: 100%;
        justify-content: center;
        height: 80%;
        align-content: center;
        justify-items: center;
        align-items: center;
    }

    .image-gallery img {
        width: 60px;
        height: 60px;
        cursor: pointer;
        object-fit: cover;
    }

    #lightbox-image-name {
        margin: 0px;
        text-align: center;
        font-size: 20px;
        color: #fff;
        height: 0%;
    }

    #close-lightbox {
        color: #fff;
        width: 15px;
        height: 15px;
        top: 9%;
        right: 11%;
        font-size: 10px;
    }

    #pagination-info {
        font-size: 18px;
        color: #fff;
    }

    .pagination button {
        width: 20px;
        height: 20px;
        padding: 0px 5px;
        font-size: 12px;

    }

    .selected-image {
        border: 8px solid #6894B1;
        border-radius: 5px;
    }
}