/* --- การตั้งค่าพื้นฐานและตัวแปรสี --- */
*, *::before, *::after {
    box-sizing: border-box;
}
/* --- การตั้งค่าพื้นฐานและตัวแปรสี --- */
:root {
    --primary-color: #6a0dad;      /* สีม่วงหลัก (เหมือนเดิม) */
    --secondary-color: #9370db;    /* สีม่วงรอง (เหมือนเดิม) */
    --accent-color: #FF8C00;       /* << เพิ่มสีส้มเข้ามา (DarkOrange) */
    --light-gray: #f4f4f4;
    --dark-gray: #333;
    --white: #ffffff;
    --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Sarabun', sans-serif; /* แนะนำให้ใช้ Google Font เพื่อความสวยงาม */
    margin: 0;
    line-height: 1.6;
    background-color: var(--light-gray);
    color: var(--dark-gray);
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
}

/* --- ส่วน Header และ Navigation --- */
.main-header {
    background: var(--white);
    box-shadow: var(--box-shadow);
    /* padding: 1rem 0;  <-- ลบบรรทัดนี้ออก */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0; /* <-- เพิ่ม padding ที่นี่แทน */
}

.logo img {
    height: 50px; /* ปรับขนาดโลโก้ตามต้องการ */
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: bold;
    transition: color 0.3s ease;
    white-space: nowrap;
    min-width: 110px;       /* << เพิ่มบรรทัดนี้: กำหนดความกว้างขั้นต่ำ */
    text-align: center;     /* << เพิ่มบรรทัดนี้: จัดข้อความให้อยู่กึ่งกลาง */
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-color); /* เปลี่ยนเป็นสีส้ม */
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 24px;
}


/* === Product Grid & Card Final Version === */

.section-title {
    text-align: center;
    margin: 50px 0 40px 0; /* ใช้ auto เพื่อจัดกึ่งกลาง */
    color: var(--dark-gray);
    font-size: 2.2rem; /* ทำให้ใหญ่ขึ้นเล็กน้อย */
    font-weight: 700;
    position: relative; /* สำคัญมากสำหรับสร้างเส้นขีด */
    padding-bottom: 20px; /* สร้างพื้นที่สำหรับเส้นขีด */
    display: inline-block; /* ทำให้ block กว้างเท่ากับข้อความ */
}
.section-title-wrapper {
    text-align: center; /* สั่งให้สิ่งที่อยู่ข้างในทั้งหมดอยู่กึ่งกลาง */
}
/* สร้างเส้นขีดสีส้มใต้หัวข้อ */
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px; /* ความยาวของเส้น */
    height: 4px;  /* ความหนาของเส้น */
    background-color: var(--accent-color); /* ใช้สีส้ม */
    border-radius: 2px;
}

/* 1. ใช้ CSS Grid สร้าง Layout ที่ยืดหยุ่นและจัดคอลัมน์อัตโนมัติ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    align-items: start;
}

/* 2. สไตล์ของการ์ดสินค้าใหม่ ให้เป็นการ์ดที่มีความสูงเท่ากันเสมอ */
.product-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex; /* << สำคัญ: ทำให้เป็นการ์ดแบบ Flex */
    flex-direction: column; /* << สำคัญ: จัดเรียงเนื้อหาจากบนลงล่าง */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow);
}
/* 3. ส่วนแสดงรูปภาพ (บังคับให้เป็นสี่เหลี่ยมจัตุรัส) */
.product-card-image {
    width: 100%;
    aspect-ratio: 1 / 1; /* บังคับให้กรอบเป็นสี่เหลี่ยมจัตุรัส */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: #f8f9fa;
}

.product-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* แสดงรูปภาพทั้งหมดไม่ให้โดนตัด */
}

/* 4. ส่วนเนื้อหาและปุ่ม */
.product-card-content {
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* << สำคัญมาก: ทำให้ส่วนเนื้อหานี้ยืดขยายจนเต็มพื้นที่ว่าง */
}

/* ชื่อสินค้า */
.product-card h3 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--dark-gray);
    flex-grow: 1; /* << สำคัญ: ทำให้ชื่อสินค้ายืดขยายและดันส่วนท้ายลงไป */
}

.product-card h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}


.product-card h3 a:hover {
    color: var(--primary-color);
}


.product-card-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
}



.btn-details {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--white) !important;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-details:hover {
    background-color: var(--accent-color);
}

/* --- หน้ารายละเอียดสินค้า --- */
.product-detail-container {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
}

/* 1. กำหนดให้ส่วนบนสุดเป็น Flex Container */
.product-top-section {
display: flex;
flex-wrap: wrap; /* ทำให้ปรับตามหน้าจอเล็กได้ */
gap: 40px;
align-items: flex-start;
padding-bottom: 40px;
border-bottom: 1px solid #eee;
margin-bottom: 40px;
}

/* 2. กำหนดขนาดของ "กล่องรูปภาพ" (ฝั่งซ้าย) */
.product-gallery {
flex: 1 1 45%; /* ให้มีความกว้างประมาณ 45% /
min-width: 300px; / ความกว้างขั้นต่ำ */
}

.main-image-container img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.thumbnail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.thumbnail {
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
}
.thumbnail.active,
.thumbnail:hover {
    opacity: 1;
    border-color: var(--primary-color);
}


.thumbnail-container img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnail-container img:hover, .thumbnail-container img.active {
    border-color: var(--primary-color);
}

/* 3. กำหนดขนาดของ "กล่องข้อมูล" (ฝั่งขวา) */
.product-info {
flex: 1 1 50%; /* ให้มีความกว้างประมาณ 50% และขยายได้ */
}


.product-info h1 {
    margin-top: 0;
    color: var(--primary-color);
}
/* คลาสใหม่ที่เพิ่มเข้ามา */
.product-title {
    font-size: 2.5rem;
    color: var(--dark-gray);
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.3;
}

.product-meta-price {
    /* เราจะลบ display: flex และคุณสมบัติที่เกี่ยวข้องออก */
    padding-top: 15px;
    border-top: 1px solid #eee;
    margin-top: 15px; /* เพิ่มระยะห่างจากชื่อสินค้า */
}

.product-category {
    font-size: 1rem;
    color: #555;
    margin: 0 0 10px 0;
}


.product-price {
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: bold;
    margin: 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* --- ฟอร์ม Login/Register --- */
.form-container {
    max-width: 450px;
    margin: 50px auto;
    padding: 30px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.form-container h2 {
    text-align: center;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    display: block; /* เพิ่ม display block */
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit; /* ให้ใช้ font เดียวกับเว็บ */
    font-size: 1rem; /* ปรับขนาด font */
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.btn-submit:hover {
    background-color: var(--secondary-color);
}

/* --- Footer Styles (2-Column Layout) --- */
.site-footer {
    position: relative; /* << สำคัญ: สำหรับสร้าง Overlay */
    padding: 60px 0 0 0;
    margin-top: 40px;
    font-size: 0.95rem;
    color: #adb5bd;
    background-image: url('../images/banners/footerban.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* สร้าง Parallax Effect */
}
/* สร้าง Overlay สีดำโปร่งแสงทับบนรูปภาพ */
.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(40, 40, 50, 0.9); /* << ปรับความเข้มของฟิลเตอร์ได้ที่นี่ */
    z-index: 1;
}
/* ทำให้เนื้อหาทั้งหมดลอยอยู่เหนือ Overlay */
.footer-main-content, .footer-bottom {
    position: relative;
    z-index: 2;
}
.footer-main-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
    align-items: flex-start;
}

/* === ส่วนซ้าย === */
.footer-left {
    flex: 2; /* ให้พื้นที่มากกว่าส่วนขวา */
    min-width: 300px;
}

.footer-logo {
    height: 60px; /* ขยายโลโก้ให้ใหญ่ขึ้น */
    margin-bottom: 20px;
    /* เทคนิคเปลี่ยนสีโลโก้เป็นสีขาวด้วย CSS */
    filter: brightness(0) invert(1);
}

.footer-description {
    line-height: 1.8;
    color: #ced4da;
    max-width: 500px; /* จำกัดความกว้างไม่ให้ยาวเกินไป */
}

/* === ส่วนขวา === */
.footer-right {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.site-footer h4 {
    color: var(--white);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.footer-contact p {
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
}

.site-footer a {
    color: #ced4da;
    text-decoration: none;
    transition: color 0.3s ease;
}
.site-footer a:hover {
    color: var(--accent-color);
}

.footer-contact p i {
    margin-right: 15px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 1.1rem;
    transition: background-color 0.3s, transform 0.3s;
}
.social-icon:hover {
    transform: translateY(-3px);
}
.social-icon.facebook:hover { background-color: #1877F2; }
.social-icon.line:hover { background-color: #06C755; }
.social-icon.youtube:hover { background-color: #FF0000; }

/* --- Footer Bottom Redesign --- */
.footer-bottom {
    background-color: var(--accent-color); /* << ใช้สีส้มแป๊ดๆ เป็นพื้นหลัง */
    padding: 20px 0;
    text-align: center;
    color: white; /* << เปลี่ยนสีตัวอักษรเป็นสีขาวเพื่อให้ตัดกับพื้นหลัง */
    font-size: 0.9em;
    font-weight: 500;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-contact, .footer-social {
    flex: 1;
    min-width: 250px;
}

.site-footer h4 {
    color: var(--white);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.site-footer a {
    color: var(--light-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--primary-color);
}

.footer-contact p {
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
}

.footer-contact p i {
    margin-right: 10px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 20px;
    transition: background-color 0.3s, transform 0.3s;
}

.social-icon:hover {
    transform: scale(1.1);
}

.social-icon.facebook:hover { background-color: #1877F2; }
.social-icon.line:hover { background-color: #06C755; }
.social-icon.youtube:hover { background-color: #FF0000; }



/* --- Contact Page Styles --- */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* แบ่ง 2 คอลัมน์ */
    gap: 40px;
    margin-top: 20px;
    align-items: flex-start;
}

.contact-info {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.contact-info h3 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    line-height: 1.7;
}

.contact-info p i {
    color: var(--primary-color);
    font-size: 1.2em;
    width: 30px;
    text-align: center;
    margin-right: 15px;
}

.contact-info a {
    text-decoration: none;
    color: var(--dark-gray);
}

.contact-info a:hover {
    color: var(--primary-color);
}
/* --- Contact Page Map Responsive Fix --- */
.contact-map iframe {
    width: 100%; /* << ทำให้แผนที่กว้างเต็มพื้นที่เสมอ */
    height: 450px; /* << กำหนดความสูงที่เหมาะสม */
    max-width: 100%;
}

/* 4. ปรับ Layout สำหรับหน้าจอขนาดเล็ก (มือถือ) */
@media (max-width: 768px) {
.product-top-section {
flex-direction: column; 
}
.product-gallery {
width: 100%; 
margin-bottom: 20px; 
}
.product-info {
width: 100%; / 
}
.product-info > * { 
text-align: left;
}
}
/* --- Welcome User Style --- */
.welcome-user {
    color: var(--primary-color);
    font-weight: bold;
    display: flex; /* จัดไอคอนกับข้อความให้อยู่ในแนวเดียวกัน */
    align-items: center;
}

.welcome-user i {
    margin-right: 8px; /* ระยะห่างระหว่างไอคอนกับข้อความ */
    font-size: 1.2rem; /* ปรับขนาดไอคอนให้ใหญ่ขึ้นเล็กน้อย */
}
/* --- Password Toggle Icon Styles --- */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    /* เพิ่ม padding ด้านขวาเพื่อให้ที่สำหรับไอคอน */
    padding-right: 40px; 
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
}
/* --- Floating Action Button (FAB) Styles --- */
.fab-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    cursor: pointer;
}

.fab-trigger {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.fab-trigger i {
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.fab-options {
    position: absolute;
    bottom: 75px; /* ระยะห่างจากปุ่มหลัก */
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transform-origin: bottom center;
    transform: scale(0); /* ซ่อนไว้ตอนแรก */
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.fab-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #555;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s, transform 0.2s;
}

.fab-option:hover {
    transform: scale(1.1);
}

/* ตั้งสีเฉพาะสำหรับแต่ละปุ่ม */
.fab-option[title="Line"] { background-color: #06C755; }
.fab-option[title="Facebook"] { background-color: #1877F2; }
.fab-option[title="Email"] { background-color: #EA4335; }
.fab-option[title="โทร"] { background-color: #FF8C00; }


/* --- การทำงานเมื่อกดปุ่ม (ใช้ JavaScript สลับคลาส) --- */
.fab-container.active .fab-trigger {
    transform: rotate(360deg);
}

.fab-container.active .fab-trigger i {
    transform: rotate(-360deg);
}

.fab-container.active .fab-options {
    transform: scale(1);
    opacity: 1;
}
/* ============================================= */
/* ===  FAB Animation & Text Label Styles  === */
/* ============================================= */

/* 1. Keyframes สำหรับสร้างเอฟเฟกต์แสงที่กระเพื่อมออกไป */
@keyframes pulse-effect {
    0% {
      box-shadow: 0 0 0 0 rgba(106, 13, 173, 0.7);
    }
    70% {
      box-shadow: 0 0 0 20px rgba(106, 13, 173, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(106, 13, 173, 0);
    }
  }
  
  /* 2. Keyframes สำหรับทำให้ข้อความปรากฏและหายไป */
  @keyframes show-hide-label {
    0% {
      transform: translateY(-50%) scale(0.8);
      opacity: 0;
    }
    25%, 75% { /* ให้แสดงค้างไว้ช่วงหนึ่ง */
      transform: translateY(-50%) scale(1);
      opacity: 1;
    }
    100% {
      transform: translateY(-50%) scale(0.8);
      opacity: 0;
    }
  }
  
  /* 3. แก้ไขปุ่มหลักให้เรียกใช้ animation แสงกระเพื่อม */
  .fab-trigger {
    /* เพิ่มบรรทัดนี้เข้าไปใน .fab-trigger ที่มีอยู่แล้ว หรือจะใช้ตัวนี้ทับก็ได้ */
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    animation: pulse-effect 2.5s infinite; /* << เรียกใช้ animation */
  }
  
  
  /* 4. สร้างข้อความ "ติดต่อเรา" ด้วย Pseudo-element */
  .fab-container::after {
    content: 'ติดต่อเรา'; /* ข้อความที่ต้องการแสดง */
    position: absolute;
    left: 80px; /* ระยะห่างจากปุ่มหลัก */
    top: 50%;
    
    /* สไตล์ของกล่องข้อความ */
    background-color: white;
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    white-space: nowrap; /* ป้องกันไม่ให้ข้อความตกบรรทัด */
  
    /* ทำให้ซ่อนไว้ตอนแรก และเรียกใช้ animation */
    opacity: 0;
    pointer-events: none; /* ทำให้คลิกทะลุไปได้ */
    animation: show-hide-label 5s infinite;
    animation-delay: 1s; /* ให้เริ่มทำงานหลังจากโหลดหน้า 1 วินาที */
  }
/* --- Navigation Buttons Styles (Updated) --- */
/* ปุ่มเข้าสู่ระบบ (ดีไซน์ใหม่) */
.nav-login-btn {
    font-weight: bold;
    padding: 8px 18px;
    border: 2px solid var(--primary-color); /* << เพิ่มเส้นขอบสีม่วง */
    color: var(--primary-color) !important; /* << ตัวอักษรสีม่วง */
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-login-btn:hover {
    background-color: var(--primary-color); /* << พื้นหลังเปลี่ยนเป็นสีม่วงเมื่อชี้ */
    color: white !important; /* << ตัวอักษรเปลี่ยนเป็นสีขาวเมื่อชี้ */
}

/* ปุ่มสมัครสมาชิก และ ปุ่มขอใบเสนอราคา (ใช้สไตล์เดียวกัน) */
.btn-register {
    background-color: var(--accent-color); /* ใช้สีส้ม */
    color: white !important;
    padding: 10px 20px; /* ขยายปุ่มเล็กน้อย */
    border-radius: 25px;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    border: 2px solid transparent; /* เพิ่มเพื่อให้ขนาดเท่ากัน */
}

.btn-register i {
    margin-right: 8px;
}

.btn-register:hover {
    background-color: #e07b00; /* สีส้มเข้มขึ้น */
    transform: translateY(-2px);
    color: white !important;
}
/* --- Search Form Style (ฉบับปรับปรุง) --- */
.search-form {
    display: flex;
    align-items: center; /* จัดให้ input กับ button สูงเท่ากัน */
    border: 1px solid #ddd;
    border-radius: 25px;
    overflow: hidden;
    background-color: white;
}

.search-form input[type="search"] {
    border: none;
    padding: 8px 20px;
    width: 250px; /* << ปรับความยาวได้ที่นี่ */
    font-size: 0.95rem;
    outline: none;
    color: #555;
    background: transparent; /* ทำให้พื้นหลังโปร่งใส */
}

.search-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: transparent;
    color: var(--primary-color);
    padding: 0 18px;
    cursor: pointer;
    transition: color 0.2s;
    font-size: 1rem; /* ปรับขนาดไอคอนแว่นขยาย */
}

.search-form button:hover {
    color: var(--accent-color);
    background-color: transparent;
}
/* --- Top Bar Styles --- */
.top-bar {
    background-color: #f8f9fa; /* สีเทาอ่อน */
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.top-bar .container {
    display: flex;
    justify-content: flex-end; /* จัดให้ช่องค้นหาอยู่ด้านขวา */
}
/* 2. สไตล์ของปุ่มเปลี่ยนภาษา (ธงชาติ) */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
}


.lang-switcher a {
    display: block;
    line-height: 0; /* ทำให้ไม่มีช่องว่างแปลกๆ */
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.6; /* ทำให้ธงที่ไม่ใช่ภาษาปัจจุบันดูจางลง */
}
.lang-switcher a img {
    height: 24px; /* ขนาดความสูงของธง */
    width: auto;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}


.lang-switcher a:hover {
    color: var(--primary-color);
}


.lang-switcher a.active {
    opacity: 1; /* ทำให้ธงของภาษาปัจจุบันชัดเจน */
    transform: scale(1.15); /* ขยายใหญ่ขึ้นเล็กน้อย */
}

.lang-switcher span {
    color: #ddd;
}
.lang-switcher a:not(.active):hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ปรับ layout ของ top-bar ใหม่ */

/* 1. แก้ไข Top Bar ให้รองรับ Layout ใหม่ */
.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 25px; /* ระยะห่างระหว่างโลโก้กับธง */
}
.top-bar .logo img {
    height: 50px;
    display: block; /* แก้ปัญหาช่องว่างใต้ภาพ */
}
.top-bar-right {
    display: flex;
    align-items: center;
}

/* --- Sidebar Menu Styles --- */
#sidebar-trigger.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
}
/* Keyframes สำหรับทำให้ข้อความกระพริบ */
@keyframes blinking-popup {
    0%, 100%, 50% {
      opacity: 0;
      transform: translateY(-50%) scale(0.8);
    }
    5%, 45% {
      opacity: 1;
      transform: translateY(-50%) scale(1);
    }
  }

/* ปุ่ม Trigger (3 ขีด) */
#sidebar-trigger {
    position: fixed;
    top: 90px;
    left: 20px;
    z-index: 1031;
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex; /* เพิ่มเข้ามาเพื่อจัดไอคอนให้อยู่กลาง */
    justify-content: center; /* เพิ่มเข้ามา */
    align-items: center; /* เพิ่มเข้ามา */
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease-in-out;
}

/* ข้อความ Pop-up "ประเภทสินค้า" */
.trigger-popup-text {
    position: absolute;
    left: 65px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: blinking-popup 5s infinite 1.5s;
    pointer-events: none;
    opacity: 0;
}

/* เพิ่มลูกเล่นตอนเอาเมาส์ไปชี้ */
#sidebar-trigger:hover {
    background-color: var(--accent-color);
    transform: scale(1.1) rotate(15deg);
}

/* แถบเมนูด้านข้าง */
.category-sidebar {
    position: fixed;
    top: 0;
    left: -320px; /* ซ่อนไว้ด้านซ้ายตอนแรก */
    width: 300px;
    height: 100%;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1030;
    transition: left 0.3s ease-in-out;
    padding: 20px;
    overflow-y: auto; /* ทำให้เลื่อนขึ้นลงได้ถ้าเนื้อหายาว */
}
/* คลาส .open จะถูกเพิ่มด้วย JavaScript เพื่อให้ Sidebar แสดงผล */
.category-sidebar.open {
    left: 0;
}

.category-sidebar h3 {
    margin-top: 30px;
    color: var(--primary-color);
}
.category-sidebar hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* ปุ่มปิด (X) */
.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 36px;
    color: #aaa;
    text-decoration: none;
}
.close-btn:hover {
    color: #333;
}

/* รายการประเภทสินค้า */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-list li {
    padding: 12px 5px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s, color 0.2s;
    font-weight: bold;
}
.category-list li:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}
.category-list li.active {
    background-color: var(--primary-color);
    color: white;
}

/* รายการสินค้าที่ดึงมาแสดง */
#product-list-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#product-list-container a {
    display: block;
    padding: 10px 5px;
    text-decoration: none;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}
#product-list-container a:hover {
    background-color: #f8f9fa;
}

/* พื้นหลัง Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1020;
    display: none; /* ซ่อนไว้ตอนแรก */
}
/* Style for dynamic product list header in sidebar */
#product-list-container h4 {
    color: var(--accent-color); /* สีส้ม */
    font-size: 1.1rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    margin-top: 0;
    margin-bottom: 10px;
}
.no-products {
    color: #999;
    font-style: italic;
}
/* --- Styles for Product Detail Page Enhancements --- */

/* ทำให้รูปภาพที่ซูมได้มี cursor เป็นรูปแว่นขยาย */
/* --- Styles for Product Detail Page Enhancements --- */

/* ทำให้รูปภาพที่ซูมได้มี cursor เป็นรูปแว่นขยาย */
.zoomable-image {
    cursor: zoom-in;
}

/* Modal (Lightbox) สำหรับซูมภาพ */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    animation-name: zoom;
    animation-duration: 0.4s;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

/* ส่วนของ Technical Parameter Table */
.product-specs-section {
    margin-top: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
}
.tech-specs-table-container table {
    width: 100%;
    border-collapse: collapse;
}
.tech-specs-table-container th,
.tech-specs-table-container td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
.tech-specs-table-container tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ส่วนของ Image Gallery ด้านล่าง */
.image-gallery-section {
    margin-top: 40px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.gallery-item img:hover {
    transform: scale(1.05);
}

.rating-group .stars label {
    color: #ddd;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}
/* --- Review Section Styles (Complete & Fixed) --- */
.reviews-section {
    margin-top: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
}
#review-form-container {
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* Star Rating Input Fix */
.rating-group .stars {
    display: flex; /* ใช้ flexbox */
    flex-direction: row-reverse; /* เรียงจากขวาไปซ้ายในโค้ด */
    justify-content: flex-end; /* จัดชิดขวา */
}
.rating-group input[type="radio"] {
    display: none;
}
.rating-group .stars label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}
.rating-group .stars label::before {
    content: '\f005';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.rating-group .stars label:hover,
.rating-group .stars label:hover ~ label {
    color: #ffc107;
}
.rating-group input[type="radio"]:checked ~ label {
    color: #ffc107;
}

/* Review List Layout */
.review-list { 
    margin-top: 20px; 
}
.review-item {
    display: flex;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}
.review-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
    background-color: #f0f0f0;
}
.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.review-content {
    flex-grow: 1;
}
.review-rating {
    margin-bottom: 8px;
}
.review-rating .fa-star { 
    color: #ddd; 
}
.review-rating .fa-star.filled { 
    color: #ffc107; 
}
.review-meta {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 10px;
}
.review-meta .review-date {
    color: #888;
    margin-left: 10px;
}
.review-comment {
    margin: 0;
    line-height: 1.6;
}
.product-long-description-section {
    margin-top: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
}
.product-long-description-section .content-box {
    line-height: 1.8;
    color: #555;
}
/* --- Header Layout Fix for Sidebar Trigger --- */

/* ปรับแก้ container หลักเพื่อให้เว้นที่ว่างด้านซ้าย 
  สำหรับปุ่ม 3 ขีดที่ลอยอยู่ 
*/
.main-header .container {
    position: relative;
    padding-left: 80px; /* เพิ่มระยะห่างด้านซ้าย 80px */
}

/* ปรับตำแหน่งของปุ่ม Hamburger (สำหรับมือถือ) 
  ไม่ให้ถูกดันออกไปนอกจอ 
*/
.main-nav .hamburger {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}
/* --- About Us Page Styles --- */
.about-header-banner {
    padding: 60px 20px;
    text-align: center;
    color: white;
    /* แก้ไขที่อยู่ไฟล์ให้ถูกต้อง และใส่ชื่อไฟล์ของคุณ
       เราจะใช้ ../images/ เพื่อถอยออกจากโฟลเดอร์ css ก่อน
    */
    background-image: linear-gradient(rgba(49, 49, 49, 0.85), rgba(243, 243, 243, 0.85)), url('../images/555.jpg');
    background-size: cover;
    background-position: center;
    margin-bottom: 50px;
}

.about-header-banner h1 {
    font-size: 2.5rem;
}
.about-page-content {
    max-width: 1000px;
}
.about-section {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 50px;
}
.about-section.reverse {
    flex-direction: row-reverse;
}
.about-text {
    flex: 1;
}
.about-image {
    flex: 1;
}
.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.about-text h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}
.about-text p, .about-text ul {
    line-height: 1.8;
    color: #555;
}
/* --- News Page Styles --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}
.news-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.news-card-image-link img {
    width: 100%;
    height: 180px; /* << ปรับความสูงตรงนี้ */
    object-fit: cover;
    transition: transform 0.3s;
}
.news-card-image-link:hover img {
    transform: scale(1.05);
}
.news-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.news-card-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
}
.news-card-title {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}
.news-card-title a {
    text-decoration: none;
    color: var(--dark-gray);
}
.news-card-title a:hover {
    color: var(--primary-color);
}
.news-card-excerpt {
    color: #555;
    flex-grow: 1; /* ดันปุ่มไปล่างสุด */
    margin-bottom: 20px;
}
/* --- News Detail Page --- */
.news-detail-page { max-width: 800px; margin: auto; }
.news-detail-title { font-size: 2.5rem; color: var(--primary-color); }
.news-detail-meta { color: #888; margin-bottom: 20px; }
.news-detail-image { width: 100%; border-radius: 8px; margin-bottom: 30px; }
.news-detail-content { line-height: 1.8; font-size: 1.1rem; }
.related-news-section { margin-top: 50px; }

/* --- Zoom Icon for News Detail Image --- */
.image-zoom-wrapper {
    position: relative;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    aspect-ratio: 1 / 1; /* ทำให้กรอบเป็นสี่เหลี่ยมจัตุรัส */
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-zoom-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* แสดงรูปภาพทั้งหมดไม่ให้ถูกตัด */
    border-radius: 8px;
}

.image-zoom-wrapper .news-detail-image {
    width: 100%;
    border-radius: 8px;
    display: block; /* แก้ปัญหาช่องว่างใต้รูป */
}
/* ใช้ .zoom-overlay ที่มีอยู่แล้ว แต่ปรับให้ใช้กับ wrapper นี้ด้วย */
.image-zoom-wrapper:hover .zoom-overlay {
    opacity: 1;
}
/* --- Video Section Styles --- */
.main-video-section, .product-video-section {
    margin-top: 50px;
}
.video-responsive {
    overflow: hidden;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
    height: 0;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}
.video-responsive iframe {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    position: absolute;
}
/* --- YouTube Subscribe Button Wrapper --- */
.youtube-subscribe-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}
/* --- Video Wrapper for Sizing Control --- */
.video-wrapper {
    max-width: 800px; /* กำหนดความกว้างสูงสุดของวิดีโอ */
    margin: 0 auto;   /* จัดให้อยู่ตรงกลาง */
}
/* --- Banner Slider Styles (Safe Zone Version) --- */
.banner-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f0f0f0; /* สีพื้นหลังเผื่อไว้ */
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.slide {
    min-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    height: 550px; /* ความสูงสำหรับจอคอม (ปรับได้) */
    background-size: cover; /* << สำคัญ: ทำให้ภาพเต็มกรอบ */
    background-position: center center; /* << สำคัญ: จัดให้อยู่กลางเสมอ */
    background-repeat: no-repeat;
}
.slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}
.slider-btn.prev {
    left: 15px;
}
.slider-btn.next {
    right: 15px;
}

/* ลิงก์ที่ครอบทั้งสไลด์ */
.slide-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- ปุ่มและจุดเหมือนเดิม --- */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    cursor: pointer;
    padding: 15px;
    font-size: 20px;
    z-index: 10;
    border-radius: 5px;
    transition: background-color 0.3s;
}
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

/* --- ทำให้รองรับจอมือถือ --- */
@media (max-width: 1024px) {
    .slide {
        height: 450px;
    }
}
@media (max-width: 768px) {
    .slide {
        height: 350px;
    }
}
@media (max-width: 480px) {
    .slide {
        height: 250px;
    }
}

    .slide img {
        object-fit: cover; /* ทำให้ภาพเต็มกรอบในจอมือถือ */
    }

    .dot {
        width: 12px;
        height: 12px;
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        cursor: pointer;
        transition: background-color 0.3s;
    }
    .dot.active, .dot:hover {
        background-color: white;
    }
/* --- Call to Action (CTA) Banner Styles --- */

/* --- Call to Action (CTA) Banner Styles (Updated) --- */
.cta-banner {
    padding: 80px 20px;
    margin: 60px 0;
    text-align: center;
    color: white;
    background-image: url('../images/banners/informationban.jpg'); /* << ลบ linear-gradient ออก */
    background-size: cover;
    background-position: center;
    background-attachment: scroll; /* << เปลี่ยนจาก fixed เป็น scroll */
}

.cta-banner h2 {
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 15px;
    /* เพิ่มเงาให้ตัวอักษรเพื่อให้อ่านง่ายขึ้นบนพื้นหลังที่สว่าง */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6); 
}

.cta-banner p {
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6); /* เพิ่มเงาให้ตัวอักษร */
}

.cta-banner .cta-button {
    background-color: var(--accent-color); /* สีส้ม */
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cta-banner .cta-button:hover {
    background-color: #e07b00; /* สีส้มเข้มขึ้น */
    transform: translateY(-3px);
}
/* ทำให้ CTA Banner รองรับจอมือถือ */
@media (max-width: 768px) {
    .cta-banner {
        /* เปลี่ยนเป็น scroll บนมือถือเพื่อแก้ปัญหาภาพไม่ขึ้น */
        background-attachment: scroll;
    }
}
/* --- Custom Chat Widget Styles --- */
@keyframes pulse-orange-chat {
    0% { box-shadow: 0 0 0 0 rgba(255, 140, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 140, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 140, 0, 0); }
  }
  
  #chat-widget-container {
      position: fixed;
      bottom: 30px;
      right: 30px;
      z-index: 1000;
  }
  
  .chat-trigger {
      width: 60px;
      height: 60px;
      background-color: var(--accent-color);
      color: white;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 28px;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      animation: pulse-orange-chat 2s infinite;
      transition: transform 0.3s;
  }
  .chat-trigger:hover {
      transform: scale(1.1);
  }
  
  .chat-window {
      position: absolute;
      bottom: 80px;
      right: 0;
      width: 400px;
      max-width: 90vw;
      height: 600px;
      max-height: 85vh;
      background-color: white;
      border-radius: 15px;
      box-shadow: 0 5px 20px rgba(0,0,0,0.2);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      /* ซ่อนไว้ตอนแรก */
      opacity: 0;
      visibility: hidden;
      transform: translateY(20px);
      transition: all 0.3s ease;
  }
  
  .chat-window.open {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
  }
  
  .chat-header {
      background: var(--primary-color);
      color: white;
      padding: 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
  }
  .chat-header h3 { margin: 0; font-size: 1.1rem; }
  #chat-close-btn {
      background: none;
      border: none;
      color: white;
      font-size: 24px;
      cursor: pointer;
  }
  
  .chat-body {
      flex-grow: 1;
      padding: 15px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
  }
  .chat-message {
      padding: 8px 12px;
      border-radius: 18px;
      margin-bottom: 10px;
      max-width: 80%;
      line-height: 1.4;
  }
  .chat-message.user {
    background-color: var(--primary-color); /* เปลี่ยนเป็นสีหลักเพื่อให้เด่น */
    color: white;
    align-self: flex-end; /* << แก้ไข: จัดชิดขวา */
    border-bottom-right-radius: 4px; /* ทำให้มุมล่างขวาเป็นเหลี่ยม */
}
.chat-message.admin {
    background-color: #e9e9eb;
    color: #000;
    align-self: flex-start; /* << แก้ไข: จัดชิดซ้าย */
    border-bottom-left-radius: 4px; /* ทำให้มุมล่างซ้ายเป็นเหลี่ยม */
}
  
  .chat-footer {
      padding: 10px;
      border-top: 1px solid #eee;
  }
  #chat-form {
      display: flex;
      gap: 10px;
  }
  #chat-message-input {
      flex-grow: 1;
      border: 1px solid #ddd;
      border-radius: 20px;
      padding: 10px 15px;
      outline: none;
  }
  #chat-form button {
      background: var(--primary-color);
      border: none;
      color: white;
      border-radius: 50%;
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      cursor: pointer;
  }
  /* --- Chat Attachment Styles --- */
.chat-attachment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    cursor: pointer;
    color: #888;
    font-size: 18px;
}
.attachment-preview {
    font-size: 0.85rem;
    padding: 5px 10px;
    color: #555;
    display: none; /* ซ่อนไว้ตอนแรก */
}
.attachment-preview span {
    background-color: #f0f0f0;
    padding: 3px 8px;
    border-radius: 12px;
}
.attachment-preview button {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
    margin-left: 5px;
}
/* --- Lightbox Close Button Fix --- */
.lightbox-close {
    color: #ffffff; /* เปลี่ยนเป็นสีขาวชัดเจน */
    opacity: 0.9;
    z-index: 2010; /* เพิ่ม z-index ให้สูงกว่ารูปภาพ */
    text-shadow: 0 0 5px black; /* เพิ่มเงาให้เห็นชัดขึ้น */
}
.lightbox-close:hover {
    opacity: 1;
}
/* --- Chat Attachment Image Style --- */
.chat-attachment-image {
    max-width: 100%;      /* ทำให้รูปภาพไม่ล้นกรอบข้อความ */
    max-height: 200px;    /* จำกัดความสูงสูงสุดของรูปภาพ */
    border-radius: 10px;
    margin-top: 5px;
    display: block;
}
/* === Header Responsive Fix for Mobile === */

@media (max-width: 768px) {

    /* 1. จัดเรียง Top Bar ใหม่ในแนวตั้ง */
    .top-bar .container {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        gap: 15px;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    /* 2. จัดกลุ่ม โลโก้ และ ภาษา ให้อยู่ด้วยกัน */
    .top-bar-left {
        justify-content: space-between;
        width: 100%;
    }

    /* 3. ทำให้ช่องค้นหายืดเต็มความกว้าง */
    .search-form {
        width: 100%;
    }
    .search-form input[type="search"] {
        width: 100%;
    }

    /* 4. ปรับตำแหน่งปุ่ม Sidebar ไม่ให้เกยกับเนื้อหา */
    #sidebar-trigger {
        top: 20px;
    }

    /* 5. (สำคัญ) แก้ไข container หลักของ Header ให้เว้นที่ว่างสำหรับปุ่ม 3 ขีด */
    .main-header .container {
        padding-left: 80px; /* << จุดที่แก้ไข */
    }
}
/* --- Login/Register Form Logo --- */
.form-logo {
    display: block;
    max-width: 150px;
    margin: 0 auto 25px auto; /* จัดกึ่งกลางและเว้นระยะห่างด้านล่าง */
}
/* --- Product Badge Styles --- */
.product-card-image {
    width: 100%;
    aspect-ratio: 1 / 1; /* บังคับให้กรอบเป็นสี่เหลี่ยมจัตุรัส */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: var(--white); /* เปลี่ยนพื้นหลังเป็นสีขาวเพื่อให้ดูสะอาดตา */
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 5;
    color: white;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-badge.bestseller {
    background-color: var(--accent-color); /* สีส้ม */
}
.product-badge.new-arrival {
    background-color: #0d6efd; /* สีน้ำเงิน */
}
/* --- Breadcrumb Styles --- */
/* === Breadcrumbs Redesign === */
.breadcrumbs-wrapper {
    padding: 15px 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumbs .container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumbs li a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumbs li a:hover {
    text-decoration: underline;
}

/* สไตล์สำหรับตัวคั่น ( > ) */
.breadcrumbs li + li::before {
    content: '>';
    margin-right: 8px;
    color: #6c757d;
}

.breadcrumbs li .active {
    color: #6c757d;
    font-weight: bold;
}
/* --- Wishlist Button Styles --- */
.wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 6;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #eee;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.wishlist-btn i {
    color: #ddd;
    font-size: 18px;
    transition: all 0.3s ease;
}

.wishlist-btn:hover {
    background-color: white;
    transform: scale(1.1);
}

.wishlist-btn.active i {
    color: #ff4d4d; /* สีแดงสำหรับหัวใจที่ถูกกด */
}
/* --- User Profile Page Styles --- */
.profile-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}
.profile-sidebar {
    flex: 1 1 250px;
    background: #fff;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
}
.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid #f0e6ff;
}
.profile-sidebar h3 { margin-bottom: 5px; }
.profile-sidebar p { color: #888; margin-top: 0; }
.profile-sidebar .btn-details {
    margin-top: 20px;
    display: inline-block;
    width: auto;
}
.profile-main {
    flex: 2 1 500px;
}
.profile-main .form-container {
    margin: 0;
    width: 100%;
    max-width: 100%;
}
/* --- Pagination Styles --- */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    color: var(--primary-color);
    padding: 10px 18px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    font-weight: 500;
}

.pagination a:hover {
    background-color: #f0e6ff;
    border-color: #c5a8e8;
}

.pagination .active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    cursor: default;
}

.pagination .disabled {
    color: #ccc;
    background-color: #f8f9fa;
    border-color: #eee;
    cursor: not-allowed;
}
/* --- Page Header Banner Styles --- */
.page-header-banner {
    padding: 60px 20px;
    background-size: cover;
    background-position: center;
    text-align: center;
    color: white;
}

/* --- รูปภาพพื้นหลังสำหรับหน้า "สินค้าทั้งหมด" --- */
.products-banner {
    background-image: linear-gradient(rgba(40, 40, 60, 0.7), rgba(40, 40, 60, 0.7)), url('../images/banners/productban.jpg');
}

/* --- รูปภาพพื้นหลังสำหรับหน้า "ติดต่อเรา" --- */
.contact-banner {
    background-image: linear-gradient(rgba(40, 40, 60, 0.7), rgba(40, 40, 60, 0.7)), url('../images/banners/contactban.jpg');
}
.news-banner {
    background-image: linear-gradient(rgba(40, 40, 60, 0.7), rgba(40, 40, 60, 0.7)), url('../images/banners/newsban.jpg');
}

.page-header-banner h1 {
    font-size: 2.8rem;
    margin: 0 0 15px 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

/* ปรับสี Breadcrumbs ในหน้านี้ให้เป็นสีขาว */
.page-header-banner .breadcrumbs li,
.page-header-banner .breadcrumbs li a,
.page-header-banner .breadcrumbs li + li::before {
    color: rgba(255, 255, 255, 0.8);
}
.page-header-banner .breadcrumbs li a:hover {
    color: var(--white);
}
.page-header-banner .breadcrumbs li .active {
    color: var(--white);
    font-weight: bold;
}
/* --- Homepage Section Header Banners --- */
.section-header-banner {
    padding: 60px 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
.section-header-banner .section-title {
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.section-header-banner .section-title::after {
    background-color: var(--white);
}

/* กำหนดรูปภาพสำหรับ "สินค้ามาใหม่" */
.new-arrivals-banner {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/banners/newban.jpg');
}

/* กำหนดรูปภาพสำหรับ "สินค้าขายดี" */
.best-sellers-banner {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/banners/bestban.jpg');
}

/* สำหรับมือถือ ให้ยกเลิก effect fixed */
@media (max-width: 768px) {
    .section-header-banner {
        background-attachment: scroll;
    }
}
/* --- Review Reply Styles --- */
.review-actions { margin-top: 10px; }
.btn-reply {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9em;
}
.reply-form-container { margin-top: 15px; }
.reply-form { display: flex; gap: 10px; }
.reply-form textarea { flex-grow: 1; border-radius: 5px; padding: 8px; border: 1px solid #ddd; }
.reply-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 5px;
    cursor: pointer;
}
.review-replies-container { margin-top: 20px; margin-left: 50px; border-left: 3px solid #f0f0f0; padding-left: 20px; }

.reply-item {
    display: flex;
    align-items: flex-start;
    margin-top: 15px;
}
.admin-badge {
    background-color: var(--accent-color);
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}
/* --- Impersonation Bar Styles --- */
.impersonation-bar {
    background-color: #ffc107; /* สีเหลือง */
    color: #333;
    padding: 10px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 2000; /* ทำให้แสดงอยู่บนสุดเสมอ */
}
.impersonation-bar .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.impersonation-bar p {
    margin: 0;
    font-weight: 500;
}
.impersonation-bar i {
    margin-right: 8px;
}
.impersonation-bar a {
    background-color: var(--dark-gray);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
}
.impersonation-bar a:hover {
    background-color: #000;
}

/* ทำให้ Header หลักเลื่อนลงมาข้างล่างเมื่อมี Impersonation Bar */
body.impersonating .main-header {
    top: 40px; /* ความสูงของ Impersonation Bar */
}
.view-only-bar {
    background-color: #0d6efd;
    color: white;
    padding: 10px 0;
    text-align: center;
}
.view-only-bar .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.view-only-bar p { margin: 0; }
.view-only-bar a { color: white; font-weight: bold; }
/* --- Product Detail Page Redesign Additions --- */
.product-contact-box {
    background-color: #f0e6ff; /* สีม่วงอ่อน */
    border-left: 5px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 25px 30px; /* เพิ่ม padding */
    margin-top: 25px;
}
.product-contact-box h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.3rem; /* ขยายขนาดหัวข้อ */
}
.product-contact-box p {
    margin: 0 0 10px 0;
    font-weight: 500;
}
.contact-link {
    display: flex; /* ทำให้ไอคอนกับข้อความอยู่แนวเดียวกัน */
    align-items: center; /* จัดกึ่งกลางแนวตั้ง */
    font-size: 1.3rem; /* << ขยายขนาดตัวอักษรให้ใหญ่ขึ้น */
    font-weight: bold;
    color: var(--dark-gray);
    text-decoration: none;
    margin-bottom: 12px; /* เพิ่มระยะห่างระหว่างบรรทัด */
    transition: color 0.2s;
}
.contact-link:last-child {
    margin-bottom: 0; /* ไม่ต้องมีระยะห่างที่บรรทัดสุดท้าย */
}
.contact-link:hover {
    color: var(--primary-color);
}
.contact-link.line {
    color: #06C755;
}
.contact-link.line:hover {
    color: #05a546;
}
.contact-link i {
    font-size: 1.2rem; /* ขนาดไอคอน */
    margin-right: 12px; /* ระยะห่างระหว่างไอคอนกับข้อความ */
}

.related-products-section {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 1px solid var(--border-color);
}
/* --- "Why Us" Section on About Page --- */
.why-us-section {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 1px solid var(--border-color);
}
.why-us-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    text-align: center;
}
.why-us-item {
    background: #fff;
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}
.why-us-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.why-us-item h4 {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin-bottom: 10px;
}
/* --- Sidebar Submenu Styles --- */
.category-list li {
    padding: 0; /* นำ padding เดิมออก */
    border-bottom: 1px solid #f0f0f0;
}
.category-main-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5px;
}
.category-main-item a {
    text-decoration: none;
    color: inherit;
    flex-grow: 1;
}
.submenu-toggle {
    padding: 5px 10px;
    cursor: pointer;
    transition: transform 0.3s;
}
.submenu-toggle.open {
    transform: rotate(180deg);
}
.submenu {
    list-style: none;
    padding-left: 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}
.submenu li a {
    display: block;
    padding: 10px 5px;
    color: #555;
    text-decoration: none;
}
.submenu li a:hover {
    color: var(--primary-color);
}
/* --- Header Video Styles --- */
.header-video-container {
    width: 100%;
    height: 60vh; /* ความสูงของวิดีโอ (60% ของความสูงหน้าจอ) */
    overflow: hidden;
    position: relative;
    background-color: #000;
}
.header-video-container video,
.header-video-container .video-responsive {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover; /* ทำให้วิดีโอเต็มกรอบ */
}
.header-video-container .video-responsive iframe {
    height: 100%;
    width: 100%;
}
/* --- Video Gallery Page Styles --- */
.video-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}
.video-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}
.video-card:hover {
    transform: translateY(-5px);
}
.video-thumbnail {
    position: relative;
}
.video-thumbnail img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.video-thumbnail .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    transition: transform 0.2s, background-color 0.2s;
}
.video-thumbnail a:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: var(--primary-color);
}
.video-info {
    padding: 20px;
}
.video-info h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    min-height: 45px;
}
.btn-details-small {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
}
.btn-details-small:hover {
    background-color: #e07b00;
}

/* --- Video Lightbox Styles --- */
.lightbox-content-video {
    position: relative;
    margin: auto;
    width: 90%;
    max-width: 900px;
}
#video-player-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
}
#video-player-container iframe,
#video-player-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
/* --- Video Page Header Banner Title Color --- */
.videos-banner h1 {
    color: var(--accent-color); /* << ใช้สีส้ม */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4); /* เพิ่มเงาเล็กน้อยให้อ่านง่าย */
}

/* ทำให้เส้นใต้หัวข้อเป็นสีส้มด้วย (ถ้ามี) */
.videos-banner .section-title::after {
    background-color: var(--accent-color);
}
/* --- Quote Page Header Banner --- */
.quote-banner {
    background-image: linear-gradient(rgba(40, 40, 60, 0.7), rgba(40, 40, 60, 0.7)), url('../images/banners/paperban.jpg');
}
/* --- Videos Page Header Banner --- */
.videos-banner {
    background-image: linear-gradient(rgba(40, 40, 60, 0.7), rgba(40, 40, 60, 0.7)), url('../images/banners/videobanner.jpg');
}
/* --- Product Compare Styles --- */
.compare-action { margin-top: 10px; text-align: center; }
.compare-action label { cursor: pointer; }

/* Comparison Tray */
.compare-tray {
    position: fixed;
    bottom: -150px; /* ซ่อนไว้ข้างล่าง */
    left: 0;
    width: 100%;
    background: #333;
    color: white;
    z-index: 1010;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.2);
    transition: bottom 0.4s ease-in-out;
}
.compare-tray.show {
    bottom: 0; /* แสดงเมื่อมีสินค้า */
}
.compare-tray-content { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.selected-products { display: flex; gap: 10px; }
.selected-product-item { position: relative; }
.selected-product-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 5px; }
.remove-compare-item {
    position: absolute; top: -5px; right: -5px; background: red; color: white;
    border-radius: 50%; width: 20px; height: 20px; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.compare-tray-actions { display: flex; gap: 15px; }
.clear-btn { background: #6c757d; color: white; border: none; padding: 10px 15px; border-radius: 5px; cursor: pointer; }

/* Compare Page Table */
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { border: 1px solid #ddd; padding: 12px; text-align: center; vertical-align: top; }
.compare-table th { background: #f8f9fa; }
.compare-table th img { width: 100px; height: 100px; object-fit: contain; margin-bottom: 10px; }
.compare-table td:first-child { text-align: left; font-weight: bold; background: #f8f9fa; }
/* --- Custom LINE FAB Button --- */
.fab-option.fab-line {
    height: auto !important; /* ปรับความสูงอัตโนมัติ */
    padding: 8px 5px;
    display: flex !important;
    flex-direction: column; /* เรียงจากบนลงล่าง */
    justify-content: center;
    line-height: 1;
}

.fab-line i {
    font-size: 22px; /* ขนาดไอคอน */
    margin-bottom: 4px; /* ระยะห่างระหว่างไอคอนกับข้อความ */
}

.fab-line span {
    font-size: 11px; /* ขนาดตัวอักษร IDLINE */
    font-weight: bold;
}
/* --- Custom Multiline LINE Link --- */
.contact-link-line-multiline {
    display: flex !important;
    flex-direction: column; /* เรียงจากบนลงล่าง */
    align-items: flex-start; /* จัดชิดซ้าย */
    text-align: left;
    color: #06C755 !important; /* สีเขียว LINE */
}

.contact-link-line-multiline:hover {
    color: #05a546 !important; /* สีเขียวเข้มขึ้น */
}

.contact-link-line-multiline i {
    font-size: 1.8rem; /* ขยายขนาดไอคอน */
    margin-bottom: 5px; /* ระยะห่างระหว่างไอคอนกับข้อความ */
}

.contact-link-line-multiline span {
    font-size: 1.1rem; /* ขนาดตัวอักษร IDLINE */
    font-weight: bold;
}
/* --- Quote Form Select/Dropdown Styles --- */
#category-selector,
#product-selector {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Sarabun', sans-serif; /* ใช้ font เดียวกับเว็บ */
    font-size: 1rem;
    background-color: white;
    -webkit-appearance: none; /* เอาดีไซน์เริ่มต้นของ browser ออก */
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236a0dad' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

/* สไตล์เมื่อ disabled */
#product-selector:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}
/* --- Form Extra Links Style --- */
.form-extra-links {
    margin-top: 20px;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* --- Product Filter & Shop Layout --- */
.shop-layout {
    display: grid;
    grid-template-columns: 250px 1fr; /* คอลัมน์ซ้ายสำหรับฟิลเตอร์, คอลัมน์ขวาสำหรับสินค้า */
    gap: 30px;
    align-items: flex-start;
}

.product-filter-sidebar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.product-filter-sidebar h4 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.filter-group h5 {
    margin-bottom: 10px;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list li {
    margin-bottom: 8px;
}

.filter-list input[type="checkbox"] {
    margin-right: 8px;
}

.filter-list label {
    cursor: pointer;
}

.filter-btn {
    width: 100%;
    margin-top: 20px;
}

.clear-filter-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
    color: #888;
}
/* --- Product Page Search Bar --- */
.product-search-bar {
    margin-bottom: 30px;
}
.product-search-bar form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 25px;
    overflow: hidden;
}
.product-search-bar input {
    border: none;
    padding: 10px 20px;
    width: 100%;
    outline: none;
}
.product-search-bar button {
    border: none;
    background-color: var(--primary-color);
    color: white;
    padding: 0 20px;
    cursor: pointer;
}

/* --- Pagination Styles --- */
.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.pagination a, .pagination span {
    color: var(--primary-color);
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}
.pagination a:hover {
    background-color: #f0e6ff;
}
.pagination .active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    cursor: default;
}
.filter-search-box {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}
/* --- Responsive Fixes for Mobile --- */
@media (max-width: 992px) {
    /* ปรับ Layout หน้าสินค้าทั้งหมดและหน้ารายละเอียดสินค้า */
    .shop-layout {
        grid-template-columns: 1fr; /* เปลี่ยนเป็น 1 คอลัมน์ */
    }

    .product-filter-sidebar {
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .product-gallery, .product-info {
        flex-basis: 100%; /* ทำให้แต่ละส่วนกว้างเต็มจอ */
    }
}
/* --- Collapsible Filter Sidebar (Updated) --- */
.filter-header-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.filter-header-toggle h4 {
    margin: 0;
}

.filter-arrow {
    transition: transform 0.3s ease;
}

/* เมื่อ filter ถูกเปิด (active) ให้หมุนลูกศร */
.filter-header-toggle.active .filter-arrow {
    transform: rotate(180deg);
}

.filter-content {
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}
/* --- Product Detail Main Content Alignment Fix --- */
.product-detail-main-content {
    display: flex;
    flex-direction: column; /* บังคับให้ทุกส่วนเรียงจากบนลงล่าง */
    gap: 40px; /* เพิ่มระยะห่างที่เท่ากันระหว่างทุกส่วน */
}

/* รีเซ็ต margin เดิมของแต่ละส่วนเพื่อใช้ gap แทน */
.product-detail-main-content .product-top-section,
.product-detail-main-content .product-specs-section,
.product-detail-main-content .product-long-description-section,
.product-detail-main-content .product-video-section,
.product-detail-main-content .image-gallery-section,
.product-detail-main-content .reviews-section,
.product-detail-main-content .related-products-section {
    margin-top: 0;
    margin-bottom: 0;
}

/* --- Review Section Alignment Fix --- */
.reviews-section {
    max-width: 1000px; /* กำหนดความกว้างสูงสุดของกล่องรีวิว */
    width: 100%; /* ทำให้ยืดหยุ่น */
    margin: 0 auto; /* จัดกล่องรีวิวให้อยู่กึ่งกลางในแนวนอน */
}

.reviews-section h3 {
    text-align: center; /* จัดหัวข้อให้อยู่กึ่งกลาง */
}

#review-form-container {
    max-width: 600px; /* กำหนดความกว้างของฟอร์มเขียนรีวิว */
    margin: 0 auto 40px auto; /* จัดฟอร์มให้อยู่กึ่งกลาง */
}
.product-specific-banner {
position: relative; 
text-align: center;
margin-bottom: 40px;
}

.product-specific-banner a {
display: inline-block; /* ทำให้ container ของรูปภาพ block */
}

.product-specific-banner img {
max-width: 100%;
height: auto;
display: block; /* ป้องกันช่องว่างใต้รูปภาพ */
}

.product-specific-banner .zoom-icon {
position: absolute;
top: 10px; 
right: 10px;
background-color: rgba(0, 0, 0, 0.5); 
color: var(--white);
padding: 8px;
border-radius: 5px;
font-size: 1.2em;
opacity: 0; 
transition: opacity 0.3s ease; 
cursor: pointer;
}

.product-specific-banner a:hover .zoom-icon {
opacity: 1; /* แสดงไอคอนเมื่อ hover */
}

/* สำหรับหน้าจอขนาดเล็ก (มือถือ) */
@media (max-width: 768px) {
    /* * สั่งให้กล่องรูปภาพมีความกว้างสูงสุดไม่เกิน 80% 
     * และจัดให้อยู่กึ่งกลาง
    */
    .product-gallery {
        max-width: 80%; /* << คุณสามารถปรับ % ตรงนี้ได้ตามต้องการ */
        margin-left: auto;
        margin-right: auto;
    }
}
/* --- Responsive Layout Fix for Mobile (Final Version) --- */

/* สำหรับหน้าจอขนาดกลางลงไป (Tablet และ มือถือ) */
@media (max-width: 992px) {
    /*
     * สั่งให้ layout หลักที่เป็น 2 คอลัมน์ (ฟิลเตอร์ + สินค้า)
     * เปลี่ยนเป็น 1 คอลัมน์เต็มความกว้าง
    */
    .shop-layout {
        grid-template-columns: 1fr; 
    }

    .product-filter-sidebar {
        margin-bottom: 30px;
    }
}

/* สำหรับหน้าจอขนาดเล็ก (มือถือ) */
@media (max-width: 768px) {
    /*
     * สั่งให้ส่วนบนของหน้ารายละเอียดสินค้า (รูปภาพ + ข้อมูล)
     * เปลี่ยนเป็นเรียงจากบนลงล่าง
    */
    .product-top-section {
        flex-direction: column; 
        gap: 20px; /* << ลดช่องว่างระหว่างรูปกับข้อมูล */
        margin-bottom: 20px; /* << ลดช่องว่างด้านล่าง */
        padding-bottom: 20px; /* << ลดช่องว่างด้านล่าง */
    }

    .product-gallery, .product-info {
        flex-basis: 100%; /* ทำให้แต่ละส่วนกว้างเต็มจอ */
    }

    /* (เพิ่มใหม่) ลดขนาดรูปภาพหลักในมือถือ */
    .product-gallery {
        max-width: 85%; /* ทำให้รูปไม่ใหญ่จนเกินไป */
        margin-left: auto;
        margin-right: auto;
    }
}
/* 1. ซ่อน thumbnail ของรูปภาพหลักที่ซ้ำกันในแกลเลอรี Lightbox */
.main-thumb-link {
    display: none !important;
}

/* 2. ทำให้รูปภาพหลักและรูปย่อมี cursor เป็นรูปมือ */
.product-gallery .thumbnail,
.product-gallery .image-zoom-wrapper a {
    cursor: pointer;
}
/* --- Header Layout & Responsive Fix (Final Version) --- */

/* 1. ยกเลิก padding ที่ผิดพลาดใน container หลัก */
.main-header .container, .nav-wrapper .container {
    padding-left: 20px;
    padding-right: 20px;
}

/* 2. จัดวางตำแหน่ง Navigation ใหม่ */
.nav-wrapper {
    background-color: var(--white);
    border-top: 1px solid #f0f0f0;
}
.main-nav {
    display: flex;
    justify-content: space-between; /* จัดให้ชิดซ้ายและขวา */
    align-items: center;
}

/* 3. ปรับสไตล์ปุ่ม Hamburger */
.hamburger {
    display: none; /* ซ่อนในจอคอม */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 1010;
}
.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--dark-gray);
    border-radius: 5px;
    transition: all 0.3s linear;
}

/* 4. จัดการการแสดงผลบนมือถือ */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--white);
        position: absolute;
        top: 146px; /* ปรับตามความสูงของ Header */
        left: 0;
        text-align: center;
        box-shadow: var(--box-shadow);
        padding: 15px 0;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links li {
        margin: 15px 0;
    }
    .hamburger {
        display: flex; /* แสดงปุ่ม Hamburger */
    }
    #sidebar-trigger {
        display: none; /* ซ่อนปุ่ม Sidebar เดิมในจอมือถือ */
    }
}
/* ============================================= */
/* === โค้ดสำหรับควบคุมขนาดรูปภาพใน Lightbox === */
/* ============================================= */

.lightbox .lb-image {
    /* กำหนดขนาด "ขั้นต่ำ" (บังคับให้รูปเล็กขยายขึ้น) */
    /* ถ้าไม่อยากให้รูปเล็กขยาย ให้ลบบรรทัดนี้ออก */
    min-width: 700px; 

    /* กำหนดขนาด "สูงสุด" (เผื่อไว้กรณีที่ไม่ได้ตั้งค่าใน JS) */
    /* 90vw หมายถึง 90% ของความกว้างหน้าจอ */
    max-width: 90vw; 

    /* ทำให้ความสูงปรับตามอัตโนมัติ และป้องกันการยืดผิดสัดส่วน */
    width: auto;
    height: auto !important; 
}

/* สำหรับจอมือถือ เราอาจไม่ต้องการให้มีขนาดขั้นต่ำ */
@media (max-width: 768px) {
    .lightbox .lb-image {
        min-width: 0; /* ยกเลิกขนาดขั้นต่ำบนมือถือ */
        width: 100%;  /* ทำให้รูปเต็มความกว้างของ lightbox บนมือถือ */
    }
}
/* ใช้ Selector ที่เจาะจงมากขึ้นโดยอ้างอิงจากตำแหน่งใน nav-right */
.nav-right .search-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* ล้างค่าเก่าๆ ที่อาจรบกวนออกไป */
    border: none;
    background: transparent;
    padding: 0 18px;
    cursor: pointer;
    transition: color 0.2s;
    color: var(--primary-color);
}

.nav-right .search-form button:hover {
    color: var(--accent-color);
    background: transparent;
}
