/* =========================================================
   app.css — Đồng bộ giao diện các trang "app" (mobile & PC)
   Nạp SAU cùng để override style riêng của từng trang.
   Chuẩn: khung 480px căn giữa, nền gradient Shopee, bottom-nav đồng bộ.
   ========================================================= */

:root {
    --sp-primary: #ee4d2d;
    --sp-primary-light: #ff6f61;
    --sp-bg: #eceef0;
}

/* Nền chung cho toàn bộ trang app */
body.sp-app {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    min-height: 100vh;
    background:
        radial-gradient(130% 55% at 50% 0%, #ff8f6b 0%, #ff5f52 20%, transparent 46%),
        linear-gradient(180deg, #ffe9e2 0%, var(--sp-bg) 28%, var(--sp-bg) 100%) !important;
}

/* Khung nội dung chuẩn — mọi trang app quy về 480px căn giữa */
.sp-app .profile-container,
.sp-app .flash-sale-container,
.sp-app .order-container,
.sp-app .home,
.sp-app .settings-container,
.sp-app .wrap {
    max-width: 480px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 108px !important;
    background: transparent !important;
}

/* Trên PC: hiện như một khung điện thoại nổi ở giữa nền */
@media (min-width: 481px) {
    .sp-app .profile-container,
    .sp-app .flash-sale-container,
    .sp-app .order-container,
    .sp-app .home,
    .sp-app .settings-container,
    .sp-app .wrap {
        min-height: 100vh;
        box-shadow: 0 0 50px rgba(0, 0, 0, .12);
    }
}

/* Bottom navigation đồng bộ trên mọi trang, căn giữa theo khung 480px */
/* Bottom navigation đồng bộ trên mọi trang, căn giữa theo khung 480px */
.app-bottom-nav {
    position: fixed !important;
    bottom: 16px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 24px) !important;
    max-width: 456px !important;
    height: 72px !important;
    background: #fff !important;
    border-radius: 20px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08), 0 0 1px rgba(0,0,0,0.1) !important;
    display: flex !important;
    padding-top: 10px !important;
    z-index: 900 !important;
}

/* The bump (nổi lên trên) - NOW ATTACHED TO ACTIVE TAB */
.app-bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 24px;
    background: #fff;
    border-radius: 14px 14px 0 0;
    z-index: -1;
}

/* The orange handle inside the bump */
.app-bottom-nav a.active::after {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, #ff8a3d, #ee4d2d);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(238, 77, 45, 0.3);
}

.app-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    text-decoration: none;
    color: #887a70;
    font-size: 11px;
    font-weight: 600;
    position: relative;
}

.app-bottom-nav a i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 17px;
    color: #9c8e84;
    transition: all .2s;
    border: 1px solid #e8e3e0;
}

.app-bottom-nav a.active { color: #ee4d2d; }
.app-bottom-nav a span { position: relative; }
/* Active text underline */
.app-bottom-nav a.active span::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #ff8a3d, #ee4d2d);
}

.app-bottom-nav a.active i {
    color: #fff;
    background: linear-gradient(135deg, #ff8a3d, #ee4d2d);
    box-shadow: 0 4px 10px rgba(238, 77, 45, .4);
    border: none;
    transform: scale(1.05);
}

/* Banner Slider */
.banner-slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 16px; margin: 10px 0; scrollbar-width: none; border-radius:8px; }
.banner-slider::-webkit-scrollbar { display: none; }
.banner-slide { flex: 0 0 100%; scroll-snap-align: center; }
.banner-slide img { width: 100%; border-radius: 8px; object-fit: cover; }

/* Card trắng bo góc đồng bộ (nếu trang dùng .card) */
.sp-app .card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .05);
}
