/* ==========================================
   1. PREMIUM FLOATING DARK THEME & BACKGROUND
========================================== */
body { 
    background-color: #0d0d0d; 
    color: #e5e7eb; 
    font-family: 'Segoe UI', -apple-system, Roboto, Helvetica, sans-serif; 
    margin: 0; 
    padding: 0; 
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ปรับฟิกซ์ภาพพื้นหลังให้อยู่กับที่เต็มจอ 100% ไม่บิดเบี้ยว */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('Bg.jpg') no-repeat center center fixed;
    background-size: cover;
    z-index: -1; /* อยู่หลังสุด */
    filter: blur(10px) brightness(0.65); /* เพิ่มความสว่างหลังบ้านขึ้นมาอีกนิด ให้เห็นลายศูนย์คูโบต้าสวยๆ */
    transition: filter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* เมื่อล็อกอินสำเร็จ จะปลดบล็อคความเบลอของภาพพื้นหลัง */
body.logged-in-state::before {
    filter: blur(10px) brightness(0.7); /* ปรับจาก 0.65 เป็น 0.7 ให้สว่างขึ้นอีกนิด */
}

/* ส่วนเนื้อหาหลัก (เคลียร์พื้นหลังดำออกเพื่อให้เห็นภาพ Bg ด้านหลังทะลุขึ้นมา) */
.main-content-blur-bg {
    min-height: 100vh;
    pointer-events: none; /* ล็อกปุ่มด้านหลังไม่ให้เผลอกดก่อนล็อกอิน */
}

/* เมื่อล็อกอินสำเร็จ จะปลดล็อกให้กดปุ่มใช้งานได้ */
body.logged-in-state .main-content-blur-bg {
    pointer-events: auto;
}

/* ==========================================
   2. HIGH-END GLASSMORPHIC SIDEBAR (ขวาเต็มจอ)
========================================== */
.glass-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.05); 
    backdrop-filter: blur(30px); /* เพิ่มความละมุนของกระจกฝ้า */
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

.sidebar-content {
    padding: 50px 35px;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    box-sizing: border-box;
}

.brand-logo-zone {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}
.kubota-k-logo {
    width: 55px;
    height: 55px;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.3));
}
.brand-text {
    font-size: 38px;
    font-weight: 800;
    color: #ff6600;
    font-family: 'Arial Black', Gadget, sans-serif;
    letter-spacing: -1.5px;
}

.welcome-text {
    font-size: 18px;
    color: #ffffff;
    margin-top: 50px;
    font-weight: 400;
    opacity: 0.8;
}
.branch-text {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 6px;
    margin-bottom: 50px;
    letter-spacing: 0.5px;
}

.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
}

/* ปรับปุ่ม Social ให้ฟอนต์เนียนตา ช่องไฟ Professional เป๊ะๆ */
.social-btn {
    width: 100%;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.social-btn i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}
.social-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.sidebar-footer {
    font-size: 11px;
    color: #aaaaaa;
    line-height: 1.6;
    text-align: left;
    margin-bottom: 10px;
    opacity: 0.7;
}

/* ==========================================
   3. BENTO UI COMPONENT STYLES (ปรับความโปร่งแสงเบาๆ)
========================================== */
.orange-btn {
    background: linear-gradient(135deg, #ff6600 0%, #e65c00 100%);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 13px;
}
.header-banner { 
    background: rgba(5, 5, 5, 0.6); /* ปรับให้โปร่งแสงเพื่อโชว์ภาพพื้นหลัง */
    padding: 25px 15px; 
    text-align: center; 
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.header-banner h1 { color: #ff6600; margin: 0; font-size: 24px; font-weight: 800; }
.header-banner p { color: #bbb; margin: 6px 0 0 0; font-size: 12px; }

#user-top-icons {
    display: none; background-color: #050505; padding: 10px 20px; text-align: right; border-bottom: 1px solid #111; font-size: 13px;
}
#user-top-icons span { margin-left: 15px; color: #888; }

.bento-container {
    display: flex; flex-direction: column; gap: 16px; padding: 16px; max-width: 600px; margin: 0 auto;
}
.bento-bar-row {
    background: rgba(20, 20, 20, 0.4); /* ลดความทึบลงจาก 0.75 เหลือ 0.4 ให้เห็นภาพข้างหลังทะลุออกมา */
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px; 
    padding: 18px; 
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.box-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: #ffffff; display: flex; align-items: center; gap: 8px; }
.ribbon-badge { position: absolute; top: 14px; right: 18px; background: #ff6600; color: #fff; padding: 3px 10px; border-radius: 8px; font-size: 10px; font-weight: 700; }
.combo-grid-row { display: flex; flex-direction: column; gap: 20px; }
.combo-column { width: 100%; }
.combo-divider { border-bottom: 1px solid rgba(255,255,255,0.1); margin: 5px 0; }
.product-sub-container { display: flex; flex-direction: column; gap: 8px; }
.product-card { background-color: rgba(26, 26, 26, 0.6); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; padding: 8px 12px; display: flex; align-items: center; gap: 12px; }
.product-img-slot { background-color: #111; border: 1px dashed #3a3a3a; width: 42px; height: 42px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 8px; color: #555; }
.product-title-sub { font-weight: 600; font-size: 13px; color: #ddd; }
.review-sub-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.review-nested-slot { background-color: rgba(26, 26, 26, 0.6); border: 1px dashed rgba(255,255,255,0.05); border-radius: 12px; aspect-ratio: 1/1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: #888; gap: 4px; text-align: center; padding: 4px; }
.review-nested-slot i { font-size: 14px; color: #ff6600; }
.models-horizontal-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.model-card { background-color: rgba(26, 26, 26, 0.6); border: 1px solid rgba(255,255,255,0.05); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; justify-content: space-between; }
.model-title-zone { font-weight: 700; font-size: 11px; display: flex; align-items: center; gap: 4px; color: #fff; }
.dot-status { width: 6px; height: 6px; background-color: #28a745; border-radius: 50%; }
.square-product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.square-product-slot { background-color: #111; border: 1px dashed #262626; border-radius: 6px; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #444; }
#sticky-cart { display: none; position: fixed; bottom: 20px; right: 20px; background: #ff6600; color: #fff; padding: 12px 20px; border-radius: 30px; z-index: 9999; font-weight: 700; font-size: 13px; }

@media screen and (max-width: 480px) {
    .glass-sidebar {
        max-width: 100%;
    }
}