/* ============================================================
   For a Cup of Coffee — Fresh Design
   Palette: Espresso #2C1810 | Cream #FBF5ED | Gold #C8860A
            Latte #E8D5B0 | Warm White #FEFAF4
   Fonts: Playfair Display (headings) | Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600&display=swap');

/* ---- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: #FEFAF4;
  color: #2C1810;
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: #C8860A; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  line-height: 1.2;
}

/* ---- Navigation ------------------------------------------- */
.navbar {
  background: #2C1810;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.3em;
  color: #F5C842;
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo:hover { text-decoration: none; color: #fff; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  color: #E8D5B0;
  font-size: 0.9em;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-links a:hover { background: rgba(255,255,255,0.12); color: #fff; }

.nav-badge {
  background: #C8860A;
  color: #fff;
  font-size: 0.7em;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 3px;
  vertical-align: middle;
}

.nav-city {
  background: #C8860A;
  color: #fff !important;
  border-radius: 20px;
  padding: 6px 14px !important;
  font-weight: 600 !important;
}
.nav-city:hover { background: #a06b00 !important; color: #fff !important; }

.nav-city-empty {
  background: #4a7c59;
  color: #fff !important;
  border-radius: 20px;
  padding: 6px 14px !important;
  font-weight: 600 !important;
}
.nav-city-empty:hover { background: #3a6348 !important; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: #E8D5B0;
  border-radius: 2px;
  transition: all 0.25s;
}

/* ---- Hero ------------------------------------------------- */
.hero {
  background: url('https://images.unsplash.com/photo-1495474472287-4d71bcdd2085?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(44,24,16,0.78) 0%, rgba(44,24,16,0.55) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 32px;
  max-width: 760px;
}

.hero-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 1em;
  font-weight: 600;
  color: #F5C842;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-content h1 {
  font-size: clamp(2em, 5vw, 3.2em);
  color: #fff;
  margin-bottom: 16px;
}

.hero-content h1 em {
  color: #F5C842;
  font-style: normal;
}

.hero-content p {
  color: #E8D5B0;
  font-size: 1.15em;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95em;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-align: center;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

.btn-primary   { background: #C8860A; color: #fff; }
.btn-primary:hover { background: #a06b00; color: #fff; }

.btn-secondary { background: rgba(255,255,255,0.15); color: #fff; border: 2px solid rgba(255,255,255,0.5); }
.btn-secondary:hover { background: rgba(255,255,255,0.25); color: #fff; }

.btn-outline { background: transparent; color: #C8860A; border: 2px solid #C8860A; }
.btn-outline:hover { background: #C8860A; color: #fff; }

.btn-dark { background: #2C1810; color: #fff; }
.btn-dark:hover { background: #1a0d08; color: #fff; }

.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #96281b; color: #fff; }

.btn-sm { padding: 7px 14px; font-size: 0.85em; }
.btn-full { width: 100%; }

/* ---- Stats bar -------------------------------------------- */
.stats-bar {
  background: #2C1810;
  color: #E8D5B0;
  text-align: center;
  padding: 14px 20px;
  font-size: 0.95em;
}
.stats-bar strong { color: #F5C842; }

/* ---- Sections --------------------------------------------- */
.section {
  padding: 64px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.6em, 3vw, 2.2em);
  color: #2C1810;
  margin-bottom: 8px;
}

.section-subtitle {
  color: #7a5c4e;
  margin-bottom: 40px;
  font-size: 1.05em;
}

/* ---- How It Works ----------------------------------------- */
.how-it-works { background: #fff; }
.how-it-works .inner { max-width: 1200px; margin: 0 auto; padding: 64px 24px; text-align: center; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.step {
  background: #FBF5ED;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}

.step-icon { font-size: 2.5em; margin-bottom: 12px; }
.step h3 { font-size: 1.1em; margin-bottom: 8px; color: #2C1810; }
.step p { font-size: 0.95em; color: #6b4c3b; }

/* ---- Item Cards ------------------------------------------- */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.item-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(44,24,16,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.item-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(44,24,16,0.14); }

.item-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.item-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.item-card-cat  { font-size: 0.78em; font-weight: 600; color: #C8860A; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.item-card h2   { font-size: 1.05em; margin-bottom: 6px; }
.item-card p    { font-size: 0.9em; color: #6b4c3b; margin-bottom: 4px; }
.item-card-trade { font-size: 0.9em; margin-top: auto; padding-top: 10px; }
.item-card-trade strong { color: #C8860A; }

.item-card .btn { margin-top: 12px; }

/* ---- Item Detail ------------------------------------------ */
.item-detail { max-width: 900px; margin: 40px auto; padding: 0 24px 60px; }

.item-detail-grid {
  display: grid;
  grid-template-columns: minmax(200px, 420px) 1fr;
  gap: 40px;
  align-items: start;
}



.item-detail-img {
  border-radius: 14px;
  width: auto;
  max-width: 100%;
  max-height: 340px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(44,24,16,0.15);
  display: block;
}



.item-detail-meta { display: flex; flex-direction: column; gap: 14px; }
.item-detail-meta h1 { font-size: 1.8em; }

.meta-row { display: flex; gap: 10px; align-items: flex-start; }
.meta-label { font-weight: 600; min-width: 110px; color: #7a5c4e; font-size: 0.9em; }
.meta-value { color: #2C1810; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
}
.badge-category { background: #FBF5ED; color: #C8860A; border: 1px solid #E8D5B0; }
.badge-cash { background: #e6f9ef; color: #2d7a4f; border: 1px solid #b2dfcb; }
.badge-status-active { background: #e6f9ef; color: #2d7a4f; }
.badge-status-traded { background: #fdf0d5; color: #a06b00; }

.trade-box {
  background: #FBF5ED;
  border: 1px solid #E8D5B0;
  border-radius: 14px;
  padding: 24px;
  margin-top: 8px;
}
.trade-box h3 { font-size: 1.1em; margin-bottom: 12px; }

/* ---- Browse / Filters ------------------------------------- */
.browse-filters {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: 0 1px 6px rgba(44,24,16,0.07);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 0.8em; font-weight: 600; color: #7a5c4e; text-transform: uppercase; letter-spacing: 0.06em; }
.filter-group select,
.filter-group input { padding: 8px 12px; border: 1px solid #E8D5B0; border-radius: 8px; font-size: 0.95em; background: #FEFAF4; color: #2C1810; }

/* ---- Forms ------------------------------------------------ */
.page-form {
  max-width: 640px;
  margin: 48px auto;
  padding: 0 24px 60px;
}

.form-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 4px 20px rgba(44,24,16,0.08);
}

.form-card h1 { font-size: 1.8em; margin-bottom: 6px; }
.form-card .form-subtitle { color: #7a5c4e; margin-bottom: 28px; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-group label { font-weight: 600; font-size: 0.9em; color: #4a2c1a; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  padding: 11px 14px;
  border: 1.5px solid #E8D5B0;
  border-radius: 8px;
  font-size: 1em;
  font-family: 'Inter', sans-serif;
  background: #FEFAF4;
  color: #2C1810;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #C8860A;
  box-shadow: 0 0 0 3px rgba(200,134,10,0.12);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-hint { font-size: 0.82em; color: #9a7060; }

.form-check { display: flex; gap: 10px; align-items: flex-start; }
.form-check input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; accent-color: #C8860A; }

.form-error { color: #c0392b; font-size: 0.88em; font-weight: 500; }
.form-success { color: #2d7a4f; font-size: 0.95em; font-weight: 500; }

.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.95em;
}
.alert-warning  { background: #fff8e6; border: 1px solid #f0c040; color: #7a5200; }
.alert-danger   { background: #fdf0ee; border: 1px solid #e0a0a0; color: #8a2c22; }
.alert-success  { background: #e8f8ef; border: 1px solid #a0d8b8; color: #1d6b40; }
.alert-info     { background: #e8f0fb; border: 1px solid #a0b8e0; color: #1d3f7a; }

/* ---- Form wrapper with side ads --------------------------- */
.form-with-ads {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  gap: 24px;
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 16px;
  align-items: start;
}

.ad-sidebar { display: flex; flex-direction: column; gap: 16px; }

/* ---- Ads -------------------------------------------------- */
.ad-link { display: block; }
.ad-img { width: 100%; border-radius: 10px; box-shadow: 0 2px 8px rgba(44,24,16,0.12); }

.ad-banner {
  text-align: center;
  margin: 28px auto;
  max-width: 800px;
  padding: 0 16px;
}
.ad-banner .ad-img { max-width: 468px; margin: 0 auto; }

.ad-placeholder {
  background: #FBF5ED;
  border: 1px dashed #E8D5B0;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  font-size: 0.85em;
  color: #9a7060;
  line-height: 1.4;
}
.ad-placeholder a { color: #C8860A; font-weight: 600; }

/* Amazon ad strip */
.amazon-strip {
  background: #fff8e6;
  border-top: 1px solid #f0d880;
  border-bottom: 1px solid #f0d880;
  padding: 18px 24px;
  text-align: center;
  margin: 32px auto;
  max-width: 300px;
  border-radius: 12px;
}
.amazon-strip .amazon-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9a7060;
  margin-bottom: 10px;
}

/* ---- Messages / Inbox ------------------------------------- */
.inbox-list { display: flex; flex-direction: column; gap: 12px; }

.inbox-item {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 6px rgba(44,24,16,0.07);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: box-shadow 0.15s;
}
.inbox-item:hover { box-shadow: 0 3px 14px rgba(44,24,16,0.12); }
.inbox-item.unread { border-left: 4px solid #C8860A; }

.inbox-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.inbox-body { flex: 1; }
.inbox-title { font-weight: 600; margin-bottom: 4px; }
.inbox-snippet { font-size: 0.88em; color: #7a5c4e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px; }
.inbox-meta { font-size: 0.78em; color: #9a7060; margin-top: 4px; }
.inbox-badge { float: right; }

/* Thread */
.thread-messages { display: flex; flex-direction: column; gap: 16px; max-height: 480px; overflow-y: auto; padding: 20px; background: #FEFAF4; border-radius: 12px; border: 1px solid #E8D5B0; }

.msg-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.95em;
  line-height: 1.5;
}
.msg-bubble.mine { align-self: flex-end; background: #C8860A; color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble.theirs { align-self: flex-start; background: #fff; color: #2C1810; border: 1px solid #E8D5B0; border-bottom-left-radius: 4px; }
.msg-time { font-size: 0.7em; opacity: 0.7; margin-top: 4px; }

.thread-compose { margin-top: 16px; display: flex; gap: 10px; }
.thread-compose textarea { flex: 1; padding: 12px; border: 1.5px solid #E8D5B0; border-radius: 10px; font-size: 0.95em; resize: none; font-family: inherit; }
.thread-compose textarea:focus { outline: none; border-color: #C8860A; }

/* ---- Trade Status Tags ------------------------------------ */
.status-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
}
.status-pending   { background: #fff8e6; color: #a06b00; }
.status-accepted  { background: #e6f9ef; color: #2d7a4f; }
.status-declined  { background: #fdf0ee; color: #8a2c22; }
.status-completed { background: #e8f0fb; color: #1d3f7a; }
.status-cancelled { background: #f5f5f5; color: #666; }

/* ---- Profile / My Trades ---------------------------------- */
.profile-header {
  background: linear-gradient(135deg, #2C1810 0%, #5a3020 100%);
  color: #fff;
  padding: 48px 24px;
  text-align: center;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #F5C842;
  margin: 0 auto 16px;
}
.profile-name { font-family: 'Playfair Display', serif; font-size: 1.8em; }

/* ---- Flavor Notes ----------------------------------------- */
.note-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 8px rgba(44,24,16,0.07);
  border-left: 4px solid #C8860A;
  margin-bottom: 16px;
}
.note-meta { font-size: 0.82em; color: #9a7060; margin-bottom: 8px; }
.note-content { color: #2C1810; line-height: 1.6; }

/* ---- Footer ----------------------------------------------- */
footer {
  background: #2C1810;
  color: #E8D5B0;
  padding: 48px 24px 28px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 36px;
  margin-bottom: 36px;
}

.footer-col h4 {
  font-family: 'Playfair Display', serif;
  color: #F5C842;
  margin-bottom: 14px;
  font-size: 1.05em;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #C8A87A; font-size: 0.9em; }
.footer-col a:hover { color: #fff; }
.footer-col p { font-size: 0.88em; color: #C8A87A; line-height: 1.6; }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.82em;
  color: #9a7060;
}

/* ---- Admin ------------------------------------------------ */
.admin-wrap { max-width: 1100px; margin: 40px auto; padding: 0 20px 60px; }
.admin-wrap h1 { font-size: 1.8em; margin-bottom: 24px; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(44,24,16,0.08); }
.data-table th { background: #2C1810; color: #E8D5B0; padding: 12px 16px; text-align: left; font-size: 0.85em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f0e8e0; font-size: 0.93em; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FBF5ED; }

.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }

/* ---- Utilities -------------------------------------------- */
.text-center { text-align: center; }
.text-muted  { color: #9a7060; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.divider { border: none; border-top: 1px solid #E8D5B0; margin: 28px 0; }

/* Hidden by default on desktop */
.mobile-ad-strip { display: none; }

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

@media (max-width: 900px) {
  .item-detail-grid { grid-template-columns: 1fr; }
  .form-with-ads { grid-template-columns: 1fr; }
  .form-with-ads .ad-sidebar { display: none; }
  .mobile-ad-strip { display: block; max-width: 600px; margin: 0 auto 32px; padding: 0 24px; }
.mobile-ad-strip .ad-link, .mobile-ad-strip img { width: 100%; border-radius: 10px; }
}
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: #2C1810; padding: 16px 24px 24px; gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: flex; }

  .hero-content { padding: 32px 20px; }
  .steps { grid-template-columns: 1fr; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .browse-filters { flex-direction: column; }
  .thread-messages { max-height: 340px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .item-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .form-card { padding: 24px 20px; }
}
