/* =========================================
   โครงสร้างหลัก (ซ้าย-ขวา)
========================================= */
.shop-section {
    padding: 40px 20px;
    background-color: #f9fbfd; /* สีพื้นหลังเว็บอ่อนๆ */
}

.shop-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* =========================================
   ฝั่งซ้าย: Sidebar ตัวกรอง
========================================= */
.shop-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.filter-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.filter-title {
    font-size: 18px;
    color: #1A365D;
    margin-bottom: 15px;
    font-weight: bold;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ปุ่มหมวดหมู่สินค้า */
.category-list li {
    margin-bottom: 10px;
}
.category-list a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: all 0.3s;
}
.category-list a.active, .category-list a:hover {
    background-color: #0056b3; /* สีน้ำเงินปุ่ม Active */
    color: #fff;
    border-color: #0056b3;
}
.filter-icon {
    width: 20px;
    margin-right: 10px;
}

/* Checkbox ความจุ */
.check-list li {
    margin-bottom: 12px;
}
.check-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #555;
    font-size: 15px;
}
.check-list input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* =========================================
   ฝั่งขวา: รายการสินค้า
========================================= */
.shop-content {
    flex-grow: 1;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
}

.breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}
.breadcrumb span {
    color: #2161A4;
    font-weight: bold;
}

.main-title {
    font-size: 28px;
    color: #2161A4; /* สีน้ำเงินเข้ม */
    margin: 0 0 5px 0;
}

.item-count {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.shop-sort select {
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #ddd;
    outline: none;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* =========================================
   การ์ดสินค้า (Product Grid)
========================================= */
.product-grid-layout {
    display: grid;
    /* แสดง 4 คอลัมน์ ถ้าจอเล็กจะลดหลั่นลงมาอัตโนมัติ */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

/* ป้ายวงกลมมุมซ้ายบน */
.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #2161A4;
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.2;
    z-index: 1;
}

.product-img {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}
.product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-details {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 16px;
    color: #2161A4;
    margin: 0 0 5px 0;
}
.product-model {
    font-size: 13px;
    color: #666;
    font-weight: bold;
    margin: 0 0 15px 0;
}

/* ลิสต์คุณสมบัติ (ติ๊กถูก) */
.product-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
    font-size: 12px;
    color: #555;
    flex-grow: 1;
}
.product-features li {
    margin-bottom: 6px;
    position: relative;
    padding-left: 20px;
}
.product-features li::before {
    content: '✔'; /* ใช้สัญลักษณ์ติ๊กถูก */
    color: #2161A4;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 12px;
}

/* ปุ่มดูรายละเอียด */
.btn-detail {
    display: block;
    width: 100%;
    padding: 10px 0;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}
.btn-detail.outline {
    background: transparent;
    color: #2161A4;
    border: 1px solid #2161A4;
    transition: all 0.3s ease-in-out
}
.btn-detail.outline:hover {
    background-color: #2161A4 ;
    color: #ffffff ;
    border: 1px solid #2161A4 ;
}

.btn-detail.primary {
    background: #2161A4;
    color: #fff;
    border: 1px solid #2161A4;
}
.btn-detail.primary:hover {
    background: #2161A4;
}
/* =========================================
   ฝั่งขวา: รายการสินค้า
========================================= */
.shop-content {
    flex-grow: 1;
    min-width: 0; /* 🌟 เพิ่มบรรทัดนี้: ป้องกันเนื้อหาด้านในดันจนกล่องแตก */
}
/* =========================================
   ส่วนหัวของหน้ารวมสินค้า (Shop Header)
========================================= */

/* ปรับระยะห่างของแถบนำทาง */
.shop-title-area .breadcrumb {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 14px;
}

/* ตกแต่งลิงก์ หน้าแรก > สินค้า */
.shop-title-area .breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: 0.3s;
}

/* เพิ่มลูกเล่นเวลาเอาเมาส์ไปชี้ลิงก์ */
.shop-title-area .breadcrumb a:hover {
    color: #0056b3; 
    text-decoration: underline;
}

/* ตกแต่งชื่อหน้าปัจจุบัน (สินค้าทั้งหมด) */
.shop-title-area .breadcrumb span {
    font-weight: bold;
    color: #0056b3;
}

/* ปรับระยะห่างของหัวข้อหลัก (H2) */
.shop-title-area .main-title {
    margin-top: 0;
    margin-bottom: 5px;
}

/* ปรับระยะห่างและสีของจำนวนรายการ */
.shop-title-area .item-count {
    margin-top: 0;
    color: #777;
}

/* =========================================
   รองรับหน้าจอมือถือ (Responsive)
========================================= */
@media (max-width: 768px) {

/* =========================================
   สไตล์ปุ่มตัวกรอง (ซ่อนไว้ก่อนบนจอคอม)
========================================= */
.mobile-filter-btn {
    display: none; /* บนจอคอมปกติ ไม่ต้องโชว์ปุ่มนี้ */
    width: 100%;
    padding: 12px 20px;
    background-color: #ffffff;
    color: #1a5299;
    border: 2px solid #1a5299;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: space-between;
    margin-bottom: 15px;
    justify-content: space-between;
    align-items: center;
}
.mobile-filter-btn {
        display: flex; 
    }
    /* 2. ซ่อนเนื้อหาตัวกรองไว้ก่อน */
    .filter-content-wrapper {
        display: none; 
        /* ใส่แอนิเมชันให้ตอนกางออกดูสมูท */
        animation: slideDown 0.3s ease-out;
    }
    
    /* 3. คลาสนี้จะถูกเรียกใช้ตอนลูกค้ากดปุ่ม (กางออก) */
    .filter-content-wrapper.show {
        display: block;
    }
/* =========================================
   📱 สำหรับหน้าจอ แท็บเล็ต ไอแพด และมือถือ (ต่ำกว่า 992px)
========================================= */
    /* 1. โชว์ปุ่มกด */
    .mobile-filter-btn {
        display: flex; 
    }
    
    /* 2. ซ่อนเนื้อหาตัวกรองไว้ก่อน */
    .filter-content-wrapper {
        display: none; 
        /* ใส่แอนิเมชันให้ตอนกางออกดูสมูท */
        animation: slideDown 0.3s ease-out;
    }
    
    /* 3. คลาสนี้จะถูกเรียกใช้ตอนลูกค้ากดปุ่ม (กางออก) */
    .filter-content-wrapper.show {
        display: block;
    }
/* ลูกเล่นแอนิเมชันตอนกางเมนู */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* 1. สั่งซ่อนปุ่มตัวกรอง และกล่องเนื้อหาตัวกรองทั้งหมดบนมือถือถาวร */
    .mobile-filter-btn, 
    #filterContent,
    .shop-sidebar {
        display: none !important;
    }
    
    /* 2. จัดระเบียบให้เหลือแค่กล่อง "เรียงตาม" เต็มความกว้างสวยๆ ชิ้นเดียว */
    .shop-tools-vertical {
        display: block;
        margin-top: 15px;
        width: 100%;
    }
    
    .shop-tools-vertical .shop-sort {
        width: 100%;
    }
    
    .shop-tools-vertical .shop-sort select {
        width: 100%;
        height: 46px;
        padding: 0 15px;
        border: 2px solid #ccc;
        border-radius: 8px;
        font-size: 15px;
        color: #333333;
        background-color: #ffffff;
        
        /* ใส่ลูกศรสามเหลี่ยมชี้ลง (▼) ให้ฝั่งตัวเลือก */
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path fill='%231a5299' d='M7 10l5 5 5-5z'/></svg>");
        background-repeat: no-repeat;
        background-position: right 15px center;
    }
/* =================================================
       โซนรายการสินค้า (เรียง 2 ชิ้น ซ้าย-ขวา)
    ================================================= */
    /* 🌟 เปลี่ยนมาใช้ .product-grid-layout ให้ตรงกับ HTML ของคุณ */
    .product-grid-layout {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* บังคับ 2 คอลัมน์ */
        gap: 10px !important; /* ลดช่องไฟลงให้เหมาะกับจอมือถือ */
        padding: 0 10px;
    }

    /* 🌟 เปลี่ยนมาใช้ .product-item ให้ตรงกับการ์ดสินค้าของคุณ */
    .product-item {
        padding: 10px !important;
    }
    
    /* ปรับขนาดตัวอักษรชื่อสินค้า */
    .product-item .product-name {
        font-size: 14px !important; 
        margin-top: 10px;
        margin-bottom: 5px;
    }
    
    /* ปรับขนาดตัวอักษรรายการคุณสมบัติ (จุดไข่ปลา) */
    .product-item .product-features {
        font-size: 11px !important;
        padding-left: 15px !important; /* ลดระยะร่นหน้ากระดาษ */
        margin-bottom: 10px;
    }
    
    /* ปรับขนาดปุ่ม "ดูรายละเอียด" ให้กะทัดรัดขึ้น */
    .product-item .btn-detail {
        font-size: 12px !important;
        padding: 5px 10px !important;
    }

    /* ปรับป้ายวงกลมน้ำเงิน (ซัก 9 kg.) ให้เล็กลง */
    .product-badge {
        width: 40px !important;
        height: 40px !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
        padding: 5px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    /* =================================================
       แก้ปัญหา CTA ทับกล่องสินค้าบนมือถือ
    ================================================= */
    
    /* 1. ดันระยะห่างด้านล่างของตารางสินค้าทั้งหมด ให้ถอยห่างจากแบนเนอร์ CTA */
    .product-grid-layout {
        margin-bottom: 40px !important; 
    }

    /* 2. ปลดล็อกความสูงของการ์ดสินค้า และเผื่อพื้นที่ใต้ปุ่ม 'ดูรายละเอียด' */
    .product-item {
        height: auto !important; /* บังคับให้กล่องยืดหดตามเนื้อหาจริง ห้ามล็อกความสูง */
        min-height: 100%; 
        padding-bottom: 20px !important; 
    }
    /* =========================================================
   📱 ซ่อนปุ่ม "เรียงตาม" เฉพาะบนหน้าจอมือถือและแท็บเล็ต
========================================================= */
@media (max-width: 992px) {
    .shop-sort {
        display: none !important; /* บังคับซ่อนกล่องเรียงลำดับทันที */
    }
}
}





    
    

