@charset "utf-8";

/* =======================================================
   🌐 1. แกนโครงสร้างหลัก และ ถมสีพื้นหลังดำสนิทกึ่งกลางบอร์ด
   ======================================================= */
body { 
    font-family: 'Kanit', sans-serif, Tahoma !important; 
    max-width: 1200px !important; 
    margin: 0 auto !important; 
    padding: 0 0 40px 0 !important; 
    background-color: #0b0c10 !important; /* คืนค่าสีดำดั้งเดิมหน้าร้านค้า */
    color: #c5c6c7 !important; 
    box-sizing: border-box !important;
}

/* =======================================================
   🌐 2. FACEBOOK FANPAGE HEADER LAYOUT (ส่วนหัวเว็บโปร่งแสง ลบมุมโค้ง)
   ======================================================= */
.fb-header {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    background: rgba(26, 28, 35, 0.75) !important; /* แถบข้อมูลใต้ปกโปร่งแสงหรูหรา */
    backdrop-filter: blur(8px) !important; 
    border-bottom: 1px solid rgba(45, 49, 63, 0.5) !important;
    margin: 0 0 30px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    border-bottom-left-radius: 12px !important; 
    border-bottom-right-radius: 12px !important; 
}

/* ผืนผ้าใบภาพหน้าปก (Cover Photo) กางความสูง 350px ลบมุมขอบด้านบนโค้งมนสวยงาม */
.banner-container {
    width: 100% !important;
    height: 350px !important;
    min-height: 350px !important;
    border-bottom: 1px solid rgba(45, 49, 63, 0.5) !important;
    position: relative !important;
    display: block !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border-top-left-radius: 12px !important; 
    border-top-right-radius: 12px !important; 
    overflow: hidden !important;
}

/* แผงจัดระเบียบช่องไฟใต้ภาพหน้าปก */
.header-content {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    padding: 0 32px 24px 32px !important;
    position: relative !important;
    z-index: 10 !important;
    gap: 20px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* ล็อกพิกัดให้รูปโปรไฟล์โลโก้และชื่อร้านเรียงต่อกันในแนวนอนสไตล์ Facebook Page ตัวจริง */
.header-left {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    gap: 24px !important;
    flex-grow: 1 !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

/* กล่องคุมรูปโปรไฟล์ ยิฟต์ติดลบ -80px เพื่อยกตัวรูปขึ้นไปซ้อนเหลื่อมอยู่บนภาพหน้าปกพอดีเป๊ะ */
.profile-avatar-wrapper {
    margin-top: -80px !important; 
    position: relative !important;
    z-index: 15 !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

/* รูปโปรไฟล์วงกลมขอบหนา ล็อกตำแหน่งเข้าล็อกเฟรมกึ่งกลางพอดี ไม่หลุดลอยเตลิดออกไปทางซ้าย */
.profile-img {
    width: 160px !important;
    height: 160px !important;
    border-radius: 50% !important;
    border: 6px solid #1a1c23 !important; 
    background: #1a1c23 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    object-fit: cover !important;
    display: block !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 🛠️ ปรับสเกลกล่องข้อความชื่อร้านค้า: เพิ่มระยะ margin-bottom ให้กรอบลงมาอยู่ระหว่างกลางขอบบนและขอบล่างพอดีอย่างสมส่วน */
.shop-info {
    margin-bottom: 25px !important; /* 🛠️ ขยับปรับระยะลงมาให้อยู่กึ่งกลางเด่นตาแนวดิ่ง ไม่ชิดติดรูปภาพ */
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    min-width: 0 !important;
    background: rgba(14, 17, 25, 0.5) !important; 
    padding: 14px 20px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(102, 252, 241, 0.25) !important; 
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.05) !important;
}
.shop-info h1 {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 2.1em !important;
    font-weight: bold !important;
    letter-spacing: -0.5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important; 
    text-shadow: 0 0 10px rgba(255,255,255,0.15) !important;
}
.shop-info p {
    margin: 0 !important;
    color: #00ffcc !important; 
    font-size: 0.98em !important;
    line-height: 1.4 !important;
    font-weight: bold !important;
    text-shadow: 0 0 8px rgba(0,255,204,0.2) !important;
}

.header-right {
    display: flex !important;
    align-items: flex-end !important;
    margin-bottom: 25px !important; /* 🛠️ ขยับปุ่มสมาชิกให้ลงมาอยู่ในระดับระนาบกึ่งกลางสมดุลคู่กับกล่องชื่อร้าน */
    flex-shrink: 0 !important;
}

/* ปุ่มควบคุมสมาชิกสีน้ำเงินสไตล์เพจเฟซบุ๊กแท้ */
.admin-link {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: bold !important;
    border: none !important;
    padding: 11px 18px !important;
    border-radius: 6px !important;
    background: #1877f2 !important;
    transition: background 0.2s !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
    font-size: 0.92em !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.admin-link:hover {
    background: #166fe5 !important;
    color: #ffffff !important;
}
/* =======================================================
   📦 3. PRODUCTS GRID LAYOUT (ส่วนโครงสร้างคลังการ์ดโค้งมน 12px และขยายกรอบเลือกแบรนด์รถยนต์)
   ======================================================= */
/* 🛠️ ปรับปรุงกล่องครอบหลักหน้าร้าน: ล้างระบบการบีบขอบข้างออก เพื่อให้ตัวสล็อตเนื้อหายืดขยายกว้างเท่ากับกรอบแบนเนอร์ด้านบนพอดีเป๊ะ */
.main-container { 
    max-width: 100% !important; 
    width: 100% !important; 
    margin: 30px 0 auto 0 !important; 
    display: flex !important; 
    gap: 20px; 
    padding: 0 !important; /* 🛠️ เคลียร์ Padding ทิ้งเพื่อให้ตัวขอบยืดไปชนแนวระนาบเดียวกับแบนเนอร์ครอบจักรวาล */
    box-sizing: border-box !important; 
    align-items: flex-start; 
}

/* 🛠️ ปรับสเกลแผงควบคุมเมนูด้านซ้าย: บังคับเปลี่ยนมาใช้สไตล์โครงสร้างแบบเดียวกับแบนเนอร์ด้านบน โปร่งแสง มีกรอบรายเส้นนีออน และลบมุมโค้งมน 12px ครบสูตร */
.sidebar-cat { 
    width: 260px; 
    background: rgba(26, 28, 35, 0.75) !important; /* 🛠️ ปรับสีพื้นหลังให้เป็นแบบเดียวกับแถบใต้หน้าปกแบนเนอร์ */
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(45, 49, 63, 0.5) !important; /* 🛠️ ทำกรอบรายเส้นครอบรอบตารางแบบเดียวกับแบนเนอร์ */
    border-radius: 12px !important; /* ลบมุมโค้งมนทรงเดียวกับหัวเว็บด้านบน */
    padding: 20px !important; 
    box-sizing: border-box !important; 
    flex-shrink: 0; 
    position: sticky; 
    top: 20px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
}

.content-products { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    min-width: 0; 
    box-sizing: border-box !important;
}
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; width: 100%; box-sizing: border-box; }

/* ลบมุมคมกล่องการ์ดสินค้าชิ้นจริงหน้าร้านให้มนโค้ง 12px ทรงสัญลักษณ์เดียวกับหัวเว็บ */
.grid-product-card { 
    background: #151a24; 
    border: 1px solid #222a36; 
    border-radius: 12px !important; 
    padding: 15px; 
    box-sizing: border-box; 
    display: flex; 
    flex-direction: column; 
    transition: all 0.25s ease-in-out; 
    position: relative; 
    overflow: hidden; 
}
.grid-product-card img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px !important; border: 1px solid #1f2833; margin-bottom: 12px; display: block; }
.grid-product-title { font-size: 1.1em; font-weight: bold; color: #ffffff; margin-bottom: 10px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.6em; }

.cat-btn { 
    display: block; 
    color: white; 
    text-decoration: none; 
    padding: 12px; 
    margin-bottom: 6px; 
    background: rgba(21, 26, 36, 0.6) !important; 
    border-radius: 8px !important; 
    font-size: 0.9em; 
    border: 1px solid rgba(34, 42, 54, 0.5) !important; 
    transition: 0.2s; 
}
.cat-btn:hover, .cat-btn.active { 
    background: #1f2833 !important; 
    color: #66fcf1 !important; 
    border-color: #45a29e !important; 
    box-shadow: 0 0 8px rgba(102,252,241,0.2) !important; 
}

.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); align-items: center; justify-content: center; }
.modal-content { max-width: 85%; max-height: 85%; border-radius: 12px !important; border: 2px solid #66fcf1; box-shadow: 0 0 25px #66fcf1; }
.close-modal { position: absolute; top: 20px; right: 30px; color: #66fcf1; font-size: 45px; font-weight: bold; cursor: pointer; }

/* =======================================================
   📱 4. MOBILE LAYOUT RESPONSIVE (ปรับขนาดจอมือถืออัตโนมัติ)
   ======================================================= */
@media (max-width: 900px) {
    .banner-container { height: 200px !important; min-height: 200px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; }
    .fb-header { border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; }
    .header-content { flex-direction: column !important; align-items: center !important; text-align: center !important; padding: 0 16px 20px 16px !important; gap: 15px !important; }
    .header-left { flex-direction: column !important; align-items: center !important; gap: 12px !important; width: 100% !important; }
    .profile-avatar-wrapper { margin-top: -60px !important; }
    .profile-img { width: 120px !important; height: 120px !important; border: 4px solid #1a1c23 !important; }
    .shop-info { align-items: center !important; padding: 10px 15px !important; width: 100% !important; box-sizing: border-box !important; margin-bottom: 0 !important; }
    .shop-info h1 { font-size: 1.5em !important; text-align: center !important; justify-content: center !important; }
    .shop-info p { font-size: 0.88em !important; text-align: center !important; }
    .header-right { width: 100% !important; justify-content: center !important; margin-bottom: 0 !important; }
    .admin-link { width: 100% !important; text-align: center !important; padding: 12px !important; display: block !important; box-sizing: border-box !important; }
    .main-container { flex-direction: column; margin: 15px auto; padding: 0 10px; gap: 15px; width: 100% !important; }
    .sidebar-cat { width: 100%; position: static; padding: 12px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; background: #0e1119 !important; border-radius: 10px !important; border: 1px solid #222a36 !important; box-shadow: none !important; }
    .sidebar-cat h3 { margin-bottom: 10px !important; }
    .sidebar-cat :not(h3) { display: inline-flex !important; white-space: nowrap; gap: 6px; }
    .cat-btn { display: inline-block; margin-bottom: 0; padding: 8px 16px; font-size: 0.85em; background: #151a24 !important; border: 1px solid #222a36 !important; border-radius: 6px !important; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

