/* ===== NaijaHomes - homepage styles ===== */
:root {
  --g: #0b6b3a;
  --g-dark: #063d21;
  --g-soft: #eaf6ef;
  --gold: #f5b82e;
  --bg: #eef3f0;
  --text: #1b2b22;
  --muted: #5c6b62;
  --line: #dfe7e2;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 84px; /* room for mobile bottom nav */
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
.container { max-width: 1150px; margin: 0 auto; padding: 0 16px; }

/* ===== Buttons ===== */
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 15px; border: 2px solid var(--g); cursor: pointer; }
.btn-solid { background: var(--g); color: #fff; }
.btn-ghost { background: transparent; color: var(--g); }
.btn.wide { width: 100%; padding: 14px; font-size: 16px; }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; color: var(--g); }
.logo {
  width: 38px; height: 38px; border-radius: 10px; background: var(--g); color: #fff;
  display: grid; place-items: center; font-size: 22px; font-weight: 800;
}
.desk-nav { display: none; gap: 26px; font-weight: 600; }
.desk-nav a { padding: 6px 2px; border-bottom: 2px solid transparent; }
.desk-nav a.active, .desk-nav a:hover { color: var(--g); border-bottom-color: var(--g); }
.top-actions { display: flex; align-items: center; gap: 10px; }
#guest-actions { display: none; gap: 8px; }
.hello { font-weight: 700; color: var(--g); font-size: 14px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: none; }
.menu-btn { background: none; border: 0; width: 42px; height: 42px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 10px; cursor: pointer; }
.menu-btn span { display: block; height: 3px; background: var(--g-dark); border-radius: 2px; }

/* ===== Hero ===== */
.hero {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(6,61,33,.35) 0%, rgba(6,61,33,.92) 70%),
    url("../images/hero.jpg") center / cover no-repeat,
    linear-gradient(160deg, #0b6b3a, #063d21);
}
.hero-inner { max-width: 1150px; margin: 0 auto; padding: 36px 16px 20px; }
.hero-text h1 { margin: 0 0 12px; font-size: 40px; line-height: 1.08; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.hero-text p { margin: 0 0 22px; font-size: 18px; max-width: 430px; text-shadow: 0 1px 6px rgba(0,0,0,.4); }

/* search card */
.search-card { background: #fff; color: var(--text); border-radius: 18px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); scroll-margin-top: 80px; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; background: var(--bg); padding: 4px; border-radius: 12px; }
.tab { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; font-size: 15px; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--g); color: #fff; }
.field { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; background: #fff; }
.ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; background: var(--g-soft); color: var(--g); border-radius: 10px; font-size: 18px; font-weight: 800; }
.field-body { flex: 1; min-width: 0; display: block; }
.lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.field select, .field input {
  width: 100%; border: 0; outline: 0; background: transparent; padding: 4px 0;
  font-size: 16px; color: var(--text); font-family: inherit; min-width: 0;
}
.field select { cursor: pointer; }
.field:focus-within { border-color: var(--g); box-shadow: 0 0 0 2px rgba(11,107,58,.15); }
.price-row { display: flex; align-items: center; gap: 8px; }
.dash { color: var(--muted); }
.search-btn {
  width: 100%; margin-top: 4px; padding: 16px; border: 0; border-radius: var(--radius);
  background: var(--g); color: #fff; font-size: 18px; font-weight: 800; cursor: pointer;
}
.search-btn:hover { background: var(--g-dark); }

/* trust row */
.trust { max-width: 1150px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 8px 16px 22px; }
.trust > div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; border-left: 1px solid rgba(255,255,255,.25); }
.trust > div:first-child { border-left: 0; }
.t-ico { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 20px; margin-bottom: 6px; }

/* ===== Choose (logged in) ===== */
.choose { padding: 28px 0 6px; }
.choose h2, .listings h2 { margin: 0 0 4px; color: var(--g); font-size: 26px; }
.choose-sub { margin: 0 0 16px; color: var(--muted); }
.choose-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.choose-card {
  display: block; text-align: left; background: #fff; border: 2px solid var(--line);
  border-radius: 16px; padding: 20px; cursor: pointer; font-size: 16px; color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.choose-card:hover { border-color: var(--g); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.cc-ico { display: block; font-size: 30px; margin-bottom: 8px; }
.cc-title { display: block; font-size: 20px; font-weight: 800; color: var(--g); margin-bottom: 4px; }
.cc-text { display: block; color: var(--muted); font-size: 15px; line-height: 1.4; }

/* ===== Listings ===== */
.listings { padding: 28px 0 36px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 14px; }
.card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 3px 12px rgba(0,0,0,.07); display: block; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,.12); }
.card-img { position: relative; height: 170px; background: linear-gradient(135deg, #cfe3d6, #a9c9b6); display: grid; place-items: center; font-size: 48px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 10px; right: 10px; background: var(--g); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.badge.rent { left: 10px; right: auto; background: var(--gold); color: #3a2a00; }
.card-body { padding: 14px; }
.price { font-size: 20px; font-weight: 800; color: var(--g); }
.loc { color: var(--muted); font-size: 14px; margin: 4px 0; }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.ctitle { font-weight: 700; font-size: 15px; }
.grid-msg { color: var(--muted); text-align: center; margin: 18px 0 0; }

/* ===== Footer ===== */
.footer { background: var(--g-dark); color: #fff; text-align: center; padding: 22px 0; }
.footer .small { font-size: 12px; opacity: .75; margin-top: 6px; }

/* ===== Bottom nav (mobile) ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 66px;
  background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; text-align: center;
  box-shadow: 0 -4px 14px rgba(0,0,0,.06);
}
.bottom-nav a, .bottom-nav button { background: none; border: 0; font-size: 12px; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; }
.bottom-nav a span, .bottom-nav button span { font-size: 20px; }
.bottom-nav a.active { color: var(--g); font-weight: 700; }
.bottom-nav .plus {
  width: 56px; height: 56px; border-radius: 50%; background: var(--g); color: #fff;
  font-size: 34px; line-height: 1; margin: -26px auto 0; padding: 0; justify-content: center;
  box-shadow: 0 6px 16px rgba(11,107,58,.45); border: 4px solid #fff;
}

/* ===== Drawer ===== */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 50; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(88vw, 360px); background: #fff; z-index: 60;
  transform: translateX(105%); transition: transform .28s ease; overflow-y: auto; padding: 18px 16px 24px;
  box-shadow: -10px 0 30px rgba(0,0,0,.2);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.close { background: none; border: 0; font-size: 34px; line-height: 1; cursor: pointer; color: var(--text); }
.drawer-links { display: flex; flex-direction: column; gap: 2px; }
.drawer-links a, .drawer-links button {
  display: block; text-align: left; background: none; border: 0; width: 100%;
  padding: 14px 12px; border-radius: 12px; font-size: 17px; font-weight: 600; color: var(--text); cursor: pointer;
}
.drawer-links a.active { background: var(--g-soft); color: var(--g); }
.drawer-links a:hover, .drawer-links button:hover { background: var(--bg); }
.drawer-sec { margin: 16px 12px 6px; font-size: 12px; letter-spacing: 1px; color: var(--muted); font-weight: 700; border-top: 1px solid var(--line); padding-top: 16px; }
.drawer-promo { background: var(--g-soft); border-radius: 14px; padding: 16px; margin-top: 20px; }
.drawer-promo p { margin: 0 0 12px; font-size: 14px; color: var(--g-dark); }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1b2b22; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 80;
  max-width: 90vw; text-align: center; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Tablet ===== */
@media (min-width: 600px) {
  .choose-grid { grid-template-columns: 1fr 1fr; }
  .hero-text h1 { font-size: 48px; }
  .search-card { max-width: 560px; }
}

/* ===== Desktop ===== */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .desk-nav { display: flex; }
  #guest-actions { display: flex; }
  .hello { display: block; }
  .toast { bottom: 30px; }

  .hero-inner {
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
    padding: 70px 24px 40px;
  }
  .hero-text h1 { font-size: 58px; }
  .hero-text p { font-size: 20px; }
  .search-card { max-width: none; padding: 22px; }
  .trust { padding: 10px 24px 34px; max-width: 700px; margin: 0; margin-left: max(24px, calc((100% - 1150px) / 2 + 24px)); }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .choose h2, .listings h2 { font-size: 30px; }
}

/* very small phones */
@media (max-width: 360px) {
  .hero-text h1 { font-size: 34px; }
  .brand-name { font-size: 19px; }
}
