/* ===== MyShare.vn ===== */
:root {
  /* Lạc Xoong: xanh lá tươi mát + beige/trắng/vàng nhạt — sạch sẽ, thân thiện môi trường */
  --primary: #4CAF50;
  --primary-dark: #388E3C;
  --primary-deep: #2E7D32;
  --primary-light: #E8F5E9;
  --accent: #f59e0b;
  --text: #1f2a1f;
  --muted: #6b7566;
  --border: #e9e6da;
  --bg: #FAF8F0;
  --danger: #dc2626;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(46, 90, 50, .05), 0 2px 8px rgba(46, 90, 50, .04);
  --shadow-md: 0 4px 14px rgba(46, 90, 50, .08), 0 2px 4px rgba(46, 90, 50, .05);
  --shadow-lg: 0 12px 32px rgba(46, 90, 50, .14);
  --grad-primary: linear-gradient(135deg, #66BB6A, #43A047);
  --grad-accent: linear-gradient(135deg, #fbbf24, #f59e0b);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a, button, .card, .cat-item, .panel, input, select { transition: all .18s ease; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }

/* ---- Header ---- */
.header { background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(230, 235, 233, .8); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.logo { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.8px; }
.logo span { background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo:hover { text-decoration: none; }
.search { flex: 1; display: flex; max-width: 480px; }
.search input { flex: 1; border: 2px solid var(--primary); border-right: none; border-radius: 8px 0 0 8px; padding: 8px 12px; font-size: 14px; outline: none; }
.search button { border: none; background: var(--primary); color: #fff; padding: 0 16px; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 16px; }
.nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-link { font-size: 20px; position: relative; text-decoration: none; }
.nav-link:hover { text-decoration: none; }
.nav-link-text { font-weight: 600; font-size: 14px; }
.nav-user { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.nav-user:hover { text-decoration: none; }
.nav-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; min-width: 16px; text-align: center; }
.chat-item-meta .dot, .chat-list .dot { position: static; }
.catbar { display: flex; gap: 4px; overflow-x: auto; padding: 6px 16px; }
.catbar-item { white-space: nowrap; font-size: 13px; padding: 4px 10px; border-radius: 999px; color: var(--text); }
.catbar-item:hover, .catbar-item.active { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }

/* ---- Nút ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 12px; padding: 10px 18px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; text-decoration: none !important; }
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: 0 4px 12px rgba(76, 175, 80, .35); }
.btn-post { background: var(--grad-accent); color: #fff; font-weight: 800; letter-spacing: .2px; box-shadow: 0 4px 14px rgba(245, 158, 11, .5); animation: postGlow 2.6s ease-in-out infinite; }
@keyframes postGlow { 0%, 100% { box-shadow: 0 4px 14px rgba(245, 158, 11, .5); } 50% { box-shadow: 0 6px 22px rgba(245, 158, 11, .8); } }

/* Nút Đăng tin nổi (FAB) — chỉ hiện trên mobile, dính đáy màn hình */
.post-fab { display: none; }
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 10px 26px rgba(245, 158, 11, .55), 0 0 0 0 rgba(245, 158, 11, .5); }
  50%      { box-shadow: 0 10px 26px rgba(245, 158, 11, .55), 0 0 0 12px rgba(245, 158, 11, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-post, .post-fab { animation: none; }
}
.btn-outline { background: #fff; color: var(--primary-dark); border: 1.5px solid var(--primary); }
.btn-ghost { background: #f3f4f6; color: var(--text); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; text-align: center; padding: 52px 16px 34px; background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 45%, #388E3C 100%); border-radius: 24px; margin-top: 16px; color: #f2fbf0; box-shadow: var(--shadow-lg); }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .4; pointer-events: none; }
.hero::before { width: 380px; height: 380px; background: #C5E1A5; top: -180px; left: -100px; }
.hero::after { width: 320px; height: 320px; background: #FFF59D; bottom: -180px; right: -80px; }
.hero > * { position: relative; z-index: 1; }
.hero-brand { display: inline-block; background: rgba(255, 251, 235, .22); border: 1px solid rgba(255, 255, 255, .35); color: #FFFDE7; font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; border-radius: 999px; padding: 6px 16px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(28px, 4.6vw, 46px); font-weight: 800; letter-spacing: -0.5px; color: #fff; margin-bottom: 12px; text-shadow: 0 2px 12px rgba(27, 67, 30, .25); }
.hero p { color: #E8F5E9; margin-bottom: 20px; }
.hero .hero-tag { font-size: clamp(18px, 2.6vw, 26px); font-weight: 700; color: #FFFDE7; margin-bottom: 24px; text-shadow: 0 1px 8px rgba(27, 67, 30, .25); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px 12px; justify-content: center; margin-top: 26px; }
.hero-badges span { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .32); color: #fff; font-weight: 600; font-size: clamp(13px, 1.5vw, 16px); padding: 8px 16px; border-radius: 999px; backdrop-filter: blur(2px); }
.hero .btn-hero-main { background: #FFFDE7; color: #2E7D32; box-shadow: 0 6px 18px rgba(27, 67, 30, .25); }
.hero .btn-ghost { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.hero .btn-hero-soft { background: rgba(46, 125, 50, .35); color: #FFFDE7; border: 1px solid rgba(255, 253, 231, .35); }
.hero-stats b { color: #fff !important; }
.hero-stats span { color: #DCEDC8 !important; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; justify-content: center; margin-top: 26px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 22px; color: var(--primary-dark); }
.hero-stats span { font-size: 12px; color: var(--muted); }

/* ---- Section & lưới ---- */
.main { min-height: 60vh; padding-bottom: 40px; }
.section { margin-top: 30px; }
.section-title { font-size: 19px; margin-bottom: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.link-more { font-size: 13px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 14px; }
.cat-item { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 20px 12px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: flex-start; box-shadow: var(--shadow-sm); min-height: 132px; }
.cat-item:hover { box-shadow: 0 10px 24px rgba(76, 175, 80, .16); transform: translateY(-4px); text-decoration: none; border-color: var(--primary); background: #f6fdf7; }
.cat-icon { display: flex; justify-content: center; align-items: center; height: 56px; }
/* Icon emoji minh họa nhiều màu, không nền */
.cat-item .cat-emoji { display: inline-flex; align-items: center; justify-content: center; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.08)); }
.cat-item:hover .cat-emoji { transform: scale(1.12); transition: transform .18s ease; }
.catbar-item { display: inline-flex; align-items: center; gap: 5px; }
.catbar-item .cat-emoji { line-height: 1; }
.cat-name { font-weight: 600; font-size: 14px; line-height: 1.35; color: var(--text); display: flex; align-items: center; min-height: 2.7em; }
@media (max-width: 600px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-item { padding: 16px 6px; border-radius: 15px; min-height: 120px; gap: 9px; }
  .cat-name { font-size: 12.5px; min-height: 2.6em; }
}
.section-free { background: #FFF8E1; border: 1px solid #FDEBB2; border-radius: var(--radius); padding: 18px; }

/* ---- Bảng Tin ưu tiên (4 ô luân phiên như quảng cáo) ---- */
.uu-tien-strip { background: linear-gradient(135deg, #fff7ed, #fffbeb); border: 1px solid #fde68a; border-radius: 16px; padding: 12px 14px 16px; margin-bottom: 18px; }
.uu-tien-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.uu-tien-badge { font-weight: 800; font-size: 14px; color: #b45309; background: #fef3c7; border: 1px solid #fcd34d; padding: 4px 12px; border-radius: 999px; }
.uu-tien-head .muted { font-size: 12.5px; }
.uu-tien-cards { transition: opacity .2s ease; }

/* ---- Card tin đăng ---- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); text-decoration: none; border-color: #cde9e3; }
.card-img { aspect-ratio: 1; background: #f3f4f6; position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-img img { transform: scale(1.06); }
.noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 34px; color: #cbd5e1; }
.noimg-lg { min-height: 280px; font-size: 20px; text-align: center; flex-direction: column; }
.tag-free { position: absolute; top: 8px; left: 8px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.tag-free-lg { font-size: 14px; padding: 6px 12px; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-size: 14px; font-weight: 500; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.card-price { color: var(--accent); font-weight: 700; font-size: 15px; margin-top: 4px; }
.card-price.free { color: #e11d48; }
.card-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card-meta .dist { color: var(--primary-dark); }
.geo-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.near-badge { background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 600; border-radius: 8px; padding: 6px 10px; margin-top: 8px; }
#miniMap { height: 280px; border-radius: 8px; z-index: 1; }
.bds-box { background: #f0fdf9; border: 1px solid #ccfbf1; border-radius: 10px; padding: 14px; margin-top: 14px; }
.bds-info { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.bds-info .chip { background: var(--primary-light); }
.gia-tham-khao { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

/* ---- Đấu giá ---- */
.auction-box { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.auction-head { margin-bottom: 6px; }
.auction-head .countdown { color: #c2410c; }
.auction-current { font-size: 15px; margin-bottom: 10px; }
.auction-form { display: flex; gap: 8px; margin-bottom: 6px; }
.auction-form input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.auction-bids { border-top: 1px dashed #fed7aa; margin-top: 10px; padding-top: 8px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }

/* ---- Trả giá & Yêu thích (nút hành động phụ, rõ ràng & thân thiện) ---- */
.detail-actions-2 { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.detail-actions-2 > form { margin: 0; }
.btn-offer { background: #fff7ed; color: #b45309; border: 1.5px solid #fdba74; }
.btn-offer:hover { background: #ffedd5; }
.btn-fav { background: #fff; color: #e11d48; border: 1.5px solid #fecdd3; }
.btn-fav:hover { background: #fff1f2; }
.btn-fav.active { background: #ffe4e6; border-color: #fda4af; color: #be123c; }
.offer-details { position: relative; }
.offer-details summary { list-style: none; cursor: pointer; }
.offer-details summary::-webkit-details-marker { display: none; }
.offer-details summary::after { content: '▾'; margin-left: 8px; font-size: 12px; display: inline-block; transition: transform .2s ease; }
.offer-details[open] summary::after { transform: rotate(180deg); }
.offer-details[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.offer-body { background: #fffdf7; border: 1.5px solid #fdba74; border-top: none; border-radius: 0 0 12px 12px; padding: 12px; margin-top: -1px; }
.offer-body .auction-form { margin-bottom: 0; }
.offer-panel { background: #fffbeb; border-color: #fde68a; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.offer-actions { display: flex; gap: 8px; margin-left: auto; }
.offer-actions form { margin: 0; }
.ai-check { border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 8px; }

/* ---- Thương hiệu chính hãng (Resale-as-a-Service) ---- */
.tag-brand { position: absolute; top: 8px; right: 8px; background: var(--grad-primary); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: #fff; font-weight: 800; font-size: 20px; flex-shrink: 0; }
.brand-logo-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 30px; }
.brand-check { color: var(--primary-dark); font-weight: 800; }
.brand-hero { background: var(--primary-light); border: 1px solid #cdeccf; border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.brand-hero h1 { font-size: 22px; margin-bottom: 6px; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.brand-card { display: flex; gap: 12px; align-items: flex-start; color: var(--text); margin-bottom: 0; }
.brand-card:hover { text-decoration: none; border-color: var(--primary); }
.brand-invite { margin-top: 16px; background: #FFF8E1; border-color: #FDEBB2; }
.brand-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.brand-chip { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; white-space: nowrap; color: var(--text); box-shadow: var(--shadow-sm); }
.brand-chip:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-md); }
.brand-banner { display: flex; gap: 16px; align-items: center; border-radius: 20px; padding: 26px; color: #fff; margin: 16px 0; box-shadow: var(--shadow-lg); flex-wrap: wrap; }
.brand-banner h1 { font-size: 24px; }
.brand-banner p { opacity: .92; }
.brand-check-lg { background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .4); font-size: 13px; padding: 3px 10px; border-radius: 999px; vertical-align: middle; }
.brand-meta { margin-top: 6px; font-size: 13px; opacity: .95; }
.brand-warranty { background: var(--primary-light); border-color: #cdeccf; }

/* ---- Nhóm cộng đồng ---- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.group-card { display: flex; gap: 12px; align-items: flex-start; color: var(--text); margin-bottom: 0; }
.group-card:hover { text-decoration: none; border-color: var(--primary); }
.group-icon { font-size: 30px; }
.group-page { max-width: 760px; margin: 16px auto; }
.group-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.group-head h1 { font-size: 21px; }
.group-post-body { margin: 8px 0; font-size: 14px; }
.group-listing { display: flex; gap: 10px; align-items: center; background: var(--primary-light); border-radius: 8px; padding: 8px 10px; color: var(--text); margin-bottom: 8px; }
.group-listing:hover { text-decoration: none; }
.group-replies { border-top: 1px dashed var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.group-reply { font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.group-reply-form { display: flex; gap: 6px; margin-top: 4px; }
.group-reply-form input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; }

/* ---- How it works ---- */
.how { background: #fff; border-radius: var(--radius); padding: 22px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.how-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.how-col-title { font-size: 16px; font-weight: 800; color: var(--primary-dark, #2E7D32); margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid #E8F5E9; }
.how-col .how-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.how-col .how-item > span { flex: none; width: 28px; height: 28px; border-radius: 8px; background: #E8F5E9; color: #2E7D32; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.how-item span { font-size: 24px; }
.how-item b { display: block; margin: 6px 0 4px; }
.how-col .how-item b { margin: 2px 0 3px; }
.how-item p { font-size: 13px; color: var(--muted); }
.how-col .how-item p { margin: 0; line-height: 1.5; }
@media (max-width: 720px) { .how-cols { grid-template-columns: 1fr; gap: 16px; } }

/* ---- Panel & form ---- */
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.form label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
.form input, .form select, .form textarea, .filters input, .filters select, .report-form select, .report-form textarea, .admin-search input, .wallet-head input, textarea[name="note"] {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 13px; font-size: 14px; font-family: inherit; outline: none; background: #fbfdfc;
}
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 159, 138, .14); background: #fff;
}
.form button { margin-top: 16px; }
.form-page { max-width: 640px; margin: 20px auto; }
.form-page h1 { margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.req { color: var(--danger); }
.field-hint { font-size: 12.5px; line-height: 1.55; color: #4b5563; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 9px; padding: 8px 11px; margin: 2px 0 6px; }
.char-counter { font-size: 12px; font-weight: 600; margin-top: 5px; text-align: right; }
.char-counter.short { color: var(--danger); }
.char-counter.ok { color: var(--primary); }
.char-counter.ok::before { content: '✓ '; }
.check-free { display: flex; align-items: center; gap: 8px; background: #fff1f2; padding: 10px 12px; border-radius: 8px; margin-top: 12px; font-weight: 400 !important; }
.check-free input { width: auto !important; }
.img-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.img-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.video-preview { margin-top: 8px; }
.video-preview-el { max-width: 280px; border-radius: 10px; border: 1px solid var(--border); }
.listing-video { width: 100%; max-height: 440px; border-radius: 10px; background: #000; }

/* ---- Auth ---- */
.auth-page { display: flex; justify-content: center; padding: 30px 0; }
.auth-panel { width: 100%; max-width: 420px; }
.auth-panel h1 { font-size: 22px; margin-bottom: 4px; }
.demo-note { margin-top: 14px; background: var(--primary-light); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.demo-note code { background: #fff; padding: 1px 6px; border-radius: 4px; }

/* ---- Flash ---- */
.flash { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 14px; font-weight: 500; }
.flash-success { background: #dcfce7; color: #15803d; }
.flash-error { background: #fee2e2; color: #b91c1c; }
.flash-warn { background: #fef3c7; color: #b45309; }

/* ---- Browse ---- */
.browse { display: grid; grid-template-columns: 240px 1fr; gap: 18px; margin-top: 18px; }
.filters { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; align-self: start; position: sticky; top: 110px; }
.filters h3 { font-size: 15px; margin: 10px 0 8px; }
.filters label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
.filters button { width: 100%; margin-top: 12px; }
.price-row { display: flex; gap: 6px; }
.filter-cats { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.filter-cats em { color: var(--muted); font-style: normal; font-size: 11px; }
.browse-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.browse-head h1 { font-size: 20px; }
.pagination { display: flex; justify-content: center; gap: 16px; margin-top: 22px; align-items: center; }
.empty { background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--muted); }

/* ---- Chi tiết tin ---- */
.crumbs { font-size: 13px; color: var(--muted); margin: 14px 0; }
.detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.gallery-main { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; }
.gallery-main img { width: 100%; max-height: 440px; object-fit: contain; background: #f8fafc; display: block; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--primary); }
.detail-title { font-size: 21px; margin-bottom: 6px; }
.detail-price { font-size: 26px; font-weight: 800; color: var(--accent); margin-bottom: 14px; }
.detail-price.free { color: #e11d48; }
.detail-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.detail-actions form { margin: 0; }
.safe-note { background: var(--primary-light); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-top: 10px; }
.sold-banner { background: #f3f4f6; border-radius: 8px; padding: 12px; text-align: center; font-weight: 600; }
.desc { white-space: pre-line; font-size: 14px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { background: #f3f4f6; border-radius: 999px; padding: 4px 12px; font-size: 12px; }
.seller-head { display: flex; gap: 12px; align-items: center; color: var(--text); margin-bottom: 8px; }
.seller-head:hover { text-decoration: none; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.review { border-top: 1px solid var(--border); padding: 10px 0; }
.review:first-of-type { border-top: none; }
.review-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.report-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* ---- Avatar ---- */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; }

/* ---- Tài khoản ---- */
.account-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.account-info { flex: 1; min-width: 220px; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mylisting { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mylisting-img { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: #f3f4f6; flex-shrink: 0; }
.mylisting-img img { width: 100%; height: 100%; object-fit: cover; }
.mylisting-body { flex: 1; min-width: 200px; }
.mylisting-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mylisting-actions form { margin: 0; display: flex; gap: 6px; }
.mylisting-actions input { border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 12px; width: 130px; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.shortcut { text-align: center; font-weight: 600; color: var(--text); }
.shortcut:hover { text-decoration: none; border-color: var(--primary); }

/* ---- Chat ---- */
.chat-list { padding: 0; overflow: hidden; }
.chat-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: center; color: var(--text); }
.chat-item:hover { background: var(--primary-light); text-decoration: none; }
.chat-item.unread { background: #f0fdf9; }
.chat-item-body { flex: 1; min-width: 0; }
.chat-last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 480px; }
.chat-item-meta { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.chat-page { max-width: 720px; margin: 16px auto; }
.chat-header { display: flex; gap: 10px; align-items: center; }
.chat-thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: #f3f4f6; display: flex; align-items: center; justify-content: center; }
.chat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.chat-box { height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { background: #f3f4f6; border-radius: 14px 14px 14px 4px; padding: 8px 12px; max-width: 75%; font-size: 14px; }
.bubble-row.mine .bubble { background: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; }
.bubble-time { display: block; font-size: 10px; opacity: .65; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; }

/* ---- Đơn hàng ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text); }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab:hover { text-decoration: none; }
.order-item { display: flex; gap: 12px; align-items: center; color: var(--text); }
.order-item:hover { text-decoration: none; border-color: var(--primary); }
.order-thumb { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; background: #f3f4f6; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-body { flex: 1; min-width: 0; }
.order-right { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.order-detail { max-width: 860px; margin: 16px auto; }
.order-detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.order-table { width: 100%; font-size: 14px; border-collapse: collapse; margin-top: 10px; }
.order-table td { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.order-table td:last-child { text-align: right; }
.order-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.order-actions textarea { margin-bottom: 6px; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { display: flex; gap: 10px; font-size: 14px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }

/* ---- Ví ---- */
.wallet { max-width: 760px; margin: 16px auto; }
.wallet-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.wallet-balance { font-size: 30px; font-weight: 800; color: var(--primary-dark); }
.wallet-head form { display: flex; gap: 8px; }
.wallet-head input { width: 150px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 8px; border-bottom: 2px solid var(--border); font-size: 12px; color: var(--muted); text-transform: uppercase; }
.table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }

/* ---- Admin ---- */
.admin { display: grid; grid-template-columns: 220px 1fr; gap: 18px; margin-top: 18px; }
.admin-side { align-self: start; position: sticky; top: 110px; padding: 12px; }
.admin-brand { font-weight: 800; padding: 8px 10px; margin-bottom: 6px; }
.admin-nav { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 500; }
.admin-nav:hover, .admin-nav.active { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.admin-main h1 { font-size: 22px; margin-bottom: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { font-size: 21px; color: var(--primary-dark); }
.admin-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; align-items: center; }
.admin-search { display: flex; gap: 8px; margin-bottom: 14px; max-width: 420px; }
.row-actions form { display: inline-block; }

/* ---- Static & footer ---- */
.static-page { max-width: 760px; margin: 20px auto; }
.static-page h1 { margin-bottom: 12px; }
.static-page h2 { margin: 18px 0 8px; font-size: 17px; }
.static-page p { margin-bottom: 10px; }
.footer { background: linear-gradient(160deg, #1B3A1F, #122916); color: #d7e7d2; margin-top: 48px; padding: 34px 0 0; font-size: 13px; }
.footer a { color: #aed4a3; display: block; margin-bottom: 6px; }
.footer h4 { color: #fff; margin-bottom: 10px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 24px; padding-bottom: 20px; }
.logo-footer { color: #fff; margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding: 14px 16px; text-align: center; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .browse, .detail, .admin, .admin-two { grid-template-columns: 1fr; }
  .filters, .admin-side { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-inner { flex-wrap: wrap; }
  .search { order: 3; max-width: none; width: 100%; }
  .hero-stats { gap: 20px; }
  .nav-name { display: none; }
  /* Trên mobile: ẩn nút trong header, dùng FAB dính đáy thay thế */
  .nav .btn-post { display: none; }
  .post-fab {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 200;
    background: var(--grad-accent); color: #fff;
    font-weight: 800; font-size: 16px; letter-spacing: .3px;
    padding: 15px 34px; border-radius: 999px;
    text-decoration: none !important;
    animation: fabPulse 2.2s ease-in-out infinite;
  }
  .post-fab:active { transform: translateX(-50%) scale(.95); }
  /* Chừa chỗ để FAB không che footer/nội dung cuối trang */
  .footer { padding-bottom: 88px; }
}

/* ---- Ví MShare: nạp nhanh ---- */
.topup-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.topup-btn { border: 1.5px solid var(--border); background: #fbfdfc; border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.topup-btn:hover, .topup-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.topup-row { display: flex; gap: 8px; }
.topup-row input { flex: 1; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 13px; font-size: 14px; font-family: inherit; outline: none; background: #fbfdfc; max-width: 260px; }
.wallet-earn { background: var(--primary-light); border: 1px solid #cdeccf; margin-top: 12px; }

/* ---- Gói tin đăng: đẩy tin / tin ưu tiên ---- */
.tag-priority { position: absolute; bottom: 8px; left: 8px; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.boost-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.boost-card { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.boost-card .muted { flex: 1; font-size: 13px; }
.boost-icon { font-size: 34px; }
.boost-price { font-size: 20px; font-weight: 800; color: var(--primary-dark); margin: 6px 0; }
.boost-card button[disabled] { opacity: .5; cursor: not-allowed; }

/* Danh sách trong trang tĩnh (quy chế, bảo mật, trợ giúp) */
.static-page ul { margin: 0 0 12px; padding-left: 22px; }
.static-page li { margin-bottom: 6px; line-height: 1.55; }
.static-page h3 { margin: 14px 0 6px; font-size: 15px; }

/* Thông báo */
.notif-list { display:flex; flex-direction:column; }
.notif-item { display:flex; gap:12px; padding:14px 8px; border-bottom:1px solid var(--line,#e5e7eb); text-decoration:none; color:inherit; }
.notif-item.unread { background:#f0fdf4; }
.notif-ico { font-size:22px; width:34px; text-align:center; }
.notif-body b { color:#1f2937; }

/* Quản trị: form nạp ví + tạo admin */
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.grid2 label { font-size:13px; }
.nap-form { display:flex; gap:4px; align-items:center; }
.nap-form input, .nap-form select { padding:5px 6px; font-size:13px; }
@media (max-width:640px){ .grid2 { grid-template-columns:1fr; } }

/* Dải ngành con trên trang danh mục */
.subcat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.subcat-chip { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line, #e5e7eb); color: var(--ink, #1f2937); font-size: 13px; font-weight: 500; text-decoration: none; }
.subcat-chip:hover { border-color: #4CAF50; color: #2E7D32; }
.subcat-chip.active { background: #2E7D32; color: #fff; border-color: #2E7D32; }

/* Dải hãng (điện tử, xe cộ) */
.brand-chips { align-items: center; }
.brand-label { font-size: 13px; color: var(--muted, #6b7280); font-weight: 600; margin-right: 2px; }
