/* =====================================================================
   HFood – giao dien mobile (cung phong cach voi HGO / HBanks / Hbar)
   - Theme TIM - XANH
   - Chi .screen cuon doc ben trong, khoa truot ngoai
   - Anh chup (logo, banner, mon an, nha hang) la PNG XAM placeholder
   - Icon nho (dac trung, hanh dong, dieu huong) code bang SVG
   ===================================================================== */

:root {
  --maxw: 440px;
  --line: #7a3df0;
  --line-2: #4ea0ff;
  --glow: rgba(130, 80, 240, .45);
  --txt: #f2efff;
  --muted: #b9add9;
  --card: rgba(20, 12, 46, .55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }

body {
  position: fixed; inset: 0;
  color: var(--txt);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  touch-action: none;
  background: #08051a url("public/bg-app.png") center top / cover no-repeat;
}

a { text-decoration: none; color: inherit; }
button { border: 0; font: inherit; color: inherit; cursor: pointer; background: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

.app { position: relative; width: min(100vw, var(--maxw)); height: 100%; margin: 0 auto; }

.screen {
  height: 100%;
  padding: 12px 14px calc(96px + env(safe-area-inset-bottom));
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
}
.screen::-webkit-scrollbar { width: 0; height: 0; }

/* ======================= Header ======================= */
.topbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.menu-btn { display: grid; gap: 6px; place-content: center; width: 44px; height: 44px; }
.menu-btn span { width: 28px; height: 3px; border-radius: 99px; background: #f0f0f0; box-shadow: 0 0 10px rgba(150,110,255,.7); }

.brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand-logo { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.brand-text h1 { font-size: 28px; line-height: .95; font-weight: 800; }
.brand-text p { font-size: 10px; font-weight: 700; letter-spacing: .8px; margin-top: 2px; color: var(--muted); }

.bell-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.bell-ic { width: 24px; height: 24px; color: #f0f0f0; filter: drop-shadow(0 0 7px rgba(150,110,255,.65)); }
.bell-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 99px; background: #e0246b; color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; box-shadow: 0 0 8px rgba(224,36,107,.7); }

.hero-sub { text-align: center; margin: 8px 0 12px; display: grid; gap: 3px; }
.hero-sub strong { font-size: 14px; letter-spacing: 1px; color: #a07bff; text-shadow: 0 0 12px rgba(140,90,255,.6); }
.hero-sub span { font-size: 10.5px; font-weight: 600; color: var(--muted); }

/* ===== khung chung: nen mo, vien tim ===== */
.features, .wallet, .promo-banner, .quick, .web3, .cat img, .rest {
  border: 1.5px solid var(--line);
  box-shadow: 0 0 12px var(--glow), inset 0 0 16px rgba(130,80,240,.08);
}

/* ===== Hang dac trung ===== */
.features {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  border-radius: 12px; padding: 10px 6px; background: var(--card);
}
.feature { display: grid; justify-items: center; gap: 5px; text-align: center; color: #c9bdf2; }
.feature svg { width: 24px; height: 24px; color: #a07bff; }
.feature small { font-size: 9.5px; line-height: 1.15; }

/* ===================== HFOOD WALLET ===================== */
.wallet {
  margin-top: 12px; border-radius: 16px; padding: 14px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(16,8,40,.78), rgba(10,6,26,.86)),
    url("public/emblem-hfood.png") center / cover no-repeat;
}
.wallet-top { display: flex; align-items: center; justify-content: space-between; }
.wallet-brand { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; letter-spacing: .5px; }
.wallet-brand img { width: 22px; height: 22px; border-radius: 50%; }
.ghost-btn { border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 12px; font-weight: 700; color: #d6c9ff; }
.ghost-btn i { font-style: normal; }

.wallet-body { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: 12px; }
.wallet-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.eye { width: 18px; height: 11px; border: 2px solid #cfc6ee; border-radius: 50%; position: relative; }
.eye::after { content: ""; position: absolute; inset: 2px 5px; border-radius: 50%; background: #cfc6ee; }
.wallet-balance { margin-top: 8px; font-size: 28px; font-weight: 900; line-height: 1; }
.wallet-balance small { font-size: 14px; font-weight: 800; }
.wallet-usd { margin-top: 6px; font-size: 13px; color: var(--muted); }

.wallet-actions { display: flex; gap: 8px; border: 1px solid rgba(150,110,255,.4); border-radius: 14px; padding: 10px 8px; background: rgba(40,20,80,.35); }
.wa { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 50px; }
.wa-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(160deg, rgba(150,90,255,.4), rgba(90,40,180,.2)); border: 1px solid var(--line); }
.wa-ic svg { width: 21px; height: 21px; color: #d8c9ff; }
.wa strong { font-size: 11.5px; font-weight: 800; }
.wa small { font-size: 8.5px; color: var(--muted); }

.wallet-coins {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(150,120,255,.25);
}
.wc { display: flex; align-items: flex-start; gap: 7px; }
.wc > img { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; }
.wc strong { display: block; font-size: 11px; font-weight: 800; }
.wc b { display: block; font-size: 11px; font-weight: 800; margin-top: 1px; }
.wc small { display: block; font-size: 8.5px; color: var(--muted); }
.wc .link { color: #8fb6ff; }
.wc-more-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); flex: 0 0 auto; }
.wc-more-ic svg { width: 15px; height: 15px; color: #d8c9ff; }

/* ===================== Search ===================== */
.searchbar { display: flex; gap: 8px; margin-top: 12px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(20,12,46,.6); }
.search-field svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.search-field input { flex: 1; border: 0; background: none; outline: none; color: var(--txt); font-size: 13px; }
.search-field input::placeholder { color: var(--muted); }
.loc-chip { display: flex; align-items: center; gap: 5px; padding: 0 12px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(20,12,46,.6); font-size: 12px; font-weight: 700; color: #d6c9ff; white-space: nowrap; }
.loc-chip svg { width: 16px; height: 16px; color: #ff5a8a; }
.loc-chip i { font-style: normal; }

/* ===================== Banner uu dai ===================== */
.promo-banner { position: relative; margin-top: 12px; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; }
.promo-banner > img { width: 100%; height: 100%; object-fit: cover; }
.promo-overlay { position: absolute; inset: 0; display: grid; align-content: center; gap: 2px; padding: 16px; background: linear-gradient(90deg, rgba(10,6,26,.85) 40%, rgba(10,6,26,.1)); }
.po-1 { font-size: 13px; font-weight: 800; color: #e7deff; }
.po-2 { font-size: 12px; font-weight: 700; color: var(--muted); }
.po-3 { font-size: 48px; font-weight: 900; line-height: 1; color: #ff3d8b; text-shadow: 0 0 16px rgba(255,61,139,.6); }
.po-4 { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.po-btn { justify-self: start; padding: 7px 16px; border-radius: 8px; background: linear-gradient(#9b5cf6, #6d28d9); border: 1px solid #c4a4ff; color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 0 10px rgba(150,90,255,.6); }
.dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.4); }
.dots i.on { width: 14px; background: #fff; }

/* ===================== Quick services ===================== */
.quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 12px; border-radius: 14px; padding: 14px 4px; background: var(--card); }
.qk { display: grid; justify-items: center; gap: 5px; text-align: center; }
.qk-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(160deg, rgba(150,90,255,.35), rgba(90,40,180,.18)); border: 1px solid var(--line); box-shadow: 0 0 10px var(--glow); }
.qk-ic svg { width: 23px; height: 23px; color: #cdb8ff; }
.qk strong { font-size: 11px; font-weight: 800; }
.qk small { font-size: 9px; color: var(--muted); }

/* ===================== Section head ===================== */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.section-head h2 { font-size: 16px; font-weight: 800; }
.link { font-size: 12px; color: #8fb6ff; font-weight: 700; }

/* ===== hang truot ngang ===== */
.hscroll { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; overflow-y: hidden; touch-action: pan-x pan-y; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.hscroll::-webkit-scrollbar { height: 0; }

/* ===================== Danh muc ===================== */
.cat { flex: 0 0 auto; display: grid; justify-items: center; gap: 6px; width: 76px; text-align: center; }
.cat img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.cat strong { font-size: 11px; font-weight: 700; }

/* ===================== Nha hang ===================== */
.rest { flex: 0 0 200px; display: grid; gap: 3px; border-radius: 14px; padding: 8px; background: var(--card); }
.rest-img { position: relative; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10; }
.rest-img img { width: 100%; height: 100%; object-fit: cover; }
.rating { position: absolute; top: 6px; right: 6px; background: rgba(10,6,26,.8); border: 1px solid var(--line); color: #ffd34d; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 99px; }
.rest strong { margin-top: 5px; font-size: 14px; font-weight: 800; }
.rest small { font-size: 10.5px; color: var(--muted); }
.freeship { justify-self: start; margin-top: 3px; font-size: 10px; font-weight: 800; color: #44d39a; }

/* ===================== HFOOD WEB3 ===================== */
.web3 { margin-top: 16px; border-radius: 16px; padding: 12px; background: var(--card); }
.web3-title { text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .5px; color: #b89bff; margin-bottom: 12px; }
.web3-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.w3card { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(30,16,64,.4); }
.w3card img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 10px; }
.w3card strong { font-size: 12px; font-weight: 800; }
.w3card small { font-size: 9px; color: var(--muted); line-height: 1.2; }
.w3btn { margin-top: 4px; padding: 5px 10px; border-radius: 7px; border: 1px solid #6ad0ff; color: #bfe6ff; font-size: 10px; font-weight: 800; background: rgba(40,90,160,.25); }

/* ============== BOTTOM NAV (dung chung dang) ============== */
.bottom-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; align-items: flex-end;
  background: linear-gradient(180deg, rgba(16,9,38,.92), rgba(8,4,18,.98));
  border-top: 1px solid #2a1850;
  padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
}
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; color: #8a78b8; font-size: 11px; }
.nav-item svg { width: 23px; height: 23px; color: currentColor; }
.nav-item.active { color: #b98bff; }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(170,110,255,.7)); }
.nav-center { position: relative; color: #b98bff; }
.nav-center-label { font-size: 11px; }
.nav-center-circle {
  width: 60px; height: 60px; margin-top: -24px; border-radius: 50%;
  background-image: url("public/nav-center-btn.png");
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
