/*
Theme Name: NE Bazaar
Theme URI: https://example.com
Author: WeBloom Studio
Description: A local classifieds marketplace theme for Guwahati & the Northeast — listings, categories, seller dashboard, and an approval-gated contact system. Pairs a custom "listing" post type with native WordPress admin review (Pending -> Publish).
Version: 1.0.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: ne-bazaar
*/

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

:root {
  --cream: #FBF5E8;
  --cream-deep: #F3E9D6;
  --card: #FFFFFF;
  --ink: #2A2218;
  --ink-soft: #7C7061;
  --maroon: #9C2B26;
  --maroon-deep: #7A211D;
  --teal: #1F5C4E;
  --teal-deep: #143F35;
  --gold: #C6952F;
  --hairline: #E7DAC0;
  --shadow: 0 6px 24px rgba(42, 34, 24, 0.09);
  --shadow-sm: 0 2px 8px rgba(42, 34, 24, 0.07);
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1100px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1, h2, h3, .logo, .brand-serif {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
img { max-width: 100%; }

/* Signature motif: woven diamond border, standing in for a gamosa's red
   woven edge. Used under the header and above the footer only. */
.weave-strip {
  height: 9px;
  background-image:
    linear-gradient(135deg, var(--maroon) 25%, transparent 25.5%),
    linear-gradient(225deg, var(--maroon) 25%, transparent 25.5%),
    linear-gradient(315deg, var(--maroon) 25%, transparent 25.5%),
    linear-gradient(45deg, var(--maroon) 25%, transparent 25.5%);
  background-size: 11px 11px;
  background-position: 0 0, 5.5px 0, 5.5px -5.5px, 0 5.5px;
  background-color: var(--gold);
}

/* ---- Header ---- */
.site-header { background: var(--teal-deep); color: #fff; padding: 18px 0 16px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; }
.logo { font-size: 25px; font-weight: 700; color: #fff; line-height: 1; }
.logo span { color: var(--gold); }
.tagline { font-size: 11.5px; color: #C9D9D2; text-transform: uppercase; letter-spacing: 0.09em; margin-top: 3px; font-weight: 500; }
.nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.nav a { color: #E9E2CF; font-size: 14.5px; font-weight: 500; }
.nav a:hover { color: #fff; }
.nav a.btn { background: var(--maroon); color: #fff; padding: 9px 18px; border-radius: 24px; font-weight: 600; }
.nav a.btn:hover { background: var(--maroon-deep); text-decoration: none; }

/* Hamburger toggle - hidden on desktop, shown only on narrow screens */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: #fff; font-size: 26px; line-height: 1;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .site-header .wrap { flex-wrap: nowrap; }
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--teal-deep);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 20px 16px;
    z-index: 50;
  }
  .nav.nav-open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
  .nav a.btn { text-align: center; margin: 10px 0 4px; }
  .site-header { position: relative; }
}

/* ---- Hero ---- */
.hero { padding: 34px 0 8px; text-align: center; }
.hero h1 { font-size: 30px; color: var(--ink); }
.hero p { color: var(--ink-soft); font-size: 15px; max-width: 480px; margin: 0 auto; }

/* ---- Flash messages ---- */
.flash { padding: 13px 18px; border-radius: var(--radius-sm); margin: 16px 0; font-size: 14px; font-weight: 500; }
.flash.success { background: #E6F2EC; color: var(--teal-deep); }
.flash.error { background: #FBE9E7; color: var(--maroon-deep); }

/* ---- Buttons & forms ---- */
.btn {
  display: inline-block; background: var(--teal); color: #fff; border: none;
  padding: 12px 22px; border-radius: 9px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.15s ease;
}
.btn:hover { background: var(--teal-deep); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--hairline); }
.btn.ghost:hover { background: var(--cream-deep); }
.btn.danger { background: var(--maroon); }
.btn.danger:hover { background: var(--maroon-deep); }
.btn.marigold { background: var(--gold); color: var(--ink); }
.btn.marigold:hover { background: #B3852A; }
.btn.block { width: 100%; text-align: center; }

input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 9px; border: 1.5px solid var(--hairline);
  font-size: 15px; font-family: inherit; margin-bottom: 13px; background: #fff; color: var(--ink);
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); }
label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; display: block; margin-bottom: 5px; }
textarea { resize: vertical; min-height: 100px; font-family: inherit; }

.card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.form-narrow { max-width: 460px; margin: 34px auto; }

/* ---- Category chips ---- */
.cat-chips { display: flex; gap: 9px; flex-wrap: wrap; margin: 20px 0; }
.cat-chips a { background: #fff; border: 1.5px solid var(--hairline); padding: 8px 17px; border-radius: 22px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.cat-chips a.active { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ---- Search bar ---- */
.search-bar { display: flex; gap: 10px; margin: 22px 0 18px; }
.search-bar input { margin-bottom: 0; }
.search-bar button { flex-shrink: 0; }

/* ---- Listing grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 20px; margin: 22px 0 44px; }
.listing-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease; border: 1px solid var(--hairline);
}
.listing-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.listing-card .thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--cream-deep); }
.listing-card .body { padding: 13px 15px; flex: 1; display: flex; flex-direction: column; }
.listing-card .price { font-size: 19px; font-weight: 700; color: var(--maroon-deep); font-family: 'Fraunces', serif; }
.listing-card .title { font-size: 14.5px; margin: 4px 0; color: var(--ink); font-weight: 500; }
.listing-card .meta { font-size: 12px; color: var(--ink-soft); margin-top: auto; padding-top: 7px; }

.badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge.free { background: var(--gold); color: var(--ink); }
.badge.pending { background: var(--cream-deep); color: var(--ink-soft); }
.badge.sold { background: var(--hairline); color: var(--ink-soft); }
.badge.rejected { background: #FBE9E7; color: var(--maroon-deep); }
.badge.active { background: #E6F2EC; color: var(--teal-deep); }

/* ---- Listing detail ---- */
.listing-detail { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; margin: 26px 0 54px; }
@media (max-width: 720px) { .listing-detail { grid-template-columns: 1fr; } }

/* Responsive table -> stacked cards on narrow screens, so the Messages
   tab doesn't force horizontal scrolling on a phone. */
@media (max-width: 640px) {
  table.responsive-table tr:first-child { display: none; } /* hides the header row */
  table.responsive-table, table.responsive-table tr, table.responsive-table td {
    display: block; width: 100%;
  }
  table.responsive-table tr {
    border-bottom: 1px solid var(--hairline);
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
  }
  table.responsive-table td {
    border-bottom: none;
    padding: 6px 0;
  }
  table.responsive-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    font-weight: 700;
    margin-bottom: 2px;
  }
}
.gallery-main { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); background: var(--cream-deep); border: 1px solid var(--hairline); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 9px; }
.gallery-thumbs img { width: 66px; height: 66px; object-fit: cover; border-radius: 7px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--teal); }

.seller-box { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.seller-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; font-family: 'Fraunces', serif; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
th, td { text-align: left; padding: 11px 13px; font-size: 13.5px; border-bottom: 1px solid var(--hairline); }
th { background: var(--cream-deep); color: var(--ink-soft); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

.tabs { display: flex; gap: 4px; margin: 20px 0; border-bottom: 2px solid var(--hairline); }
.tabs a { padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--maroon-deep); border-bottom-color: var(--maroon); }

.empty-state { text-align: center; padding: 56px 20px; color: var(--ink-soft); }
.empty-state h3 { color: var(--ink); }

.footer { text-align: center; padding: 32px 0 26px; color: var(--ink-soft); font-size: 13px; background: var(--cream-deep); margin-top: 30px; }
.footer .weave-strip { margin-bottom: 26px; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 15px; margin: 22px 0; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); border-top: 3px solid var(--gold); }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--teal-deep); font-family: 'Fraunces', serif; }
.stat-card .label { font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
