body { 
    background-color: var(--bg-color, #f9fafb); 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    padding-bottom: 90px; 
    color: #2b2b2b;
    letter-spacing: 0.2px;
}

/* แถบเมนูด้านบน */
.top-navbar {
    background: linear-gradient(135deg, var(--main-theme) 0%, var(--dark-theme) 100%);
    color: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 1050;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: var(--shadow-red, 0 10px 25px rgba(220, 53, 69, 0.25));
}
.top-navbar .brand-name img { height: 28px; width: auto; margin-right: 10px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.top-navbar .profile-img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: 0.2s; }
.top-navbar .profile-img:active { transform: scale(0.9); }
.top-navbar .points-display { line-height: 1.1; text-align: right; }
.top-navbar .points-label { font-size: 0.65rem; opacity: 0.85; font-weight: 600; }
.top-navbar .points-value { font-size: 1.15rem; font-weight: 900; color: #ffeb3b; }

/* แถบเมนูด้านล่าง (ติดขอบจอ เรียบหรู ไม่เบี้ยว) */
.bottom-nav { 
    background: rgba(255, 255, 255, 0.98); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0;
    z-index: 1000; 
    padding: 12px 10px calc(15px + env(safe-area-inset-bottom)) 10px; 
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.03);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

/* ล็อกเลย์เอาต์เมนู ป้องกันสคริปต์ทำพัง */
.nav-item-btn { 
    flex: 1; 
    text-align: center; 
    color: #a0aec0; 
    cursor: pointer; 
    transition: all 0.2s ease-in-out; 
    display: flex !important; 
    flex-direction: column !important; 
    align-items: center; 
    justify-content: center;
}
.nav-item-btn i { 
    font-size: 1.45rem; 
    margin-bottom: 3px; 
    transition: all 0.2s; 
    line-height: 1; 
}
.nav-item-btn span { 
    font-size: 0.65rem; 
    font-weight: 600; 
    transition: all 0.2s; 
    line-height: 1; 
    letter-spacing: 0.3px; 
}
.nav-item-btn.active { 
    color: var(--main-theme); 
}
.nav-item-btn.active i { 
    font-size: 1.6rem; 
    filter: drop-shadow(0 3px 5px rgba(220, 53, 69, 0.3)); 
    transform: translateY(-2px); 
}
.nav-item-btn.active span { 
    font-weight: 800; 
    transform: translateY(-1px); 
}

/* อนิเมชันเวลาเปลี่ยนหน้า */
.tab-content-view { display: none; animation: fadeIn 0.4s ease; }
.tab-content-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* การ์ดคะแนน VIP */
.vip-points-card { 
    background: linear-gradient(135deg, var(--main-theme) 0%, var(--dark-theme) 100%); 
    border-radius: 24px; position: relative; overflow: hidden; 
    box-shadow: var(--shadow-red, 0 10px 25px rgba(220, 53, 69, 0.25));
    border: 1px solid rgba(255,255,255,0.15);
}
.vip-points-card::after { content: ""; position: absolute; top: -40px; right: -40px; width: 160px; height: 160px; background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%); border-radius: 50%; }
.vip-points-card::before { content: ""; position: absolute; bottom: -50px; left: -30px; width: 120px; height: 120px; background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%); border-radius: 50%; }

/* พื้นฐานของการ์ด */
.card { border: none !important; border-radius: 20px; box-shadow: var(--shadow-sm, 0 4px 15px rgba(0,0,0,0.04)); transition: 0.3s; }
.card:hover { box-shadow: var(--shadow-md, 0 8px 25px rgba(0,0,0,0.08)); }

/* กล่องเมนู 4 ช่อง */
.grid-box { border-radius: 20px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm, 0 4px 15px rgba(0,0,0,0.04)); display: flex; flex-direction: column; height: 100%; border: 1px solid rgba(0,0,0,0.02); }
.grid-box img { width: 100%; height: 90px; object-fit: cover; }
.grid-box .title { font-size: 0.85rem; font-weight: 800; color: #222; line-height: 1.2; }
.grid-box .desc { font-size: 0.7rem; color: #777; line-height: 1.3; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-box .btn-area { margin-top: auto; padding-top: 10px; }

/* การ์ดสินค้าแนะนำ */
.product-card { min-width: 155px; max-width: 155px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm, 0 4px 15px rgba(0,0,0,0.04)); scroll-snap-align: start; overflow: hidden; display: flex; flex-direction: column; position: relative; border: 1px solid rgba(0,0,0,0.02); }
.product-card img { width: 100%; height: 130px; object-fit: cover; }
.product-card .p-details { padding: 10px; white-space: normal; }
.product-card .p-name { font-size: 0.8rem; font-weight: 700; color: #333; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.product-card .p-price { color: var(--main-theme); font-weight: 900; font-size: 1.05rem; line-height: 1; }

/* ปุ่มต่างๆ และรายละเอียดเล็กๆ */
.btn-theme { background: linear-gradient(135deg, var(--main-theme) 0%, var(--dark-theme) 100%); color: white; border: none; box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2); }
.btn-theme:hover { color: white; opacity: 0.95; transform: translateY(-1px); }
.btn-outline-danger { border-radius: 12px; }

.cvt-card { border: 2px dashed var(--main-theme); border-radius: 24px; background-color: var(--soft-red, #fff0f1); }
.section-title { font-weight: 800; font-size: 1rem; color: #111; letter-spacing: 0.3px; }

/* แก้ไขดีไซน์ของ Pop-up ให้สวยขึ้น */
.swal2-confirm { background-color: var(--main-theme) !important; color: white !important; border-radius: 12px !important; padding: 10px 30px !important;}
.swal2-popup { border-radius: 24px !important; }