/* ============================================
   CHOWK — global styles
   A local buy & rent marketplace
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  /* -- Color tokens -- */
  --paper:      white;
  --paper-alt:  white;
  --ink:        #202A25;
  --ink-soft:   #5B655F;
  --line:       #DED6C4;
  --primary:    #3E6259;   /* awning green */
  --primary-dk: #2C4740;
  --accent:     #C98A2C;   /* price ochre */
  --accent-dk:  #A66F1E;
  --white:      #FFFFFF;

  /* -- Type -- */
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, Segoe UI, sans-serif;

  --radius-sm: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
}
.account-area {
    position: relative;
}
.logout-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.logout-box {
    width: 360px;
    max-width: calc(100% - 40px);
    background: white;
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.logout-box h2 {
    margin-bottom: 8px;
}

.logout-box p {
    color: var(--ink-soft);
    margin-bottom: 24px;
}

.logout-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.logout-actions button {
    padding: 9px 18px;
    border-radius: 6px;
    border: 1px solid var(--line);
    cursor: pointer;
}

#cancel-logout {
    background: white;
}

#confirm-logout {
    background: var(--primary);
    color: white;
    border: none;
}
.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;

    width: 280px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: 20px;
    padding-right:50px;

    z-index: 9999;
    display: none;
}
.account-info {
    display: block;
}

.account-info h3 {
    display: block;
    margin: 0 0 8px;
}

.account-info p {
    display: block;
    margin: 0 0 15px;
}

.account-menu a {
    display: block;
    margin: 12px 0;
}

.account-menu button {
    display: block;
    margin-top: 12px;
}
.logout-btn
{
  border:none;
  background-color:white;
  color:rgb(239, 143, 143);
  cursor:pointer;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;

    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.wordmark {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-dk);
  white-space: nowrap;
}
.avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border:none;
    background: #f4f4f4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-btn img {
    width: 24px;
    height: 24px;
}
.search-bar {
  flex: 1;
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: transparent;
  outline: none;
}

.search-bar button {
  border: none;
  background: var(--primary);
  color: var(--white);
  padding: 0 18px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
}

.search-bar button:hover { background: var(--primary-dk); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}

.header-actions a { font-size: 0.95rem; color: var(--ink-soft); }
.header-actions a:hover { color: var(--ink); }

.btn-sell {
  background: var(--accent);
  color: var(--white) !important;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.btn-sell:hover { background: var(--accent-dk); }

/* ---------- Category nav ---------- */

.category-nav {
  border-bottom: 1px solid var(--line);
  background: var(--paper-alt);
}

.category-list {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 12px 24px;
  max-width: 1120px;
  margin: 0 auto;
  overflow-x: auto;
}

.category-list a {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.category-list a:hover,
.category-list a.active {
  color: var(--primary-dk);
  border-bottom-color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  padding: 150px 24px 40px;
  max-width: 1120px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.4rem;
  line-height: 1.15;
  max-width: 14ch;
}

.hero p {
  color: var(--ink-soft);
  max-width: 46ch;
  margin-top: 12px;
  font-size: 1.05rem;
}

/* ---------- Listings ---------- */

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 24px 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.section-title h2 { font-size: 1.3rem; }
.section-title span { color: var(--ink-soft); font-size: 0.9rem; }

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: 1120px;
  margin: 0 auto 60px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.listing-card {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px;
  background: var(--paper);
  transition: background 0.15s ease;
}

.listing-card:hover { background: var(--paper-alt); }

.listing-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.listing-price {
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: var(--accent-dk);
  margin-bottom: 4px;
}

.listing-title {
  font-size: 0.98rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.listing-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.tag-rent {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--primary-dk);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  margin-bottom: 8px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.footer-row {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-row a { color: var(--ink-soft); margin-right: 16px; }
.footer-row a:hover { color: var(--ink); }

/* ---------- Buttons (shared) ---------- */

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dk); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--ink-soft); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
  .header-row { flex-wrap: wrap; }
  .search-bar { order: 3; flex-basis: 100%; }
}

@media (max-width: 560px) {
  .listing-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .header-actions span.only-desktop { display: none; }
}
