/* --- Popup Overlay --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* ทึบแสง 60% */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* ให้ popup อยู่ด้านบนสุด */

    /* Hidden by default, show with JavaScript */
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease-in-out;
}

.popup-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* --- Product Popup Content --- */
.product-popup-content {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex; /* ใช้ Flexbox สำหรับ layout 2 คอลัมน์ */
    max-width: 900px; /* ความกว้างสูงสุดของ Popup */
    width: 90%; /* ยืดหยุ่นตามหน้าจอ */
    max-height: 90vh; /* ความสูงสูงสุด, ป้องกันไม่ให้ล้นหน้าจอเล็ก */
    overflow: hidden; /* ซ่อนส่วนเกิน */
    position: relative; /* สำหรับตำแหน่งปุ่มปิด */
}

/* --- Close Button --- */
.close-popup-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #ffa6a66e;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    padding: 1rem;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 2rem;
    font-weight: 300;
    color: #ff4949;
    z-index: 1010;
    /* box-shadow: 0 2px 5px rgba(0,0,0,0.1); */
    transition: background-color 0.2s, color 0.2s;
}

.close-popup-btn:hover {
    background-color: #e0e0e0;
    color: #333333; 
	
}

/* --- Product Image Section (Left Column) --- */
.product-image-section {
    flex: 2; /* ใช้ 2 ส่วนของพื้นที่ */
    background-color: #fff;  /* สีเหลืองตามรูป */
    padding: 20px; /* เพิ่ม padding รอบรูปภาพ */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden; /* เพื่อซ่อนส่วนเกินของรูปภาพ */
}

.product-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* ทำให้รูปภาพพอดีโดยไม่ถูกตัด */
    border-radius: 8px; /* ขอบมนเล็กน้อย */
}
.category{
    color: #3E414B80;
    font-size: 1rem;
	font-weight: 500;
}

.product-id-label {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgb(48 146 255 / 79%);
    color: #ffffff;
    font-size: 1rem;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 5;
}

/* --- Product Details Section (Right Column) --- */
.product-details-section {
    flex: 2; /* ใช้ 3 ส่วนของพื้นที่ */
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px; /* ระยะห่างระหว่างกลุ่มข้อมูล */
}

.product-meta {
    font-size: 0.9em;
    color: #888888;
    display: flex;
    flex-wrap: wrap; /* ให้ meta items ขึ้นบรรทัดใหม่ได้ */
    gap: 10px;
}

.product-title {
    font-size: 1.8em;
    font-weight: bold;
    color: #323539;
    margin: 0;
    line-height: 1.3;
}

.product-price-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.price-value-container {
    display: flex;
    align-items: flex-end;
    gap: 5px;
	margin-top: 10px;
}

.currency-thb {
    font-size: 1em;
    color: #666666;
    margin-bottom: 2px; /* จัด alignment */
}

.price-value {
    font-size: 2.8em; /* ขนาดใหญ่สำหรับราคา */
    font-weight: bold;
    color: #FF5733; /* สีแดงส้มสำหรับราคา (ปรับได้) */
    line-height: 1; /* ปรับ line-height เพื่อจัดตำแหน่ง */
}

.shipping-info {
margin-top: auto;
    font-size: 0.95em;
    color: #555555;
    line-height: 1.6;
}

.shipping-info p {
    margin: 0; /* ลบ margin เริ่มต้นของ p */
}

.social-share-icons {
    display: flex;
    gap: 15px;
/*    margin-top: 0;*/
    padding-top: 15px;
    border-top: 1px solid #eeeeee;
    justify-content: center;
	}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #666666;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.social-icon:hover {
    background-color: #e0e0e0;
    color: #333333;
}

/* Optional: Specific colors for social icons on hover */
.social-icon.facebook:hover { background-color: #3b5998; color: white; }
.social-icon.instagram:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); color: white; }
.social-icon.line:hover { background-color: #00B900; color: white; }
.social-icon.tiktok:hover { background-color: #000000; color: white; }


.view-count {
    font-size: 0.9em;
    color: #888888;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .product-popup-content {
        flex-direction: column; /* เปลี่ยนเป็นเรียงซ้อนกันแนวตั้งบนจอเล็ก */
        max-width: 95%;
        max-height: 95vh;
        overflow-y: auto; /* ถ้าเนื้อหายาว ให้ scroll ได้ */
    }

    .product-image-section {
        flex: none; /* ลบ flex growth */
        width: 100%; /* ให้รูปภาพเต็มความกว้าง */
        padding-bottom: 1rem; /* เพื่อให้รูปภาพมีพื้นที่ (ถ้าไม่มี padding-top ก็ใช้ height แทน) */
        height: 100%; /* รีเซ็ต height */
    }
    
    .product-main-image {
/*        position: absolute;*/
        width: 100%;
        height: 100%;
        object-fit: cover; /* บนมือถืออาจจะให้ cover เพื่อความสวยงาม */
    }

    .product-details-section {
        flex: none; /* ลบ flex growth */
        width: 100%;
        padding: 20px;
        gap: 15px;
    }

    .product-title {font-size: 1.3em;}
    .price-value {font-size: 2.2em;}
	.category{font-size: 1em;}
}

/*----------------
-----------------------------------------------------------------------------------------------------------------  mini preview    */
 .product-preview-container {
/*            background-color: #fff;*/
/*            padding: 20px;*/
/*            border-radius: 8px;*/
/*            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);*/
/*            text-align: center;*/
/*            max-width: 600px;*/
/*            width: 100%;*/
        }
        .main-image {
            width: 100%;
            max-width: 500px; /* Adjust as needed */
            height: auto;
/*            border: 1px solid #ddd;*/
            border-radius: 4px;
            margin-bottom: 20px;
            display: block;
            margin-left: auto;
            margin-right: auto;
        }
        .thumbnail-container {
            display: flex;
            justify-content: center;
            gap: 5px;
           
        }
        .thumbnail {
            width: 55px;
            height: 55px;
            object-fit: cover; /* Ensures images fill the thumbnail area without distortion */
            border: 2px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
            transition: border-color 0.2s ease-in-out;
        }
        .thumbnail:hover, .thumbnail.active {
            border-color: #007bff; /* Highlight color for active/hovered thumbnail */
        }

