:root {
  --hero-overlay: 0.62;
  --content-width: 1120px;
  --bg: #F6F5EF;
  --bg-alt: #FFFFFF;
  --ink: #22261F;
  --muted: #6F6D5F;
  --border: #DEDACB;
  --navy: #1B2A4A;
  --navy-light: #2E4270;
  --amber: #E8A33D;
  --amber-dark: #C6842A;
  --teal: #2F7A5D;
  --teal-dark: #205940;
  --radius-card: 10px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Be Vietnam Pro", -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.wrap {
  max-width: var(--content-width, 1120px);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
}

.menu-btn {
  background: none; border: none; color: var(--navy); cursor: pointer;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; flex-shrink: 0;
}
.menu-btn:hover { background: var(--bg); }

.logo {
  font-weight: 800;
  font-size: 22px;
  color: var(--navy);
  white-space: nowrap;
}
.logo span { color: var(--amber-dark); }

.header-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; margin-left: auto; }
.link-plain { font-weight: 500; color: var(--navy); }
.link-hide-mobile { margin-right: 4px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-alt); color: var(--navy);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg); }

/* ---------- Menu tài khoản (khi đã đăng nhập) ---------- */
.account-menu { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer; padding: 4px 8px 4px 4px;
  border-radius: var(--radius-pill); font: inherit;
}
.account-btn:hover { background: var(--bg); }
.account-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.account-name { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.account-role { font-size: 11px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: var(--radius-pill); }
.account-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 170px;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(27,42,74,0.14); padding: 6px; z-index: 30;
}
.account-dropdown.open { display: block; }
.account-dropdown a {
  display: block; padding: 9px 12px; font-size: 13.5px; color: var(--ink); border-radius: 7px;
}
.account-dropdown a:hover { background: var(--bg); }

@media (max-width: 520px) { .account-role { display: none; } .account-name { display: none; } }

.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
}
.btn-amber { background: var(--amber); color: var(--navy); }
.btn-amber:hover { background: var(--amber-dark); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-light); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-lg { padding: 14px 26px; font-size: 16px; }

/* ---------- Service tabs ---------- */
.service-tabs { background: var(--navy); }
.tabs-row { display: flex; justify-content: center; gap: 4px; }
.tab {
  background: none;
  border: none;
  color: #C7D0E0;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab-active { color: #fff; border-bottom-color: var(--amber); }

/* ---------- Hero band + thanh tìm kiếm nổi ---------- */
.hero-band {
  background:
    linear-gradient(120deg, rgba(27,42,74,var(--hero-overlay, 0.62)) 0%, rgba(198,132,42,var(--hero-overlay, 0.62)) 100%),
    url("https://picsum.photos/seed/rao24hbanner/1600/500") center/cover no-repeat;
  padding: 44px 0 76px;
  text-align: center;
}
.hero-band-inner { max-width: 720px; margin: 0 auto; }
.hero-eyebrow { color: #FFE9C2; font-weight: 700; margin: 0 0 10px; font-size: 13.5px; }
.hero-band h1 {
  font-size: 38px; line-height: 1.2; margin: 0 0 14px;
  color: #fff; font-weight: 800; letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.hero-sub { color: #F3EADA; font-size: 16px; margin: 0; }

.hero-search-wrap { margin-top: -46px; margin-bottom: 32px; position: relative; z-index: 2; }
.hero-search-card {
  background: var(--bg-alt); border-radius: 16px; box-shadow: var(--shadow-pop, 0 16px 36px -12px rgba(27,42,74,0.28));
  padding: 10px; display: flex; align-items: stretch; gap: 8px; max-width: 860px; margin: 0 auto;
}
.hero-search-input { flex: 1.6; display: flex; align-items: center; gap: 10px; padding: 6px 14px; color: var(--muted); }
.hero-search-input input { border: none; outline: none; font: inherit; font-size: 15px; flex: 1; background: none; }
.hero-search-loc {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 6px 14px;
  border-left: 1px solid var(--border); color: var(--navy);
}
.hero-search-loc select { border: none; outline: none; font: inherit; font-size: 14.5px; background: none; flex: 1; color: var(--navy); }
.hero-search-btn { flex-shrink: 0; }

/* ---------- Category strip: cuộn ngang + nút xem thêm ---------- */
.cat-strip { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 22px 0; }
.cat-strip-inner { position: relative; display: flex; align-items: center; gap: 8px; }
.cat-row {
  display: flex; gap: 6px; overflow-x: auto; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none; flex: 1;
  justify-content: space-between;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap;
  padding: 8px 10px; border-radius: 10px; flex-shrink: 0;
}
.cat-item:hover { background: var(--bg); }
.cat-icon-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1;
}
.ic-1 { background: #FBEAD9; color: #B85C28; }
.ic-2 { background: #E4ECF7; color: #2E5C9A; }
.ic-3 { background: #E9E4F5; color: #6C4FA0; }
.ic-4 { background: #FDEBEA; color: #C0473E; }
.ic-5 { background: #FBE7F0; color: #B23E75; }
.ic-6 { background: #E8F3E7; color: #3F7A3D; }
.ic-7 { background: #FFF3D6; color: #B8860B; }
.ic-8 { background: #E1F1EC; color: var(--teal-dark); }
.ic-give { background: #E1F1EC; color: var(--teal-dark); }

.cat-next-btn {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--navy);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cat-next-btn:hover { background: var(--bg); }


/* ---------- About block ---------- */
.about-block {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  margin-bottom: 40px;
}
.about-block h2 { color: var(--navy); font-size: 19px; margin: 0 0 10px; }
.about-block p { color: var(--muted); font-size: 14.5px; max-width: 78ch; margin: 0; }

/* ---------- Keyword card ---------- */
.keyword-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 32px 8px;
  margin-bottom: 56px;
}
.keyword-card h3 { font-size: 17px; color: var(--navy); margin: 0 0 18px; }
.keyword-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 24px;
}
.keyword-columns ul { list-style: disc; margin: 0; padding: 0 0 20px 18px; }
.keyword-columns li { margin-bottom: 11px; }
.keyword-columns li::marker { color: var(--border); }
.keyword-columns a { font-size: 13.5px; color: var(--muted); }
.keyword-columns a:hover { color: var(--navy); }

/* ---------- App download banner ---------- */
.app-banner {
  background: linear-gradient(120deg, var(--amber) 0%, var(--amber-dark) 100%);
}
.app-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 52px 24px;
}
.app-banner-copy h2 {
  color: var(--navy);
  font-size: 26px;
  margin: 0 0 10px;
  max-width: 20ch;
}
.app-banner-copy p { color: #5B4419; margin: 0 0 22px; font-size: 15px; max-width: 42ch; }
.store-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.store-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  font-family: inherit; border: none; cursor: pointer;
}
.store-btn-primary { background: var(--navy); color: #fff; }
.store-btn-primary:hover { background: var(--navy-light); }
.store-btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.store-btn-ghost:hover { background: rgba(27,42,74,0.08); }

.app-banner-art { position: relative; flex-shrink: 0; width: 180px; height: 200px; }
.phone-mock {
  width: 140px; height: 200px;
  background: var(--navy);
  border-radius: 22px;
  padding: 14px 12px;
  position: relative;
  margin: 0 auto;
}
.phone-notch { width: 40px; height: 5px; background: rgba(255,255,255,0.25); border-radius: 3px; margin: 0 auto 14px; }
.phone-line { height: 8px; background: rgba(255,255,255,0.85); border-radius: 4px; margin-bottom: 8px; }
.phone-line-1 { width: 70%; }
.phone-line-2 { width: 45%; background: var(--amber); }
.phone-card { height: 36px; background: rgba(255,255,255,0.14); border-radius: 6px; margin-bottom: 8px; }
.bell-badge {
  position: absolute; top: -6px; right: 6px;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(32,89,64,0.35);
}

/* ---------- Listings ---------- */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin: 44px 0 20px; }
.section-head h2 { font-size: 22px; color: var(--navy); margin: 0; }

.listing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}
.listing-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; display: block; color: inherit; }
.listing-card:hover { border-color: var(--navy); }
.listing-img { position: relative; }
.listing-img img { width: 100%; height: 160px; object-fit: cover; display: block; }
.badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--teal); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: var(--radius-pill);
}
.listing-price { font-weight: 700; font-size: 17px; color: var(--navy); margin: 12px 14px 4px; }
.listing-title { font-size: 14.5px; font-weight: 500; margin: 0 14px 8px; line-height: 1.4; }
.listing-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }
.listing-loading a { color: var(--navy); font-weight: 600; }
.listing-meta { font-size: 12.5px; color: var(--muted); margin: 0 14px 14px; }

/* ---------- Nút "Lọc kết quả" chỉ hiện trên mobile ---------- */
.filter-toggle-btn {
  display: none; width: 100%; align-items: center; justify-content: space-between;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-input);
  padding: 12px 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--navy);
  margin-bottom: 14px;
}
.filter-toggle-arrow { transition: transform 0.15s; color: var(--muted); }
.filter-toggle-btn.filter-toggle-open .filter-toggle-arrow { transform: rotate(180deg); }

/* ---------- Bộ lọc dạng thẻ (dùng chung: trang Tuyển dụng, Cho - Tặng) ---------- */
.jobs-filter, .give-filter {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 84px;
}
.jobs-filter h3, .give-filter h3 {
  font-size: 15px; color: var(--navy); margin: 0 0 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.filter-group { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.filter-group:last-of-type { margin-bottom: 18px; padding-bottom: 0; border-bottom: none; }
.filter-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: var(--muted); margin: 0 0 12px; }
.filter-check {
  display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink);
  padding: 7px 8px; margin: 0 -8px 2px; border-radius: 8px; cursor: pointer;
}
.filter-check:hover { background: var(--bg); }
.filter-check input {
  width: 17px; height: 17px; margin: 0; cursor: pointer; flex-shrink: 0;
}
/* ---------- Cho - Tặng miễn phí (dưới Tin đăng, desktop = lưới, mobile = cuộn ngang) ---------- */
.giveaway-strip { margin: 0; }
.giveaway-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.giveaway-card {
  background: var(--bg-alt); border: 2px solid var(--amber); border-radius: var(--radius-card);
  overflow: hidden; display: block; color: inherit;
}
.giveaway-card img { width: 100%; height: 130px; object-fit: cover; display: block; }
.giveaway-card-title { font-size: 13.5px; font-weight: 500; margin: 10px 14px 4px; line-height: 1.4; }
.giveaway-card-meta { font-size: 12px; color: var(--muted); margin: 0 14px 14px; }
.giveaway-free { color: var(--teal-dark); font-weight: 700; }

/* Mobile: giao diện riêng kiểu cuộn ngang (carousel) như các app rao vặt phổ biến,
   thay vì xếp chồng dọc chiếm nhiều diện tích màn hình nhỏ */
@media (max-width: 720px) {
  .giveaway-row {
    display: flex; grid-template-columns: none;
    overflow-x: auto; gap: 12px; padding-bottom: 6px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin: 0 -24px; padding-left: 24px; padding-right: 24px;
  }
  .giveaway-row::-webkit-scrollbar { display: none; }
  .giveaway-card { flex: 0 0 62%; scroll-snap-align: start; }
  .giveaway-card img { height: 110px; }
}
@media (max-width: 420px) {
  .giveaway-card { flex-basis: 72%; }
}
.site-footer { background: var(--navy); color: #C7D0E0; padding: 48px 0 0; font-size: 13.5px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-logo { color: #fff; font-size: 20px; }
.footer-logo span { color: var(--amber); }
.footer-brand p { margin: 12px 0 14px; line-height: 1.6; color: #C7D0E0; }
.footer-brand address { font-style: normal; line-height: 1.6; color: #9FAAC2; }
.footer-col h4 { color: #fff; font-size: 14px; margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #C7D0E0; }
.footer-col a:hover { color: var(--amber); }
.footer-bottom { padding: 18px 0; color: #8D97AD; font-size: 12.5px; }

@media (max-width: 520px) {
  .header-row { gap: 8px; padding: 12px 16px; }
  .logo { font-size: 19px; }
  .icon-btn { width: 34px; height: 34px; }
  .header-actions .btn { padding: 9px 14px; font-size: 13.5px; }
  .account-avatar { width: 26px; height: 26px; font-size: 11px; }
}

@media (max-width: 520px) {
  .tabs-row { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs-row::-webkit-scrollbar { display: none; }
  .tab { padding: 12px 14px; font-size: 13.5px; white-space: nowrap; flex-shrink: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .listing-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .hero-band h1 { font-size: 28px; }
  .hero-sub { font-size: 14.5px; }
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
  .keyword-blocks { grid-template-columns: 1fr; }
  .keyword-columns { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .app-banner-row { flex-direction: column; text-align: center; }
  .app-banner-copy h2 { max-width: none; }
  .store-buttons { justify-content: center; }
}
@media (max-width: 520px) {
  .hero-band { padding: 28px 0 26px; }
  .hero-band h1 { font-size: 22px; }
  .hero-search-wrap { margin-top: 16px; }
  .hero-search-card { flex-direction: column; border-radius: 14px; }
  .hero-search-loc { border-left: none; border-top: 1px solid var(--border); }
  .hero-search-btn { width: 100%; }
  .listing-grid { grid-template-columns: 1fr; }
  .header-actions .link-hide-mobile { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .keyword-columns { grid-template-columns: 1fr; }
}
