/* Giao diện khách hàng: bố cục quen thuộc của cửa hàng (thanh trên, header, thanh menu, thẻ sản phẩm). */
:root {
    --primary: #007ea8;
    --primary-dark: #1a5e75;
    --text: #555;
    --heading: #39404a;
    --muted: #8a8f98;
    --border: #e8e8e8;
    --body: #f5f6f7;
    --white: #fff;
    --green: #11b76b;
    --red: #ff3838;
    --orange: #e86121;
    --shadow: 0 6px 24px rgba(0, 0, 0, .06);
    --radius: 8px;
}

body { background: var(--body); color: var(--text); font-size: 15px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4, h5, h6 { color: var(--heading); }
.text-primary { color: var(--primary) !important; }
.bg-primary { background: var(--primary) !important; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* Thanh trên cùng */
.header-top { background: var(--primary); color: rgba(255, 255, 255, .85); font-size: 13px; padding: 6px 0; }
.header-top a { color: rgba(255, 255, 255, .85); }
.header-top a:hover { color: #fff; }
.header-top .top-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; justify-content: flex-end; }
.header-top select { background: transparent; color: #fff; border: 0; font-size: 13px; cursor: pointer; }
.header-top select option { color: #333; }

/* Header */
.header-part { background: var(--white); border-bottom: 1px solid var(--border); padding: 14px 0; position: sticky; top: 0; z-index: 1020; }
.header-content { display: flex; align-items: center; gap: 24px; }
.header-logo img { max-height: 46px; max-width: 190px; }
.header-logo .site-name { font-size: 22px; font-weight: 700; color: var(--primary); }
.header-form { flex: 1; display: flex; max-width: 560px; background: var(--body); border-radius: 50px; overflow: hidden; border: 1px solid var(--border); }
.header-form input { flex: 1; border: 0; background: transparent; padding: 10px 18px; outline: none; }
.header-form button { border: 0; background: transparent; padding: 0 18px; color: var(--muted); }
.header-widgets { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-widget { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: var(--body); color: var(--heading); font-size: 17px; }
.header-widget:hover { background: var(--primary); color: #fff; }
.header-widget sup { position: absolute; top: -4px; right: -4px; background: var(--primary); color: #fff; font-size: 11px; line-height: 1; min-width: 18px; text-align: center; border-radius: 10px; padding: 3px 5px; }
.header-user { display: flex; align-items: center; gap: 10px; color: var(--heading); }
.header-user img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--body); }
.header-user .name { font-weight: 600; text-transform: uppercase; font-size: 13px; line-height: 1.2; }
.header-user .balance { color: var(--primary); font-weight: 600; font-size: 14px; }
.header-toggle { display: none; border: 0; background: none; font-size: 22px; color: var(--heading); }

/* Thanh menu */
.navbar-part { background: var(--white); border-bottom: 1px solid var(--border); }
.navbar-part .container { display: flex; align-items: center; }
.navbar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.navbar-item { position: relative; }
.navbar-link { display: block; color: var(--heading); padding: 12px 14px; font-size: 14px; font-weight: 500; }
.navbar-item:first-child > .navbar-link { padding-left: 0; }
.navbar-link:hover, .navbar-item:hover > .navbar-link { color: var(--primary); }
.navbar-contact { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 12px; line-height: 1.25; }
.navbar-contact a { display: flex; align-items: center; gap: 8px; color: var(--heading); }
.navbar-contact i { font-size: 24px; color: var(--primary); }
.navbar-item.has-dropdown > .navbar-link::after { content: "\f107"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-left: 6px; font-size: 12px; }
.nav-dropdown { position: absolute; top: 100%; left: 0; min-width: 230px; background: #fff; box-shadow: var(--shadow); border-radius: 0 0 var(--radius) var(--radius); list-style: none; padding: 8px 0; margin: 0; display: none; z-index: 1030; }
.navbar-item:hover > .nav-dropdown { display: block; }
.nav-dropdown a { display: flex; align-items: center; gap: 8px; padding: 8px 18px; color: var(--heading); }
.nav-dropdown a:hover { background: var(--body); color: var(--primary); }
.nav-dropdown img { width: 20px; height: 20px; object-fit: contain; }
.megamenu { position: absolute; top: 100%; left: 0; width: min(900px, 90vw); background: #fff; box-shadow: var(--shadow); border-radius: 0 0 var(--radius) var(--radius); padding: 20px; display: none; z-index: 1030; }
.navbar-item:hover > .megamenu { display: block; }
.megamenu h6 { font-weight: 700; border-bottom: 2px solid var(--primary); padding-bottom: 6px; margin-bottom: 8px; }
.megamenu ul { list-style: none; padding: 0; margin: 0 0 14px; }
.megamenu li a { display: block; padding: 4px 0; color: var(--text); }
.megamenu li a:hover { color: var(--primary); padding-left: 4px; }

/* Thẻ & khối nội dung */
.section { padding: 28px 0 40px; }
.account-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 24px; }
.account-title { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 18px; }
.account-title h4 { font-size: 18px; margin: 0; font-weight: 600; }
/* Tiêu đề khung trang khách: thanh màu chủ đạo như tiêu đề chuyên mục ở trang chủ */
.account-card { border-radius: 4px; }
.account-card > .account-title { margin: -22px -22px 18px; padding: 10px 16px; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 4px 4px 0 0; border-bottom: 0; flex-wrap: wrap; gap: 8px; }
.account-card > .account-title h4 { color: #fff; font-size: 15px; font-weight: 700; text-transform: uppercase; }
.account-card > .account-title h4 i { color: #fff; }
.account-card > .account-title .btn-outline-primary, .account-card > .account-title .btn-light { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .7); }
.account-card > .account-title .btn-outline-primary:hover, .account-card > .account-title .btn-light:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.account-card > .account-title .form-control, .account-card > .account-title .form-select { background-color: #fff; }
.account-card .table { font-size: 13px; }
.account-card .table:not(.history-table) th { background: #f3f4f6; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--heading); }
.account-card .table:not(.history-table) { border: 1px solid var(--border); }
/* Tiêu đề chuyên mục: thanh màu chủ đạo đổ bóng */
.home-heading { background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 4px; padding: 9px 12px; box-shadow: 0 4px 8px rgba(0, 0, 0, .25); }
.home-heading h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; text-transform: uppercase; color: #fff; margin: 0; }
.home-heading img { width: 30px; height: 20px; object-fit: cover; border-radius: 2px; }
.home-group { margin-bottom: 26px; }

/* Trang lịch sử: thanh tiêu đề như trang chủ, bảng viền nhạt */
.history-card { margin-top: 10px; border-radius: 4px; padding: 18px; }
.history-card .form-control, .history-card .form-select { background-color: #f3f4f6; border-color: #e3e5e8; }
.btn-history { background: #e3e5e8; color: var(--heading); font-size: 13px; padding: 5px 10px; }
.btn-history:hover { background: #d3d6da; color: var(--heading); }
.history-table { font-size: 13px; }
.history-table th { background: #f3f4f6 !important; font-size: 12px; font-weight: 600; text-align: center; white-space: nowrap; color: var(--heading); }
.history-table tfoot td { background: #fff; }
.history-table .btn-view { font-size: 11px; padding: 1px 7px; line-height: 1.6; border-radius: 3px; }

.category-buttons { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.category-buttons a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 3px; background: #2b2f33; color: #fff; font-weight: 700; font-size: 12px; text-transform: uppercase; }
.category-buttons a:hover { background: var(--primary); color: #fff; }
.category-buttons a.active { background: #dcdfe3; color: var(--heading); }
.category-buttons img { width: 20px; height: 13px; object-fit: cover; border-radius: 2px; }

.feature-card { background: #fff; border-radius: 4px; border: 1px solid #d9dce0; padding: 12px 14px; margin-bottom: 10px; position: relative; transition: box-shadow .2s; height: calc(100% - 10px); }
.feature-card:hover { box-shadow: var(--shadow); }
.feature-card .col { min-width: 0; }
.feature-card.out-of-stock { opacity: .75; }
.feature-card.out-of-stock::after { content: attr(data-out-label); position: absolute; top: 12px; right: -1px; background: rgba(224, 152, 22, .95); color: #fff; font-size: 11px; padding: 2px 10px; border-radius: 4px 0 0 4px; text-transform: uppercase; }
.feature-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; line-height: 1.45; }
.feature-name a { color: var(--heading); }
.feature-name a:hover { color: var(--primary); }
.feature-desc { font-size: 12px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-text { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px; margin: 0 4px 2px 0; color: #fff; }
.label-text.stock { background: #b5179e; }
.label-text.sold { background: var(--primary); }
.label-text.off { background: var(--red); }
.price-box { border: 1px solid var(--red); border-radius: 4px; text-align: center; font-size: 15px; padding: 5px 8px; margin-bottom: 8px; }
.feature-price { font-size: 18px; font-weight: 700; color: var(--red); margin: 0 0 10px; }
.feature-price del { font-size: 13px; color: var(--muted); font-weight: 400; margin-right: 6px; }
.btn-buy { display: block; width: 100%; border: 0; border-radius: 4px; background: linear-gradient(180deg, var(--primary), var(--primary-dark)); color: #fff; font-weight: 600; padding: 7px 10px; font-size: 13px; text-transform: uppercase; }
.btn-buy:hover { background: var(--primary-dark); color: #fff; }
.btn-buy:disabled { background: #b8bec6; }
.btn-more { display: block; width: 100%; border: 1px solid var(--primary); border-radius: 6px; color: var(--primary); text-align: center; padding: 7px 10px; font-weight: 600; font-size: 14px; text-transform: uppercase; }
.btn-more:hover { background: var(--primary); color: #fff; }
.product-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--body); }
.box4-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.box4-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.box4-head img { width: 26px; height: 26px; object-fit: contain; }
.box4-head h4 { font-size: 15px; margin: 0; font-weight: 600; }
.box4-body { padding: 12px 14px; flex: 1; font-size: 13px; }
.box4-body p { margin-bottom: 4px; }
.box4-body .fa-circle-check { color: var(--green); }
.box4-footer { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); text-align: center; font-size: 12px; }
.box4-footer > div { padding: 8px 4px; }
.box4-footer > div + div { border-left: 1px solid var(--border); }
.box4-footer img { width: 26px; display: block; margin: 2px auto 0; }
.box4-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 14px 14px; }

/* Ví bên phải */
.wallet-card { background: #fff; border-radius: 4px; box-shadow: var(--shadow); padding: 18px 16px; margin-bottom: 24px; }
.wallet-card p { margin: 0; color: var(--muted); font-size: 12px; }
.wallet-card h3 { color: var(--primary); margin: 2px 0 14px; font-size: 26px; font-weight: 600; }
.wallet-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.wallet-grid div { background: #f3f4f6; border-radius: 6px; padding: 14px 16px; }
.wallet-grid h5 { color: var(--heading); font-size: 17px; font-weight: 500; margin: 6px 0 0; }

.feed-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); height: 360px; overflow-y: auto; }
.feed-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.feed-item .badge { white-space: nowrap; height: fit-content; }

/* Bảng, phân trang, form */
.table-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 0; overflow: hidden; }
.table-card .table { margin: 0; }
.table-card th { background: var(--body); font-weight: 600; font-size: 13px; text-transform: uppercase; color: var(--heading); white-space: nowrap; }
.table td { vertical-align: middle; }
.form-label { font-weight: 500; color: var(--heading); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(0, 126, 168, .15); }

/* Đăng nhập / đăng ký */
.auth-wrap { max-width: 460px; margin: 30px auto; }
.auth-wrap .account-card { padding: 32px; }
.auth-wrap h2 { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }

/* Nạp tiền */
.pay-box { border: 2px dashed var(--primary); border-radius: var(--radius); padding: 18px; background: #f7fbfd; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.pay-row:last-child { border-bottom: 0; }
.pay-row .value { font-weight: 700; color: var(--heading); word-break: break-all; text-align: right; }
.pay-row .value.big { font-size: 22px; color: var(--red); letter-spacing: 1px; }
.btn-copy { border: 0; background: var(--body); border-radius: 4px; padding: 3px 8px; font-size: 12px; color: var(--primary); white-space: nowrap; }
.countdown { font-size: 26px; font-weight: 700; color: var(--orange); font-variant-numeric: tabular-nums; }
.qr-img { max-width: 260px; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }

/* Sidebar tài khoản */
.account-menu { list-style: none; padding: 0; margin: 0; }
.account-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; color: var(--heading); }
.account-menu a.active, .account-menu a:hover { background: var(--body); color: var(--primary); }

/* Footer */
.footer-part { background: #fff; color: var(--text); padding: 24px 0 0; margin-top: 40px; font-size: 13px; }
.footer-part h5 { color: var(--heading); font-size: 16px; margin-bottom: 18px; }
.footer-part a { color: var(--text); }
.footer-part a:hover { color: var(--primary); }
.footer-part ul { list-style: none; padding: 0; }
.footer-part li { margin-bottom: 10px; }
.footer-part .contact-list i { color: var(--primary); font-size: 18px; width: 22px; }
.footer-logo img { max-height: 50px; max-width: 190px; margin-bottom: 12px; }
.footer-bottom { background: var(--primary); color: #fff; margin-top: 30px; padding: 14px 20px; font-size: 12px; border-radius: 4px 4px 0 0; }
.footer-bottom a { color: #fff; }

/* Nút nổi */
.backtop { position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: none; align-items: center; justify-content: center; z-index: 1000; }
.backtop.show { display: flex; }
.float-contact { position: fixed; left: 16px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; }
.float-contact a { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; box-shadow: var(--shadow); }
.float-contact .zalo { background: #0068ff; font-size: 12px; }
.float-contact .phone { background: var(--green); font-size: 18px; }

.empty-state { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty-state i { font-size: 46px; margin-bottom: 10px; opacity: .5; }
.content-html img { max-width: 100%; height: auto; }

/* Thanh điều hướng dưới cùng trên điện thoại */
.mobile-bottom-nav { display: none; }

/* Bảng xếp hạng nạp tiền */
.leaderboard li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #e5e7eb; }
.leaderboard li:last-child { border-bottom: 0; }
.leaderboard .rank { width: 26px; height: 26px; border-radius: 50%; background: #eef2f7; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.leaderboard li:nth-child(1) .rank { background: #f5b849; color: #fff; }
.leaderboard li:nth-child(2) .rank { background: #adb5bd; color: #fff; }
.leaderboard li:nth-child(3) .rank { background: #cd7f32; color: #fff; }

@media (max-width: 991px) {
    body { padding-bottom: 62px; }
    .mobile-bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 58px; background: #fff; box-shadow: 0 -2px 10px rgba(0, 0, 0, .08); z-index: 1001; }
    .mobile-bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); }
    .mobile-bottom-nav a i { font-size: 18px; }
    .mobile-bottom-nav a.active { color: var(--primary); }
    .backtop, .float-contact { bottom: 76px; }
    .header-form { display: none; }
    .header-form.open { display: flex; position: absolute; left: 12px; right: 12px; top: 100%; max-width: none; margin-top: 6px; }
    /* Ẩn các icon header trùng với thanh điều hướng dưới (Đơn hàng, Yêu thích, Nạp tiền) để chừa chỗ hiển thị số dư gọn gàng, không tràn màn hình. */
    .header-dup { display: none; }
    /* .name dùng class Bootstrap .d-block (display:block !important) nên phải !important mới ẩn được trên mobile. */
    .header-user .name { display: none !important; }
    .header-user .balance { font-size: 13px; white-space: nowrap; }
    .header-toggle { display: block; }
    .navbar-part { display: none; }
    .navbar-part.open { display: block; }
    .navbar-list { flex-direction: column; }
    .navbar-item:first-child > .navbar-link { padding-left: 14px; }
    .navbar-contact { display: none; }
    .nav-dropdown, .megamenu { position: static; width: auto; box-shadow: none; border-radius: 0; }
    .navbar-item.open > .nav-dropdown, .navbar-item.open > .megamenu { display: block; }
    .navbar-item:hover > .nav-dropdown, .navbar-item:hover > .megamenu { display: none; }
    .navbar-item.open:hover > .nav-dropdown, .navbar-item.open:hover > .megamenu { display: block; }
}
@media (max-width: 575px) {
    .header-content { gap: 8px; }
    .header-widgets { gap: 8px; }
    .header-widget { width: 36px; height: 36px; font-size: 15px; }
    .header-logo img { max-height: 36px; max-width: 130px; }
    .header-logo .site-name { font-size: 18px; }
    .header-user .balance { font-size: 12px; }
    /* Thanh trên cùng: thu gọn để ngôn ngữ + tiền tệ không rớt xuống dòng 2 trên màn hẹp. */
    .header-top { font-size: 12px; }
    .header-top .top-list { gap: 10px; }
    .header-top select { font-size: 12px; }
}
