/* กำหนดสีพื้นหลังสำหรับทั้งหน้าเว็บไซต์ */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #c5ecfa; /* สีเทาอ่อนมาก c5ecfa เพื่อความสบายตา */
    color: #333; /* สีข้อความเริ่มต้น */
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    text-align: center;
}

/* สำหรับส่วน Header ของเว็บไซต์ */
.header {
    background-image: url('../images/header-bg.png'); /* ใส่ Path รูปพื้นหลังของคุณ */
    background-size: cover; /* ทำให้รูปภาพครอบคลุมพื้นที่ Header ทั้งหมด */
    background-position: center; /* จัดตำแหน่งรูปภาพให้อยู่ตรงกลาง */
    background-repeat: no-repeat; /* ไม่ให้รูปภาพซ้ำ */
    min-height: 30vh; /* ปรับความสูงขั้นต่ำให้เป็น 30% ของความสูงหน้าจอ */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Media Query สำหรับหน้าจอขนาดเล็ก (เช่น มือถือ) */
@media (max-width: 768px) {
    .header {
        min-height: 200px; /* ลดความสูงของ Header บนหน้าจอขนาดเล็ก */
    }
}

.header h1 {
    font-size: 2.5em; /* ปรับขนาดหัวข้อ */
    margin-bottom: 10px;
    color: inherit; /* ใช้สีที่กำหนดไว้ใน .header */
}

.header .product-detail {
    font-size: 1.1em; /* ปรับขนาดรายละเอียด */
    margin-top: 5px;
    margin-bottom: 5px;
    line-height: 1.4;
    color: inherit; /* ใช้สีที่กำหนดไว้ใน .header */
}

.header a {
    color: #ADD8E6; /* สีลิงก์ใน Header (ปรับให้เข้ากับพื้นหลัง) */
    text-decoration: underline; /* ขีดเส้นใต้ลิงก์ */
}

h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #0056b3;
}

.promotion-label {
    background-color: #ff4d4d; /* สีพื้นหลังแดงสด */
    color: white; /* สีตัวอักษรขาว */
    font-weight: bold; /* ตัวหนา */
    padding: 5px 10px; /* ระยะห่างภายในป้าย */
    border-radius: 5px; /* มุมโค้งมน */
    margin-top: 10px; /* ระยะห่างจากด้านบน */
    display: inline-block; /* ทำให้สามารถกำหนด padding ได้ */
    font-size: 0.9em; /* ขนาดตัวอักษร */
    text-transform: uppercase; /* ตัวพิมพ์ใหญ่ทั้งหมด */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* เพิ่มเงา */
    position: relative; /* สำหรับจัดตำแหน่งเพิ่มเติม */
    /* ถ้าต้องการให้ลอยอยู่บนรูปภาพ */
    /* position: absolute; */
    /* top: 10px; */
    /* right: 10px; */
}

/* สำหรับป้าย "สินค้าขายดี" */
.bestseller-label {
    background-color: #4CAF50; /* สีเขียวสดใส */
    color: white; /* สีตัวอักษรขาว */
    font-weight: bold; /* ตัวหนา */
    padding: 5px 10px; /* ระยะห่างภายในป้าย */
    border-radius: 5px; /* มุมโค้งมน */
    margin-top: 5px; /* ระยะห่างจากป้ายด้านบนหรือรายละเอียดสินค้า */
    display: inline-block; /* ทำให้สามารถกำหนด padding ได้ */
    font-size: 0.9em; /* ขนาดตัวอักษร */
    text-transform: uppercase; /* ตัวพิมพ์ใหญ่ทั้งหมด */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* เพิ่มเงา */
    
    /* เพิ่ม animation เพื่อให้ป้ายขยับ */
    animation: pulse 2s infinite; 
}

/* หากมีหลายป้ายใน product-info สามารถเพิ่ม margin ด้านขวาได้เล็กน้อยเพื่อให้มีช่องไฟ */
.product-info .promotion-label + .bestseller-label,
.product-info .bestseller-label + .promotion-label {
    margin-left: 5px;
}

/* สำหรับรูปภาพสินค้าภายใน .product-card */
.product-card img {
    max-width: 70%; /* ทำให้รูปภาพมีขนาดไม่เกินความกว้างของกรอบแม่ */
    height: auto;    /* รักษาอัตราส่วนของรูปภาพ */
    display: block;  /* กำหนดให้รูปภาพเป็น block-level element */
    margin: 0 auto;  /* จัดรูปภาพให้อยู่ตรงกลาง */
    border-bottom: 1px solid #eee; /* เส้นแบ่งใต้รูป */
    padding-bottom: 5px; /* ระยะห่างจากเส้นแบ่ง */

    /* เพิ่มโค้ดนี้เพื่อทำให้ขอบรูปภาพโค้งมน */
    border-radius: 8px; 
}

.product-info {
    padding: 15px;
    text-align: center;
}

.product-info h3 {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

/* สำหรับรายละเอียดสินค้า (แพ็คละ, หิ้วละ) */
.product-detail {
    font-size: 0.9em; /* กำหนดขนาดตัวอักษรให้เล็กลง */
    color: #555;     /* สีรายละเอียด */
    margin-top: 0;    /* ลบช่องว่างด้านบน */
    margin-bottom: 0; /* ลบช่องว่างด้านล่าง */
    line-height: 1.1; /* ปรับความสูงของบรรทัด */
}

.price2 {
    font-size: 0.9em;
    color: #f5ab16; /* สีราคา */
    font-weight: bold;
    margin-top: 6px;
    margin-bottom: 10px;
}

.price {
    font-size: 1.2em;
    color: #dc3545; /* สีราคา */
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 10px;
}

.order-info {
    background-color: #f8f8f8; /* พื้นหลังสำหรับส่วนสั่งซื้อ */
    padding: 10px 15px;
    font-size: 0.9em;
    border-top: 1px solid #eee; /* เส้นแบ่งด้านบน */
}

.order-info a {
    color: #007bff; /* สีลิงก์สั่งซื้อ */
    text-decoration: none;
    font-weight: bold;
}

.order-info a:hover {
    text-decoration: underline;
}

/* สไตล์สำหรับปุ่มเลื่อนกลับขึ้นด้านบนสุด */
#scrollToTopBtn {
    display: none; /* ซ่อนปุ่มไว้ในตอนแรก */
    position: fixed; /* ทำให้ปุ่มลอยอยู่บนหน้าจอ */
    bottom: 30px; /* ระยะห่างจากขอบล่างของหน้าจอ */
    right: 30px; /* ระยะห่างจากขอบขวาของหน้าจอ */
    z-index: 99; /* ทำให้ปุ่มอยู่เหนือองค์ประกอบอื่นๆ */
    border: none; /* ไม่มีขอบ */
    outline: none; /* ไม่มีขอบเมื่อโฟกัส */
    background-color: #007bff; /* สีพื้นหลังของปุ่ม (สีฟ้า) */
    color: white; /* สีตัวอักษรบนปุ่ม */
    cursor: pointer; /* เปลี่ยนเคอร์เซอร์เป็นรูปมือเมื่อชี้ */
    padding: 15px 20px; /* ขนาดของปุ่ม */
    border-radius: 50%; /* ทำให้ปุ่มเป็นวงกลม */
    font-size: 18px; /* ขนาดตัวอักษรของลูกศร */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* เพิ่มเงาให้ปุ่ม */
    transition: background-color 0.3s, opacity 0.3s; /* เพิ่ม Transition เพื่อความสวยงาม */
    opacity: 0.8; /* ทำให้ปุ่มโปร่งแสงเล็กน้อย */
}

#scrollToTopBtn:hover {
    background-color: #0056b3; /* สีพื้นหลังเมื่อชี้เมาส์ */
    opacity: 1; /* ทำให้ทึบแสงเมื่อชี้เมาส์ */
}

/* ปรับขนาดปุ่มสำหรับ Mobile (ถ้าต้องการให้เล็กลง) */
@media (max-width: 600px) {
    #scrollToTopBtn {
        bottom: 20px;
        right: 20px;
        padding: 12px 16px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .header {
        min-height: 200px;
    }
    .header h1 {
        font-size: 1.8em;
    }
    .header .product-detail {
        font-size: 0.9em;
    }
}

/* สไตล์สำหรับช่องค้นหา - ปรับให้เป็น Fixed Position */
.search-container {
    display: flex; /* ใช้ flexbox ในการจัดวาง input และ button */
    align-items: center;
    
    position: fixed; /* ทำให้ลอยอยู่บนหน้าจอ */
    bottom: 30px; /* เริ่มต้นให้ห่างจากขอบล่าง 30px เหมือนปุ่ม scroll-to-top */
    right: 90px; /* ให้ห่างจากปุ่ม scroll-to-top ประมาณหนึ่ง (30px ของปุ่ม + 60px ความกว้างปุ่ม) */
    z-index: 98; /* อยู่ต่ำกว่าปุ่ม scroll-to-top เล็กน้อย */
    
    background-color: rgba(255, 255, 255, 0.95); /* พื้นหลังโปร่งแสงเล็กน้อย */
    padding: 10px 15px; /* เพิ่ม padding รอบๆ */
    border-radius: 30px; /* ทำให้มนทั้งก้อน */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); /* เพิ่มเงา */
    transition: bottom 0.3s ease, right 0.3s ease, opacity 0.3s ease; /* เพิ่ม transition */
    opacity: 0.9;
}

#searchInput {
    padding: 10px 15px; /* ลด padding ลงเล็กน้อย */
    border: 1px solid #ccc;
    border-radius: 20px; /* ทำให้ขอบมน */
    font-size: 0.9em; /* ลดขนาดตัวอักษรเล็กน้อย */
    width: 150px; /* กำหนดความกว้างเริ่มต้น */
    margin-right: 8px; /* ระยะห่างจากปุ่ม */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#searchButton {
    padding: 10px 15px; /* ลด padding ลงเล็กน้อย */
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px; /* ทำให้ขอบมน */
    font-size: 0.9em; /* ลดขนาดตัวอักษรเล็กน้อย */
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#searchButton:hover {
    background-color: #0056b3;
}

/* เพิ่มสไตล์สำหรับ Product Card ที่ถูกซ่อน */
.product-card.hidden {
    display: none;
}

/* สำหรับหน้าจอขนาดเล็กกว่า 768px (แท็บเล็ตและมือถือ) */
@media (max-width: 768px) {
    .search-container {
        /* ย้ายไปอยู่ด้านซ้ายล่าง เพื่อไม่ให้ชนกับปุ่ม Scroll-to-Top */
        bottom: 20px;
        right: auto; /* ลบ right ออกไป */
        left: 20px; /* จัดไปทางซ้าย */
        flex-direction: row; /* คงเป็นแนวนอน */
        padding: 8px 12px;
        opacity: 0.95;
    }
    #searchInput {
        width: 120px; /* ลดความกว้างลงบนมือถือ */
        padding: 8px 12px;
        font-size: 0.85em;
        margin-right: 5px;
    }
    #searchButton {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    /* ปรับตำแหน่งปุ่ม Scroll-to-Top ให้เหมาะสมบนมือถือ (ถ้าชนกัน) */
    #scrollToTopBtn {
        bottom: 20px;
        right: 20px;
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* สไตล์สำหรับส่วนข้อมูลการติดต่อที่ย้ายมา */
.contact-info-block {
    max-width: 800px; /* กำหนดความกว้างสูงสุดเหมือน delivery-info */
    margin: 10px auto; /* จัดกึ่งกลางและเว้นระยะห่างด้านบน/ล่าง */
    padding: 2px 2px; /* ลด padding ลงเล็กน้อย */
    background-color: #FFFFFF; /* สีพื้นหลังอ่อนๆ ที่ตัดกับ header และ delivery-info */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    line-height: 1.5;
    font-size: 1.1em;
    color: #0056b3; /* สีข้อความให้เข้ากับธีม */
    font-weight: bold;
}

.contact-info-block .contact-text a {
    color: #dc3545; /* สีแดงสำหรับลิงก์ Line/Facebook */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.contact-info-block .contact-text a:hover {
    color: #a71d2a;
    text-decoration: underline;
}

/* Responsive Adjustments สำหรับ contact-info-block บนมือถือ */
@media (max-width: 768px) {
    .contact-info-block {
        margin: 15px auto;
        padding: 12px 20px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .contact-info-block {
        margin: 1px auto;
        padding: 1px 6px;
        font-size: 0.95em;
    }
}

/* =====================================================================
   โค้ดสำหรับ Product Grid และ Product Card
   ===================================================================== */
.product-grid {
    display: grid;
    /* เพิ่ม max-width เพื่อจำกัดความกว้างสูงสุด */
    max-width: 1400px; 
    margin: 0 auto; /* จัดกึ่งกลาง */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    background-color: #FFFAF0;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* เพิ่มการตั้งค่านี้เพื่อให้การ์ดมีความสูงเท่ากัน */
    align-items: stretch;
}

/* เพิ่ม media query สำหรับหน้าจอขนาดใหญ่ (PC) โดยเฉพาะ */
@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(6, 1fr); /* กำหนดให้แสดง 6 คอลัมน์ */
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* แสดง 2 คอลัมน์บนมือถือ */
    }
}

/* =====================================================================
   ปรับปรุงโค้ดสำหรับ Product Card และ Product Info
   ===================================================================== */
.product-card {
    /*background-color: #fff;*/
    background: linear-gradient(135deg, #f0f8ff, #f9f9f9); /* สร้างการไล่เฉดสีจากมุมบนซ้ายไปล่างขวา */
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding-top: 10px;
    
    /* จัดการให้การ์ดมีความสูงเท่ากัน */
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative; /* สำคัญสำหรับการวางตำแหน่งป้าย */
    
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* ทำให้เงาเข้มขึ้น */
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* เพิ่มการจัดเรียงข้อความภายใน product-info */
.product-info {
    padding: 15px;
    
    /* ใช้ Flexbox เพื่อจัดเรียงข้อความให้เรียงต่อกันเป็นคอลัมน์และอยู่ตรงกลาง */
    display: flex;
    flex-direction: column;
    justify-content: center; /* จัดเนื้อหาให้อยู่ตรงกลางแนวตั้ง */
    align-items: center; /* จัดเนื้อหาให้อยู่ตรงกลางแนวนอน */
    text-align: center; /* จัดข้อความให้อยู่ตรงกลาง (สำหรับเนื้อหาหลายบรรทัด) */

    flex-grow: 1; /* เพื่อให้ส่วนข้อมูลยืดออกเต็มพื้นที่ที่เหลืออยู่ */
}

.product-info h3 {
    font-size: 1.4em; /* ปรับขนาดหัวข้อให้ใหญ่ขึ้นเล็กน้อย */
    margin-top: 0;
    margin-bottom: 5px; /* ลดระยะห่างด้านล่าง */
    color: #333;
}

.product-info .product-detail {
    font-size: 0.9em;
    color: #555; /* ปรับสีให้เข้มขึ้นเล็กน้อย */
    margin: 4px 0; /* เพิ่ม margin บนและล่างเล็กน้อย */
    line-height: 1.2;
}

.price {
    font-size: 1.2em; /* ปรับขนาดราคาให้ใหญ่ขึ้น */
    color: #dc3545;
    font-weight: bold;
    margin: 10px 0; /* เพิ่ม margin บนและล่าง */
}

.quantity-input {
    width: 60px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
}

.add-to-cart-btn:hover {
    background-color: #0056b3;
}

/* สำหรับป้าย "สินค้าขายดี" - ให้ตำแหน่งอยู่บนรูปภาพ */
.bestseller-label {
    background-color: #ffc107;
    color: #333;
    font-size: 0.8em;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 5px;
    position: absolute; /* กำหนดตำแหน่งแบบสัมบูรณ์ */
    top: 10px; /* ห่างจากขอบบน 10px */
    left: 10px; /* ห่างจากขอบซ้าย 10px */
}

/* =====================================================================
   โค้ดสำหรับส่วนรายละเอียดการจัดส่ง (Delivery Info)
   ===================================================================== */
.delivery-info {
    max-width: 900px;
    margin: 10px auto;
    padding: 20px;
    background-color: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    line-height: 1.6;
}

.delivery-title {
    font-size: 1.5em;
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

.shipping-rates, .box-prices {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.shipping-rates li, .box-prices li {
    background-color: #f9f9f9;
    margin-bottom: 5px;
    padding: 10px;
    border-radius: 5px;
    font-size: 1.1em;
}

.shipping-rates strong {
    color: #dc3545;
}

.note {
    font-style: italic;
    color: #777;
    font-size: 0.9em;
}

.delivery-text {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #333;
}

.important-note {
    font-size: 1.5em;
    color: #dc3545;
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: bold;
}

.highlight {
    background-color: #ffe4e1;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    color: #c90000;
    display: block;
    margin-top: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.final-note {
    font-weight: bold;
    color: #007bff;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* =====================================================================
   Lightbox Modal CSS
   ===================================================================== */
.lightbox {
    display: none; /* ซ่อนไว้ตอนแรก */
    position: fixed; /* ให้อยู่ด้านบนของทุกอย่าง */
    z-index: 1000; /* กำหนดลำดับการแสดงผล */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8); /* พื้นหลังสีดำจางๆ */
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
}

#lightbox-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    border-radius: 4px;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.lightbox-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.lightbox-thumbnails img:hover,
.lightbox-thumbnails img.active {
    border-color: #007BFF;
}

/* เพิ่มโค้ดนี้ที่ท้ายไฟล์ style.css */

/* กำหนดขนาดของรูปภาพขนาดใหญ่ใน Lightbox สำหรับ PC */
@media (min-width: 769px) {
    #lightbox-image {
        /* กำหนดขนาดความสูงสูงสุด เพื่อป้องกันไม่ให้รูปภาพใหญ่เกินไปในจอ PC */
        max-height: 80vh; /* กำหนดให้รูปภาพสูงไม่เกิน 80% ของหน้าจอ */
        width: auto;
        /* ตรวจสอบให้แน่ใจว่า margin ไม่ทำให้รูปภาพถูกซ่อน */
        margin-bottom: 20px;
    }
    
    .lightbox-content {
        /* ปรับขนาดของคอนเทนเนอร์ Lightbox ให้เหมาะสมกับ PC */
        width: 80%;
        max-width: 900px; /* สามารถปรับค่านี้ได้ตามต้องการ */
    }
}

/*-------------------------------------------------------*/
/* Utility classes (ถ้าต้องการ) */
    .text-center {
        text-align: center;
}
    .my-20 {
        margin-top: 20px;
        margin-bottom: 20px;
}
		

/* สำหรับปุ่มลอยติดต่อ */
.floating-contact-buttons {
    position: fixed;
    bottom: 90px;
    right: 35px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-button {
    display: inline-block;
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, opacity 0.3s ease; /* เพิ่ม opacity ใน transition */
    opacity: 0.7; /* ความโปร่งแสง 70% */
}

.contact-button:hover {
    transform: scale(1.1);
    opacity: 1; /* ทึบแสงเต็มที่เมื่อเอาเมาส์ไปชี้ */
}

.line-button {
    background-color: #00B900;
}

.facebook-button {
    background-color: #1877F2;
}

/* Media query สำหรับหน้าจอขนาดเล็ก (มือถือ) */
@media (max-width: 768px) {
    .floating-contact-buttons {
        bottom: 75px;
        right: 19px;
    }
}

/* สำหรับป้าย "สินค้าหมด" */
.stock-status-label {
    background-color: #dc3545; /* สีแดง */
    color: white;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    margin-top: 10px;
    display: inline-block;
    font-size: 0.9em;
}

/* ซ่อนส่วนควบคุมจำนวนและปุ่มเมื่อสินค้าหมดสต็อก */
.product-card.out-of-stock .quantity-control {
    display: none;
}

/* ทำให้สินค้าที่หมดสต็อกดูจางลง */
.product-card.out-of-stock {
    opacity: 0.6;
}

/* สไตล์สำหรับปุ่มที่ถูกปิดใช้งาน */
.add-to-cart-btn[disabled] {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ทำให้ป้ายโปรโมชั่นไม่แสดงผลในสินค้าหมดสต็อก */
.out-of-stock .promotion-label,
.out-of-stock .bestseller-label {
    display: none;
}

/* สำหรับส่วนควบคุมจำนวนสินค้า */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.quantity-input {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.add-to-cart-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.add-to-cart-btn:hover {
    background-color: #218838;
}

/* =====================================================================
   โค้ดสำหรับส่วนสรุปยอดรวม (Summary Section) ที่ปรับปรุงแล้ว
   ===================================================================== */
.summary-section {
    /* ใช้ padding น้อยลงเพื่อให้กระชับขึ้น */
    padding: 15px; 
    
    /* จัดกึ่งกลางเหมือนเดิม แต่ใช้ max-width ที่เล็กลงเล็กน้อย */
    width: 90%;
    max-width: 450px; 
    margin: 20px auto; 
    
    background-color: #f0f8ff; /* เปลี่ยนสีพื้นหลังให้ดูสดใสขึ้น */
    border: 1px solid #dcdcdc; /* ปรับสีขอบให้ดูอ่อนลง */
    border-radius: 10px; /* ขอบโค้งมนที่ดูทันสมัย */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* เพิ่มเงาให้ดูมีมิติ */
    text-align: center;
}

/* ส่วนหัวข้อ "สรุปยอดรวม" */
.summary-section h4 {
    font-size: 1.3em;
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e0e0e0; /* เพิ่มเส้นแบ่งด้านล่าง */
}

/* สำหรับส่วนแสดงราคารวม */
.total-price-container {
    /* ใช้ flexbox เพื่อจัดวางข้อความให้อยู่คนละฝั่ง */
    display: flex;
    justify-content: space-between; /* จัดให้อยู่ซ้ายสุดและขวาสุด */
    align-items: baseline;
    
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px dashed #a0a0a0; /* ปรับเส้นแบ่งให้ดูดีขึ้น */
    
    font-size: 1.3em; /* ขนาดตัวอักษรสำหรับราคารวม */
    font-weight: bold;
    color: #333;
}

/* สำหรับป้ายบอก "ค่าจัดส่ง" หรือ "ค่ากล่อง" */
.shipping-cost-info {
    font-size: 0.9em;
    color: #dc3545; /* สีแดงสำหรับราคา */
    font-weight: normal; /* ตัวอักษรไม่หนาเกินไป */
}

/* สำหรับส่วนของตะกร้าสินค้า */
#cart-section {
    position: fixed;
    bottom: 240px;
    right: 5px;
    width: 300px;
    background-color: rgba(255, 255, 255, 0.85); /* เพิ่มความทึบแสงเล็กน้อย */
    border: 1px solid rgba(221, 221, 221, 0.6);
    border-radius: 12px; /* ทำให้ขอบมนขึ้นเล็กน้อย */
    padding: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15); /* เพิ่มเงาให้ดูโดดเด่นขึ้น */
    z-index: 1000;
    text-align: left;
    max-height: 400px; /* **เพิ่มโค้ดนี้เพื่อจำกัดความสูงสูงสุด** */
    overflow-y: auto; /* **เพิ่มโค้ดนี้เพื่อสร้าง scrollbar เมื่อเนื้อหาเกิน** */
    display: none; /* **เพิ่มโค้ดนี้เพื่อซ่อนตะกร้าตั้งแต่แรก** */
}

#cart-items {
    margin-bottom: 15px; /* เพิ่มระยะห่างด้านล่าง */
    max-height: 250px; /* **เพิ่มโค้ดนี้เพื่อจำกัดความสูงของรายการสินค้า** */
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center; /* จัดให้อยู่กึ่งกลางแนวตั้ง */
    padding: 8px 0; /* เพิ่ม padding เล็กน้อยเพื่อให้มีช่องไฟ */
    border-bottom: 1px solid #eee;
    font-size: 0.9em; /* ลดขนาดตัวอักษรลงเล็กน้อย */
}

.cart-item:last-child {
    border-bottom: none; /* ลบเส้นแบ่งบรรทัดสุดท้าย */
}

.cart-item .item-name {
    font-weight: bold;
    flex-grow: 1; /* ทำให้ชื่อสินค้าขยายเต็มพื้นที่ที่เหลือ */
}

.cart-item .item-price {
    color: #dc3545; /* สีแดงสำหรับราคา */
}

/* Media Query สำหรับหน้าจอที่มีความกว้างไม่เกิน 768px (เหมาะสำหรับมือถือ) */
@media (max-width: 768px) {
    #cart-section {
        width: 250px; /* ลดความกว้างของตะกร้าลง */
        bottom: 10px; /* ปรับตำแหน่งให้ห่างจากขอบล่างน้อยลง */
        right: 10px; /* ปรับตำแหน่งให้ห่างจากขวามากขึ้น */
        padding: 10px; /* ลดขนาด padding ลง */
    }
}

/* สไตล์สำหรับไอคอนตะกร้า */
#cart-icon {
    position: fixed;
    bottom: 217px;
    right: 15px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    /* เพิ่ม opacity หรือปรับค่า opacity เดิมที่มีอยู่ */
    opacity: 0.8; /* กำหนดความโปร่งใส 80% */
    transition: opacity 0.3s ease; /* เพิ่ม transition เพื่อให้การเปลี่ยนแปลงนุ่มนวล */
}

/* เพิ่ม transition เพื่อให้การเปลี่ยนแปลงเป็นไปอย่างราบรื่น */
#cart-icon img {
    width: 50px;
    height: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}

/* เมื่อผู้ใช้เลื่อนเมาส์ไปชี้ */
#cart-icon:hover {
    opacity: 1; /* ทำให้ทึบแสง 100% เมื่อชี้เมาส์ */
}

/* เมื่อผู้ใช้เลื่อนเมาส์ไปชี้ที่ไอคอนตะกร้า */
#cart-icon:hover img {
    transform: scale(1.1); /* ทำให้ไอคอนขยายใหญ่ขึ้น 10% */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* เพิ่มเงาให้ดูมีมิติ */
}

/* เมื่อผู้ใช้คลิกที่ไอคอนตะกร้า */
#cart-icon:active img {
    transform: scale(0.95); /* ทำให้ไอคอนหดลงเล็กน้อย เพื่อให้ความรู้สึกเหมือนถูกกด */
}

#cart-count {
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 12px;
    position: relative;
    top: -15px;
    left: -10px;
}

/* สไตล์สำหรับ Pop-up (modal) */
#cart-modal {
    display: none; /* ซ่อน Pop-up ไว้ในตอนแรก */
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.modal-content .close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.modal-content .close-btn:hover,
.modal-content .close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* -------------------------------------------------- */
/* โค้ดสำหรับหน้าจอมือถือและแท็บเล็ต (ขนาดไม่เกิน 768px) */
@media (max-width: 768px) {
    #cart-icon {
        top: initial; /* ยกเลิกการจัดตำแหน่งจากด้านบน */
        bottom: 205px; /* ย้ายไอคอนไปที่ขอบล่างของหน้าจอ */
        right: -1px; /* ให้ไอคอนอยู่ทางขวาเหมือนเดิม */
    }
}

/* สำหรับ FAQ Section */
.faq-section {
    width: 90%;
    max-width: 800px;
    margin: 40px auto;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.faq-item {
    border-bottom: 1px solid #eee;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    background-color: #fff;
    color: #333;
    cursor: pointer;
    padding: 18px 20px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1em;
    transition: background-color 0.4s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.faq-question:hover {
    background-color: #f1f1f1;
}

/* เพิ่มไอคอน + และ - เพื่อบอกสถานะ */
.faq-question::after {
    content: '+';
    font-size: 1.5em;
    color: #777;
    transition: transform 0.3s ease-in-out;
}

.faq-question.active::after {
    content: '-';
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    background-color: #f9f9f9;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.faq-question.active + .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 10px 0;
    margin: 0;
    line-height: 1.6;
    color: #555;
}

.faq-question.active {
    background-color: #e0e0e0;
}

/* Styling for the shipping table */
.shipping-table-container {
    margin-bottom: 30px;
}

.shipping-rates-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 1em;
}

.shipping-rates-table th,
.shipping-rates-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.shipping-rates-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #333;
}

.shipping-rates-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Styling for delivery notes */
.delivery-notes {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.delivery-text {
    margin-bottom: 15px;
    line-height: 1.6;
}

.highlight {
    background-color: #ffe4e1; /* สีชมพูอ่อน */
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    color: #c90000;
}

.pickup-points {
    margin-top: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.key-info {
    list-style-type: none;
    padding: 0;
    margin-top: 20px;
}

.key-info li {
    margin-bottom: 10px;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
    border-left: 5px solid #28a745; /* สีเขียว */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.key-info li:nth-child(2) {
    border-left-color: #dc3545; /* สีแดง */
}

.key-info li:nth-child(3) {
    border-left-color: #ffc107; /* สีเหลือง */
}

.key-info li:nth-child(4) {
    border-left-color: #007bff; /* สีน้ำเงิน */
}

.warning-text {
    color: #dc3545;
    font-weight: bold;
}

/* Styling for combined shipping and box rates */
.shipping-and-box-rates {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    background-color: #e6f7ff; /* สีฟ้าอ่อน */
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.shipping-and-box-rates > li {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.shipping-and-box-rates ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 10px;
}

.price-info {
    font-weight: normal;
    color: #555;
    background-color: #d9edf7;
    padding: 5px 10px;
    border-radius: 5px;
    margin-left: 10px;
}

/* Styling for delivery notes list */
.delivery-notes {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    text-align: left;
}

.delivery-notes li {
    margin-bottom: 5px;
    color: #555;
}

/* Rest of the new CSS code from previous recommendations */
.delivery-info {
    max-width: 900px;
    margin: 10px auto;
    padding: 20px;
    background-color: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    line-height: 1.6;
}

.important-note {
    color: #c90000;
}

.highlight {
    background-color: #ffe4e1;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    color: #c90000;
}

.pickup-points {
    margin-top: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.key-info {
    list-style-type: none;
    padding: 0;
    margin-top: 20px;
}

.key-info li {
    margin-bottom: 10px;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
    border-left: 5px solid #28a745;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.key-info li:nth-child(2) {
    border-left-color: #dc3545;
}

.key-info li:nth-child(3) {
    border-left-color: #ffc107;
}

.key-info li:nth-child(4) {
    border-left-color: #007bff;
}

.warning-text {
    color: #dc3545;
    font-weight: bold;
}

/* Styling สำหรับ Pop-up Quick View */
#quick-view-modal {
    display: none; /* ซ่อน Pop-up ไว้ก่อน */
    position: fixed; /* ทำให้ Pop-up อยู่กับที่ */
    z-index: 2000; /* ให้แสดงผลอยู่บนสุด */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7); /* พื้นหลังสีดำจางๆ */
}

.quick-view-content {
    background-color: #fefefe;
    margin: 5% auto; /* จัดให้อยู่กลางหน้าจอ */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px; /* จำกัดความกว้างสูงสุด */
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Styling สำหรับปุ่มดูรายละเอียดด่วน */
.quick-view-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.quick-view-btn:hover {
    background-color: #0056b3;
}

/* Styling สำหรับเนื้อหาภายใน Quick View */
#quick-view-details img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 15px;
}

.order-tracking-section {
    max-width: 800px;
    margin: 50px auto; /* จัดให้อยู่กึ่งกลางหน้าจอ และเพิ่มระยะห่างด้านบน-ล่าง */
    padding: 30px;
    background-color: #f8f9fa; /* สีพื้นหลังอ่อนๆ */
    border-radius: 10px; /* ทำให้ขอบโค้งมน */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* เพิ่มเงาให้ดูมีมิติ */
    text-align: center;
}

.order-tracking-section h3 {
    font-size: 2em;
    color: #343a40;
    margin-bottom: 10px;
}

.order-tracking-section p {
    font-size: 1.2em;
    color: #6c757d;
    margin-bottom: 20px;
}

.tracking-form {
    display: flex;
    justify-content: center;
    gap: 10px; /* เพิ่มช่องว่างระหว่าง input และ button */
    margin-bottom: 20px;
}

#phone-input {
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ced4da;
    border-radius: 5px;
    width: 200px;
}

#search-order-btn {
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#search-order-btn:hover {
    background-color: #0056b3;
}

#order-result {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#order-result .shipping-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

#order-result .shipping-link:hover {
    background-color: #218838;
}

/* สำหรับป้ายลดราคา */
.sale-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #e74c3c; /* สีแดงสดใส */
    color: white;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transform: rotate(5deg);
    text-transform: uppercase;
    animation: pulse 2s infinite; /* เพิ่ม animation ให้ป้ายกระพริบเบาๆ */
}

/* เพิ่ม keyframes สำหรับ animation */
@keyframes pulse {
    0% {
        transform: scale(1) rotate(5deg);
    }
    50% {
        transform: scale(1.05) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(5deg);
    }
}

/* สำหรับช่องข้อมูลการจัดส่ง (ภายใน summary) */
.customer-info-form {
    background-color: #ffffff; /* พื้นหลังสีขาว */
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 15px; /* เพิ่มระยะห่างด้านล่าง */
}

.customer-info-form h4 {
    margin-bottom: 15px;
    color: #333;
}

/* ปรับปรุงฟอร์มข้อมูลลูกค้าให้ดูดีขึ้น */
.customer-info-form label {
    display: block; /* ทำให้ label ขึ้นบรรทัดใหม่ */
    text-align: left; /* จัดข้อความชิดซ้าย */
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.customer-info-form .form-control {
    width: calc(100% - 20px); /* ทำให้ input กว้างขึ้นเล็กน้อย */
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

/* สำหรับปุ่มใน modal ขอบคุณ */
.contact-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.contact-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 250px;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.contact-buttons .btn img {
    margin-right: 8px;
}

.contact-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.contact-buttons .btn-primary {
    background-color: #1877F2; /* สีฟ้า Facebook */
    border: none;
}

.contact-buttons .btn-secondary {
    background-color: #06C755; /* สีเขียว Line */
    border: none;
}

/* สำหรับ Modal ขอบคุณ (confirmation-modal) */
#confirmation-modal {
    display: none; /* ซ่อน modal ไว้ตอนเริ่มต้น */
    position: fixed; /* ทำให้ modal อยู่บนหน้าจอเสมอเมื่อ scroll */
    z-index: 1001; /* กำหนดค่า z-index ให้สูงกว่า modal อื่นๆ */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* พื้นหลังทึบแสง */
    justify-content: center;
    align-items: center;
}

.confirmation-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    margin: auto;
    position: relative;
    animation: fadeIn 0.5s;
}

.confirmation-modal-content h3 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.confirmation-modal-content p {
    margin-bottom: 15px;
}

.contact-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.contact-buttons .btn {
    width: 250px;
    padding: 12px;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.contact-buttons .btn.facebook {
    background-color: #1877f2;
}

.contact-buttons .btn.facebook:hover {
    background-color: #166fe5;
}

.contact-buttons .btn.line {
    background-color: #06C755;
}

.contact-buttons .btn.line:hover {
    background-color: #05ae4a;
}

.contact-buttons .btn img {
    margin-right: 10px;
    width: 24px;
    height: 24px;
}