/* style.css */

.product-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.product-item {
    background-color: #f2f2f2;
    border-radius: 5px;
    transition: background-color 0.3s, box-shadow 0.3s;
    cursor: pointer;
    width: 100%;
    min-width: 250px;
    color: #182676;
    font-weight: 600;
}

.product-table th {
    text-align: center;
    user-select: none; /* ป้องกันการเลือกข้อความ */
}

.product-table .fa-solid {
    font-size: 24px;
    margin-right: 5px;
}


.product-table {
    height: 100%;
    margin-top: 0rem;
}

.product-table th {
    min-width: 135px;
    background-color: #062E73;
    color: #fff;
    border-radius: 5px;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    border: 1px solid;
    height: 100%;
}





.popup .product-table th {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border: none;
    background-color: #ffffff;
    color: #062e73;
    position: relative; /* เพิ่ม position relative เพื่อใช้งาน pseudo-element */
    z-index: 1; /* กำหนด z-index เพื่อให้อยู่หน้าสุด */
    overflow: visible; /* อนุญาตให้เส้นเกินจาก div */
    transition: transform 0.3s ease-in-out; /* เพิ่ม transition สำหรับการขยาย */
    background: none;
}

.popup .product-table th::before,
.popup .product-table th::after {
    content: '';
    position: absolute;
    top: 80%;
    bottom: 0;
    height: 2px;
    width: 0; /* เริ่มที่ 0 */
    transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out; /* เพิ่ม transition สำหรับ opacity */
    opacity: 0; /* ตั้งค่า opacity เป็น 0 */
    z-index: 2; /* กำหนด z-index เพื่อให้อยู่หน้าสุด */
}

.popup .product-table th::before {
    left: 50%;
    background-color: #0407be; /* ตั้งค่าสีสำหรับเส้นทางซ้าย */
    transform: translateX(-50%); /* เริ่มจากตรงกลาง */
}

.popup .product-table th::after {
    left: 50%;
    background-color: #69047e; /* ตั้งค่าสีสำหรับเส้นทางขวา */
    transform: translateX(-50%); /* เริ่มจากตรงกลาง */
}

.popup .product-table th:hover::before {
    width: 40%; /* ขยายขนาดความกว้างเพื่อให้เกิน div */
    opacity: 1; /* ตั้งค่า opacity เป็น 1 */
    transform: translateX(-100%); /* ขยายออกไปทางซ้าย */
}

.popup .product-table th:hover::after {
    width:40%; /* ขยายขนาดความกว้างเพื่อให้เกิน div */
    opacity: 1; /* ตั้งค่า opacity เป็น 1 */
    transform: translateX(0); /* ขยายออกไปทางขวา */
}

/* เพิ่มอนิเมชั่นขยายสำหรับไอคอนและข้อความ */
.popup .product-table th:hover {
    transform: scale(1.2); /* ขยายทั้งไอคอนและข้อความ */
}




/*เอาเส้น VS ออก*/
.popup .product-table th.logo_icon::after {
    display: none ;
}
.popup .product-table th.logo_icon::before {
    display: none ;
}

.product-table .fas{
    margin-top: 2px;
}


.popup .product-main,
.popup .product-details {
    position: relative;
}



.popup .product-main::before,
.popup .product-main::after,
.popup .product-details::before,
.popup .product-details::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    transition: width 2s, height 2s, opacity 0.5s;
    opacity: 0;
}

.popup .product-main::before,
.popup .product-main::after {
    border: 1px solid#062e73; /* เส้นขอบสีเขียวเข้ม */
    box-shadow: 0 0 5px 2px #0407be; /* เงาสีเขียวนีออน */
}

.popup .product-details::before,
.popup .product-details::after {
    border: 1px solid #69047e; /* เส้นขอบสีแดง */
    box-shadow: 0 0 5px 2px#9F04BE; /* เงาสีแดงนีออน */
}

.popup .product-main::before {
    top: 0;
    left: 0;
}

.popup .product-main::after {
    bottom: 0;
    right: 0;
}

.popup .product-details::before {
    top: 0;
    right: 0;
}

.popup .product-details::after {
    bottom: 0;
    left: 0;
}

.popup .product-main.hover::before,
.popup .product-main.hover::after,
.popup .product-details.hover::before,
.popup .product-details.hover::after {
    opacity: 1;
    animation: border-anim 2.5s forwards; /* ใช้ animation border-anim เมื่อ hover */
}

.popup .product-main:not(.hover)::before,
.popup .product-main:not(.hover)::after,
.popup .product-details:not(.hover)::before,
.popup .product-details:not(.hover)::after {
    opacity: 1;
    animation: border-reverse-anim 3s forwards; /* ใช้ animation border-reverse-anim เมื่อไม่ hover */
}

@keyframes border-anim {
    0% {
        width: 0;
        height: 0;
    }
    25% {
        width: 100%;
        height: 0;
    }
    50% {
        width: 100%;
        height: 100%;
    }
    75% {
        width: 100%;
        height: 100%;
    }
    100% {
        width: 100%;
        height: 100%;
    }
}

@keyframes border-reverse-anim {
    0% {
        width: 100%;
        height: 100%;
    }
    25% {
        width: 0%;
        height: 100%;
    }
    50% {
        width: 0%;
        height: 0;
    }
    75% {
        width: 0%;
        height: 0;
    }
    100% {
        width: 0;
        height: 0;
        opacity: 0; /* เพิ่มค่า opacity เพื่อปิดการมองเห็นของเส้นขอบ */
    }
}







.product-table th:nth-child(n+2) {
    width: 280px;
    max-height: 50px;
}

.compare-btn {
    display: none;
}

.product_popup_all {
    display: flex;
}

.product-item.selected .p__product {
    background-color: #b3c5f9;
    border: 1px solid #0056b3;
}

.compare-btn {
    position: fixed;
    bottom: 10%;
    right: 10%;
    z-index: 1000;
    display: none;
}

.compare-btn.visible {
    display: block;
}

.compare-btn.hidden {
    display: none;
}

.popup .product-main {
    margin-top: 0;
    width: 250px;
    height: 100%;
}

.product-main {

    width: 100%;
    max-width: 250px;
    height: 100%;
    font-weight: 600;
    color: #062e73;
}

.product-detel {
    height: 100px;
}

.product-detel_1 {
    height: 137px;
}

.product-detel_2 {
    height: 60px;
    padding-top: 26px !important;
}

.product-detel_3 {
    height: 88px;
    padding-top: 1.5rem !important;
}

.product-detel_4 {
    height: 64px;
    padding-top: 27px !important;
}

.product-detel_5 {
    height: 61px;
    padding-top: 1.5rem !important;
}

.product-detel_6 {
    height: 61px;
    padding-top: 1.5rem !important;
}

.product-details .product-detel_3 {
    height: 88px;
}



.product_name {
    display: flex;
    font-size: 15px;
    text-align: center;
    font-weight: bold;
    color: #ffffff;
    height: 75px;
    padding-top: 1rem;
    background: #062e73;
    max-height: 75px;
    width: 100%;
    justify-content: center;
    align-items: center;
    transition: font-size 0.15s ease;
}

.popup .product-table {
    margin-top: 0px;   
     height: 74%;
}

.contaner__product {
    display: flex;
    max-height: 86vh;
    background-color: white;
}

.product-item:hover img {
    transform: scale(1.3);
    transition: transform 0.3s ease-in-out;
    
}


button.compare-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}

button.compare-btn:hover {
    background-color: #0056b3;
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px;
    border-radius: 5px;
    z-index: 9999;
    width: auto !important;;
}

.product-details {
    width: 250px;
    color: #062e73;
}

.popup-display {
    width: 100%;
    background: #dce4eb;
    height: 100%;
}

.close-btn {
    position: absolute;
    top: 1px;
    right: -40px;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: red;
    font-size: 26px;
}

.tr1 {
    height: 200px;
}

.tr0 {
    height: 193px;
}
 #popup .p__product{
border: none;
box-shadow: 4px 6px 12px 4px rgba(0, 0, 0, 0.3);
}

.p__product {
    width: 250px;
    background-color: #f2f2f2;
    border: 1px solid #ccc;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}



.p__product img {
    width: 100px;
    height: 100px;
}


.product__all {
    display: flex;
    overflow: auto;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100%;
}

.product__all a{
    color: white;
}

.product-item .product_name:hover a{
    color: white;
    text-decoration-line: underline;
}


.product__all .product_name:hover{
    font-size: 18px; /* หรือขนาดอื่นๆ ที่คุณต้องการ */
    
}


.popup .product-details a{
    color: white;
}

.popup .product-details p{
    font-weight: bold;
}

.popup .product-details .product_name:hover a{
    color: white;
    text-decoration-line: underline;
}


.popup .product-details .product_name:hover{
font-size: 18px; /* หรือขนาดอื่นๆ ที่คุณต้องการ */
}


.breadcrumbs {
    margin-bottom: 2rem;
}

.product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-item img {
    width: 90px;
    height: 90px;
    object-fit: cover;
}

.prev-btn,
.next-btn {
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    transition: background-color 0.3s;
    font-size: 36px;
    background: white;
}

.prev-btn {
    left: 0;
}

.next-btn {
    right: 0;
}

.product-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}


.product-main img {
    min-width: 120px;
    height: 120px;
    object-fit: cover;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)); /* เงา */
}

.btn-read-more {
    display: inline-block;
    padding: 10px 20px;
    background-color: transparent;
    color: #062E73;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-read-more:hover {
    color: #0056b3;
}

.detail-container {
    border-bottom: 4px solid #062E73;
    margin-bottom: 40px;
    margin-top: 3rem;
    padding: 40px;
    max-width: 1198px;
}

/* ... (CSS อื่น ๆ) ... */
.popup .product_name{
    background-color: #062e73;}



 

    .popup-display {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        position: relative;
        animation: fadeIn 0.5s ease-in-out;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: scale(0.9);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    @keyframes fadeOut {
        from {
            opacity: 1;
            transform: scale(1);
        }
        to {
            opacity: 0;
            transform: scale(0.9);
        }
    }

   
    

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        display: none;
        z-index: 999; /* ให้อยู่เหนือเนื้อหาทั้งหมด แต่ต่ำกว่า popup */
        transition: opacity 1s ease;

    }

    .overlay.show {
        display: block;
        opacity: 1;
    }
    
    .popup {
      
        z-index: 1000; /* ให้อยู่เหนือ overlay */
    }


/* Initial focus state */
.popup .product-detel_1,
.popup .product-detel_2,
.popup .product-detel_3,
.popup .product-detel_4,
.popup .product-detel_5,
.popup .product-detel_6 {
    background-color: initial; /* Default background color */
    transition: background-color 0s ease-in-out; /* เพิ่ม transition เพื่อให้สมูท */

}

/* Focus state */
.popup .product-detel_1.focus,
.popup .product-detel_2.focus,
.popup .product-detel_3.focus,
.popup .product-detel_4.focus,
.popup .product-detel_5.focus,
.popup .product-detel_6.focus {
    background: #062e73;  
    color: white;
}


/* Toast */

.contaner__product.blur .product-main {
    filter: blur(10px) brightness(0.5);
    /* ปรับค่า filter ให้มีค่าน้อยลง */
    opacity: 1;
    /* ลองปรับค่า opacity */
    pointer-events: none;
    /* ไม่สามารถคลิกได้ */
}

.contaner__product.blur .product__all {
    filter: blur(10px) brightness(0.5);
    /* ปรับค่า filter ให้มีค่าน้อยลง */
    opacity: 1;
    /* ลองปรับค่า opacity */
    pointer-events: none;
    /* ไม่สามารถคลิกได้ */
}

.unblur {
    filter: none;
}

/* สไตล์สำหรับ container หลัก */
.toast-container {
    max-width: 100%;
    width: 90%;
    /* ปรับความกว้างเป็น % แทนที่จะเป็น px */
    max-width: 720px;
    /* กำหนดความกว้างสูงสุด */
    height: 360px;
    display: none;
    /* ซ่อน Toast Container เริ่มต้น */
}

.toast-container .custom-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background-color: red;
    border-radius: 50%;
    opacity: 0.8;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    /* เงาเริ่มต้น */
    transition: all 0.3s ease;
    /* เพิ่ม transition ให้กับทุก properties */
}

.toast-container .custom-close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    /* ขยายขนาดเล็กน้อยเมื่อ hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    /* เงาเมื่อ hover */
}

.toast-container .custom-close-btn::before,
.toast-container .custom-close-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    /* ปรับขนาดกากบาท */
    height: 2px;
    background-color: white;
}

.toast-container .custom-close-btn::before {
    transform: translate(-50%, -50%) rotate(45deg);
    /* หมุนกากบาท */
}

.toast-container .custom-close-btn::after {
    transform: translate(-50%, -50%) rotate(-45deg);
    /* หมุนกากบาท */
}

/* สไตล์สำหรับกล่องด้านบน */
.top-box {
    width: 500px;
    height: 70px;
    background-color: white;
    margin-top: 15px;
    margin-bottom: 20px;
    /* ระยะห่างระหว่างกล่อง */
    border-radius: 75px;
    position: relative;
}


/* สไตล์สำหรับกล่องด้านล่าง */
.bottom-box {
    width: 600px;
    height: 215px;
    background-color: white;
    margin-bottom: 30px;
    border-radius: 35px;
}

.toast-container .toast {
    background: #062E73 !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    position: absolute;
}

.toast-container.show {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.toast.hide {
    /* เพิ่มคลาสนี้เมื่อ toast ถูกปิด */
    display: none !important;
}

.toast-container .toast .close-button {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    /* ปรับระยะห่างด้านบน */
}

/* CSS ปุ่มลอย */
.floating-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: none;
    /* ซ่อนปุ่มเริ่มต้น */
    width: 50px;
    height: 50px;
    background-color: #062E73;
    /* หรือสีอื่นๆ ที่คุณต้องการ */
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    /* จัดตำแหน่งไอคอนให้กึ่งกลาง */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
    /* เพิ่ม transition ให้กับ transform */
}

.floating-button:hover {
    transform: scale(1.2);
    background-color: #175fda;
    /* ขยายขนาดเมื่อ hover */
}

.floating-button .tooltiptext {
    visibility: hidden;
    /* ซ่อนข้อความเริ่มต้น */
    width: 120px;
    /* ปรับความกว้างตามต้องการ */
    background-color: black;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    /* จัดตำแหน่งข้อความให้อยู่ด้านบนของปุ่ม */
    left: calc(50% + 30px);
    /* ขยับไปทางขวา*/
    margin-left: -60px;
    /* จัดกึ่งกลางข้อความ */
    opacity: 0;
    /* เริ่มต้นให้ข้อความโปร่งใส */
    transition: opacity 0.3s;
    /* เพิ่ม transition ให้กับ opacity */
}

.floating-button:hover .tooltiptext {
    visibility: visible;
    /* แสดงข้อความเมื่อ hover */
    opacity: 1;
    /* ทำให้ข้อความทึบ */
}

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

/* Media query สำหรับหน้าจอขนาดเล็ก (เช่น มือถือ) */
@media (max-width: 768px) {
    .toast-container {
        width: 95%;
        /* เพิ่มความกว้างสำหรับหน้าจอขนาดเล็ก */
        height: auto;
        /* ปรับความสูงให้เป็น auto */
    }

    .top-box {
        width: 90%;
        /* ปรับขนาดกล่องด้านบน */
        height: 60px;
    }

    .bottom-box {
        width: 95%;
        /* ปรับขนาดกล่องด้านล่าง */
        height: auto;
    }

    .toast-body {
        font-size: 16px;
        /* ลดขนาดตัวอักษร */
    }
}
    